Skip to content

Commit

Permalink
Merged again, more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sauraen committed Jun 6, 2024
2 parents 762f5b6 + 3251456 commit 609e90f
Show file tree
Hide file tree
Showing 66 changed files with 231 additions and 138 deletions.
Binary file modified F3DEX3/F3DEX3_BrW.code.bps
Binary file not shown.
Binary file modified F3DEX3/F3DEX3_BrW.data.bps
Binary file not shown.
Binary file modified F3DEX3/F3DEX3_BrW_NOC.code.bps
Binary file not shown.
Binary file modified F3DEX3/F3DEX3_BrW_NOC.data.bps
Binary file not shown.
Binary file modified F3DEX3/F3DEX3_BrW_NOC_PA.code.bps
Binary file not shown.
Binary file modified F3DEX3/F3DEX3_BrW_NOC_PA.data.bps
Binary file not shown.
Binary file modified F3DEX3/F3DEX3_BrW_NOC_PB.code.bps
Binary file not shown.
Binary file modified F3DEX3/F3DEX3_BrW_NOC_PB.data.bps
Binary file not shown.
Binary file modified F3DEX3/F3DEX3_BrW_NOC_PC.code.bps
Binary file not shown.
Binary file modified F3DEX3/F3DEX3_BrW_NOC_PC.data.bps
Binary file not shown.
Binary file modified F3DEX3/F3DEX3_BrW_PA.code.bps
Binary file not shown.
Binary file modified F3DEX3/F3DEX3_BrW_PA.data.bps
Binary file not shown.
Binary file modified F3DEX3/F3DEX3_BrW_PB.code.bps
Binary file not shown.
Binary file modified F3DEX3/F3DEX3_BrW_PB.data.bps
Binary file not shown.
Binary file modified F3DEX3/F3DEX3_BrW_PC.code.bps
Binary file not shown.
Binary file modified F3DEX3/F3DEX3_BrW_PC.data.bps
Binary file not shown.
4 changes: 2 additions & 2 deletions include/functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,7 @@ Gfx* Gfx_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1
u32 x2, u32 y2, s32 width2, s32 height2, s32 r, s32 g, s32 b, s32 a);
Gfx* Gfx_EnvColor(GraphicsContext* gfxCtx, s32 r, s32 g, s32 b, s32 a);
void Gfx_SetupFrame(GraphicsContext* gfxCtx, s32 clearFB, u8 r, u8 g, u8 b);
void Gfx_ClearZBuffer(GraphicsContext* gfxCtx);
void func_80095974(GraphicsContext* gfxCtx);
void func_80095AA0(PlayState* play, Room* room, Input* input, s32 arg3);
void Room_DrawBackground2D(Gfx** gfxP, void* tex, void* tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 tlutMode,
Expand Down Expand Up @@ -1993,8 +1994,7 @@ void Play_DisableMotionBlur(void);

#if ENABLE_F3DEX3
void OcclusionPlane_NewScene(PlayState* play);
void OcclusionPlane_Draw_Start(PlayState* play);
void OcclusionPlane_Draw_Phase(PlayState* play, OcclusionPlanePhase loc);
void OcclusionPlane_Draw_Phase(PlayState* play, OcclusionPlanePhase phase);
void OcclusionPlane_Draw_PostCamUpdate(PlayState* play);
#endif

Expand Down
37 changes: 37 additions & 0 deletions include/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,3 +294,40 @@ extern struct GraphicsContext* __gfxCtx;
#else
#define NO_REORDER
#endif

// System for inserting SPDontSkipTexLoadsAcross for actors/effects which
// manipulate segments to select texture indices. Note that this only needs to
// be done for things which have a single material and which can appear multiple
// times consecutively in the scene, such as Rupees and effects.
#if ENABLE_F3DEX3

// It might seem that we'd need to ensure this is reset every frame. But we
// actually only care about when this changes within a frame, as the texture
// loads would only ever be skipped between two or more rupees drawn
// consecutively. This is s32 so it can hold an actual texture pointer in case
// an "index" is not available.
#define IF_F3DEX3_DONT_SKIP_TEX_INIT() \
static s32 _lastTexIndex = -1; \
(void)0

// If we have consecutive items rendering with different textures, F3DEX3's
// optimizer will incorrectly believe the texture loads can be skipped, so this
// command tells it not to skip them. However, if the texture really is the same
// as last time, then we can let the optimizer skip the load.
#define IF_F3DEX3_DONT_SKIP_TEX_HERE(pkt, texIndex) \
if ((s32)(texIndex) != _lastTexIndex) { \
gSPDontSkipTexLoadsAcross(pkt); \
_lastTexIndex = (s32)(texIndex); \
} \
(void)0

// In some cases we are sure things are rendered consecutively with different
// textures, e.g. in Fire Temple fire objects.
#define IF_F3DEX3_ALWAYS_DONT_SKIP_TEX(pkt) \
gSPDontSkipTexLoadsAcross(pkt)

#else
#define IF_F3DEX3_DONT_SKIP_TEX_INIT() (void)0
#define IF_F3DEX3_DONT_SKIP_TEX_HERE(pkt, texIndex) (void)0
#define IF_F3DEX3_ALWAYS_DONT_SKIP_TEX(pkt) (void)0
#endif
10 changes: 4 additions & 6 deletions include/occlusionplanes.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,16 @@ typedef enum F3DEX3OccMode {
F3DEX3_OCC_MODE_COUNT
} F3DEX3OccMode;

typedef enum {
OCCLUSION_PLANE_PHASE_PRE_SKY_1,
OCCLUSION_PLANE_PHASE_PRE_SCENE,
OCCLUSION_PLANE_PHASE_PRE_SKY_2,
OCCLUSION_PLANE_PHASE_PRE_ACTORS,
typedef enum OcclusionPlanePhase {
OCCLUSION_PLANE_PHASE_START,
OCCLUSION_PLANE_PHASE_POST_SKY,
OCCLUSION_PLANE_PHASE_COUNT
} OcclusionPlanePhase;

typedef struct {
OcclusionPlaneCandidate* list;
u8 count;
Gfx* planeCommands[OCCLUSION_PLANE_PHASE_COUNT];
Gfx* planeCommands[OCCLUSION_PLANE_PHASE_COUNT]
Vec3f selCandidate[4];
} OcclusionPlaneContext;

Expand Down
20 changes: 20 additions & 0 deletions include/ultra64/gbi.f3dex3.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ of warnings if you use -Wpedantic. */
/*#define G_SPECIAL_3 0xD3 no-op in F3DEX2 */
/*#define G_SPECIAL_2 0xD4 no-op in F3DEX2 */
/*#define G_SPECIAL_1 0xD5 triggered MVP recalculation, not supported in F3DEX3 */
#define G_MEMSET 0xD5
#define G_DMA_IO 0xD6
#define G_TEXTURE 0xD7
#define G_POPMTX 0xD8
Expand Down Expand Up @@ -2385,6 +2386,25 @@ _DW({ \
#define gSPDmaWrite(pkt,dmem,dram,size) gSPDma_io((pkt),1,(dmem),(dram),(size))
#define gsSPDmaWrite(dmem,dram,size) gsSPDma_io( 1,(dmem),(dram),(size))

/**
* Use RSP DMAs to set a region of memory to a repeated 16-bit value. This can
* clear the color framebuffer or Z-buffer faster than the RDP can in fill mode.
* SPMemset overwrites the DMEM vertex buffer, so vertices loaded before this
* command cannot be used after it (though this would not normally be done).
*
* dram: Segmented or physical start address. Must be aligned to 16 bytes.
* value: 16-bit value to fill the memory with. e.g. 0 for color, 0xFFFC for Z.
* size: Size in bytes to fill, must be nonzero and a multiple of 16 bytes.
*/
#define gSPMemset(pkt, dram, value, size) \
_DW({ \
gImmp1(pkt, G_RDPHALF_1, ((value) & 0xFFFF)); \
gDma0p(pkt, G_MEMSET, (dram), ((size) & 0xFFFFF0)); \
})

#define gsSPMemset(pkt, dram, value, size) \
gsImmp1(G_RDPHALF_1, ((value) & 0xFFFF)), \
gsDma0p(G_MEMSET, (dram), ((size) & 0xFFFFF0))

/*
* RSP short command (no DMA required) macros
Expand Down
8 changes: 1 addition & 7 deletions include/variables.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,7 @@ extern volatile s8 gLoadedF3DEX3Version;
extern volatile s8 gF3DEX3ProfVersion;
extern volatile s8 gF3DEX3NOCVersion;
extern s8 gF3DEX3OccMode;
#endif

#if ENABLE_F3DEX3
extern u8 gF3DEX3TextBuffer[];
extern volatile s8 gF3DEX3ProfVersion;
extern volatile s8 gF3DEX3NOCVersion;
extern s8 gF3DEX3OccMode;
extern u8 gUseMemsetForZBuffer;
#endif

extern SfxBankEntry D_8016BAD0[9];
Expand Down
80 changes: 30 additions & 50 deletions src/code/occlusionplanes.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ static bool ClipPolygon(PlayState* play, ClipVertex* verts, s8* indices, s8** id
// Too many generated vertices
return false;
}
if(idxWrite - &indices[idxSelect] >= 9){
// Polygon has too many vertices
return false;
}
verts[igen].clip.x = clFade2 * v19->clip.x + clFade1 * v3->clip.x;
verts[igen].clip.y = clFade2 * v19->clip.y + clFade1 * v3->clip.y;
verts[igen].w = clFade2 * v19->w + clFade1 * v3->w;
Expand All @@ -238,6 +242,10 @@ static bool ClipPolygon(PlayState* play, ClipVertex* verts, s8* indices, s8** id
++igen;
}
if(!v2Offscreen){
if(idxWrite - &indices[idxSelect] >= 9){
// Polygon has too many vertices
return false;
}
*idxWrite = i2;
++idxWrite;
}
Expand Down Expand Up @@ -538,68 +546,40 @@ void OcclusionPlane_NewScene(PlayState* play){
play->occPlaneCtx.list = NULL;
}

void OcclusionPlane_Draw_Start(PlayState* play){
for(s32 i=0; i<OCCLUSION_PLANE_PHASE_COUNT; ++i){
play->occPlaneCtx.planeCommands[i] = NULL;
}

GraphicsContext* gfxCtx = play->state.gfxCtx;
OPEN_DISPS(gfxCtx, "occlusionplanes.c", __LINE__);
gSPOcclusionPlane(POLY_OPA_DISP++, &sNoOcclusionPlane);
CLOSE_DISPS(gfxCtx, "occlusionplanes.c", __LINE__);
}

void OcclusionPlane_Draw_Phase(PlayState* play, OcclusionPlanePhase loc){
void OcclusionPlane_Draw_Phase(PlayState* play, OcclusionPlanePhase phase){
GraphicsContext* gfxCtx = play->state.gfxCtx;
OPEN_DISPS(gfxCtx, "occlusionplanes.c", __LINE__);
play->occPlaneCtx.planeCommands[loc] = POLY_OPA_DISP;
play->occPlaneCtx.planeCommands[phase] = POLY_OPA_DISP;
gSPOcclusionPlane(POLY_OPA_DISP++, &sNoOcclusionPlane);
CLOSE_DISPS(gfxCtx, "occlusionplanes.c", __LINE__);

if(phase == OCCLUSION_PLANE_PHASE_START){
// Post sky might not happen in debug
play->occPlaneCtx.planeCommands[OCCLUSION_PLANE_PHASE_POST_SKY] = NULL;
}
}

void OcclusionPlane_Draw_PostCamUpdate(PlayState* play){
OcclusionPlaneContext* ctx = &play->occPlaneCtx;

bool anyPlane = false;
for(s32 i=0; i<OCCLUSION_PLANE_PHASE_COUNT; ++i){
if(ctx->planeCommands[i] != NULL){
anyPlane = true;
break;
}
}
if(!anyPlane) return;

s32 result = OcclusionPlane_Choose(play);
if(result != 0) return;
OcclusionPlane* mainPlane = ComputeOcclusionPlane(play, ctx->selCandidate);

if(ctx->planeCommands[OCCLUSION_PLANE_PHASE_PRE_SKY_1] != NULL
|| ctx->planeCommands[OCCLUSION_PLANE_PHASE_PRE_SKY_2] != NULL){
if(mainPlane != &sNoOcclusionPlane){
OcclusionPlane* skyPlane = mainPlane;
if(mainPlane != &sNoOcclusionPlane){
// The skybox is not actually really far away, it's a smallish box
// centered on the camera. Thus, for occluding sky triangles, we will
// use the same computed occlusion plane coefficients for the edges, but
// set up the clip space plane so that all tris match the equation,
// effectively disabling the depth check.
skyPlane = Graph_Alloc(play->state.gfxCtx, sizeof(OcclusionPlane));
bcopy(mainPlane, skyPlane, 8*sizeof(short)); // Copy edge coeffs
skyPlane->o.kx = 0;
skyPlane->o.ky = 0;
skyPlane->o.kz = 0;
skyPlane->o.kc = 0x7FFF;
}
if(ctx->planeCommands[OCCLUSION_PLANE_PHASE_PRE_SKY_1] != NULL){
((u32*)(ctx->planeCommands[OCCLUSION_PLANE_PHASE_PRE_SKY_1]))[1] = (u32)skyPlane;
}
if(ctx->planeCommands[OCCLUSION_PLANE_PHASE_PRE_SKY_2] != NULL){
((u32*)(ctx->planeCommands[OCCLUSION_PLANE_PHASE_PRE_SKY_2]))[1] = (u32)skyPlane;
}
}
if(ctx->planeCommands[OCCLUSION_PLANE_PHASE_PRE_SCENE] != NULL){
((u32*)(ctx->planeCommands[OCCLUSION_PLANE_PHASE_PRE_SCENE]))[1] = (u32)mainPlane;
// The skybox is not actually really far away, it's a smallish box
// centered on the camera. Thus, for occluding sky triangles, we will
// use the same computed occlusion plane coefficients for the edges, but
// set up the clip space plane so that all tris match the equation,
// effectively disabling the depth check.
skyPlane = Graph_Alloc(play->state.gfxCtx, sizeof(OcclusionPlane));
bcopy(mainPlane, skyPlane, 8*sizeof(short)); // Copy edge coeffs
skyPlane->o.kx = 0;
skyPlane->o.ky = 0;
skyPlane->o.kz = 0;
skyPlane->o.kc = 0x7FFF;
((u32*)(ctx->planeCommands[OCCLUSION_PLANE_PHASE_START]))[1] = (u32)skyPlane;
}
if(ctx->planeCommands[OCCLUSION_PLANE_PHASE_PRE_ACTORS] != NULL){
((u32*)(ctx->planeCommands[OCCLUSION_PLANE_PHASE_PRE_ACTORS]))[1] = (u32)mainPlane;
if(ctx->planeCommands[OCCLUSION_PLANE_PHASE_POST_SKY] != NULL){
((u32*)(ctx->planeCommands[OCCLUSION_PLANE_PHASE_POST_SKY]))[1] = (u32)mainPlane;
}
}
2 changes: 2 additions & 0 deletions src/code/z_effect_soft_sprite_old_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ void EffectSs_DrawGEffect(PlayState* play, EffectSs* this, void* texture) {
s32 pad1;
Mtx* mtx;
void* objectPtr = play->objectCtx.slots[this->rgObjectSlot].segment;
IF_F3DEX3_DONT_SKIP_TEX_INIT();

OPEN_DISPS(gfxCtx, "../z_effect_soft_sprite_old_init.c", 196);

Expand All @@ -66,6 +67,7 @@ void EffectSs_DrawGEffect(PlayState* play, EffectSs* this, void* texture) {
if (mtx != NULL) {
gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(texture));
IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_XLU_DISP++, texture);
Gfx_SetupDL_61Xlu(gfxCtx);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, this->rgPrimColorR, this->rgPrimColorG, this->rgPrimColorB,
this->rgPrimColorA);
Expand Down
4 changes: 4 additions & 0 deletions src/code/z_en_item00.c
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,7 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) {
void EnItem00_DrawRupee(EnItem00* this, PlayState* play) {
s32 pad;
s32 texIndex;
IF_F3DEX3_DONT_SKIP_TEX_INIT();

OPEN_DISPS(play->state.gfxCtx, "../z_en_item00.c", 1546);

Expand All @@ -834,6 +835,7 @@ void EnItem00_DrawRupee(EnItem00* this, PlayState* play) {
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_item00.c", 1562), G_MTX_MODELVIEW | G_MTX_LOAD);

gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sRupeeTex[texIndex]));
IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_OPA_DISP++, texIndex);

gSPDisplayList(POLY_OPA_DISP++, gRupeeDL);

Expand All @@ -845,6 +847,7 @@ void EnItem00_DrawRupee(EnItem00* this, PlayState* play) {
*/
void EnItem00_DrawCollectible(EnItem00* this, PlayState* play) {
s32 texIndex = this->actor.params - 3;
IF_F3DEX3_DONT_SKIP_TEX_INIT();

OPEN_DISPS(play->state.gfxCtx, "../z_en_item00.c", 1594);

Expand All @@ -859,6 +862,7 @@ void EnItem00_DrawCollectible(EnItem00* this, PlayState* play) {
POLY_OPA_DISP = Gfx_SetupDL_66(POLY_OPA_DISP);

gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sItemDropTex[texIndex]));
IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_OPA_DISP++, texIndex);

gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_item00.c", 1607), G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(POLY_OPA_DISP++, gItemDropDL);
Expand Down
2 changes: 2 additions & 0 deletions src/code/z_kankyo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1985,6 +1985,7 @@ void Environment_DrawLightning(PlayState* play, s32 unused) {
s32 pad[2];
Vec3f unused1 = { 0.0f, 0.0f, 0.0f };
Vec3f unused2 = { 0.0f, 0.0f, 0.0f };
IF_F3DEX3_DONT_SKIP_TEX_INIT();

OPEN_DISPS(play->state.gfxCtx, "../z_kankyo.c", 3253);

Expand Down Expand Up @@ -2039,6 +2040,7 @@ void Environment_DrawLightning(PlayState* play, s32 unused) {
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_kankyo.c", 3333),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(lightningTextures[sLightningBolts[i].textureIndex]));
IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_XLU_DISP++, sLightningBolts[i].textureIndex);
Gfx_SetupDL_61Xlu(play->state.gfxCtx);
gSPMatrix(POLY_XLU_DISP++, &D_01000000, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, gEffLightningDL);
Expand Down
31 changes: 16 additions & 15 deletions src/code/z_play.c
Original file line number Diff line number Diff line change
Expand Up @@ -1258,9 +1258,13 @@ void Play_Draw(PlayState* this) {
clearG = this->lightCtx.fogColor[1];
clearB = this->lightCtx.fogColor[2];
}
// Clear the fb only if we aren't drawing a skybox, but always clear zb
// Clear the fb only if we aren't drawing a skybox
Gfx_SetupFrame(gfxCtx, clearFB, clearR, clearG, clearB);
}

#if ENABLE_F3DEX3
OcclusionPlane_Draw_Phase(this, OCCLUSION_PLANE_PHASE_START);
#endif

if (!IS_DEBUG || (R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_RUN_DRAW) {
POLY_OPA_DISP = Play_SetFog(this, POLY_OPA_DISP);
Expand All @@ -1285,10 +1289,6 @@ void Play_Draw(PlayState* this) {

gSPSegment(POLY_OPA_DISP++, 0x01, this->billboardMtx);

#if ENABLE_F3DEX3
OcclusionPlane_Draw_Start(this);
#endif

if (!IS_DEBUG || (R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_DRAW_COVER_ELEMENTS) {
Gfx* gfxP;
Gfx* sp1CC = POLY_OPA_DISP;
Expand Down Expand Up @@ -1361,9 +1361,6 @@ void Play_Draw(PlayState* this) {

if (!IS_DEBUG || (R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_DRAW_SKYBOX) {
if (this->skyboxId != SKYBOX_NONE && (this->skyboxId != SKYBOX_UNSET_1D) && !this->envCtx.skyboxDisabled) {
#if ENABLE_F3DEX3
OcclusionPlane_Draw_Phase(this, OCCLUSION_PLANE_PHASE_PRE_SKY_1);
#endif
if ((this->skyboxId == SKYBOX_NORMAL_SKY) || (this->skyboxId == SKYBOX_CUTSCENE_MAP)) {
Environment_UpdateSkybox(this->skyboxId, &this->envCtx, &this->skyboxCtx);
Skybox_Draw(&this->skyboxCtx, gfxCtx, &this->lightCtx, this->skyboxId, this->envCtx.skyboxBlend,
Expand All @@ -1384,10 +1381,20 @@ void Play_Draw(PlayState* this) {
if (!IS_DEBUG || (R_HREG_MODE != HREG_MODE_PLAY) || (R_PLAY_DRAW_ENV_FLAGS & PLAY_ENV_DRAW_SKYBOX_FILTERS)) {
Environment_DrawSkyboxFilters(this);
}

// The Z buffer has to be cleared at some point before anything using it
// is drawn (lighting strike is the first which does). But if we are
// using F3DEX3's SPMemset to clear it, it should be done as late as
// possible, after the RSP has already sent commands to the RDP for the
// skybox or framebuffer clear. This is so that the RSP can clear the Z
// buffer while the RDP is working on the framebuffer, without making
// the RDP wait for new work to be available.
Gfx_ClearZBuffer(gfxCtx);

#if ENABLE_F3DEX3
OcclusionPlane_Draw_Phase(this, OCCLUSION_PLANE_PHASE_PRE_SCENE);
OcclusionPlane_Draw_Phase(this, OCCLUSION_PLANE_PHASE_POST_SKY);
#endif

if (!IS_DEBUG || (R_HREG_MODE != HREG_MODE_PLAY) || (R_PLAY_DRAW_ENV_FLAGS & PLAY_ENV_DRAW_LIGHTNING)) {
Environment_UpdateLightningStrike(this);
Environment_DrawLightning(this, 0);
Expand Down Expand Up @@ -1417,9 +1424,6 @@ void Play_Draw(PlayState* this) {
if (!IS_DEBUG || (R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_DRAW_SKYBOX) {
if ((this->skyboxCtx.drawType != SKYBOX_DRAW_128) &&
(GET_ACTIVE_CAM(this)->setting != CAM_SET_PREREND_FIXED)) {
#if ENABLE_F3DEX3
OcclusionPlane_Draw_Phase(this, OCCLUSION_PLANE_PHASE_PRE_SKY_2);
#endif
Vec3f quakeOffset;

quakeOffset = Camera_GetQuakeOffset(GET_ACTIVE_CAM(this));
Expand All @@ -1430,9 +1434,6 @@ void Play_Draw(PlayState* this) {
}
}

#if ENABLE_F3DEX3
OcclusionPlane_Draw_Phase(this, OCCLUSION_PLANE_PHASE_PRE_ACTORS);
#endif
if (this->envCtx.precipitation[PRECIP_RAIN_CUR] != 0) {
Environment_DrawRain(this, &this->view, gfxCtx);
}
Expand Down
1 change: 1 addition & 0 deletions src/code/z_prenmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ void PreNMI_Draw(PreNMIState* this) {

gSPSegment(POLY_OPA_DISP++, 0x00, NULL);
Gfx_SetupFrame(gfxCtx, true, 0, 0, 0);
Gfx_ClearZBuffer(gfxCtx);
Gfx_SetupDL_36Opa(gfxCtx);
gDPSetFillColor(POLY_OPA_DISP++, (GPACK_RGBA5551(255, 255, 255, 1) << 16) | GPACK_RGBA5551(255, 255, 255, 1));
gDPFillRectangle(POLY_OPA_DISP++, 0, this->timer + 100, SCREEN_WIDTH - 1, this->timer + 100);
Expand Down
Loading

0 comments on commit 609e90f

Please sign in to comment.