Improve mismatch of bgLoadRoom

This commit is contained in:
Ryan Dwyer
2022-09-18 14:13:11 +10:00
parent 52a06d0698
commit f7cb81bac5
10 changed files with 251 additions and 212 deletions
+3
View File
@@ -3499,6 +3499,9 @@
#define RESETTYPE_COLD 0
#define RESETTYPE_WARM 1
#define ROOMBLOCKTYPE_LEAF 0
#define ROOMBLOCKTYPE_PARENT 1
#define ROOMFLAG_DISABLEDBYSCRIPT 0x0001
#define ROOMFLAG_HASDYNTEX 0x0002 // Has dynamic textures such as water
#define ROOMFLAG_ONSCREEN 0x0004
+5 -5
View File
@@ -13,7 +13,7 @@ Gfx *func0f158400(Gfx *gdl, struct xraydata *xraydata, s16 vertices1[3], s16 ver
void bgChooseXrayVtxColour(bool *inrange, s16 vertex[3], u32 *colour, struct xraydata *xraydata);
Gfx *func0f158d9c(Gfx *gdl, struct xraydata *xraydata, s16 arg2[3], s16 arg3[3], s16 arg4[3], s32 arg5, s32 arg6, s32 arg7, s32 arg8, s32 arg9, s32 arg10);
Gfx *bg0f1598b4(Gfx *gdl, Gfx *gdl2, struct gfxvtx *vertices, s16 arg3[3]);
Gfx *bgRenderRoomXrayPass(Gfx *gdl, s32 roomnum, struct roomgfxdata18 *arg2, bool recurse, s16 arg4[3]);
Gfx *bgRenderRoomXrayPass(Gfx *gdl, s32 roomnum, struct roomblock *blocks, bool recurse, s16 arg4[3]);
Gfx *bgRenderRoomInXray(Gfx *gdl, s32 roomnum);
Gfx *bgRenderSceneInXray(Gfx *gdl);
Gfx *bgRenderScene(Gfx *gdl);
@@ -51,15 +51,15 @@ bool roomIsOnPlayerScreen(s32 room, u32 playernum);
bool roomIsOnPlayerStandby(s32 room, u32 aibotindex);
s32 portalFindNumByVertices(struct portalvertices *pvertices);
u32 bgInflate(u8 *src, u8 *dst, u32 len);
Gfx *func0f15da00(struct roomgfxdata18 *arg0, Gfx *arg1, Gfx *arg2);
Gfx *room0f15dab4(s32 roomnum, Gfx *gdl, u32 types);
struct gfxvtx *room0f15dbb4(s32 roomnum, Gfx *gdl);
Gfx *roomGetNextGdlInBlock(struct roomblock *block, Gfx *start, Gfx *end);
Gfx *roomGetNextGdlInLayer(s32 roomnum, Gfx *start, u32 types);
struct gfxvtx *roomFindVerticesForGdl(s32 roomnum, Gfx *gdl);
void bgLoadRoom(s32 roomnum);
void bgUnloadRoom(s32 room);
void bgUnloadAllRooms(void);
void bgGarbageCollectRooms(s32 bytesneeded, bool desparate);
void bgTickRooms(void);
Gfx *bgRenderRoomPass(Gfx *gdl, s32 roomnum, struct roomgfxdata18 *arg2, bool arg3);
Gfx *bgRenderRoomPass(Gfx *gdl, s32 roomnum, struct roomblock *blocks, bool arg3);
Gfx *bgRenderRoomOpaque(Gfx *gdl, s32 roomnum);
Gfx *bgRenderRoomXlu(Gfx *gdl, s32 roomnum);
s32 bgPopulateVtxBatchType(s32 roomnum, struct vtxbatch *batches, Gfx *gdl, s32 batchindex, struct gfxvtx *vertices, s32 arg5);
+1 -1
View File
@@ -5,6 +5,6 @@
#include "types.h"
void gfxReplaceGbiCommands(Gfx *gdl, Gfx *endgdl, s32 type);
void gfxReplaceGbiCommandsRecursively(struct roomgfxdata18 *arg0, s32 type);
void gfxReplaceGbiCommandsRecursively(struct roomblock *arg0, s32 type);
#endif
+2 -2
View File
@@ -43,7 +43,7 @@ Gfx *tex0f175308(Gfx *gdl, struct tex *tex, s32 arg2, s32 arg3, s32 arg4, struct
Gfx *tex0f175490(Gfx *gdl, struct tex *tex, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7, bool arg8);
Gfx *tex0f1755dc(Gfx *gdl, struct tex *tex, s32 arg2, s32 arg3, s32 arg4);
Gfx *tex0f17563c(Gfx *gdl, struct tex *tex, s32 arg2, s32 arg3, s32 arg4);
s32 tex0f1756c0(Gfx *arg0, s32 arg1, Gfx *arg2, struct texpool *pool, u8 *arg4);
void tex0f175ef4(Gfx *arg0, Gfx *arg1, s32 arg2);
s32 texLoadFromGdl(Gfx *arg0, s32 gdlsizeinbytes, Gfx *arg2, struct texpool *pool, u8 *arg4);
void texCopyGdls(Gfx *src, Gfx *dst, s32 numbytes);
#endif
+9 -9
View File
@@ -3524,32 +3524,32 @@ struct screenbox {
};
};
struct roomgfxdata18 {
struct roomblock {
u8 type;
struct roomgfxdata18 *next;
struct roomblock *next;
union {
struct { // type 0
struct { // type 0 (leaf)
Gfx *gdl;
struct gfxvtx *vertices;
u32 *colours;
};
struct { // type 1
struct roomgfxdata18 *child;
struct { // type 1 (parent)
struct roomblock *child;
struct coord *unk0c; // pointer to 2 coords at least
};
};
u32 *colours;
};
struct roomgfxdata {
/*0x00*/ struct gfxvtx *vertices;
/*0x04*/ u32 *colours;
/*0x08*/ struct roomgfxdata18 *unk08; // opa
/*0x0c*/ struct roomgfxdata18 *unk0c; // xlu
/*0x08*/ struct roomblock *opablocks;
/*0x0c*/ struct roomblock *xlublocks;
/*0x10*/ s16 lightsindex;
/*0x12*/ s16 numlights;
/*0x14*/ s16 numvertices;
/*0x16*/ s16 numcolours;
/*0x18*/ struct roomgfxdata18 unk18[1];
/*0x18*/ struct roomblock blocks[1];
};
struct vtxbatch {