mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-02-03 12:31:15 +00:00
Add Danish support
This commit is contained in:
parent
36ee7e7b2b
commit
d156ac0f48
@ -48,6 +48,7 @@ class HistoryBook : public LegoWorld {
|
|||||||
MxStillPresenter* m_scores[20]; // 0x394
|
MxStillPresenter* m_scores[20]; // 0x394
|
||||||
|
|
||||||
MxStillPresenter* m_intAlphabet[sizeOfArray(LegoGameState::g_intCharacters)];
|
MxStillPresenter* m_intAlphabet[sizeOfArray(LegoGameState::g_intCharacters)];
|
||||||
|
MxU32 m_intAlphabetOffset;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // HISTORYBOOK_H
|
#endif // HISTORYBOOK_H
|
||||||
|
|||||||
@ -263,7 +263,7 @@ class LegoGameState {
|
|||||||
Area m_previousArea; // 0x428
|
Area m_previousArea; // 0x428
|
||||||
Area m_unk0x42c; // 0x42c
|
Area m_unk0x42c; // 0x42c
|
||||||
|
|
||||||
static const InternationalCharacter g_intCharacters[4];
|
static const InternationalCharacter g_intCharacters[7];
|
||||||
};
|
};
|
||||||
|
|
||||||
MxBool ROIColorOverride(const char* p_input, char* p_output, MxU32 p_copyLen);
|
MxBool ROIColorOverride(const char* p_input, char* p_output, MxU32 p_copyLen);
|
||||||
|
|||||||
@ -65,6 +65,7 @@ class RegistrationBook : public LegoWorld {
|
|||||||
LPDIRECTDRAWSURFACE m_checkboxSurface; // 0x2c8
|
LPDIRECTDRAWSURFACE m_checkboxSurface; // 0x2c8
|
||||||
LPDIRECTDRAWSURFACE m_checkboxNormal; // 0x2cc
|
LPDIRECTDRAWSURFACE m_checkboxNormal; // 0x2cc
|
||||||
MxStillPresenter* m_intAlphabet[sizeOfArray(LegoGameState::g_intCharacters)];
|
MxStillPresenter* m_intAlphabet[sizeOfArray(LegoGameState::g_intCharacters)];
|
||||||
|
MxU32 m_intAlphabetOffset;
|
||||||
|
|
||||||
MxLong HandleEndAction(MxEndActionNotificationParam& p_param);
|
MxLong HandleEndAction(MxEndActionNotificationParam& p_param);
|
||||||
MxLong HandleKeyPress(SDL_Keycode p_key);
|
MxLong HandleKeyPress(SDL_Keycode p_key);
|
||||||
|
|||||||
@ -143,8 +143,15 @@ const char* g_strEnable = "enable";
|
|||||||
// STRING: LEGO1 0x100f3bf4
|
// STRING: LEGO1 0x100f3bf4
|
||||||
const char* g_strDisable = "disable";
|
const char* g_strDisable = "disable";
|
||||||
|
|
||||||
const InternationalCharacter LegoGameState::g_intCharacters[4] =
|
const InternationalCharacter LegoGameState::g_intCharacters[7] = {
|
||||||
{{0xe4, "Aum_Bitmap", 29}, {0xf6, "Oum_Bitmap", 30}, {0xdf, "Beta_Bitmap", 31}, {0xfc, "Uum_Bitmap", 32}};
|
{0xe4, "Aum_Bitmap", 29},
|
||||||
|
{0xf6, "Oum_Bitmap", 30},
|
||||||
|
{0xdf, "Beta_Bitmap", 31},
|
||||||
|
{0xfc, "Uum_Bitmap", 32},
|
||||||
|
{0xe5, "Ao_Bitmap", 29},
|
||||||
|
{0xe6, "Ae_Bitmap", 30},
|
||||||
|
{0xf8, "Oz_Bitmap", 31}
|
||||||
|
};
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10039550
|
// FUNCTION: LEGO1 0x10039550
|
||||||
LegoGameState::LegoGameState()
|
LegoGameState::LegoGameState()
|
||||||
|
|||||||
@ -119,6 +119,16 @@ void HistoryBook::ReadyWorld()
|
|||||||
m_intAlphabet[i] = (MxStillPresenter*) Find("MxStillPresenter", LegoGameState::g_intCharacters[i].m_bitmap);
|
m_intAlphabet[i] = (MxStillPresenter*) Find("MxStillPresenter", LegoGameState::g_intCharacters[i].m_bitmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_intAlphabetOffset = 0;
|
||||||
|
for (i = 0; i < sizeOfArray(m_intAlphabet); i++) {
|
||||||
|
if (!m_intAlphabet[i]) {
|
||||||
|
m_intAlphabetOffset++;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MxStillPresenter* scoreboxMaster = (MxStillPresenter*) Find("MxStillPresenter", "ScoreBox");
|
MxStillPresenter* scoreboxMaster = (MxStillPresenter*) Find("MxStillPresenter", "ScoreBox");
|
||||||
MxU8 scoreColors[3] =
|
MxU8 scoreColors[3] =
|
||||||
{0x76, 0x4c, 0x38}; // yellow - #FFB900, blue - #00548C, red - #CB1220, background - #CECECE, border - #74818B
|
{0x76, 0x4c, 0x38}; // yellow - #FFB900, blue - #00548C, red - #CB1220, background - #CECECE, border - #74818B
|
||||||
@ -181,9 +191,9 @@ void HistoryBook::ReadyWorld()
|
|||||||
}
|
}
|
||||||
|
|
||||||
index -= sizeOfArray(m_alphabet);
|
index -= sizeOfArray(m_alphabet);
|
||||||
assert(index < sizeOfArray(m_intAlphabet));
|
index += m_intAlphabetOffset;
|
||||||
|
|
||||||
if (!m_intAlphabet[index]) {
|
if (index >= sizeOfArray(m_intAlphabet) || !m_intAlphabet[index]) {
|
||||||
SDL_Log("Warning: international character not present in current game. Falling back to X");
|
SDL_Log("Warning: international character not present in current game. Falling back to X");
|
||||||
return &m_alphabet[SDLK_X - SDLK_A];
|
return &m_alphabet[SDLK_X - SDLK_A];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -212,8 +212,9 @@ MxLong RegistrationBook::HandleKeyPress(SDL_Keycode p_key)
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_unk0x280.m_letters[m_unk0x280.m_cursorPos] =
|
m_unk0x280.m_letters[m_unk0x280.m_cursorPos] =
|
||||||
key >= SDLK_A && key <= SDLK_Z ? key - SDLK_A
|
key >= SDLK_A && key <= SDLK_Z
|
||||||
: (intoAlphabet - m_intAlphabet) + sizeOfArray(m_alphabet);
|
? key - SDLK_A
|
||||||
|
: (intoAlphabet - m_intAlphabet) + sizeOfArray(m_alphabet) - m_intAlphabetOffset;
|
||||||
m_unk0x280.m_cursorPos++;
|
m_unk0x280.m_cursorPos++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -460,6 +461,16 @@ void RegistrationBook::ReadyWorld()
|
|||||||
m_intAlphabet[i] = (MxStillPresenter*) Find("MxStillPresenter", LegoGameState::g_intCharacters[i].m_bitmap);
|
m_intAlphabet[i] = (MxStillPresenter*) Find("MxStillPresenter", LegoGameState::g_intCharacters[i].m_bitmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_intAlphabetOffset = 0;
|
||||||
|
for (i = 0; i < sizeOfArray(m_intAlphabet); i++) {
|
||||||
|
if (!m_intAlphabet[i]) {
|
||||||
|
m_intAlphabetOffset++;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Now we have to do the checkmarks
|
// Now we have to do the checkmarks
|
||||||
char checkmarkBuffer[] = "Check0_Ctl";
|
char checkmarkBuffer[] = "Check0_Ctl";
|
||||||
for (i = 0; i < 10; i++) {
|
for (i = 0; i < 10; i++) {
|
||||||
@ -488,9 +499,9 @@ void RegistrationBook::ReadyWorld()
|
|||||||
}
|
}
|
||||||
|
|
||||||
index -= sizeOfArray(m_alphabet);
|
index -= sizeOfArray(m_alphabet);
|
||||||
assert(index < sizeOfArray(m_intAlphabet));
|
index += m_intAlphabetOffset;
|
||||||
|
|
||||||
if (!m_intAlphabet[index]) {
|
if (index >= sizeOfArray(m_intAlphabet) || !m_intAlphabet[index]) {
|
||||||
SDL_Log("Warning: international character not present in current game. Falling back to X");
|
SDL_Log("Warning: international character not present in current game. Falling back to X");
|
||||||
return &m_alphabet[SDLK_X - SDLK_A];
|
return &m_alphabet[SDLK_X - SDLK_A];
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user