Widescreen Radio

This commit is contained in:
Sonic Dreamcaster 2024-12-06 02:35:52 -03:00
parent a23d9246b2
commit 7c263a0900
4 changed files with 52 additions and 39 deletions

View File

@ -117,6 +117,11 @@ Gfx sRadioDamageDL[] = {
gsSPEndDisplayList(),
};
void HUD_MatrixTranslateCoordLeft(f32* transX, f32* transY) {
*transX = OTRGetRectDimensionFromLeftEdge(*transX) - (SCREEN_WIDTH / 2.0f);
*transY = (SCREEN_HEIGHT / 2.0f) - *transY;
}
// Used in the status screen, and when losing a life
void HUD_LivesCount1_Draw(f32 xPos, f32 yPos, s32 lifeCount) {
u8* sLifeIconTex[] = { aArwingLifeIconTex, aBlueMarineLifeIconTex, aLandmasterLifeIconTex };
@ -203,16 +208,22 @@ void HUD_TeamDownWrench_Draw(s32 arg0) {
}
}
} else {
f32 x = 48.0f;
f32 y = 0.0f;
HUD_MatrixTranslateCoordLeft(&x, &y);
y = -81.0f;
Lib_InitOrtho(&gMasterDisp);
Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, -234.0f, -167.0f, -600.0f, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, x, y, -600.0f, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, M_PI / 4, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 0.68f, 0.68f, 1.0f, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 0.31f, 0.31f, 1.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, aDownWrenchDL);
Matrix_RotateZ(gGfxMatrix, 3 * M_PI / 2, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, aDownWrenchDL);
Matrix_Pop(&gGfxMatrix);
Lib_InitPerspective(&gMasterDisp);
}
}
@ -304,11 +315,6 @@ void HUD_BoostGaugeCool_Draw(f32 xPos, f32 yPos, f32 xScale, f32 yScale) {
}
}
void HUD_MatrixTranslateCoordLeft(f32* transX, f32* transY) {
*transX = OTRGetRectDimensionFromLeftEdge(*transX) - (SCREEN_WIDTH / 2.0f);
*transY = (SCREEN_HEIGHT / 2.0f) - *transY;
}
void HUD_GoldRings_Draw(void) {
Gfx* sGoldRingDLs[] = {
aGoldRingFrame1DL, aGoldRingFrame2DL, aGoldRingFrame3DL, aGoldRingFrame4DL,
@ -2242,49 +2248,51 @@ void HUD_RadioCharacterName_Draw(void) {
RCP_SetupDL(&gMasterDisp, SETUPDL_76_POINT);
gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255);
f32 xPos = OTRGetRectDimensionFromLeftEdge(73.0f);
switch ((s32) gRadioMsgRadioId) {
case RCID_FOX:
Graphics_DisplaySmallText(73, 173, 1.0f, 1.0f, "FOX");
Graphics_DisplaySmallText(xPos, 173, 1.0f, 1.0f, "FOX");
break;
case RCID_FALCO:
Graphics_DisplaySmallText(73, 173, 1.0f, 1.0f, "FALCO");
Graphics_DisplaySmallText(xPos, 173, 1.0f, 1.0f, "FALCO");
break;
case RCID_SLIPPY:
Graphics_DisplaySmallText(73, 173, 1.0f, 1.0f, "SLIPPY");
Graphics_DisplaySmallText(xPos, 173, 1.0f, 1.0f, "SLIPPY");
break;
case RCID_PEPPY:
Graphics_DisplaySmallText(73, 173, 1.0f, 1.0f, "PEPPY");
Graphics_DisplaySmallText(xPos, 173, 1.0f, 1.0f, "PEPPY");
break;
case RCID_WOLF:
case RCID_WOLF_2:
Graphics_DisplaySmallText(73, 173, 1.0f, 1.0f, "WOLF");
Graphics_DisplaySmallText(xPos, 173, 1.0f, 1.0f, "WOLF");
break;
case RCID_LEON:
case RCID_LEON_2:
Graphics_DisplaySmallText(73, 173, 1.0f, 1.0f, "LEON");
Graphics_DisplaySmallText(xPos, 173, 1.0f, 1.0f, "LEON");
break;
case RCID_PIGMA:
case RCID_PIGMA_2:
Graphics_DisplaySmallText(73, 173, 1.0f, 1.0f, "PIGMA");
Graphics_DisplaySmallText(xPos, 173, 1.0f, 1.0f, "PIGMA");
break;
case RCID_ANDREW:
case RCID_ANDREW_2:
Graphics_DisplaySmallText(73, 173, 1.0f, 1.0f, "ANDREW");
Graphics_DisplaySmallText(xPos, 173, 1.0f, 1.0f, "ANDREW");
break;
case RCID_BILL:
Graphics_DisplaySmallText(73, 173, 1.0f, 1.0f, "BILL");
Graphics_DisplaySmallText(xPos, 173, 1.0f, 1.0f, "BILL");
break;
case RCID_KATT:
Graphics_DisplaySmallText(73, 173, 1.0f, 1.0f, "KATT");
Graphics_DisplaySmallText(xPos, 173, 1.0f, 1.0f, "KATT");
break;
}
}
@ -2615,12 +2623,18 @@ void HUD_RadioDamage_Draw(void) {
if ((D_80161788 != 0) || (D_8016178C != 0)) {
RCP_SetupDL(&gMasterDisp, SETUPDL_12);
gDPSetPrimColor(gMasterDisp++, 0, 0, r, g, b, alpha);
f32 x = 48.0f;
f32 y = 0.0f;
HUD_MatrixTranslateCoordLeft(&x, &y);
y = -81.0f;
Lib_InitOrtho(&gMasterDisp);
Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, -53.9f, -38.5f, -139.4f, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 1.0f, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, x, y, -139.4f, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 2.25f, 2.25f, 2.25f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, sRadioDamageDL);
Matrix_Pop(&gGfxMatrix);
Lib_InitPerspective(&gMasterDisp);
}
}
@ -2778,7 +2792,6 @@ void HUD_VsModePortraitTex_Draw(f32 xPos, f32 yPos, f32 scale, s32 idx) {
Lib_TextureRect_RGBA16(&gMasterDisp, sVsModeFaceDL[idx], 44, 44, xPos, yPos, scale, scale);
}
// LTODO: Align these
void HUD_EdgeArrows_Draw(s32 idx, bool arg1) {
f32 D_800D1EF8[] = { 0.0f, 0.0f, -9.0f, 9.0f, 10.0f, 10.0f, 10.0f, 10.0f, 0.0f, 0.0f, -8.0f, 8.0f };
f32 D_800D1F28[] = { -7.0f, 7.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 8.0f, -8.0f, 0.0f, 0.0f };

View File

@ -19,8 +19,8 @@ u16 Message_IdFromPtr(u16* msgPtr) {
MsgLookup* lookup = (MsgLookup*) LOAD_ASSET(gMsgLookup);
while (lookup->msgPtr != NULL) {
if(GameEngine_OTRSigCheck(msgPtr)){
if(strcmp(((char*) msgPtr) + 7, lookup->path) == 0){
if (GameEngine_OTRSigCheck(msgPtr)) {
if (strcmp(((char*) msgPtr) + 7, lookup->path) == 0) {
return lookup->msgId;
}
} else {
@ -65,7 +65,7 @@ void Message_DisplayChar(Gfx** gfxPtr, u16 msgChar, s32 xpos, s32 ypos) {
gDPLoadTextureBlock_4b((*gfxPtr)++, gTextCharTextures[msgChar >> 2], G_IM_FMT_CI, 16, 13, msgChar % 4U,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
G_TX_NOLOD);
gSPTextureRectangle((*gfxPtr)++, xpos << 2, ypos << 2, (xpos + 13) << 2, (ypos + 13) << 2, G_TX_RENDERTILE, 64, 0,
gSPWideTextureRectangle((*gfxPtr)++, xpos << 2, ypos << 2, (xpos + 13) << 2, (ypos + 13) << 2, G_TX_RENDERTILE, 64, 0,
1024, 1024);
}

View File

@ -127,21 +127,21 @@ void Radio_PlayMessage(u16* msg, RadioCharacterId character) {
case GSTATE_TITLE:
case GSTATE_ENDING:
gRadioPrintPosY = 176;
gRadioPrintPosX = 85;
gRadioTextBoxPosX = 80.0f;
gRadioPrintPosX = OTRGetRectDimensionFromLeftEdge(85.0f);
gRadioTextBoxPosX = OTRGetRectDimensionFromLeftEdge(80.0f);
gRadioTextBoxPosY = 174.0f;
gRadioTextBoxScaleX = 4.63f;
gRadioPortraitPosX = 32.0f;
gRadioPortraitPosX = OTRGetRectDimensionFromLeftEdge(32.0f);
gRadioPortraitPosY = 174.0f;
break;
case GSTATE_PLAY:
gRadioPrintPosY = 180;
gRadioPrintPosX = 79;
gRadioTextBoxPosX = 74.0f;
gRadioPrintPosX = OTRGetRectDimensionFromLeftEdge(79.0f);
gRadioTextBoxPosX = OTRGetRectDimensionFromLeftEdge(74.0f);
gRadioTextBoxPosY = 178.0f;
gRadioTextBoxScaleX = 4.53f;
gRadioPortraitPosX = 26.0f;
gRadioPortraitPosX = OTRGetRectDimensionFromLeftEdge(26.0f);
gRadioPortraitPosY = 178.0f;
break;
}
@ -700,12 +700,12 @@ void Radio_Draw(void) {
(gCurrentRadioPortrait != RCID_1000)) {
RCP_SetupDL(&gMasterDisp, SETUPDL_76_POINT);
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 0, 255);
Graphics_DisplaySmallText(31, 167, 1.0f, 1.0f, "DOWN");
Graphics_DisplaySmallText(OTRGetRectDimensionFromLeftEdge(31.0f), 167, 1.0f, 1.0f, "DOWN");
HUD_TeamDownWrench_Draw(1);
}
if (((gCurrentRadioPortrait != RCID_STATIC) && (gCurrentRadioPortrait != RCID_STATIC + 1)) &&
(gCurrentRadioPortrait != RCID_1000)) {
HUD_TeamShields_Draw(22.0f, 165.0f, gTeamShields[idx]);
HUD_TeamShields_Draw(OTRGetRectDimensionFromLeftEdge(22.0f), 165.0f, gTeamShields[idx]);
}
}
@ -749,11 +749,11 @@ void Radio_Draw(void) {
(gCurrentRadioPortrait != RCID_STATIC + 1) && (gCurrentRadioPortrait != RCID_1000)) {
RCP_SetupDL(&gMasterDisp, SETUPDL_76_POINT);
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 0, 255);
Graphics_DisplaySmallText(31, 167, 1.0f, 1.0f, "DOWN");
Graphics_DisplaySmallText(OTRGetRectDimensionFromLeftEdge(31.0f), 167, 1.0f, 1.0f, "DOWN");
}
if (((gCurrentRadioPortrait != RCID_STATIC) && (gCurrentRadioPortrait != RCID_STATIC + 1)) &&
(gCurrentRadioPortrait != RCID_1000)) {
HUD_TeamShields_Draw(22.0f, 165.0f, gActors[idx].health * 2.55f);
HUD_TeamShields_Draw(OTRGetRectDimensionFromLeftEdge(22.0f), 165.0f, gActors[idx].health * 2.55f);
}
}
if (((gCurrentRadioPortrait != RCID_STATIC) && (gCurrentRadioPortrait != RCID_STATIC + 1)) &&

View File

@ -3629,21 +3629,21 @@ void Title_Radio_PlayMessage(u16** msgList, RadioCharacterId character) {
switch (gGameState) {
case GSTATE_TITLE:
gRadioPrintPosY = 176;
gRadioPrintPosX = 85;
gRadioTextBoxPosX = 80.0f;
gRadioPrintPosX = OTRGetRectDimensionFromLeftEdge(85);
gRadioTextBoxPosX = OTRGetRectDimensionFromLeftEdge(80.0f);
gRadioTextBoxPosY = 174.0f;
gRadioTextBoxScaleX = 4.63f;
gRadioPortraitPosX = 32.0f;
gRadioPortraitPosX = OTRGetRectDimensionFromLeftEdge(32.0f);
gRadioPortraitPosY = 174.0f;
break;
case GSTATE_PLAY:
gRadioPrintPosY = 179;
gRadioPrintPosX = 79;
gRadioTextBoxPosX = 74.0f;
gRadioPrintPosX = OTRGetRectDimensionFromLeftEdge(79);
gRadioTextBoxPosX = OTRGetRectDimensionFromLeftEdge(74.0f);
gRadioTextBoxPosY = 178.0f;
gRadioTextBoxScaleX = 4.53f;
gRadioPortraitPosX = 26.0f;
gRadioPortraitPosX = OTRGetRectDimensionFromLeftEdge(26.0f);
gRadioPortraitPosY = 178.0f;
}