From df985747e125739f180d857ddfd1ab0ec301dfe6 Mon Sep 17 00:00:00 2001 From: Gregory Montoir Date: Sun, 11 Jan 2004 17:20:29 +0000 Subject: minor display code changes svn-id: r12323 --- queen/display.cpp | 23 +++++++++++------------ queen/display.h | 2 ++ queen/graphics.cpp | 6 +++--- queen/logic.cpp | 4 ++-- 4 files changed, 18 insertions(+), 17 deletions(-) (limited to 'queen') diff --git a/queen/display.cpp b/queen/display.cpp index 966156584d..e809f6ce87 100644 --- a/queen/display.cpp +++ b/queen/display.cpp @@ -196,8 +196,8 @@ void Display::palFadeIn(int start, int end, uint16 roomNum, bool dynalum, int16 palSet(tempPal, start, end, true); } } - _pal.dirtyMin = 0; - _pal.dirtyMax = _vm->logic()->isIntroRoom(roomNum) ? 255 : 223; + _pal.dirtyMin = start; + _pal.dirtyMax = end; _pal.scrollable = true; } @@ -895,22 +895,17 @@ void Display::drawText(uint16 x, uint16 y, uint8 color, const char *text, bool o const uint8 *str = (const uint8*)text; uint16 xs = x; while (*str && x < SCREEN_W) { - uint8 c = (_vm->resource()->getLanguage() == FRENCH && *str == 0x96) ? 0xFB : *str; const uint8 *pchr = _font + c * 8; if (outlined) { - drawChar(x - 1, y - 1, INK_OUTLINED_TEXT, pchr); - drawChar(x , y - 1, INK_OUTLINED_TEXT, pchr); - drawChar(x + 1, y - 1, INK_OUTLINED_TEXT, pchr); - drawChar(x + 1, y , INK_OUTLINED_TEXT, pchr); - drawChar(x + 1, y + 1, INK_OUTLINED_TEXT, pchr); - drawChar(x , y + 1, INK_OUTLINED_TEXT, pchr); - drawChar(x - 1, y + 1, INK_OUTLINED_TEXT, pchr); - drawChar(x - 1, y , INK_OUTLINED_TEXT, pchr); + const int xOff[] = { -1, 0, 1, 1, 1, 0, -1, -1 }; + const int yOff[] = { -1, -1, -1, 0, 1, 1, 1, 0 }; + for (int i = 0; i < 8; ++i) { + drawChar(x + xOff[i], y + yOff[i], INK_OUTLINED_TEXT, pchr); + } } drawChar(x, y, color, pchr); - x += _charWidth[ c ]; ++str; } @@ -928,6 +923,10 @@ void Display::drawBox(int16 x1, int16 y1, int16 x2, int16 y2, uint8 col) { } } +void Display::shake(bool reset) { + _system->set_shake_pos(reset ? 0 : 3); +} + void Display::blankScreen() { static int current = 0; typedef void (Display::*BlankerEffect)(); diff --git a/queen/display.h b/queen/display.h index 3b42ef8554..2820e6f6a3 100644 --- a/queen/display.h +++ b/queen/display.h @@ -102,6 +102,8 @@ public: void drawChar(uint16 x, uint16 y, uint8 color, const uint8 *chr); void drawText(uint16 x, uint16 y, uint8 color, const char *text, bool outlined = true); void drawBox(int16 x1, int16 y1, int16 x2, int16 y2, uint8 col); + + void shake(bool reset); void blankScreen(); void blankScreenEffect1(); diff --git a/queen/graphics.cpp b/queen/graphics.cpp index 0d009cd82b..ac190e00cb 100644 --- a/queen/graphics.cpp +++ b/queen/graphics.cpp @@ -1201,12 +1201,12 @@ void BamScene::updateFightAnimation() { switch (bdb->sfx) { case 0: // nothing, so reset shaked screen if necessary if (_screenShaked) { - OSystem::instance()->set_shake_pos(0); + _vm->display()->shake(true); _screenShaked = false; } break; case 1: // shake screen - OSystem::instance()->set_shake_pos(3); + _vm->display()->shake(false); _screenShaked = true; break; case 2: // play background sfx @@ -1214,7 +1214,7 @@ void BamScene::updateFightAnimation() { break; case 3: // play background sfx and shake screen playSfx(); - OSystem::instance()->set_shake_pos(3); + _vm->display()->shake(false); _screenShaked = true; break; case 99: // end of BAM data diff --git a/queen/logic.cpp b/queen/logic.cpp index 0a038f0a51..81295df199 100644 --- a/queen/logic.cpp +++ b/queen/logic.cpp @@ -1960,9 +1960,9 @@ void Logic::asmWaitForCarPosition() { void Logic::asmShakeScreen() { - OSystem::instance()->set_shake_pos(3); + _vm->display()->shake(false); _vm->update(); - OSystem::instance()->set_shake_pos(0); + _vm->display()->shake(true); _vm->update(); } -- cgit v1.2.3