aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/graphics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/agi/graphics.cpp')
-rw-r--r--engines/agi/graphics.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp
index 6d3563a451..3b1b99f458 100644
--- a/engines/agi/graphics.cpp
+++ b/engines/agi/graphics.cpp
@@ -61,6 +61,14 @@ GfxMgr::GfxMgr(AgiBase *vm, GfxFont *font) : _vm(vm), _font(font) {
_displayWidthMulAdjust = 0; // visualPos * (2+0) = displayPos
_displayHeightMulAdjust = 0; // visualPos * (1+0) = displayPos
+
+ _pixels = 0;
+ _displayPixels = 0;
+
+ _activeScreen = NULL;
+ _gameScreen = NULL;
+ _priorityScreen = NULL;
+ _displayScreen = NULL;
}
/**
@@ -605,7 +613,7 @@ void GfxMgr::render_BlockEGA(int16 x, int16 y, int16 width, int16 height, bool c
switch (_upscaledHires) {
case DISPLAY_UPSCALED_640x400:
- offsetDisplay += _displayScreenWidth;;
+ offsetDisplay += _displayScreenWidth;
break;
default:
break;
@@ -660,7 +668,7 @@ void GfxMgr::render_BlockCGA(int16 x, int16 y, int16 width, int16 height, bool c
switch (_upscaledHires) {
case DISPLAY_UPSCALED_640x400:
- offsetDisplay += _displayScreenWidth;;
+ offsetDisplay += _displayScreenWidth;
break;
default:
break;
@@ -743,7 +751,7 @@ void GfxMgr::render_BlockHercules(int16 x, int16 y, int16 width, int16 height, b
offsetVisual += SCRIPT_WIDTH - width;
offsetDisplay += _displayScreenWidth - displayWidth;
- offsetDisplay += _displayScreenWidth;;
+ offsetDisplay += _displayScreenWidth;
remainingHeight--;
}
@@ -1178,13 +1186,17 @@ void GfxMgr::drawCharacterOnDisplay(int16 x, int16 y, const byte character, byte
#define SHAKE_HORIZONTAL_PIXELS 4
// Sierra used some EGA port trickery to do it, we have to do it by copying pixels around
+//
+// Shaking locations:
+// - Fanmade "Enclosure" right during the intro
+// - Space Quest 2 almost right at the start when getting captured (after walking into the space ship)
void GfxMgr::shakeScreen(int16 repeatCount) {
int shakeNr, shakeCount;
uint8 *blackSpace;
int16 shakeHorizontalPixels = SHAKE_HORIZONTAL_PIXELS * (2 + _displayWidthMulAdjust);
int16 shakeVerticalPixels = SHAKE_VERTICAL_PIXELS * (1 + _displayHeightMulAdjust);
- if ((blackSpace = (uint8 *)calloc(shakeVerticalPixels * _displayScreenWidth, 1)) == NULL)
+ if ((blackSpace = (uint8 *)calloc(shakeHorizontalPixels * _displayScreenWidth, 1)) == NULL)
return;
shakeCount = repeatCount * 8; // effectively 4 shakes per repeat