1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-18 04:52:03 +00:00

Fix various small gfx issues (#1313)

* Fix various small gfx issues

* Use 0xFFFF instead of -1 for max prim depth

* More fixed point numbers

* scale -> texCoordScale, better cycle 2 render mode in z_title

* GFXP_CHAR_* defines renamed to SPACING

* Fix some gDPLoadMultiBlock uses
This commit is contained in:
Tharo 2022-07-30 22:49:10 +01:00 committed by GitHub
parent afbc312024
commit 455321d2e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
111 changed files with 695 additions and 604 deletions

View file

@ -1676,21 +1676,21 @@ void DemoEffect_DrawJewel(Actor* thisx, PlayState* play2) {
switch (this->jewel.type) {
case DEMO_EFFECT_JEWEL_KOKIRI:
gSPSegment(POLY_XLU_DISP++, 9,
Gfx_TwoTexScroll(play->state.gfxCtx, 0, (frames * 4) % 256,
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, (frames * 4) % 256,
(256 - ((frames * 2) % 256)) - 1, 64, 64, 1, (frames * 2) % 256,
(256 - (frames % 256)) - 1, 16, 16));
break;
case DEMO_EFFECT_JEWEL_GORON:
gSPSegment(POLY_XLU_DISP++, 9,
Gfx_TwoTexScroll(play->state.gfxCtx, 0, (frames * 4) % 128,
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, (frames * 4) % 128,
(256 - ((frames * 2) % 256)) - 1, 32, 64, 1, (frames * 2) % 256,
(256 - (frames % 256)) - 1, 16, 8));
break;
case DEMO_EFFECT_JEWEL_ZORA:
gSPSegment(POLY_XLU_DISP++, 9,
Gfx_TwoTexScroll(play->state.gfxCtx, 0, (frames * 4) % 256,
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, (frames * 4) % 256,
(256 - ((frames * 2) % 256)) - 1, 32, 32, 1, (frames * 2) % 256,
(256 - (frames % 256)) - 1, 16, 16));
break;
@ -1740,8 +1740,8 @@ void DemoEffect_DrawCrystalLight(Actor* thisx, PlayState* play) {
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gSPSegment(POLY_XLU_DISP++, 8,
Gfx_TwoTexScroll(play->state.gfxCtx, 0, (frames * 2) % 512, 512 - (frames % 512) - 1, 128, 128, 1,
512 - ((frames * 2) % 512) - 1, 0, 64, 64));
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, (frames * 2) % 512, 512 - (frames % 512) - 1, 128,
128, 1, 512 - ((frames * 2) % 512) - 1, 0, 64, 64));
Matrix_Push();
Matrix_RotateY(0.0f, MTXMODE_APPLY);
Matrix_RotateX(DEG_TO_RAD(11), MTXMODE_APPLY);
@ -1784,7 +1784,8 @@ void DemoEffect_DrawFireBall(Actor* thisx, PlayState* play) {
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPMatrix(POLY_XLU_DISP++, play->billboardMtx, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPSegment(POLY_XLU_DISP++, 8,
Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 32, 32, 1, 0, 128 - ((frames * 20) % 128) - 1, 32, 32));
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 32, 32, 1, 0,
128 - ((frames * 20) % 128) - 1, 32, 32));
gSPDisplayList(POLY_XLU_DISP++, gCreationFireBallDL);
CLOSE_DISPS(play->state.gfxCtx, "../z_demo_effect.c", 2723);
}
@ -1814,10 +1815,10 @@ void DemoEffect_DrawGodLgt(Actor* thisx, PlayState* play) {
}
gSPSegment(POLY_XLU_DISP++, 8,
Gfx_TwoTexScroll(play->state.gfxCtx, 0, (frames * 4) % 512, 0, 128, 64, 1, (frames * 2) % 256,
512 - ((frames * 70) % 512) - 1, 64, 32));
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, (frames * 4) % 512, 0, 128, 64, 1,
(frames * 2) % 256, 512 - ((frames * 70) % 512) - 1, 64, 32));
gSPSegment(POLY_XLU_DISP++, 9,
Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 16, 96, 1, (frames * 10) % 256,
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 16, 96, 1, (frames * 10) % 256,
256 - ((frames * 30) % 512) - 1, 8, 32));
gDPSetPrimColor(POLY_XLU_DISP++, 128, 128, this->primXluColor[0], this->primXluColor[1], this->primXluColor[2],
255);
@ -1926,8 +1927,8 @@ void DemoEffect_DrawLgtShower(Actor* thisx, PlayState* play) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_demo_effect.c", 2927),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPSegment(POLY_XLU_DISP++, 8,
Gfx_TwoTexScroll(play->state.gfxCtx, 0, (frames * 5) % 1024, 0, 256, 64, 1, (frames * 10) % 128,
512 - ((frames * 50) % 512), 32, 16));
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, (frames * 5) % 1024, 0, 256, 64, 1,
(frames * 10) % 128, 512 - ((frames * 50) % 512), 32, 16));
gSPDisplayList(POLY_XLU_DISP++, gEnliveningLightDL);
CLOSE_DISPS(play->state.gfxCtx, "../z_demo_effect.c", 2942);
}
@ -1948,8 +1949,8 @@ void DemoEffect_DrawLightRing(Actor* thisx, PlayState* play2) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_demo_effect.c", 2963),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPSegment(POLY_XLU_DISP++, 8,
Gfx_TwoTexScroll(play->state.gfxCtx, 0, (frames * 5) % 64, 512 - ((frames * 2) % 512) - 1, 16, 128, 1, 0,
0, 8, 1024));
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, (frames * 5) % 64, 512 - ((frames * 2) % 512) - 1,
16, 128, 1, 0, 0, 8, 1024));
gSPDisplayList(POLY_XLU_DISP++, gGoldenGoddessLightRingDL);
CLOSE_DISPS(play->state.gfxCtx, "../z_demo_effect.c", 2978);
@ -1975,8 +1976,8 @@ void DemoEffect_DrawTriforceSpot(Actor* thisx, PlayState* play) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_demo_effect.c", 3011),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPSegment(POLY_XLU_DISP++, 9,
Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 256 - ((frames * 4) % 256) - 1, 64, 64, 1, 0,
256 - ((frames * 2) % 256) - 1, 64, 32));
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 256 - ((frames * 4) % 256) - 1, 64, 64,
1, 0, 256 - ((frames * 2) % 256) - 1, 64, 32));
vertices[86].n.a = vertices[87].n.a = vertices[88].n.a = vertices[89].n.a = vertices[92].n.a =
vertices[93].n.a = vertices[94].n.a = vertices[95].n.a = (s8)this->triforceSpot.lightColumnOpacity;
gDPSetPrimColor(POLY_XLU_DISP++, 128, 128, 180, 255, 255, this->triforceSpot.lightColumnOpacity);
@ -1997,7 +1998,8 @@ void DemoEffect_DrawTriforceSpot(Actor* thisx, PlayState* play) {
Matrix_RotateY(BINANG_TO_RAD(this->triforceSpot.rotation), MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_demo_effect.c", 3053),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPSegment(POLY_XLU_DISP++, 8, Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 32, 16, 1, 0, 0, 16, 8));
gSPSegment(POLY_XLU_DISP++, 8,
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 32, 16, 1, 0, 0, 16, 8));
gDPSetPrimColor(POLY_XLU_DISP++, 128, 128, 255, 255, 160, this->triforceSpot.triforceSpotOpacity);
gDPSetEnvColor(POLY_XLU_DISP++, 170, 140, 0, 255);
gSPDisplayList(POLY_XLU_DISP++, gTriforceDL);
@ -2008,7 +2010,8 @@ void DemoEffect_DrawTriforceSpot(Actor* thisx, PlayState* play) {
Matrix_RotateY(BINANG_TO_RAD(this->triforceSpot.rotation), MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_demo_effect.c", 3085),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPSegment(POLY_OPA_DISP++, 8, Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 32, 16, 1, 0, 0, 16, 8));
gSPSegment(POLY_OPA_DISP++, 8,
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 32, 16, 1, 0, 0, 16, 8));
gDPSetPrimColor(POLY_OPA_DISP++, 128, 128, 255, 255, 160, 255);
gDPSetEnvColor(POLY_OPA_DISP++, 170, 140, 0, 255);
gSPDisplayList(POLY_OPA_DISP++, gTriforceDL);
@ -2048,8 +2051,9 @@ s32 DemoEffect_OverrideLimbDrawTimeWarp(PlayState* play, SkelCurve* skelCurve, s
gDPSetPrimColor(POLY_XLU_DISP++, 0, 128, 170, 255, 255, 255);
gDPSetEnvColor(POLY_XLU_DISP++, this->envXluColor[0], this->envXluColor[1], this->envXluColor[2], 255);
gSPSegment(POLY_XLU_DISP++, 8,
Gfx_TwoTexScroll(play->state.gfxCtx, 0, (frames * 6) % 1024, 256 - ((frames * 16) % 256) - 1, 256, 64, 1,
(frames * 4) % 512, 128 - ((frames * 12) % 128) - 1, 128, 32));
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, (frames * 6) % 1024,
256 - ((frames * 16) % 256) - 1, 256, 64, 1, (frames * 4) % 512,
128 - ((frames * 12) % 128) - 1, 128, 32));
CLOSE_DISPS(play->state.gfxCtx, "../z_demo_effect.c", 3172);
if (limbIndex == 0) {