Skip to content

Commit

Permalink
Merge pull request #131 from HackerN64/MoreEX3NoTexOptim
Browse files Browse the repository at this point in the history
More F3DEX3 no texture load optimizations
  • Loading branch information
sauraen authored Jun 6, 2024
2 parents db96daa + 2524518 commit b075ab0
Show file tree
Hide file tree
Showing 37 changed files with 116 additions and 36 deletions.
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
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
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,14 @@ static void* sFireballTexs[] = {

void BgHidanFirewall_Draw(Actor* thisx, PlayState* play) {
BgHidanFirewall* this = (BgHidanFirewall*)thisx;
IF_F3DEX3_DONT_SKIP_TEX_INIT();

OPEN_DISPS(play->state.gfxCtx, "../z_bg_hidan_firewall.c", 448);

POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_20);

gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sFireballTexs[this->unk_150]));
IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_XLU_DISP++, this->unk_150);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x01, 255, 255, 0, 150);
gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 255);
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_hidan_firewall.c", 458),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,11 @@ Gfx* BgHidanRsekizou_DrawFireball(PlayState* play, BgHidanRsekizou* this, s16 fr
s32 temp;
f32 fVar6;
f32 tmpf7;
IF_F3DEX3_DONT_SKIP_TEX_INIT();

temp = (((this->burnFrame + frame) % 8) * 7) * (1.0f / 7.0f);
gSPSegment(displayList++, 0x09, SEGMENTED_TO_VIRTUAL(sFireballsTexs[temp]));
IF_F3DEX3_DONT_SKIP_TEX_HERE(displayList++, temp);

frame++;
fVar6 = (frame != 4) ? frame + ((3 - this->bendFrame) * (1.0f / 3.0f)) : frame;
Expand Down
2 changes: 2 additions & 0 deletions src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,11 @@ Gfx* func_8088D9F4(PlayState* play, BgHidanSekizou* this, s16 arg2, MtxF* arg3,
f32 temp_f0;
f32 temp_f2;
f32 phi_f12;
IF_F3DEX3_DONT_SKIP_TEX_INIT();

arg6 = (((arg6 + arg2) % 8) * 7) * (1 / 7.0f);
gSPSegment(arg7++, 9, SEGMENTED_TO_VIRTUAL(sFireballsTexs[arg6]));
IF_F3DEX3_DONT_SKIP_TEX_HERE(arg7++, arg6);
arg2++;
if (arg2 != 4) {
phi_f12 = arg2 + ((4 - this->unk_170) / 4.0f);
Expand Down
2 changes: 2 additions & 0 deletions src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ Gfx* func_8088EB54(PlayState* play, BgHidanSima* this, Gfx* gfx) {
mtxF.zz += 0.4f;

gSPSegment(gfx++, 0x09, SEGMENTED_TO_VIRTUAL(sFireballsTexs[(this->timer + s3) % 7]));
IF_F3DEX3_ALWAYS_DONT_SKIP_TEX(gfx++);
gSPMatrix(gfx++,
Matrix_MtxFToMtx(MATRIX_CHECK_FLOATS(&mtxF, "../z_bg_hidan_sima.c", 611),
GRAPH_ALLOC(play->state.gfxCtx, sizeof(Mtx))),
Expand All @@ -267,6 +268,7 @@ Gfx* func_8088EB54(PlayState* play, BgHidanSima* this, Gfx* gfx) {
mtxF.xw = this->dyna.actor.world.pos.x + (phi_s5 * 25 + 80) * sin;
mtxF.zw = this->dyna.actor.world.pos.z + (phi_s5 * 25 + 80) * cos;
gSPSegment(gfx++, 0x09, SEGMENTED_TO_VIRTUAL(sFireballsTexs[(this->timer + s3) % 7]));
IF_F3DEX3_ALWAYS_DONT_SKIP_TEX(gfx++);
gSPMatrix(gfx++,
Matrix_MtxFToMtx(MATRIX_CHECK_FLOATS(&mtxF, "../z_bg_hidan_sima.c", 624),
GRAPH_ALLOC(play->state.gfxCtx, sizeof(Mtx))),
Expand Down
3 changes: 3 additions & 0 deletions src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1529,6 +1529,7 @@ void BossFd_DrawEffects(BossFdEffect* effect, PlayState* play) {
GraphicsContext* gfxCtx = play->state.gfxCtx;
s16 i;
BossFdEffect* firstEffect = effect;
IF_F3DEX3_DONT_SKIP_TEX_INIT();

OPEN_DISPS(gfxCtx, "../z_boss_fd.c", 4023);

Expand Down Expand Up @@ -1591,6 +1592,7 @@ void BossFd_DrawEffects(BossFdEffect* effect, PlayState* play) {
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_fd.c", 4104),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(dustTex[effect->timer2]));
IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_XLU_DISP++, effect->timer2);
gSPDisplayList(POLY_XLU_DISP++, gVolvagiaDustModelDL);
}
}
Expand All @@ -1614,6 +1616,7 @@ void BossFd_DrawEffects(BossFdEffect* effect, PlayState* play) {
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_fd.c", 4154),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(dustTex[effect->timer2]));
IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_XLU_DISP++, effect->timer2);
gSPDisplayList(POLY_XLU_DISP++, gVolvagiaDustModelDL);
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c
Original file line number Diff line number Diff line change
Expand Up @@ -4829,6 +4829,7 @@ void BossGanon_DrawEffects(PlayState* play) {
GraphicsContext* gfxCtx = play->state.gfxCtx;
GanondorfEffect* eff = play->specialEffects;
GanondorfEffect* effFirst = eff;
IF_F3DEX3_DONT_SKIP_TEX_INIT();

OPEN_DISPS(gfxCtx, "../z_boss_ganon.c", 10865);
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
Expand Down Expand Up @@ -4945,6 +4946,7 @@ void BossGanon_DrawEffects(PlayState* play) {
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(gfxCtx, "../z_boss_ganon.c", 11074),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sLightningTextures[eff->timer]));
IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_XLU_DISP++, eff->timer);
gSPDisplayList(POLY_XLU_DISP++, gGanondorfLightningDL);
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/overlays/actors/ovl_Boss_Va/z_boss_va.c
Original file line number Diff line number Diff line change
Expand Up @@ -3495,6 +3495,7 @@ void BossVa_DrawEffects(BossVaEffect* effect, PlayState* play) {
u8 materialFlag = 0;
BossVaEffect* effectHead = effect;
Camera* subCam = Play_GetCamera(play, sSubCamId);
IF_F3DEX3_DONT_SKIP_TEX_INIT();

OPEN_DISPS(gfxCtx, "../z_boss_va.c", 4953);

Expand Down Expand Up @@ -3535,6 +3536,7 @@ void BossVa_DrawEffects(BossVaEffect* effect, PlayState* play) {
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPPipeSync(POLY_XLU_DISP++);
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sSparkBallTex[effect->mode]));
IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_XLU_DISP++, effect->mode);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, effect->primColor[0], effect->primColor[1], effect->primColor[2],
effect->primColor[3]);
gDPPipeSync(POLY_XLU_DISP++);
Expand Down
2 changes: 2 additions & 0 deletions src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ void EnBdfire_DrawFire(EnBdfire* this, PlayState* play) {
};
s16 texIndex;
s32 pad;
IF_F3DEX3_DONT_SKIP_TEX_INIT();

OPEN_DISPS(play->state.gfxCtx, "../z_en_bdfire.c", 612);
texIndex = this->unk_156 & 7;
Expand All @@ -206,6 +207,7 @@ void EnBdfire_DrawFire(EnBdfire* this, PlayState* play) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 100, (s8)this->unk_18C);
gDPSetEnvColor(POLY_XLU_DISP++, 200, 0, 0, 0);
gSPSegment(POLY_XLU_DISP++, 8, SEGMENTED_TO_VIRTUAL(D_809BCB10[texIndex]));
IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_XLU_DISP++, texIndex);
Matrix_Translate(0.0f, 11.0f, 0.0f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_bdfire.c", 647),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
Expand Down
20 changes: 2 additions & 18 deletions src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,13 +379,7 @@ void EnExRuppy_Draw(Actor* thisx, PlayState* play) {
static void* rupeeTextures[] = {
gRupeeGreenTex, gRupeeBlueTex, gRupeeRedTex, gRupeePinkTex, gRupeeOrangeTex,
};
#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.
static s16 lastColorIdx = -1;
#endif
IF_F3DEX3_DONT_SKIP_TEX_INIT();
s32 pad;
EnExRuppy* this = (EnExRuppy*)thisx;

Expand All @@ -397,17 +391,7 @@ void EnExRuppy_Draw(Actor* thisx, PlayState* play) {
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_ex_ruppy.c", 780),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(rupeeTextures[this->colorIdx]));
#if ENABLE_F3DEX3
// If we have consecutive rupees 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
// rupee really is the same as last time, then we can let the optimizer
// skip the load.
if (this->colorIdx != lastColorIdx) {
gSPDontSkipTexLoadsAcross(POLY_OPA_DISP++);
lastColorIdx = this->colorIdx;
}
#endif
IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_OPA_DISP++, this->colorIdx);
gSPDisplayList(POLY_OPA_DISP++, gRupeeDL);

CLOSE_DISPS(play->state.gfxCtx, "../z_en_ex_ruppy.c", 784);
Expand Down
2 changes: 2 additions & 0 deletions src/overlays/actors/ovl_En_Fd/z_en_fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,7 @@ void EnFd_DrawEffectsFlames(EnFd* this, PlayState* play) {
s16 pad;
s16 materialFlag;
EnFdEffect* eff = this->effects;
IF_F3DEX3_DONT_SKIP_TEX_INIT();

OPEN_DISPS(play->state.gfxCtx, "../z_en_fd.c", 1969);

Expand Down Expand Up @@ -907,6 +908,7 @@ void EnFd_DrawEffectsFlames(EnFd* this, PlayState* play) {
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
idx = eff->timer * (8.0f / eff->initialTimer);
gSPSegment(POLY_XLU_DISP++, 0x8, SEGMENTED_TO_VIRTUAL(dustTextures[idx]));
IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_XLU_DISP++, idx);
gSPDisplayList(POLY_XLU_DISP++, gFlareDancerSquareParticleDL);
}

Expand Down
2 changes: 2 additions & 0 deletions src/overlays/actors/ovl_En_Fw/z_en_fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ void EnFw_DrawEffects(EnFw* this, PlayState* play) {
s16 alpha;
s16 i;
s16 idx;
IF_F3DEX3_DONT_SKIP_TEX_INIT();

OPEN_DISPS(play->state.gfxCtx, "../z_en_fw.c", 1191);

Expand Down Expand Up @@ -484,6 +485,7 @@ void EnFw_DrawEffects(EnFw* this, PlayState* play) {
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
idx = eff->timer * (8.0f / eff->initialTimer);
gSPSegment(POLY_XLU_DISP++, 0x8, SEGMENTED_TO_VIRTUAL(dustTextures[idx]));
IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_XLU_DISP++, idx);
gSPDisplayList(POLY_XLU_DISP++, gFlareDancerSquareParticleDL);
}

Expand Down
4 changes: 4 additions & 0 deletions src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ static void* sRupeeTextures[] = {
void EnGSwitch_DrawRupee(Actor* thisx, PlayState* play) {
s32 pad;
EnGSwitch* this = (EnGSwitch*)thisx;
IF_F3DEX3_DONT_SKIP_TEX_INIT();

if (1) {}
if (!this->broken) {
Expand All @@ -486,6 +487,7 @@ void EnGSwitch_DrawRupee(Actor* thisx, PlayState* play) {
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_g_switch.c", 957),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sRupeeTextures[this->colorIdx]));
IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_OPA_DISP++, this->colorIdx);
gSPDisplayList(POLY_OPA_DISP++, gRupeeDL);
CLOSE_DISPS(play->state.gfxCtx, "../z_en_g_switch.c", 961);
}
Expand Down Expand Up @@ -556,6 +558,7 @@ void EnGSwitch_DrawEffects(EnGSwitch* this, PlayState* play) {
s16 i;
f32 scale;
s32 pad;
IF_F3DEX3_DONT_SKIP_TEX_INIT();

OPEN_DISPS(gfxCtx, "../z_en_g_switch.c", 1073);
Gfx_SetupDL_25Opa(play->state.gfxCtx);
Expand All @@ -570,6 +573,7 @@ void EnGSwitch_DrawEffects(EnGSwitch* this, PlayState* play) {
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_g_switch.c", 1088),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sRupeeTextures[effect->colorIdx]));
IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_OPA_DISP++, effect->colorIdx);
gSPDisplayList(POLY_OPA_DISP++, gRupeeDL);
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/overlays/actors/ovl_En_Gb/z_en_gb.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ void EnGb_UpdateCagedSouls(EnGb* this, PlayState* play) {
void EnGb_DrawCagedSouls(EnGb* this, PlayState* play) {
s32 pad;
s32 i;
IF_F3DEX3_DONT_SKIP_TEX_INIT();

OPEN_DISPS(play->state.gfxCtx, "../z_en_gb.c", 914);

Expand All @@ -530,6 +531,7 @@ void EnGb_DrawCagedSouls(EnGb* this, PlayState* play) {
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 32, 64, 1, 0,
(u32)(sCagedSoulInfo[idx].timerMultiplier * this->frameTimer) % 512, 32, 128));
gSPSegment(POLY_XLU_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(sCagedSoulInfo[idx].texture));
IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_XLU_DISP++, idx);
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, sCagedSoulInfo[idx].prim.r, sCagedSoulInfo[idx].prim.g,
sCagedSoulInfo[idx].prim.b, sCagedSoulInfo[idx].prim.a);
gDPSetEnvColor(POLY_XLU_DISP++, sCagedSoulInfo[idx].env.r, sCagedSoulInfo[idx].env.g, sCagedSoulInfo[idx].env.b,
Expand Down
2 changes: 2 additions & 0 deletions src/overlays/actors/ovl_En_Go/z_en_go.c
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,7 @@ void EnGo_DrawEffects(EnGo* this, PlayState* play) {
s16 materialFlag;
s16 index;
s16 i;
IF_F3DEX3_DONT_SKIP_TEX_INIT();

OPEN_DISPS(play->state.gfxCtx, "../z_en_go.c", 2626);
materialFlag = false;
Expand Down Expand Up @@ -1222,6 +1223,7 @@ void EnGo_DrawEffects(EnGo* this, PlayState* play) {

index = dustEffect->timer * (8.0f / dustEffect->initialTimer);
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(dustTex[index]));
IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_XLU_DISP++, index);
gSPDisplayList(POLY_XLU_DISP++, gGoronDL_00FD50);
}

Expand Down
2 changes: 2 additions & 0 deletions src/overlays/actors/ovl_En_Go2/z_en_go2.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ void EnGo2_DrawEffects(EnGo2* this, PlayState* play) {
s16 materialFlag;
s16 index;
s16 i;
IF_F3DEX3_DONT_SKIP_TEX_INIT();

OPEN_DISPS(play->state.gfxCtx, "../z_en_go2_eff.c", 111);

Expand Down Expand Up @@ -246,6 +247,7 @@ void EnGo2_DrawEffects(EnGo2* this, PlayState* play) {
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
index = dustEffect->timer * (8.0f / dustEffect->initialTimer);
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sDustTex[index]));
IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_XLU_DISP++, index);
gSPDisplayList(POLY_XLU_DISP++, gGoronDL_00FD50);
}

Expand Down
2 changes: 2 additions & 0 deletions src/overlays/actors/ovl_En_Tk/z_en_tk.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ void EnTkEff_Draw(EnTk* this, PlayState* play) {
s16 gfxSetup;
s16 alpha;
s16 i;
IF_F3DEX3_DONT_SKIP_TEX_INIT();

OPEN_DISPS(play->state.gfxCtx, "../z_en_tk_eff.c", 114);

Expand Down Expand Up @@ -117,6 +118,7 @@ void EnTkEff_Draw(EnTk* this, PlayState* play) {

imageIdx = eff->timeLeft * ((f32)ARRAY_COUNT(dustTextures) / eff->timeTotal);
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(dustTextures[imageIdx]));
IF_F3DEX3_DONT_SKIP_TEX_HERE(POLY_XLU_DISP++, imageIdx);

gSPDisplayList(POLY_XLU_DISP++, gDampeEff2DL);
}
Expand Down
Loading

0 comments on commit b075ab0

Please sign in to comment.