aboutsummaryrefslogtreecommitdiff
path: root/queen
diff options
context:
space:
mode:
authorGregory Montoir2004-01-11 17:20:29 +0000
committerGregory Montoir2004-01-11 17:20:29 +0000
commitdf985747e125739f180d857ddfd1ab0ec301dfe6 (patch)
tree1b6d49fe62004a4377797e52921000a519378f69 /queen
parent7309705db5e6994563d348f67e79f4b42bdff13f (diff)
downloadscummvm-rg350-df985747e125739f180d857ddfd1ab0ec301dfe6.tar.gz
scummvm-rg350-df985747e125739f180d857ddfd1ab0ec301dfe6.tar.bz2
scummvm-rg350-df985747e125739f180d857ddfd1ab0ec301dfe6.zip
minor display code changes
svn-id: r12323
Diffstat (limited to 'queen')
-rw-r--r--queen/display.cpp23
-rw-r--r--queen/display.h2
-rw-r--r--queen/graphics.cpp6
-rw-r--r--queen/logic.cpp4
4 files changed, 18 insertions, 17 deletions
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();
}