diff options
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/game.c | 3 | ||||
| -rw-r--r-- | src/code/jpegdecoder.c | 6 | ||||
| -rw-r--r-- | src/code/speed_meter.c | 2 | ||||
| -rw-r--r-- | src/code/sys_math3d.c | 4 | ||||
| -rw-r--r-- | src/code/z_actor.c | 13 | ||||
| -rw-r--r-- | src/code/z_bgcheck.c | 22 | ||||
| -rw-r--r-- | src/code/z_camera.c | 2 | ||||
| -rw-r--r-- | src/code/z_horse.c | 14 | ||||
| -rw-r--r-- | src/code/z_kankyo.c | 2 | ||||
| -rw-r--r-- | src/code/z_message_PAL.c | 1 |
10 files changed, 35 insertions, 34 deletions
diff --git a/src/code/game.c b/src/code/game.c index 11a68e4b4..34a7c59b4 100644 --- a/src/code/game.c +++ b/src/code/game.c @@ -23,8 +23,7 @@ void GameState_FaultPrint(void) { } void GameState_SetFBFilter(Gfx** gfx) { - Gfx* gfxP; - gfxP = *gfx; + Gfx* gfxP = *gfx; if ((R_FB_FILTER_TYPE > 0) && (R_FB_FILTER_TYPE < 5)) { D_801664F0.type = R_FB_FILTER_TYPE; diff --git a/src/code/jpegdecoder.c b/src/code/jpegdecoder.c index 5261264c7..3301817d0 100644 --- a/src/code/jpegdecoder.c +++ b/src/code/jpegdecoder.c @@ -164,11 +164,9 @@ s32 JpegDecoder_ParseNextSymbol(JpegHuffmanTable* hTable, s16* outCoeff, s8* out u16 JpegDecoder_ReadBits(u8 len) { u8 byteCount; u8 data; - s32 ret; + s32 ret = 0; u32 temp; - ret = 0; // this is required for some reason - for (byteCount = sJpegBitStreamBitIdx >> 3; byteCount > 0; byteCount--) { data = sJpegBitStreamPtr[sJpegBitStreamByteIdx++]; if (sJpegBitStreamDontSkip) { @@ -184,7 +182,7 @@ u16 JpegDecoder_ReadBits(u8 len) { sJpegBitStreamBitIdx -= 8; } - ret = (sJpegBitStreamCurWord << (sJpegBitStreamBitIdx)); + ret = sJpegBitStreamCurWord << sJpegBitStreamBitIdx; temp = ret; ret = temp >> -len; sJpegBitStreamBitIdx += len; diff --git a/src/code/speed_meter.c b/src/code/speed_meter.c index 204ac000d..d94a92387 100644 --- a/src/code/speed_meter.c +++ b/src/code/speed_meter.c @@ -64,7 +64,7 @@ void SpeedMeter_DrawTimeEntries(SpeedMeter* this, GraphicsContext* gfxCtx) { sSpeedMeterTimeEntryPtr = &sSpeedMeterTimeEntryArray[0]; for (i = 0; i < ARRAY_COUNT(sSpeedMeterTimeEntryArray); i++) { - temp = ((f64) * (sSpeedMeterTimeEntryPtr->time) / gIrqMgrRetraceTime) * 64.0; + temp = ((f64)*sSpeedMeterTimeEntryPtr->time / gIrqMgrRetraceTime) * 64.0; sSpeedMeterTimeEntryPtr->x = temp + baseX; sSpeedMeterTimeEntryPtr++; } diff --git a/src/code/sys_math3d.c b/src/code/sys_math3d.c index a1964ec11..62dd7b435 100644 --- a/src/code/sys_math3d.c +++ b/src/code/sys_math3d.c @@ -427,14 +427,14 @@ f32 Math3D_Dist2D(f32 x0, f32 y0, f32 x1, f32 y1) { } /** - * Returns the magntiude (length) squared of `vec` + * Returns the magnitude (length) squared of `vec` */ f32 Math3D_Vec3fMagnitudeSq(Vec3f* vec) { return SQ(vec->x) + SQ(vec->y) + SQ(vec->z); } /** - * Returns the magnitude(length) of `vec` + * Returns the magnitude (length) of `vec` */ f32 Math3D_Vec3fMagnitude(Vec3f* vec) { return sqrt(Math3D_Vec3fMagnitudeSq(vec)); diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 9811758e4..8db84b82d 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -1507,7 +1507,6 @@ u32 Actor_ProcessTalkRequest(Actor* actor, PlayState* play) { s32 func_8002F1C4(Actor* actor, PlayState* play, f32 arg2, f32 arg3, u32 exchangeItemId) { Player* player = GET_PLAYER(play); - // This is convoluted but it seems like it must be a single if statement to match if ((player->actor.flags & ACTOR_FLAG_8) || ((exchangeItemId != EXCH_ITEM_NONE) && Player_InCsMode(play)) || (!actor->isTargeted && ((arg3 < fabsf(actor->yDistToPlayer)) || (player->targetActorDistance < actor->xzDistToPlayer) || @@ -2182,10 +2181,10 @@ void Actor_Draw(PlayState* play, Actor* actor) { Lights_Draw(lights, play->state.gfxCtx); if (actor->flags & ACTOR_FLAG_12) { - Matrix_SetTranslateRotateYXZ( - actor->world.pos.x + play->mainCamera.skyboxOffset.x, - actor->world.pos.y + (f32)((actor->shape.yOffset * actor->scale.y) + play->mainCamera.skyboxOffset.y), - actor->world.pos.z + play->mainCamera.skyboxOffset.z, &actor->shape.rot); + Matrix_SetTranslateRotateYXZ(actor->world.pos.x + play->mainCamera.skyboxOffset.x, + actor->world.pos.y + + ((actor->shape.yOffset * actor->scale.y) + play->mainCamera.skyboxOffset.y), + actor->world.pos.z + play->mainCamera.skyboxOffset.z, &actor->shape.rot); } else { Matrix_SetTranslateRotateYXZ(actor->world.pos.x, actor->world.pos.y + (actor->shape.yOffset * actor->scale.y), actor->world.pos.z, &actor->shape.rot); @@ -4214,14 +4213,14 @@ void Flags_SetEventChkInf(s32 flag) { } /** - * Tests if "inf_table flag is set. + * Tests if inf_table flag is set. */ s32 Flags_GetInfTable(s32 flag) { return GET_INFTABLE(flag); } /** - * Sets "inf_table" flag. + * Sets inf_table flag. */ void Flags_SetInfTable(s32 flag) { SET_INFTABLE(flag); diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c index e875ccc3b..640066358 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -4171,17 +4171,17 @@ u32 SurfaceType_IsWallDamage(CollisionContext* colCtx, CollisionPoly* poly, s32 /** * Zora's Domain WaterBox in King Zora's Room */ -WaterBox zdWaterBox = { -348, 877, -1746, 553, 780, 0x2104 }; +WaterBox sZorasDomainWaterBox = { -348, 877, -1746, 553, 780, 0x2104 }; /** * WaterBox's effective bounding box */ -f32 zdWaterBoxMinX = -348.0f; -f32 zdWaterBoxMinY = 777.0f; -f32 zdWaterBoxMinZ = -1746.0f; -f32 zdWaterBoxMaxX = 205.0f; -f32 zdWaterBoxMaxY = 977.0f; -f32 zdWaterBoxMaxZ = -967.0f; +f32 sZorasDomainWaterBoxMinX = -348.0f; +f32 sZorasDomainWaterBoxMinY = 777.0f; +f32 sZorasDomainWaterBoxMinZ = -1746.0f; +f32 sZorasDomainWaterBoxMaxX = 205.0f; +f32 sZorasDomainWaterBoxMaxY = 977.0f; +f32 sZorasDomainWaterBoxMaxZ = -967.0f; /** * Public. Get the water surface at point (`x`, `ySurface`, `z`). `ySurface` doubles as position y input @@ -4191,10 +4191,10 @@ f32 zdWaterBoxMaxZ = -967.0f; s32 WaterBox_GetSurface1(PlayState* play, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface, WaterBox** outWaterBox) { if (play->sceneNum == SCENE_SPOT07) { - if (zdWaterBoxMinX < x && x < zdWaterBoxMaxX && zdWaterBoxMinY < *ySurface && *ySurface < zdWaterBoxMaxY && - zdWaterBoxMinZ < z && z < zdWaterBoxMaxZ) { - *outWaterBox = &zdWaterBox; - *ySurface = zdWaterBox.ySurface; + if (sZorasDomainWaterBoxMinX < x && x < sZorasDomainWaterBoxMaxX && sZorasDomainWaterBoxMinY < *ySurface && + *ySurface < sZorasDomainWaterBoxMaxY && sZorasDomainWaterBoxMinZ < z && z < sZorasDomainWaterBoxMaxZ) { + *outWaterBox = &sZorasDomainWaterBox; + *ySurface = sZorasDomainWaterBox.ySurface; return true; } } diff --git a/src/code/z_camera.c b/src/code/z_camera.c index b625f5c39..b38a1d0cc 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -6534,7 +6534,7 @@ s32 Camera_Special5(Camera* camera) { temp_f0_2 = Rand_ZeroOne(); sp74.yaw = (s16)(playerPosRot->rot.y - 0x7FFF) + (s16)(spA4 < 0 ? -(s16)(0x1553 + (s16)(temp_f0_2 * 2730.0f)) - : (s16)(0x1553 + (s16)(temp_f0_2 * 2730.0f))); + : (s16)(0x1553 + (s16)(temp_f0_2 * 2730.0f))); sp74.pitch = roData->pitch; Camera_Vec3fVecSphGeoAdd(eyeNext, &spA8.pos, &sp74); *eye = *eyeNext; diff --git a/src/code/z_horse.c b/src/code/z_horse.c index 0cddd54b7..0a0186a56 100644 --- a/src/code/z_horse.c +++ b/src/code/z_horse.c @@ -172,17 +172,21 @@ void func_8006D684(PlayState* play, Player* player) { } } else { static struct_8011F9B8 D_8011F9B8[] = { - { 93, 0xFFF0, 0x0E10, 0x0585, 0x0168, 0x8001, 8 }, { 99, 0xFFF0, 0xFF06, 0x0001, 0xF9D4, 0x4000, 6 }, - { 99, 0xFFF1, 0x0000, 0x0000, 0x0000, 0x0000, 5 }, { 99, 0xFFF5, 0x0000, 0x0000, 0x0000, 0x0000, 7 }, - { 81, 0xFFF3, 0xF46F, 0x0139, 0x1E14, 0x0000, 7 }, { 81, 0xFFF4, 0xF894, 0x0139, 0x1B67, 0x0000, 7 }, - { 81, 0xFFF5, 0xF035, 0x0139, 0x1B15, 0x0000, 7 }, { 81, 0xFFF6, 0xF035, 0x0139, 0x1B15, 0x0000, 7 }, + { SCENE_SPOT12, 0xFFF0, { 3600, 1413, 360 }, 0x8001, 8 }, + { SCENE_SPOT20, 0xFFF0, { -250, 1, -1580 }, 0x4000, 6 }, + { SCENE_SPOT20, 0xFFF1, { 0, 0, 0 }, 0x0000, 5 }, + { SCENE_SPOT20, 0xFFF5, { 0, 0, 0 }, 0x0000, 7 }, + { SCENE_SPOT00, 0xFFF3, { -2961, 313, 7700 }, 0x0000, 7 }, + { SCENE_SPOT00, 0xFFF4, { -1900, 313, 7015 }, 0x0000, 7 }, + { SCENE_SPOT00, 0xFFF5, { -4043, 313, 6933 }, 0x0000, 7 }, + { SCENE_SPOT00, 0xFFF6, { -4043, 313, 6933 }, 0x0000, 7 }, }; for (i = 0; i < ARRAY_COUNT(D_8011F9B8); i++) { if ((play->sceneNum == D_8011F9B8[i].scene) && (((void)0, gSaveContext.cutsceneIndex) == D_8011F9B8[i].cutsceneIndex)) { if (D_8011F9B8[i].type == 7) { - if ((play->sceneNum == 99) && (((void)0, gSaveContext.cutsceneIndex) == 0xFFF1)) { + if ((play->sceneNum == SCENE_SPOT20) && (((void)0, gSaveContext.cutsceneIndex) == 0xFFF1)) { D_8011F9B8[i].pos.x = player->actor.world.pos.x; D_8011F9B8[i].pos.y = player->actor.world.pos.y; D_8011F9B8[i].pos.z = player->actor.world.pos.z; diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c index 5daf9060b..e5ba7904e 100644 --- a/src/code/z_kankyo.c +++ b/src/code/z_kankyo.c @@ -919,7 +919,7 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex } if ((pauseCtx->state == 0) && (gameOverCtx->state == GAMEOVER_INACTIVE)) { - if (((msgCtx->msgLength == 0) && (msgCtx->msgMode == GAMEMODE_NORMAL)) || + if (((msgCtx->msgLength == 0) && (msgCtx->msgMode == MSGMODE_NONE)) || (((void)0, gSaveContext.gameMode) == GAMEMODE_END_CREDITS)) { if ((envCtx->changeSkyboxTimer == 0) && !FrameAdvance_IsEnabled(play) && (play->transitionMode == TRANS_MODE_OFF || ((void)0, gSaveContext.gameMode) != GAMEMODE_NORMAL)) { diff --git a/src/code/z_message_PAL.c b/src/code/z_message_PAL.c index 668fb6120..08e2c7aec 100644 --- a/src/code/z_message_PAL.c +++ b/src/code/z_message_PAL.c @@ -3172,6 +3172,7 @@ void Message_Update(PlayState* play) { R_TEXTBOX_TEXHEIGHT = 512; } else { Message_GrowTextbox(msgCtx); + // TODO: this may be NA_SE_PL_WALK_GROUND - SFX_FLAG, or not, investigate sfxId=0 Audio_PlaySoundIfNotInCutscene(0); msgCtx->stateTimer = 0; msgCtx->msgMode = MSGMODE_TEXT_BOX_GROWING; |
