mirror of
https://github.com/HarbourMasters/Starship.git
synced 2025-02-02 16:23:57 +03:00
widescreen team help arrows
This commit is contained in:
parent
cda21a4dea
commit
c878b6bcc9
@ -35,7 +35,7 @@ void KillBoss(void);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
void Display_DrawHelpAlert(void) {
|
void Display_DrawHelpAlert(void) {
|
||||||
bool sp7C;
|
bool centered; // Enemy pos is centered, so both help arrows should be displayed
|
||||||
f32 sp78;
|
f32 sp78;
|
||||||
f32 sp74;
|
f32 sp74;
|
||||||
Vec3f sp68;
|
Vec3f sp68;
|
||||||
@ -44,11 +44,13 @@ void Display_DrawHelpAlert(void) {
|
|||||||
if ((gPlayState == PLAY_PAUSE) || (gTeamHelpActor == NULL)) {
|
if ((gPlayState == PLAY_PAUSE) || (gTeamHelpActor == NULL)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((gTeamHelpActor->obj.status != OBJ_ACTIVE) || (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_ACTIVE)) {
|
if ((gTeamHelpActor->obj.status != OBJ_ACTIVE) || (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_ACTIVE)) {
|
||||||
gTeamHelpActor = NULL;
|
gTeamHelpActor = NULL;
|
||||||
gTeamHelpTimer = 0;
|
gTeamHelpTimer = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gTeamHelpTimer != 0) {
|
if (gTeamHelpTimer != 0) {
|
||||||
gTeamHelpTimer--;
|
gTeamHelpTimer--;
|
||||||
if (gTeamHelpTimer == 0) {
|
if (gTeamHelpTimer == 0) {
|
||||||
@ -67,9 +69,9 @@ void Display_DrawHelpAlert(void) {
|
|||||||
|
|
||||||
Matrix_MultVec3f(gCalcMatrix, &sp68, &sp5C);
|
Matrix_MultVec3f(gCalcMatrix, &sp68, &sp5C);
|
||||||
|
|
||||||
sp7C = false;
|
centered = false;
|
||||||
if ((sp5C.z < 0.0f) && (sp5C.z > -12000.0f) && (fabsf(sp5C.x) < fabsf(sp5C.z * 0.4f))) {
|
if ((sp5C.z < 0.0f) && (sp5C.z > -12000.0f) && (fabsf(sp5C.x) < fabsf(sp5C.z * 0.4f))) {
|
||||||
sp7C = true;
|
centered = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
RCP_SetupDL(&gMasterDisp, SETUPDL_12);
|
RCP_SetupDL(&gMasterDisp, SETUPDL_12);
|
||||||
@ -86,19 +88,19 @@ void Display_DrawHelpAlert(void) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (sp7C) {
|
switch (centered) {
|
||||||
case false:
|
case false:
|
||||||
if (gTeamHelpActor->sfxSource[0] > 0.0f) {
|
if (gTeamHelpActor->sfxSource[0] > 0.0f) {
|
||||||
sp78 = 20.0f;
|
sp78 = 20.0f * OTRGetAspectRatio()-8;
|
||||||
sp74 = M_PI / 2;
|
sp74 = M_PI / 2;
|
||||||
} else {
|
} else {
|
||||||
sp78 = -20.0f;
|
sp78 = -20.0f * OTRGetAspectRatio()+8;
|
||||||
sp74 = -M_PI / 2;
|
sp74 = -M_PI / 2;
|
||||||
}
|
}
|
||||||
Matrix_Push(&gGfxMatrix);
|
Matrix_Push(&gGfxMatrix);
|
||||||
|
|
||||||
// @port: Tag the transform.
|
// @port: Tag the transform.
|
||||||
FrameInterpolation_RecordOpenChild("Display_DrawHelpAlert", sp7C);
|
FrameInterpolation_RecordOpenChild("Display_DrawHelpAlert", centered);
|
||||||
|
|
||||||
Matrix_Translate(gGfxMatrix, sp78, 0.0f, -50.0f, MTXF_APPLY);
|
Matrix_Translate(gGfxMatrix, sp78, 0.0f, -50.0f, MTXF_APPLY);
|
||||||
Matrix_RotateZ(gGfxMatrix, sp74, MTXF_APPLY);
|
Matrix_RotateZ(gGfxMatrix, sp74, MTXF_APPLY);
|
||||||
@ -112,20 +114,22 @@ void Display_DrawHelpAlert(void) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case true:
|
case true:
|
||||||
|
// right arrow (both at the same time)
|
||||||
Matrix_Push(&gGfxMatrix);
|
Matrix_Push(&gGfxMatrix);
|
||||||
|
|
||||||
// @port: Tag the transform.
|
// @port: Tag the transform.
|
||||||
FrameInterpolation_RecordOpenChild("Display_DrawHelpAlert", sp7C);
|
FrameInterpolation_RecordOpenChild("Display_DrawHelpAlert", centered);
|
||||||
|
Matrix_Translate(gGfxMatrix, 20.0f * OTRGetAspectRatio() - 8, 0.0f, -50.0f, MTXF_APPLY);
|
||||||
Matrix_Translate(gGfxMatrix, 20.0f, 0.0f, -50.0f, MTXF_APPLY);
|
|
||||||
Matrix_RotateZ(gGfxMatrix, -M_PI / 2, MTXF_APPLY);
|
Matrix_RotateZ(gGfxMatrix, -M_PI / 2, MTXF_APPLY);
|
||||||
Matrix_Scale(gGfxMatrix, 0.03f, 0.03f, 0.03f, MTXF_APPLY);
|
Matrix_Scale(gGfxMatrix, 0.03f, 0.03f, 0.03f, MTXF_APPLY);
|
||||||
Matrix_SetGfxMtx(&gMasterDisp);
|
Matrix_SetGfxMtx(&gMasterDisp);
|
||||||
gSPDisplayList(gMasterDisp++, D_1023700);
|
gSPDisplayList(gMasterDisp++, D_1023700);
|
||||||
Matrix_Pop(&gGfxMatrix);
|
Matrix_Pop(&gGfxMatrix);
|
||||||
sp78 = -20.0f;
|
sp78 = -20.0f;
|
||||||
|
|
||||||
|
// left arrow (both in simultaneous)
|
||||||
Matrix_Push(&gGfxMatrix);
|
Matrix_Push(&gGfxMatrix);
|
||||||
Matrix_Translate(gGfxMatrix, -20.0f, 0.0f, -50.0f, MTXF_APPLY);
|
Matrix_Translate(gGfxMatrix, -20.0f * OTRGetAspectRatio() + 8, 0.0f, -50.0f, MTXF_APPLY);
|
||||||
Matrix_RotateZ(gGfxMatrix, M_PI / 2, MTXF_APPLY);
|
Matrix_RotateZ(gGfxMatrix, M_PI / 2, MTXF_APPLY);
|
||||||
Matrix_Scale(gGfxMatrix, 0.03f, 0.03f, 0.03f, MTXF_APPLY);
|
Matrix_Scale(gGfxMatrix, 0.03f, 0.03f, 0.03f, MTXF_APPLY);
|
||||||
Matrix_SetGfxMtx(&gMasterDisp);
|
Matrix_SetGfxMtx(&gMasterDisp);
|
||||||
@ -137,22 +141,22 @@ void Display_DrawHelpAlert(void) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (sp7C) {
|
switch (centered) {
|
||||||
case false:
|
case false:
|
||||||
RCP_SetupDL(&gMasterDisp, SETUPDL_76_POINT);
|
RCP_SetupDL(&gMasterDisp, SETUPDL_76_POINT);
|
||||||
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 0, 255);
|
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 0, 255);
|
||||||
if (sp78 < 0.0f) {
|
if (sp78 < 0.0f) {
|
||||||
Graphics_DisplaySmallText(43 - 19, 106, 1.0f, 1.0f, "HELP!!");
|
Graphics_DisplaySmallText(OTRGetRectDimensionFromLeftEdge(38.0f), 106, 1.0f, 1.0f, "HELP!!");
|
||||||
} else {
|
} else {
|
||||||
Graphics_DisplaySmallText(SCREEN_WIDTH - 43 - 19, 106, 1.0f, 1.0f, "HELP!!");
|
Graphics_DisplaySmallText(OTRGetRectDimensionFromRightEdge(248), 106, 1.0f, 1.0f, "HELP!!");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case true:
|
case true:
|
||||||
RCP_SetupDL(&gMasterDisp, SETUPDL_76_POINT);
|
RCP_SetupDL(&gMasterDisp, SETUPDL_76_POINT);
|
||||||
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 0, 255);
|
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 0, 255);
|
||||||
Graphics_DisplaySmallText(43 - 19, 106, 1.0f, 1.0f, "HELP!!");
|
Graphics_DisplaySmallText(OTRGetRectDimensionFromLeftEdge(38.0f) , 106, 1.0f, 1.0f, "HELP!!");
|
||||||
Graphics_DisplaySmallText(SCREEN_WIDTH - 43 - 19, 106, 1.0f, 1.0f, "HELP!!");
|
Graphics_DisplaySmallText(OTRGetRectDimensionFromRightEdge(248), 106, 1.0f, 1.0f, "HELP!!");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user