mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-01-08 12:28:10 -05:00
Fix transition wipe not rendering properly (#4757)
This commit is contained in:
parent
f7b8ddccfd
commit
61e91526cd
@ -11,31 +11,35 @@ Gfx sCircleNullDList[] = {
|
|||||||
//#include "code/fbdemo_circle/z_fbdemo_circle.c"
|
//#include "code/fbdemo_circle/z_fbdemo_circle.c"
|
||||||
#include "code/fbdemo_circle/z_fbdemo_circle.h"
|
#include "code/fbdemo_circle/z_fbdemo_circle.h"
|
||||||
|
|
||||||
Gfx __sCircleDList[] = {
|
Gfx sTransCircleDL[] = {
|
||||||
gsDPPipeSync(), // 0
|
gsDPPipeSync(),
|
||||||
gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | // 1
|
gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN |
|
||||||
G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
|
G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
|
||||||
gsSPSetGeometryMode(G_SHADE | G_SHADING_SMOOTH), // 2
|
gsSPSetGeometryMode(G_SHADE | G_SHADING_SMOOTH),
|
||||||
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | // 3
|
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
|
||||||
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||||
G_AC_NONE | G_ZS_PIXEL | G_RM_XLU_SURF | G_RM_XLU_SURF2), // 4
|
G_AC_NONE | G_ZS_PIXEL | G_RM_XLU_SURF | G_RM_XLU_SURF2),
|
||||||
gsDPSetCombineMode(G_CC_BLENDPEDECALA, G_CC_BLENDPEDECALA), // 5
|
gsDPSetCombineMode(G_CC_BLENDPEDECALA, G_CC_BLENDPEDECALA),
|
||||||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), // 6
|
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
|
||||||
gsDPLoadTextureBlock(SEG_ADDR(8, 0), G_IM_FMT_I, G_IM_SIZ_8b, 16, 64, 0, G_TX_NOMIRROR | G_TX_WRAP, // 7
|
gsDPLoadTextureBlock(SEG_ADDR(8, 0), G_IM_FMT_I, G_IM_SIZ_8b, 16, 64, 0, G_TX_NOMIRROR | G_TX_WRAP,
|
||||||
G_TX_NOMIRROR | G_TX_CLAMP, 4, 6, G_TX_NOLOD, G_TX_NOLOD),
|
G_TX_NOMIRROR | G_TX_CLAMP, 4, 6, G_TX_NOLOD, G_TX_NOLOD),
|
||||||
gsSPDisplayList(SEG_ADDR(9, 0)), // 8
|
gsSPDisplayList(SEG_ADDR(9, 0)),
|
||||||
gsSPVertex(sTransCircleVtx, 32, 0), // 9
|
// OTRTODO: Add proper gsSPVertexOTRFilepath macro
|
||||||
gsSP2Triangles(0, 1, 2, 0, 1, 3, 4, 0), // 10
|
{ G_VTX_OTR_FILEPATH << 24, (uintptr_t)sTransCircleVtx },
|
||||||
gsSP2Triangles(3, 5, 6, 0, 5, 7, 8, 0), // 11
|
{ 32, 0 << 16 | 0 },
|
||||||
gsSP2Triangles(7, 9, 10, 0, 9, 11, 12, 0), // 12
|
gsSP2Triangles(0, 1, 2, 0, 1, 3, 4, 0),
|
||||||
gsSP2Triangles(11, 13, 14, 0, 13, 15, 16, 0), // 13
|
gsSP2Triangles(3, 5, 6, 0, 5, 7, 8, 0),
|
||||||
gsSP2Triangles(15, 17, 18, 0, 17, 19, 20, 0), // 14
|
gsSP2Triangles(7, 9, 10, 0, 9, 11, 12, 0),
|
||||||
gsSP2Triangles(19, 21, 22, 0, 21, 23, 24, 0), // 15
|
gsSP2Triangles(11, 13, 14, 0, 13, 15, 16, 0),
|
||||||
gsSP2Triangles(23, 25, 26, 0, 25, 27, 28, 0), // 16
|
gsSP2Triangles(15, 17, 18, 0, 17, 19, 20, 0),
|
||||||
gsSP1Triangle(27, 29, 30, 0), // 17
|
gsSP2Triangles(19, 21, 22, 0, 21, 23, 24, 0),
|
||||||
gsSPVertex(&sTransCircleVtx[31], 3, 0), // 18
|
gsSP2Triangles(23, 25, 26, 0, 25, 27, 28, 0),
|
||||||
gsSP1Triangle(0, 1, 2, 0), // 19
|
gsSP1Triangle(27, 29, 30, 0),
|
||||||
gsSPEndDisplayList(), // 20
|
// OTRTODO: Add proper gsSPVertexOTRFilepath macro
|
||||||
|
{ G_VTX_OTR_FILEPATH << 24, (uintptr_t)sTransCircleVtx },
|
||||||
|
{ 3, 0 << 16 | 31 },
|
||||||
|
gsSP1Triangle(0, 1, 2, 0),
|
||||||
|
gsSPEndDisplayList(),
|
||||||
};
|
};
|
||||||
|
|
||||||
void TransitionCircle_Start(void* thisx) {
|
void TransitionCircle_Start(void* thisx) {
|
||||||
@ -149,7 +153,7 @@ void TransitionCircle_Draw(void* thisx, Gfx** gfxP) {
|
|||||||
|
|
||||||
this->frame ^= 1;
|
this->frame ^= 1;
|
||||||
gDPPipeSync(gfx++);
|
gDPPipeSync(gfx++);
|
||||||
texScroll = Gfx_BranchTexScroll(&gfx, this->texX, this->texY, 0x10, 0x40);
|
texScroll = Gfx_BranchTexScroll(&gfx, this->texX, this->texY, 16, 64);
|
||||||
gSPSegment(gfx++, 9, texScroll);
|
gSPSegment(gfx++, 9, texScroll);
|
||||||
gSPSegment(gfx++, 8, this->texture);
|
gSPSegment(gfx++, 8, this->texture);
|
||||||
gDPSetColor(gfx++, G_SETPRIMCOLOR, this->color.rgba);
|
gDPSetColor(gfx++, G_SETPRIMCOLOR, this->color.rgba);
|
||||||
@ -174,15 +178,7 @@ void TransitionCircle_Draw(void* thisx, Gfx** gfxP) {
|
|||||||
guTranslate(&modelView[2], tPos, tPos, 0.0f);
|
guTranslate(&modelView[2], tPos, tPos, 0.0f);
|
||||||
gSPMatrix(gfx++, &modelView[2], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
|
gSPMatrix(gfx++, &modelView[2], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
|
||||||
}
|
}
|
||||||
|
gSPDisplayList(gfx++, sTransCircleDL);
|
||||||
// OTRTODO: This is an ugly hack but it will do for now...
|
|
||||||
Vtx* vtx = ResourceMgr_LoadVtxByName(sTransCircleVtx);
|
|
||||||
Gfx var1 = gsSPVertex(vtx, 32, 0);
|
|
||||||
Gfx var2 = gsSPVertex(&vtx[31], 3, 0);
|
|
||||||
__sCircleDList[0xe] = var1;
|
|
||||||
__sCircleDList[0x17] = var2;
|
|
||||||
|
|
||||||
gSPDisplayList(gfx++, __sCircleDList);
|
|
||||||
gDPPipeSync(gfx++);
|
gDPPipeSync(gfx++);
|
||||||
*gfxP = gfx;
|
*gfxP = gfx;
|
||||||
}
|
}
|
||||||
|
@ -3,25 +3,30 @@
|
|||||||
|
|
||||||
#include "code/fbdemo_wipe1/z_fbdemo_wipe1.h"
|
#include "code/fbdemo_wipe1/z_fbdemo_wipe1.h"
|
||||||
|
|
||||||
Gfx sWipeDList[] = {
|
Gfx sTransWipeDL[] = {
|
||||||
gsDPPipeSync(),
|
gsDPPipeSync(),
|
||||||
gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN |
|
gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN |
|
||||||
G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
|
G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
|
||||||
gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH),
|
// SOH [Port] Removed G_ZBUFFER as gsDPSetPrimDepth is unimplemented in LUS.
|
||||||
|
// This should have the same effect of ignoring previous depth values
|
||||||
|
// LUSTODO: Add back once gsDPSetPrimDepth is implemented
|
||||||
|
gsSPSetGeometryMode(/* G_ZBUFFER | */ G_SHADE | G_SHADING_SMOOTH),
|
||||||
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
|
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
|
||||||
G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_1PRIMITIVE,
|
G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_1PRIMITIVE,
|
||||||
G_AC_NONE | G_ZS_PRIM | G_RM_PASS | G_RM_AA_ZB_TEX_EDGE2),
|
G_AC_NONE | G_ZS_PRIM | G_RM_PASS | G_RM_AA_ZB_TEX_EDGE2),
|
||||||
gsDPSetCombineLERP(TEXEL1, TEXEL0, PRIM_LOD_FRAC, TEXEL0, TEXEL1, TEXEL0, PRIM_LOD_FRAC, TEXEL0, COMBINED, 0,
|
gsDPSetCombineLERP(TEXEL1, TEXEL0, PRIM_LOD_FRAC, TEXEL0, TEXEL1, TEXEL0, PRIM_LOD_FRAC, TEXEL0, COMBINED, 0,
|
||||||
PRIMITIVE, 0, COMBINED, 0, PRIMITIVE, 0),
|
PRIMITIVE, 0, COMBINED, 0, PRIMITIVE, 0),
|
||||||
gsDPSetPrimDepth(0, 0),
|
gsDPSetPrimDepth(0, 0),
|
||||||
gsDPLoadTextureBlock_4b(sTransWipeTex, G_IM_FMT_I, 64, 64, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 6, 6,
|
gsDPLoadTextureBlock_4b(sTransWipeTex, G_IM_FMT_I, 64, 64, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 6,
|
||||||
11, G_TX_NOLOD),
|
6, 11, G_TX_NOLOD),
|
||||||
gsDPLoadMultiBlock_4b(sTransWipeTex, 0x0100, 1, G_IM_FMT_I, 64, 64, 0, G_TX_NOMIRROR | G_TX_WRAP,
|
gsDPLoadMultiBlock_4b(sTransWipeTex, 0x0100, 1, G_IM_FMT_I, 64, 64, 0, G_TX_NOMIRROR | G_TX_WRAP,
|
||||||
G_TX_MIRROR | G_TX_WRAP, 6, 6, 11, 1),
|
G_TX_MIRROR | G_TX_WRAP, 6, 6, 11, 1),
|
||||||
gsDPSetTextureLUT(G_TT_NONE),
|
gsDPSetTextureLUT(G_TT_NONE),
|
||||||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
|
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
|
||||||
gsSPDisplayList(SEG_ADDR(8, 0)),
|
gsSPDisplayList(SEG_ADDR(8, 0)),
|
||||||
gsSPVertex(sTransWipeVtx, 25, 0),
|
// OTRTODO: Add proper gsSPVertexOTRFilepath macro
|
||||||
|
{ G_VTX_OTR_FILEPATH << 24, (uintptr_t)sTransWipeVtx },
|
||||||
|
{ 25, 0 << 16 | 0 },
|
||||||
gsSP2Triangles(0, 1, 2, 0, 1, 3, 4, 0),
|
gsSP2Triangles(0, 1, 2, 0, 1, 3, 4, 0),
|
||||||
gsSP2Triangles(5, 6, 7, 0, 6, 8, 9, 0),
|
gsSP2Triangles(5, 6, 7, 0, 6, 8, 9, 0),
|
||||||
gsSP2Triangles(8, 10, 11, 0, 10, 12, 13, 0),
|
gsSP2Triangles(8, 10, 11, 0, 10, 12, 13, 0),
|
||||||
@ -32,7 +37,7 @@ Gfx sWipeDList[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// unused.
|
// unused.
|
||||||
Gfx sWipeSyncDList[] = {
|
Gfx sTransWipeSyncDL[] = {
|
||||||
gsDPPipeSync(),
|
gsDPPipeSync(),
|
||||||
gsSPEndDisplayList(),
|
gsSPEndDisplayList(),
|
||||||
};
|
};
|
||||||
@ -88,18 +93,17 @@ void TransitionWipe_Draw(void* thisx, Gfx** gfxP) {
|
|||||||
Mtx* modelView;
|
Mtx* modelView;
|
||||||
TransitionWipe* this = (TransitionWipe*)thisx;
|
TransitionWipe* this = (TransitionWipe*)thisx;
|
||||||
s32 pad[4];
|
s32 pad[4];
|
||||||
Gfx* tex;
|
Gfx* texScroll;
|
||||||
Gfx* wipeDl = sWipeDList;
|
|
||||||
|
|
||||||
modelView = this->modelView[this->frame];
|
modelView = this->modelView[this->frame];
|
||||||
|
|
||||||
this->frame ^= 1;
|
this->frame ^= 1;
|
||||||
|
|
||||||
guScale(&modelView[0], 0.56f, 0.56f, 1.0f);
|
guScale(&modelView[0], 0.56f, 0.56f, 1.0f);
|
||||||
guRotate(&modelView[1], 0.0f, 0.0f, 0.0f, 1.0f);
|
guRotate(&modelView[1], 0.0f, 0.0f, 0.0f, 1.0f);
|
||||||
guTranslate(&modelView[2], 0.0f, 0.0f, 0.0f);
|
guTranslate(&modelView[2], 0.0f, 0.0f, 0.0f);
|
||||||
gDPPipeSync(gfx++);
|
gDPPipeSync(gfx++);
|
||||||
tex = Gfx_BranchTexScroll(&gfx, this->texX, this->texY, 0, 0);
|
texScroll = Gfx_BranchTexScroll(&gfx, this->texX, this->texY, 0, 0);
|
||||||
gSPSegment(gfx++, 8, tex);
|
gSPSegment(gfx++, 8, texScroll);
|
||||||
gDPSetPrimColor(gfx++, 0, 0x80, this->color.r, this->color.g, this->color.b, 255);
|
gDPSetPrimColor(gfx++, 0, 0x80, this->color.r, this->color.g, this->color.b, 255);
|
||||||
gSPMatrix(gfx++, &this->projection, G_MTX_LOAD | G_MTX_PROJECTION);
|
gSPMatrix(gfx++, &this->projection, G_MTX_LOAD | G_MTX_PROJECTION);
|
||||||
gSPPerspNormalize(gfx++, this->normal);
|
gSPPerspNormalize(gfx++, this->normal);
|
||||||
@ -107,7 +111,7 @@ void TransitionWipe_Draw(void* thisx, Gfx** gfxP) {
|
|||||||
gSPMatrix(gfx++, &modelView[0], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
gSPMatrix(gfx++, &modelView[0], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||||
gSPMatrix(gfx++, &modelView[1], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
|
gSPMatrix(gfx++, &modelView[1], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
|
||||||
gSPMatrix(gfx++, &modelView[2], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
|
gSPMatrix(gfx++, &modelView[2], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
|
||||||
gSPDisplayList(gfx++, sWipeDList);
|
gSPDisplayList(gfx++, sTransWipeDL);
|
||||||
gDPPipeSync(gfx++);
|
gDPPipeSync(gfx++);
|
||||||
*gfxP = gfx;
|
*gfxP = gfx;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user