aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorFlorian Kagerer2009-09-30 21:46:00 +0000
committerFlorian Kagerer2009-09-30 21:46:00 +0000
commit598056ead0bfff5bf6b08de50cc19e159f91d35a (patch)
treec92e08844b04c19258151379c4e49e182e793e55 /engines/kyra
parentaa368806d9a69a9a21c44322ed2fbc8ceef20af1 (diff)
downloadscummvm-rg350-598056ead0bfff5bf6b08de50cc19e159f91d35a.tar.gz
scummvm-rg350-598056ead0bfff5bf6b08de50cc19e159f91d35a.tar.bz2
scummvm-rg350-598056ead0bfff5bf6b08de50cc19e159f91d35a.zip
LOL/PC-98: - fixed TIM dialogue button text colors
- fixed menu text alignment svn-id: r44501
Diffstat (limited to 'engines/kyra')
-rw-r--r--engines/kyra/gui_lol.cpp19
-rw-r--r--engines/kyra/scene_lol.cpp5
-rw-r--r--engines/kyra/script_tim.cpp4
-rw-r--r--engines/kyra/text_lol.cpp2
4 files changed, 20 insertions, 10 deletions
diff --git a/engines/kyra/gui_lol.cpp b/engines/kyra/gui_lol.cpp
index e98f2a6049..e958302d96 100644
--- a/engines/kyra/gui_lol.cpp
+++ b/engines/kyra/gui_lol.cpp
@@ -2324,6 +2324,10 @@ int GUI_LoL::runMenu(Menu &menu) {
// a menu has scroll buttons or slider bars.
uint8 hasSpecialButtons = 0;
+ Screen::FontId of;
+ if (_vm->gameFlags().use16ColorMode)
+ of = _screen->setFont(Screen::FID_SJIS_FNT);
+
while (_displayMenu) {
_vm->_mouseX = _vm->_mouseY = 0;
@@ -2481,6 +2485,7 @@ int GUI_LoL::runMenu(Menu &menu) {
textCursorTimer = 0;
textCursorStatus = 0;
+ Screen::FontId f = _screen->setFont(Screen::FID_9_FNT);
fC = _screen->getTextWidth(_saveDescription);
while (fC >= fW) {
_saveDescription[strlen(_saveDescription) - 1] = 0;
@@ -2488,6 +2493,7 @@ int GUI_LoL::runMenu(Menu &menu) {
}
_screen->fprintString("%s", (d->sx << 3), d->sy + 2, d->unk8, d->unkA, 0, _saveDescription);
+ f = _screen->setFont(f);
_screen->fillRect((d->sx << 3) + fC, d->sy, (d->sx << 3) + fC + wW, d->sy + d->h - 1, d->unk8, 0);
_screen->setCurPage(pg);
}
@@ -2497,11 +2503,13 @@ int GUI_LoL::runMenu(Menu &menu) {
if (_currentMenu == &_savenameMenu) {
if (textCursorTimer <= _vm->_system->getMillis()) {
+ Screen::FontId f = _screen->setFont(Screen::FID_9_FNT);
fC = _screen->getTextWidth(_saveDescription);
textCursorStatus ^= 1;
textCursorTimer = _vm->_system->getMillis() + 20 * _vm->_tickLength;
_screen->fillRect((d->sx << 3) + fC, d->sy, (d->sx << 3) + fC + wW, d->sy + d->h - 1, textCursorStatus ? d->unk8 : d->unkA, 0);
_screen->updateScreen();
+ f = _screen->setFont(f);
}
}
@@ -2527,6 +2535,9 @@ int GUI_LoL::runMenu(Menu &menu) {
_newMenu = 0;
}
+ if (_vm->gameFlags().use16ColorMode)
+ _screen->setFont(of);
+
return _menuResult;
}
@@ -2591,13 +2602,7 @@ void GUI_LoL::setupSavegameNames(Menu &menu, int num) {
}
void GUI_LoL::printMenuText(const char *str, int x, int y, uint8 c0, uint8 c1, uint8 flags, Screen::FontId font) {
- if (_vm->gameFlags().use16ColorMode) {
- Screen::FontId of = _screen->setFont(Screen::FID_SJIS_FNT);
- _screen->fprintString("%s", x, y, c0, c1, flags & 3, str);
- _screen->setFont(of);
- } else {
- _screen->fprintString("%s", x, y, c0, c1, flags, str);
- }
+ _screen->fprintString("%s", x, y, c0, c1, _vm->gameFlags().use16ColorMode ? (flags & 3) : flags , str);
}
int GUI_LoL::getMenuCenterStringX(const char *str, int x1, int x2) {
diff --git a/engines/kyra/scene_lol.cpp b/engines/kyra/scene_lol.cpp
index 5a18869da0..0860b141a7 100644
--- a/engines/kyra/scene_lol.cpp
+++ b/engines/kyra/scene_lol.cpp
@@ -455,10 +455,13 @@ void LoLEngine::loadLevelGraphics(const char *file, int specialColor, int weight
for (int i = 0; i < vmpLen; i++)
_vmpPtr[i] = READ_LE_UINT16(&v[i << 1]);
+ Palette tpal(256);
+ tpal.copy(_screen->getPalette(0));
+ tpal.fill(16, 240, 0xff);
for (int i = 0; i < 7; i++) {
weight = 100 - (i * _lastSpecialColorWeight);
weight = (weight > 0) ? (weight * 255) / 100 : 0;
- _screen->generateLevelOverlay(_screen->getPalette(0), _screen->getLevelOverlay(i), _lastSpecialColor, weight);
+ _screen->generateLevelOverlay(tpal/*_screen->getPalette(0)*/, _screen->getLevelOverlay(i), _lastSpecialColor >> 4, weight);
int l = _flags.use16ColorMode ? 256 : 128;
uint8 *levelOverlay = _screen->getLevelOverlay(i);
diff --git a/engines/kyra/script_tim.cpp b/engines/kyra/script_tim.cpp
index 6ccbacc537..01f4f6171d 100644
--- a/engines/kyra/script_tim.cpp
+++ b/engines/kyra/script_tim.cpp
@@ -1168,16 +1168,18 @@ int TIMInterpreter_LoL::resetAnimationLastPart(int animIndex) {
void TIMInterpreter_LoL::drawDialogueButtons() {
int cp = _screen->setCurPage(0);
- Screen::FontId of = _screen->setFont(Screen::FID_6_FNT);
+ Screen::FontId of;
int x = _dialogueButtonPosX;
for (int i = 0; i < _dialogueNumButtons; i++) {
if (_vm->gameFlags().use16ColorMode) {
+ of = _screen->setFont(Screen::FID_SJIS_FNT);
_vm->gui_drawBox(x, (_dialogueButtonPosY & ~7) - 1, 74, 10, 0xee, 0xcc, -1);
_screen->printText(_dialogueButtonString[i], (x + 37 - (_screen->getTextWidth(_dialogueButtonString[i])) / 2) & ~3,
(_dialogueButtonPosY + 2) & ~7, _dialogueHighlightedButton == i ? 0xc1 : 0xe1, 0);
} else {
+ of = _screen->setFont(Screen::FID_6_FNT);
_vm->gui_drawBox(x, _dialogueButtonPosY, 74, 9, 136, 251, -1);
_screen->printText(_dialogueButtonString[i], x + 37 - (_screen->getTextWidth(_dialogueButtonString[i])) / 2,
_dialogueButtonPosY + 2, _dialogueHighlightedButton == i ? 144 : 254, 0);
diff --git a/engines/kyra/text_lol.cpp b/engines/kyra/text_lol.cpp
index 384681987b..a5095790c1 100644
--- a/engines/kyra/text_lol.cpp
+++ b/engines/kyra/text_lol.cpp
@@ -675,7 +675,7 @@ void TextDisplayer_LoL::printLine(char *str) {
void TextDisplayer_LoL::textPageBreak() {
int cp = _screen->setCurPage(0);
- Screen::FontId cf = _screen->setFont(Screen::FID_6_FNT);
+ Screen::FontId cf = _screen->setFont(_vm->gameFlags().use16ColorMode ? Screen::FID_SJIS_FNT : Screen::FID_6_FNT);
_vm->_timer->pauseSingleTimer(11, true);