diff options
| author | LagoLunatic <LagoLunatic@users.noreply.github.com> | 2026-08-07 16:40:56 -0400 |
|---|---|---|
| committer | LagoLunatic <LagoLunatic@users.noreply.github.com> | 2026-08-07 16:40:56 -0400 |
| commit | 07b55421f9ce2db2fecbaaa34a3e1b59d6f231a7 (patch) | |
| tree | ff592e73778c07836dbbf93912b8a2c248c6307a /src/d | |
| parent | 5e00819c5ba6ea0c7177d2f0aae29ccc7c49f55c (diff) | |
msg inline fixes, remove some fake jsystem inlines
Diffstat (limited to 'src/d')
| -rw-r--r-- | src/d/d_mesg.cpp | 74 | ||||
| -rw-r--r-- | src/d/d_name.cpp | 5 |
2 files changed, 31 insertions, 48 deletions
diff --git a/src/d/d_mesg.cpp b/src/d/d_mesg.cpp index 3011b203..3024323e 100644 --- a/src/d/d_mesg.cpp +++ b/src/d/d_mesg.cpp @@ -346,17 +346,15 @@ void dMesg_tSequenceProcessor::do_character(int param_1) { } #endif } - JUTFont::TWidth twidth; + f32 f31 = f32(mesgControl->getNowFontSize()) / f32(mesgControl->getMainFont()->getCellWidth()); - int char_code = mesgControl->getCharCode(); - mesgControl->getMainFont()->getWidthEntry(char_code, &twidth); - int tmp = twidth.field_0x1; + int width = mesgControl->getMainFont()->getWidth(char_code); if (!mesgControl->isHeader()) { - field_0x44 += tmp * f31; + field_0x44 += width * f31; mesgControl->setHeaderOn(); } else { - field_0x44 += tmp * f31 + mesgControl->getCharSpace(); + field_0x44 += width * f31 + mesgControl->getCharSpace(); } if (field_0x74 > 0) { field_0x74--; @@ -487,15 +485,14 @@ bool dMesg_tSequenceProcessor::do_tag(u32 param_1, const void* param_2, u32 para sp14[0] = sp54[r30++]; sp14[1] = 0; } - JUTFont::TWidth twidth; + f32 f29 = f32(mesgControl->getNowFontSize()) / f32(mesgControl->getMainFont()->getCellWidth()); - mesgControl->getMainFont()->getWidthEntry(char_code, &twidth); - int temp = twidth.field_0x1; + int width = mesgControl->getMainFont()->getWidth(char_code); if (field_0x44 == 0.0f) { - f32 temp2 = temp * f29; + f32 temp2 = width * f29; field_0x44 = temp2; } else { - f32 temp2 = temp * f29; + f32 temp2 = width * f29; field_0x44 += temp2 + mesgControl->getCharSpace(); } strcat(mMesg->text[0], sp14); @@ -595,15 +592,13 @@ bool dMesg_tSequenceProcessor::do_tag(u32 param_1, const void* param_2, u32 para sp10[1] = 0; } - JUTFont::TWidth twidth; int r25 = mesgControl->getNowFontSize(); f32 f29 = f32(r25) / f32(mesgControl->getMainFont()->getCellWidth()); - mesgControl->getMainFont()->getWidthEntry(char_code, &twidth); - int tmp = twidth.field_0x1; + int width = mesgControl->getMainFont()->getWidth(char_code); if (field_0x44 == 0.0f) { - field_0x44 = tmp * f29; + field_0x44 = width * f29; } else { - field_0x44 += tmp * f29 + mesgControl->getCharSpace(); + field_0x44 += width * f29 + mesgControl->getCharSpace(); } strcat(mMesg->text[0], sp10); strcat(mMesg->text[2], sp10); @@ -667,9 +662,7 @@ char* dMesg_tSequenceProcessor::ruby_character(char* param_1, int param_2) { int char_code = (byte << 8); byte = src[1]; char_code |= byte; - JUTFont::TWidth twidth; - mesgControl->getRubyFont()->getWidthEntry(char_code, &twidth); - f32 tmp = (int)twidth.field_0x1; + f32 tmp = (f32)mesgControl->getRubyFont()->getWidth(char_code); if (param_2 == 1) { if (field_0x50 == 0.0f) { field_0x54 = tmp * f31; @@ -784,7 +777,6 @@ void dMesg_tMeasureProcessor::do_character(int param_1) { dMesg_tControl* mesgControl = (dMesg_tControl*)getControl(); int r30 = field_0x50 - field_0x4c; bool r29 = false; - JUTFont::TWidth twidth; if (param_1 == 10) { if (r30 >= 0 && r30 < linemax - 1) { retFlag++; @@ -810,13 +802,12 @@ void dMesg_tMeasureProcessor::do_character(int param_1) { if (r29 && r30 >= 0 && r30 <= linemax) { f32 f31 = f32(mesgControl->getNowFontSize()) / f32(mesgControl->getMainFont()->getCellWidth()); int char_code = mesgControl->getCharCode(); - mesgControl->getMainFont()->getWidthEntry(char_code, &twidth); - int tmp = twidth.field_0x1; + int width = mesgControl->getMainFont()->getWidth(char_code); if (!mesgControl->isHeader()) { - field_0x38[r30] += tmp * f31; + field_0x38[r30] += width * f31; mesgControl->setHeaderOn(); } else { - field_0x38[r30] += mesgControl->getCharSpace() + tmp * f31; + field_0x38[r30] += mesgControl->getCharSpace() + width * f31; } } } @@ -900,16 +891,14 @@ bool dMesg_tMeasureProcessor::do_tag(u32 param_1, const void* param_2, u32 param char_code = byte; } - JUTFont::TWidth twidth; int r23 = mesgControl->getNowFontSize(); f32 f30 = f32(r23) / f32(mesgControl->getMainFont()->getCellWidth()); - mesgControl->getMainFont()->getWidthEntry(char_code, &twidth); - int tmp = twidth.field_0x1; + int width = mesgControl->getMainFont()->getWidth(char_code); if (r27 >= 0 && r27 <= linemax) { if (field_0x38[r27] == 0.0f) { - field_0x38[r27] = tmp * f30; + field_0x38[r27] = width * f30; } else { - field_0x38[r27] += tmp * f30 + mesgControl->getCharSpace(); + field_0x38[r27] += width * f30 + mesgControl->getCharSpace(); } } } @@ -964,14 +953,13 @@ bool dMesg_tMeasureProcessor::do_tag(u32 param_1, const void* param_2, u32 param #else int char_code = 'H'; #endif - JUTFont::TWidth twidth; + f32 f29 = f32(mesgControl->getNowFontSize()) / f32(mesgControl->getMainFont()->getCellWidth()); - mesgControl->getMainFont()->getWidthEntry(char_code, &twidth); - int tmp = twidth.field_0x1; + int width = mesgControl->getMainFont()->getWidth(char_code); if (field_0x48 == 0.0f) { - field_0x48 = tmp * f29; + field_0x48 = width * f29; } else { - field_0x48 += mesgControl->getCharSpace() + tmp * f29; + field_0x48 += mesgControl->getCharSpace() + width * f29; } } r26 = true; @@ -985,14 +973,13 @@ bool dMesg_tMeasureProcessor::do_tag(u32 param_1, const void* param_2, u32 param #else int char_code = 'H'; #endif - JUTFont::TWidth twidth; + f32 f29 = f32(mesgControl->getNowFontSize()) / f32(mesgControl->getMainFont()->getCellWidth()); - mesgControl->getMainFont()->getWidthEntry(char_code, &twidth); - int tmp = twidth.field_0x1; + int width = mesgControl->getMainFont()->getWidth(char_code); if (field_0x48 == 0.0f) { - field_0x48 = tmp * f29; + field_0x48 = width * f29; } else { - field_0x48 += mesgControl->getCharSpace() + tmp * f29; + field_0x48 += mesgControl->getCharSpace() + width * f29; } } r26 = true; @@ -1021,15 +1008,14 @@ bool dMesg_tMeasureProcessor::do_tag(u32 param_1, const void* param_2, u32 param byte = sp18[r25++]; char_code = byte; } - JUTFont::TWidth twidth; + f32 f30 = f32(mesgControl->getNowFontSize()) / f32(mesgControl->getMainFont()->getCellWidth()); - mesgControl->getMainFont()->getWidthEntry(char_code, &twidth); - int tmp = twidth.field_0x1; + int width = mesgControl->getMainFont()->getWidth(char_code); if (r27 >= 0 && r27 <= linemax) { if (field_0x38[r27] == 0.0f) { - field_0x38[r27] = tmp * f30; + field_0x38[r27] = width * f30; } else { - field_0x38[r27] += tmp * f30 + mesgControl->getCharSpace(); + field_0x38[r27] += width * f30 + mesgControl->getCharSpace(); } } } diff --git a/src/d/d_name.cpp b/src/d/d_name.cpp index 930e21a6..af6919ce 100644 --- a/src/d/d_name.cpp +++ b/src/d/d_name.cpp @@ -781,11 +781,8 @@ void dName_c::setNameText() { for (int i = 0; i < 8; i++) { if (chrInfo[i].field_0x3 != 0) { - JUTFont::TWidth twidth; int character = chrInfo[i].character; - nameIn.font->getWidthEntry(character, &twidth); - - f32 temp = (int)twidth.field_0x1; + f32 temp = (f32)nameIn.font->getWidth(character); temp *= ratio; int sp50 = temp * 10000.0f; |
