[Scummvm-cvs-logs] SF.net SVN: scummvm:[44905] scummvm/trunk/engines/kyra
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Sun Oct 11 13:29:34 CEST 2009
Revision: 44905
http://scummvm.svn.sourceforge.net/scummvm/?rev=44905&view=rev
Author: lordhoto
Date: 2009-10-11 11:29:34 +0000 (Sun, 11 Oct 2009)
Log Message:
-----------
Fix FM-Towns/PC98 menu code.
Modified Paths:
--------------
scummvm/trunk/engines/kyra/gui.cpp
scummvm/trunk/engines/kyra/gui.h
scummvm/trunk/engines/kyra/gui_lok.cpp
scummvm/trunk/engines/kyra/gui_v2.cpp
Modified: scummvm/trunk/engines/kyra/gui.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui.cpp 2009-10-11 11:28:43 UTC (rev 44904)
+++ scummvm/trunk/engines/kyra/gui.cpp 2009-10-11 11:29:34 UTC (rev 44905)
@@ -143,19 +143,13 @@
else
printMenuText(getMenuItemTitle(menu.item[i]), textX, textY, menu.item[i].textColor, 0, 8);
} else {
- Screen::FontId of = _screen->_currentFont;
- if (_vm->_flags.gameID != GI_LOL && menu.item[i].saveSlot > 0)
- _screen->setFont(Screen::FID_8_FNT);
-
if (_vm->gameFlags().platform != Common::kPlatformAmiga)
- printMenuText(getMenuItemTitle(menu.item[i]), textX - 1, textY + 1, defaultColor1(), 0, 0, Screen::FID_8_FNT);
+ printMenuText(getMenuItemTitle(menu.item[i]), textX - 1, textY + 1, defaultColor1(), 0, 0);
if (i == menu.highlightedItem)
- printMenuText(getMenuItemTitle(menu.item[i]), textX, textY, menu.item[i].highlightColor, 0, 0, Screen::FID_8_FNT);
+ printMenuText(getMenuItemTitle(menu.item[i]), textX, textY, menu.item[i].highlightColor, 0, 0);
else
- printMenuText(getMenuItemTitle(menu.item[i]), textX, textY, menu.item[i].textColor, 0, 0, Screen::FID_8_FNT);
-
- _screen->setFont(of);
+ printMenuText(getMenuItemTitle(menu.item[i]), textX, textY, menu.item[i].textColor, 0, 0);
}
}
}
@@ -264,13 +258,9 @@
textY++;
printMenuText(getMenuItemTitle(menu.item[i]), textX, textY, menu.item[i].textColor, 0, 8);
} else {
- Screen::FontId of = _screen->_currentFont;
- if (menu.item[i].saveSlot > 0)
- _screen->setFont(Screen::FID_8_FNT);
if (_vm->gameFlags().platform != Common::kPlatformAmiga)
printMenuText(getMenuItemTitle(menu.item[i]), textX - 1, textY + 1, defaultColor1(), 0, 0);
printMenuText(getMenuItemTitle(menu.item[i]), textX, textY, menu.item[i].textColor, 0, 0);
- _screen->setFont(of);
}
}
@@ -294,13 +284,9 @@
textY++;
printMenuText(getMenuItemTitle(menu.item[i]), textX, textY, menu.item[i].highlightColor, 0, 8);
} else {
- Screen::FontId of = _screen->_currentFont;
- if (menu.item[i].saveSlot > 0)
- _screen->setFont(Screen::FID_8_FNT);
if (_vm->gameFlags().platform != Common::kPlatformAmiga)
printMenuText(getMenuItemTitle(menu.item[i]), textX - 1, textY + 1, defaultColor1(), 0, 0);
printMenuText(getMenuItemTitle(menu.item[i]), textX, textY, menu.item[i].highlightColor, 0, 0);
- _screen->setFont(of);
}
}
@@ -461,7 +447,7 @@
}
void GUI::printMenuText(const char *str, int x, int y, uint8 c0, uint8 c1, uint8 c2, Screen::FontId font) {
- _text->printText(str, x, y, c0, c1, c2/*, font*/);
+ _text->printText(str, x, y, c0, c1, c2);
}
int GUI::getMenuCenterStringX(const char *str, int x1, int x2) {
Modified: scummvm/trunk/engines/kyra/gui.h
===================================================================
--- scummvm/trunk/engines/kyra/gui.h 2009-10-11 11:28:43 UTC (rev 44904)
+++ scummvm/trunk/engines/kyra/gui.h 2009-10-11 11:29:34 UTC (rev 44905)
@@ -176,7 +176,7 @@
bool _displaySubMenu;
bool _cancelSubMenu;
- virtual void printMenuText(const char *str, int x, int y, uint8 c0, uint8 c1, uint8 c2, Screen::FontId font=Screen::FID_8_FNT);
+ virtual void printMenuText(const char *str, int x, int y, uint8 c0, uint8 c1, uint8 c2, Screen::FontId font = Screen::FID_8_FNT);
virtual int getMenuCenterStringX(const char *str, int x1, int x2);
Button::Callback _redrawShadedButtonFunctor;
Modified: scummvm/trunk/engines/kyra/gui_lok.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui_lok.cpp 2009-10-11 11:28:43 UTC (rev 44904)
+++ scummvm/trunk/engines/kyra/gui_lok.cpp 2009-10-11 11:29:34 UTC (rev 44905)
@@ -682,17 +682,15 @@
}
void GUI_LoK::redrawTextfield() {
- Screen::FontId of = _screen->setFont(Screen::FID_8_FNT);
_screen->fillRect(38, 91, 287, 102, _vm->gameFlags().platform == Common::kPlatformAmiga ? 18 : 250);
_text->printText(_savegameName, 38, 92, 253, 0, 0);
-
+
_screen->_charWidth = -2;
int width = _screen->getTextWidth(_savegameName);
_screen->fillRect(39 + width, 93, 45 + width, 100, _vm->gameFlags().platform == Common::kPlatformAmiga ? 31 : 254);
_screen->_charWidth = 0;
_screen->updateScreen();
- _screen->setFont(of);
}
void GUI_LoK::updateSavegameString() {
@@ -704,7 +702,7 @@
char inputKey = _keyPressed.ascii;
Util::convertISOToDOS(inputKey);
- if ((uint8)inputKey > 31 && (uint8)inputKey < (_vm->gameFlags().lang == Common::JA_JPN ? 176 : 226)) {
+ if ((uint8)inputKey > 31 && (uint8)inputKey < (_vm->gameFlags().lang == Common::JA_JPN ? 128 : 226)) {
if (length < ARRAYSIZE(_savegameName)-1) {
_savegameName[length] = inputKey;
_savegameName[length+1] = 0;
@@ -751,7 +749,7 @@
}
redrawTextfield();
- while (_displaySubMenu && !_vm->shouldQuit()) {
+ while (_displaySubMenu && !_vm->shouldQuit()) {
checkTextfieldInput();
updateSavegameString();
processHighlights(_menu[3]);
Modified: scummvm/trunk/engines/kyra/gui_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui_v2.cpp 2009-10-11 11:28:43 UTC (rev 44904)
+++ scummvm/trunk/engines/kyra/gui_v2.cpp 2009-10-11 11:29:34 UTC (rev 44905)
@@ -746,21 +746,17 @@
int curPos = strlen(buffer);
int x2 = x, y2 = y;
- Screen::FontId of = _screen->setFont(Screen::FID_8_FNT);
_text->printText(buffer, x, y, c1, c2, c2);
-
+
for (int i = 0; i < curPos; ++i)
x2 += getCharWidth(buffer[i]);
drawTextfieldBlock(x2, y2, c3);
- _screen->setFont(of);
_keyPressed.reset();
_cancelNameInput = _finishNameInput = false;
while (running && !_vm->shouldQuit()) {
- of = _screen->setFont(Screen::FID_8_FNT);
checkTextfieldInput();
- _screen->setFont(of);
processHighlights(_savenameMenu);
char inputKey = _keyPressed.ascii;
@@ -783,8 +779,7 @@
drawTextfieldBlock(x2, y2, c3);
_screen->updateScreen();
_lastScreenUpdate = _vm->_system->getMillis();
- } else if ((uint8)inputKey > 31 && (uint8)inputKey < (_vm->gameFlags().lang == Common::JA_JPN ? 176 : 226) && curPos < bufferSize) {
- of = _screen->setFont(Screen::FID_8_FNT);
+ } else if ((uint8)inputKey > 31 && (uint8)inputKey < (_vm->gameFlags().lang == Common::JA_JPN ? 128 : 226) && curPos < bufferSize) {
if (x2 + getCharWidth(inputKey) + 7 < 0x11F) {
buffer[curPos] = inputKey;
const char text[2] = { buffer[curPos], 0 };
@@ -795,7 +790,6 @@
_screen->updateScreen();
_lastScreenUpdate = _vm->_system->getMillis();
}
- _screen->setFont(of);
}
_keyPressed.reset();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list