Decompile artifactsRenderGlaresForRoom

This commit is contained in:
Ryan Dwyer 2022-08-05 22:59:59 +10:00
parent 59a216bc2a
commit 7364fb8e0e
9 changed files with 256 additions and 841 deletions

View File

@ -87,7 +87,7 @@ s32 g_NumActiveRooms;
u16 g_BgUnloadDelay240;
u16 g_BgUnloadDelay240_2;
u32 var800a4bf4;
s16 var800a4bf8[100];
s16 g_GlareRooms[100];
u32 *g_BgPrimaryData2;
struct bgroom *g_BgRooms;
struct bgportal *g_BgPortals;
@ -113,7 +113,7 @@ u32 var80082474nb = 0;
s16 var8007fc0c = 0;
s16 var8007fc10 = 0;
s32 var8007fc14 = 0;
s32 g_NumRoomsWithGlares = 0;
u32 var8007fc18 = 0x01000100;
u32 var8007fc1c = 0x00000000;
s32 g_CamRoom = 0x00000001;
@ -1758,7 +1758,7 @@ Gfx *bgRenderScene(Gfx *gdl)
s16 roomorder[60];
s16 roomnums[60];
var8007fc14 = 0;
g_NumRoomsWithGlares = 0;
if (g_Vars.currentplayer->visionmode == VISIONMODE_XRAY) {
gdl = bgRenderSceneInXray(gdl);
@ -1985,10 +1985,10 @@ Gfx *bgRenderScene(Gfx *gdl)
}
if (!g_Vars.mplayerisrunning) {
lightsCalculateGlareBrightness(thing->roomnum);
artifactsCalculateGlaresForRoom(thing->roomnum);
if (var8007fc14 < 100) {
var800a4bf8[var8007fc14++] = thing->roomnum;
if (g_NumRoomsWithGlares < 100) {
g_GlareRooms[g_NumRoomsWithGlares++] = thing->roomnum;
}
}
}
@ -2675,7 +2675,7 @@ glabel bgRenderScene
/* f1556f4: 8d8ce9d4 */ lw $t4,-0x162c($t4)
/* f1556f8: 5580000f */ bnezl $t4,.NB0f155738
/* f1556fc: 2673fffe */ addiu $s3,$s3,-2
/* f155700: 0fc4dca0 */ jal lightsCalculateGlareBrightness
/* f155700: 0fc4dca0 */ jal artifactsCalculateGlaresForRoom
/* f155704: 86040000 */ lh $a0,0x0($s0)
/* f155708: 3c028008 */ lui $v0,0x8008
/* f15570c: 8c422478 */ lw $v0,0x2478($v0)
@ -2713,21 +2713,23 @@ glabel bgRenderScene
);
#endif
Gfx *func0f15b114(Gfx *gdl)
Gfx *bgRenderArtifacts(Gfx *gdl)
{
s32 i;
if (g_Vars.mplayerisrunning == false && var8007fc14 > 0) {
if (g_Vars.mplayerisrunning == false && g_NumRoomsWithGlares > 0) {
gdl = func0f13d40c(gdl);
for (i = 0; i < var8007fc14; i++) {
gdl = func0f13d568(gdl, var800a4bf8[i]);
for (i = 0; i < g_NumRoomsWithGlares; i++) {
gdl = artifactsRenderGlaresForRoom(gdl, g_GlareRooms[i]);
}
gdl = func0f13d54c(gdl);
}
return sky0f12715c(gdl);
gdl = skyRenderArtifacts(gdl);
return gdl;
}
void bgLoadFile(void *memaddr, u32 offset, u32 len)

File diff suppressed because it is too large Load Diff

View File

@ -1311,7 +1311,7 @@ Gfx *lvRender(Gfx *gdl)
gdl = boltbeamsRender(gdl);
if (g_Vars.currentplayer->visionmode != VISIONMODE_XRAY) {
gdl = func0f15b114(gdl);
gdl = bgRenderArtifacts(gdl);
}
}

View File

@ -4997,7 +4997,7 @@ Gfx *playerRenderHud(Gfx *gdl)
{
if (g_Vars.currentplayer->cameramode == CAMERAMODE_THIRDPERSON) {
gdl = boltbeamsRender(gdl);
gdl = func0f15b114(gdl);
gdl = bgRenderArtifacts(gdl);
gdl = hudmsgsRender(gdl);
if (g_Vars.currentplayer->isdead == false) {
@ -5018,7 +5018,7 @@ Gfx *playerRenderHud(Gfx *gdl)
gdl = lasersightRenderDot(gdl);
if (g_Vars.currentplayer->visionmode != VISIONMODE_XRAY) {
gdl = func0f15b114(gdl);
gdl = bgRenderArtifacts(gdl);
}
if (g_NbombsActive) {
@ -5298,7 +5298,7 @@ Gfx *playerRenderHud(Gfx *gdl)
gdl = playerDrawStoredFade(gdl);
} else {
gdl = func0f15b114(gdl);
gdl = bgRenderArtifacts(gdl);
if (g_Vars.currentplayer->eyespy) {
if (g_Vars.currentplayer->eyespy->startuptimer60 < TICKS(50)) {

View File

@ -6550,7 +6550,7 @@ Gfx *sky0f126de8(Gfx *gdl)
/**
* Render teleport artifacts, and all suns and their artifacts.
*/
Gfx *sky0f12715c(Gfx *gdl)
Gfx *skyRenderArtifacts(Gfx *gdl)
{
struct environment *env = envGetCurrent();
struct sun *sun;

View File

@ -17,7 +17,7 @@ Gfx *bgRenderRoomXrayPass(Gfx *gdl, s32 roomnum, struct roomgfxdata18 *arg2, boo
Gfx *bgRenderRoomInXray(Gfx *gdl, s32 roomnum);
Gfx *bgRenderSceneInXray(Gfx *gdl);
Gfx *bgRenderScene(Gfx *gdl);
Gfx *func0f15b114(Gfx *gdl);
Gfx *bgRenderArtifacts(Gfx *gdl);
void bgLoadFile(void *memaddr, u32 offset, u32 len);
s32 stageGetIndex2(s32 stagenum);
f32 portal0f15b274(s32 portal);

View File

@ -8,10 +8,10 @@ void func0f13c510(void);
void func0f13c54c(void);
u16 func0f13c574(f32 arg0);
s32 func0f13c710(f32 arg0);
void lightsCalculateGlareBrightness(s32 roomnum);
void artifactsCalculateGlaresForRoom(s32 roomnum);
u8 func0f13d3c4(u8 arg0, u8 arg1);
Gfx *func0f13d40c(Gfx *gdl);
Gfx *func0f13d54c(Gfx *gdl);
Gfx *func0f13d568(Gfx *gdl, u32 arg1);
Gfx *artifactsRenderGlaresForRoom(Gfx *gdl, s32 roomnum);
#endif

View File

@ -27,7 +27,7 @@ Gfx *skyRenderSuns(Gfx *gdl, bool xray);
Gfx *sky0f126384(Gfx *gdl, f32 x, f32 y, f32 arg3, f32 orbsize, s32 arg5, f32 arg6);
Gfx *sky0f126c3c(Gfx *gdl, f32 x, f32 y, f32 z, f32 arg4, f32 arg5);
Gfx *sky0f126de8(Gfx *gdl);
Gfx *sky0f12715c(Gfx *gdl);
Gfx *skyRenderArtifacts(Gfx *gdl);
void sky0f127334(s32 arg0, s32 arg1, s32 arg2);
s32 sky0f127490(s32 arg0, s32 arg1);
Gfx *sky0f1274d8(Gfx *gdl);

View File

@ -5465,17 +5465,22 @@ struct lasersight {
};
struct vec3s16 {
s16 x;
s16 y;
s16 z;
union {
struct {
s16 x;
s16 y;
s16 z;
};
s16 s[3];
};
};
struct light {
/*0x00*/ u16 roomnum;
/*0x02*/ u16 unk02;
/*0x02*/ u16 colour; // 4/4/4/4
/*0x04*/ u8 unk04;
/*0x05*/ u8 unk05_00 : 1;
/*0x05*/ u8 healthy : 1; // just a guess based on context
/*0x05*/ u8 healthy : 1;
/*0x05*/ u8 on : 1;
/*0x05*/ u8 sparking : 1;
/*0x05*/ u8 vulnerable : 1;