Start on sfx IDs (#227)

* sfx stuff

* sfxIds
This commit is contained in:
petrie911
2024-05-03 14:56:26 -05:00
committed by GitHub
parent c9df6fda72
commit 77060ba506
31 changed files with 845 additions and 341 deletions
+2 -2
View File
@@ -120,11 +120,11 @@ bool AllRange_PlayMessage(u16* msg, RadioCharacterId rcid) {
}
}
void AllRange_UpdateCountdown(void) {
void AllRange_DrawCountdown(void) {
if (gShowAllRangeCountdown != 0) {
s32 seconds = gAllRangeCountdown[1];
func_hud_8008E51C(gAllRangeCountdown, gAllRangeCountdownScale);
HUD_DrawCountdown(gAllRangeCountdown, gAllRangeCountdownScale);
if ((gAllRangeCountdown[0] == 0) && (seconds != gAllRangeCountdown[1]) && (gAllRangeCountdown[1] < 15)) {
AUDIO_PLAY_SFX(0x4900C02A, gDefaultSfxSource, 4);
}
+1 -1
View File
@@ -850,7 +850,7 @@ void func_beam_80038140(PlayerShot* shot) {
Matrix_RotateY(gCalcMatrix, shot->obj.rot.y * M_DTOR, MTXF_NEW);
Matrix_RotateX(gCalcMatrix, shot->obj.rot.x * M_DTOR, MTXF_APPLY);
sp88.x = sp88.y = 0.0f;
sp88.z = -133.33333f;
sp88.z = -400.0f / 3.0f;
Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp88, &sp7C);
shot->vel.x = sp7C.x;
shot->vel.y = sp7C.y;
+1 -1
View File
@@ -39,7 +39,7 @@ bool gExpertMode;
s32 D_ctx_80177A10[10];
f32 D_ctx_80177A48[10];
s32 gCsFrameCount;
u8 D_ctx_80177A98;
u8 D_ctx_80177A98; // some sort of flag. Used in background
u8 D_ctx_80177AB0;
u8 gAqDrawMode;
s32 gTitleState;
+2 -2
View File
@@ -722,7 +722,7 @@ void func_display_80054300(Player* player) {
switch (player->form) {
case FORM_ARWING:
fake_label:
Matrix_Scale(gGfxMatrix, 2.5049999f, 1.5f, 2.5049999f, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 1.5f * 1.67f, 1.5f, 1.5f * 1.67f, MTXF_APPLY);
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 30.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_1032780);
@@ -795,7 +795,7 @@ void func_display_8005478C(Player* player) {
if ((gGameFrameCount % 2) != 0) {
Matrix_Scale(gGfxMatrix, 0.9f, 0.63f, 1.0f, MTXF_APPLY);
} else {
Matrix_Scale(gGfxMatrix, 0.80999994f, 0.567f, 1.0f, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 0.9f * 0.9f, 0.9f * 0.63f, 1.0f, MTXF_APPLY);
}
Matrix_SetGfxMtx(&gMasterDisp);
Play_DrawEngineGlow(gLevelType);
+1 -1
View File
@@ -3745,7 +3745,7 @@ bool ActorEvent_OverrideLimbDraw2(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f*
s32 var_s1;
if (limbIndex == 5) {
var_s1 = (s32) (this->health * 0.6375f);
var_s1 = (s32) (this->health * (255.0f / 400.0f));
if (var_s1 > 255) {
var_s1 = 255;
}
+1 -1
View File
@@ -543,7 +543,7 @@ void Game_Update(void) {
}
Background_dummy_80040CDC();
HUD_DrawStatusScreens();
AllRange_UpdateCountdown();
AllRange_DrawCountdown();
if ((gGameState == GSTATE_PLAY) && gVersusMode) {
Versus_Draw();
}
+9 -9
View File
@@ -2695,8 +2695,8 @@ void func_hud_8008C104(u16* srcTexture, u16* dstTexture) {
Texture_Mottle(dst, buffer, 2);
}
void func_hud_8008C390(f32 xPos, f32 yPos, f32 scale, s32 number) {
void* D_800D1EC0[] = {
void HUD_DisplaySmallNumber(f32 xPos, f32 yPos, f32 scale, s32 number) {
void* sSmallNumberTex[] = {
aSmallText_0, aSmallText_1, aSmallText_2, aSmallText_3, aSmallText_4,
aSmallText_5, aSmallText_6, aSmallText_7, aSmallText_8, aSmallText_9,
};
@@ -2704,14 +2704,14 @@ void func_hud_8008C390(f32 xPos, f32 yPos, f32 scale, s32 number) {
for (i = 10; i != 1; i /= 10) {
if ((xPos > 0.0f) && (yPos > 0.0f)) {
TextureRect_8bIA(&gMasterDisp, D_800D1EC0[number / i], 16, 8, xPos, yPos, scale, scale);
TextureRect_8bIA(&gMasterDisp, sSmallNumberTex[number / i], 16, 8, xPos, yPos, scale, scale);
}
xPos += 9.0f * scale;
number %= i;
}
if ((xPos > 0.0f) && (yPos > 0.0f)) {
TextureRect_8bIA(&gMasterDisp, D_800D1EC0[number / i], 16, 8, xPos, yPos, scale, scale);
TextureRect_8bIA(&gMasterDisp, sSmallNumberTex[number / i], 16, 8, xPos, yPos, scale, scale);
}
}
@@ -3122,7 +3122,7 @@ void HUD_DrawBossHealth(void) {
if (D_801616C4 >= 0.88f) {
temp6 = sp3C + 8.0f;
temp7 = 101.0f - (31.884058f * D_801616C8) + temp1;
temp7 = 101.0f - ((2200.0f / 69.0f) * D_801616C8) + temp1;
if (D_801616C8 > 0.0f) {
TextureRect_16bRGBA(&gMasterDisp, D_Tex_800D99F8, 32, 32, temp6, temp7, 0.2f, D_801616C8);
}
@@ -3135,7 +3135,7 @@ void HUD_DrawBossHealth(void) {
}
}
void func_hud_8008E2C8(f32 xPos, f32 yPos, s32* countdown, f32 scale) {
void HUD_DisplayCountdown(f32 xPos, f32 yPos, s32* countdown, f32 scale) {
f32 var_fs0 = 0.0f;
s32 var_s2 = 0;
s32 i;
@@ -3159,14 +3159,14 @@ void func_hud_8008E2C8(f32 xPos, f32 yPos, s32* countdown, f32 scale) {
} else {
RCP_SetupDL_76();
gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255);
func_hud_8008C390((var_fs0 * scale) + xPos, yPos, scale, var_s2);
HUD_DisplaySmallNumber((var_fs0 * scale) + xPos, yPos, scale, var_s2);
var_fs0 += 9.0f;
}
var_fs0 += 9.0f;
}
}
void func_hud_8008E51C(s32* countdown, f32 scale) {
void HUD_DrawCountdown(s32* countdown, f32 scale) {
//! FAKE:
if (1) {}
@@ -3191,7 +3191,7 @@ void func_hud_8008E51C(s32* countdown, f32 scale) {
}
if (gPlayState != PLAY_PAUSE) {
func_hud_8008E2C8(176.0f, 22.0f, countdown, scale);
HUD_DisplayCountdown(176.0f, 22.0f, countdown, scale);
}
}
+2 -2
View File
@@ -3606,7 +3606,7 @@ void func_play_800AF07C(Player* player) {
}
if (player->barrelRoll != 0) {
sp84 = 0.2f;
gPlayerTurnRate = 6.8999996f;
gPlayerTurnRate = 6.8999996f; // 690.0f * 0.01f
}
Math_SmoothStepToF(&player->rot.y, stickX * gPlayerTurnStickMod, sp84, gPlayerTurnRate, 0.03f);
@@ -4114,7 +4114,7 @@ void func_play_800B0F50(Player* playerx) {
gRadioState = gRadioMsgRadioId = gCurrentRadioPortrait = 0;
D_ctx_8017853C = gRadioTextBoxScaleY = 0.0f;
player->cam.eye.z = 400.0f;
player->unk_148 = 0.77699995f;
player->unk_148 = 0.77699995f; // 77.7f *0.01f
player->unk_14C = 0.77699995f;
player->unk_01C = 1.0f;
player->groundPos.y = -1000.0f;
+3 -3
View File
@@ -322,7 +322,7 @@ void func_tank_800444BC(Player* player) {
}
if ((player->pos.y - sp30) < sp38) {
if (player->vel.y < -10.0f) {
AUDIO_PLAY_SFX(0x09008015, player->sfxSource, 0);
AUDIO_PLAY_SFX(NA_SE_TANK_BOUND, player->sfxSource, 0);
}
player->grounded = true;
if (player->vel.y < -20.0f) {
@@ -941,7 +941,7 @@ void func_tank_80046704(Player* player) {
player->baseSpeed = -(D_800C9F00 * 1.5f);
player->vel.z = D_800C9F00 * 1.5f;
D_800C9F00 = 12;
AUDIO_PLAY_SFX(0x09008015, player->sfxSource, 0);
AUDIO_PLAY_SFX(NA_SE_TANK_WALL_HIT, player->sfxSource, 0);
break;
}
if (scenery->obj.id == OBJ_SCENERY_59) {
@@ -1253,7 +1253,7 @@ void func_tank_80047D38(Player* player, f32 arg1) {
}
if ((player->pos.y - 5.0f) < arg1) {
if (player->vel.y < -10.0f) {
AUDIO_PLAY_SFX(0x09008015, player->sfxSource, 0);
AUDIO_PLAY_SFX(NA_SE_TANK_BOUND, player->sfxSource, 0);
player->hitTimer = 10;
}
D_800C9F04 = 1;
+23 -26
View File
@@ -349,41 +349,38 @@ void func_versus_800BDE44(void) {
}
}
s32 func_versus_800BE078(void) {
s32 temp;
s32 Versus_UpdateTimer(void) {
s32 temp = (s32) CYCLES_TO_USEC((D_80178860 - D_80178868)) / 10000;
while (true) {
temp = (s32) CYCLES_TO_USEC((D_80178860 - D_80178868)) / 10000;
if ((D_versus_80178768[2] -= temp) >= 0) {
break;
}
D_versus_80178768[2] -= temp;
if (D_versus_80178768[2] < 0) {
D_versus_80178768[2] *= -1;
temp = (D_versus_80178768[2] / 100) + 1;
D_versus_80178768[2] %= 100;
D_versus_80178768[2] = (100 - D_versus_80178768[2]) % 100;
D_versus_80178768[1] -= temp;
if ((D_versus_80178768[1] -= temp) >= 0) {
if (D_versus_80178768[1] >= 0) {
if ((D_versus_80178768[0] == 0) && (D_versus_80178768[1] < 15) && (D_versus_80178768[1] >= 0)) {
AUDIO_PLAY_SFX(0x4900C02A, gDefaultSfxSource, 4);
}
break;
} else {
// clang-format off
if (D_versus_80178768[0] == 0) {\
AUDIO_PLAY_SFX(0x4900D036, gDefaultSfxSource, 4);\
}
// clang-format on
D_versus_80178768[1] *= -1;
temp = (D_versus_80178768[1] / 60) + 1;
D_versus_80178768[1] %= 60;
D_versus_80178768[1] = (60 - D_versus_80178768[1]) % 60;
D_versus_80178768[0] -= temp;
if (D_versus_80178768[0] < 0) {
D_versus_80178768[0] = 0;
D_versus_80178768[1] = 0;
D_versus_80178768[2] = 0;
}
}
// clang-format off
if (D_versus_80178768[0] == 0) { AUDIO_PLAY_SFX(0x4900D036, gDefaultSfxSource, 4); }
// clang-format on
D_versus_80178768[1] *= -1;
temp = (D_versus_80178768[1] / 60) + 1;
D_versus_80178768[1] %= 60;
D_versus_80178768[1] = (60 - D_versus_80178768[1]) % 60;
if ((D_versus_80178768[0] -= temp) >= 0) {
break;
}
D_versus_80178768[0] = 0;
D_versus_80178768[1] = 0;
D_versus_80178768[2] = 0;
break;
}
return 0;
@@ -1538,7 +1535,7 @@ bool Versus_Update(void) {
if (gVsMatchType == 2) {
D_80178778 = 10;
func_versus_800BE078();
Versus_UpdateTimer();
func_versus_800BDE3C();
} else {
D_80178778 = 8;