diff options
| author | engineer124 <47598039+engineer124@users.noreply.github.com> | 2023-12-13 15:16:24 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-13 15:16:24 +1100 |
| commit | 5607eec18bae68e4cd38ef6d1fa69d7f1d84bfc8 (patch) | |
| tree | bb13ad49718f8883bc65d7bd0a9db4d791800cf2 /src/code/z_message.c | |
| parent | ed4da0ecef698ad0112c7cdf575368ac3c61903b (diff) | |
Use more `TRUNCF_BINANG` for f32 -> s16 casts (#1503)
* TRUNCF_BINANG
* brackets
* extra cast
Diffstat (limited to 'src/code/z_message.c')
| -rw-r--r-- | src/code/z_message.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/code/z_message.c b/src/code/z_message.c index eb2d0d8cb..7e6c9356a 100644 --- a/src/code/z_message.c +++ b/src/code/z_message.c @@ -1457,16 +1457,16 @@ void Message_DrawTextDefault(PlayState* play, Gfx** gfxP) { switch (character) { case 0x8169: case 0x8175: - msgCtx->textPosX -= (s16)(6.0f * msgCtx->textCharScale); + msgCtx->textPosX -= TRUNCF_BINANG(6.0f * msgCtx->textCharScale); break; case 0x8145: - msgCtx->textPosX -= (s16)(3.0f * msgCtx->textCharScale); + msgCtx->textPosX -= TRUNCF_BINANG(3.0f * msgCtx->textCharScale); break; case 0x8148: case 0x8149: - msgCtx->textPosX -= (s16)(2.0f * msgCtx->textCharScale); + msgCtx->textPosX -= TRUNCF_BINANG(2.0f * msgCtx->textCharScale); break; default: @@ -1494,34 +1494,34 @@ void Message_DrawTextDefault(PlayState* play, Gfx** gfxP) { charTexIndex += FONT_CHAR_TEX_SIZE; switch (character) { case 0x8144: - msgCtx->textPosX += (s16)(8.0f * msgCtx->textCharScale); + msgCtx->textPosX += TRUNCF_BINANG(8.0f * msgCtx->textCharScale); break; case 0x816A: case 0x8176: - msgCtx->textPosX += (s16)(10.0f * msgCtx->textCharScale); + msgCtx->textPosX += TRUNCF_BINANG(10.0f * msgCtx->textCharScale); break; case 0x8141: case 0x8142: case 0x8168: - msgCtx->textPosX += (s16)(12.0f * msgCtx->textCharScale); + msgCtx->textPosX += TRUNCF_BINANG(12.0f * msgCtx->textCharScale); break; case 0x8194: - msgCtx->textPosX += (s16)(14.0f * msgCtx->textCharScale); + msgCtx->textPosX += TRUNCF_BINANG(14.0f * msgCtx->textCharScale); break; case 0x8145: - msgCtx->textPosX += (s16)(15.0f * msgCtx->textCharScale); + msgCtx->textPosX += TRUNCF_BINANG(15.0f * msgCtx->textCharScale); break; default: if ((msgCtx->msgMode >= MSGMODE_SCENE_TITLE_CARD_FADE_IN_BACKGROUND) && (msgCtx->msgMode <= MSGMODE_SCENE_TITLE_CARD_FADE_OUT_BACKGROUND)) { - msgCtx->textPosX += (s16)((16.0f * msgCtx->textCharScale) - 1.0f); + msgCtx->textPosX += TRUNCF_BINANG((16.0f * msgCtx->textCharScale) - 1.0f); } else { - msgCtx->textPosX += (s16)(16.0f * msgCtx->textCharScale); + msgCtx->textPosX += TRUNCF_BINANG(16.0f * msgCtx->textCharScale); } break; } @@ -2200,7 +2200,7 @@ void Message_Decode(PlayState* play) { msgCtx->unk11FFA = msgCtx->textboxY + 6; msgCtx->unk11F1A[spD2] = 0; if (msgCtx->unk11F18 == 0) { - msgCtx->unk11F1A[spD2] = (s16)((msgCtx->textCharScale * 16.0f * 16.0f) - spC0) / 2; + msgCtx->unk11F1A[spD2] = TRUNCF_BINANG((msgCtx->textCharScale * 16.0f * 16.0f) - spC0) / 2; } spC0 = 0.0f; if (curChar == 0xB) { |
