[Scummvm-cvs-logs] CVS: scummvm/queen display.cpp,1.53,1.54 display.h,1.39,1.40 graphics.cpp,1.81,1.82 logic.cpp,1.169,1.170
Gregory Montoir
cyx at users.sourceforge.net
Sun Jan 11 09:21:01 CET 2004
Update of /cvsroot/scummvm/scummvm/queen
In directory sc8-pr-cvs1:/tmp/cvs-serv18368/queen
Modified Files:
display.cpp display.h graphics.cpp logic.cpp
Log Message:
minor display code changes
Index: display.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/display.cpp,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- display.cpp 11 Jan 2004 14:08:07 -0000 1.53
+++ display.cpp 11 Jan 2004 17:20:29 -0000 1.54
@@ -196,8 +196,8 @@
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 @@
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;
}
@@ -926,6 +921,10 @@
for (i = x1; i <= x2; ++i) {
*(p + y1 * SCREEN_W + i) = *(p + y2 * SCREEN_W + i) = col;
}
+}
+
+void Display::shake(bool reset) {
+ _system->set_shake_pos(reset ? 0 : 3);
}
void Display::blankScreen() {
Index: display.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/display.h,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- display.h 11 Jan 2004 14:08:07 -0000 1.39
+++ display.h 11 Jan 2004 17:20:29 -0000 1.40
@@ -102,6 +102,8 @@
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();
Index: graphics.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/graphics.cpp,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -d -r1.81 -r1.82
--- graphics.cpp 11 Jan 2004 14:11:36 -0000 1.81
+++ graphics.cpp 11 Jan 2004 17:20:29 -0000 1.82
@@ -1201,12 +1201,12 @@
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 @@
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
Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/logic.cpp,v
retrieving revision 1.169
retrieving revision 1.170
diff -u -d -r1.169 -r1.170
--- logic.cpp 11 Jan 2004 14:11:36 -0000 1.169
+++ logic.cpp 11 Jan 2004 17:20:29 -0000 1.170
@@ -1960,9 +1960,9 @@
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();
}
More information about the Scummvm-git-logs
mailing list