summaryrefslogtreecommitdiff
path: root/src/d/d_timer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/d/d_timer.cpp')
-rw-r--r--src/d/d_timer.cpp33
1 files changed, 30 insertions, 3 deletions
diff --git a/src/d/d_timer.cpp b/src/d/d_timer.cpp
index 16a1e6e867..aa2b5ab6b3 100644
--- a/src/d/d_timer.cpp
+++ b/src/d/d_timer.cpp
@@ -1462,6 +1462,12 @@ void dDlst_TimerScrnDraw_c::playBckAnimation(f32 i_frame) {
mpGetInParent->getPanePtr()->setAnimation((J2DAnmTransform*)NULL);
}
+#if VERSION == VERSION_GCN_JPN
+bool dDlst_TimerScrnDraw_c::isLeadByte(int i_char) {
+ return (i_char >= 0x81 && i_char <= 0x9f) || (i_char >= 0xe0 && i_char <= 0xfc);
+}
+#endif
+
/* 80260B54-80260F04 25B494 03B0+00 1/1 0/0 0/0 .text drawPikari__21dDlst_TimerScrnDraw_cFi */
void dDlst_TimerScrnDraw_c::drawPikari(int i_no) {
f32 temp_f28;
@@ -1486,12 +1492,23 @@ void dDlst_TimerScrnDraw_c::drawPikari(int i_no) {
}
for (; string[str_idx] != 0; str_idx++) {
+ int c = string[str_idx] & 0xFF;
+
if (str_idx > 0) {
var_f29 +=
var_f25 * static_cast<J2DTextBox*>(mpGetInText->getPanePtr())->getCharSpace();
}
- int c = string[str_idx] & 0xFF;
+#if VERSION == VERSION_GCN_JPN
+ if (isLeadByte(c)) {
+ c = ((string[str_idx] & 0xFF) << 8) | (string[str_idx + 1] & 0xFF);
+ str_idx++;
+ } else {
+ c = string[str_idx] & 0xFF;
+ }
+#else
+ c = string[str_idx] & 0xFF;
+#endif
var_f29 +=
var_f25 * (font_size.mSizeX * ((f32)font_p->getWidth(c) / (f32)font_p->getCellWidth()));
@@ -1501,13 +1518,23 @@ void dDlst_TimerScrnDraw_c::drawPikari(int i_no) {
f32 frame;
for (str_idx = 0; string[str_idx] != 0; str_idx++) {
+ int c = string[str_idx] & 0xFF;
+
if (str_idx > 0) {
var_f26 +=
var_f25 * static_cast<J2DTextBox*>(mpGetInText->getPanePtr())->getCharSpace();
}
- int c = string[str_idx] & 0xFF;
-
+#if VERSION == VERSION_GCN_JPN
+ if (isLeadByte(c)) {
+ c = ((string[str_idx] & 0xFF) << 8) | (string[str_idx + 1] & 0xFF);
+ str_idx++;
+ } else {
+ c = string[str_idx] & 0xFF;
+ }
+#else
+ c = string[str_idx] & 0xFF;
+#endif
f32 temp_f24 =
var_f25 * (font_size.mSizeX * ((f32)font_p->getWidth(c) / (f32)font_p->getCellWidth()));
if (c != 0x20 && c != 0x8140) {