summaryrefslogtreecommitdiff
path: root/soh/src/code
diff options
context:
space:
mode:
authorbriaguya <70942617+briaguya-ai@users.noreply.github.com>2023-04-04 03:12:09 -0400
committerGitHub <noreply@github.com>2023-04-04 03:12:09 -0400
commit44906598e4bd094543eb96a6f2be9fece9c7ece4 (patch)
treee17846aca01e7e4d280d25b795f0512bf654c21a /soh/src/code
parentff1d8a9e9d27de17b0718ef31f2ad6ac0fab3874 (diff)
fix: properly display static background scenes (#2669)
Diffstat (limited to 'soh/src/code')
-rw-r--r--soh/src/code/z_room.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/soh/src/code/z_room.c b/soh/src/code/z_room.c
index 59dea1ab3..d10a5089e 100644
--- a/soh/src/code/z_room.c
+++ b/soh/src/code/z_room.c
@@ -220,7 +220,7 @@ void func_80095D04(PlayState* play, Room* room, u32 flags) {
#define JPEG_MARKER 0xFFD8FFE0
-s32 func_80096238(void* data) {
+s32 swapAndConvertJPEG(void* data) {
OSTime time;
if (BE32SWAP(*(u32*)data) == JPEG_MARKER)
@@ -265,7 +265,7 @@ void func_8009638C(Gfx** displayList, void* source, void* tlut, u16 width, u16 h
s32 temp;
displayListHead = *displayList;
- func_80096238(SEGMENTED_TO_VIRTUAL(source));
+ swapAndConvertJPEG(SEGMENTED_TO_VIRTUAL(source));
bg = (uObjBg*)(displayListHead + 1);
gSPBranchList(displayListHead, (u8*)bg + sizeof(uObjBg));
@@ -282,6 +282,12 @@ void func_8009638C(Gfx** displayList, void* source, void* tlut, u16 width, u16 h
bg->b.imagePal = 0;
bg->b.imageFlip = 0;
+ if (ResourceMgr_ResourceIsBackground((char*) source)) {
+ char* blob = (char*) GetResourceDataByName((char*) source, true);
+ swapAndConvertJPEG(blob);
+ bg->b.imagePtr = (uintptr_t) blob;
+ }
+
displayListHead = (void*)(bg + 1);
if (fmt == G_IM_FMT_CI) {
gDPLoadTLUT(displayListHead++, tlutCount, 256, tlut);