mirror of
https://github.com/zeldaret/mm.git
synced 2026-06-04 18:58:29 -04:00
Use more TRUNCF_BINANG for f32 -> s16 casts (#1503)
* TRUNCF_BINANG * brackets * extra cast
This commit is contained in:
+11
-11
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user