aboutsummaryrefslogtreecommitdiff
path: root/engines/gob
diff options
context:
space:
mode:
authorSven Hesse2010-08-08 00:35:18 +0000
committerSven Hesse2010-08-08 00:35:18 +0000
commit44159533936ff68da1d92639003ae30fc7611cf1 (patch)
treec164e015498bfef4942893493b15319bbad4a74e /engines/gob
parentf8a43ee35f4ca2a409558fbb6bf978cc2ae54ab4 (diff)
downloadscummvm-rg350-44159533936ff68da1d92639003ae30fc7611cf1.tar.gz
scummvm-rg350-44159533936ff68da1d92639003ae30fc7611cf1.tar.bz2
scummvm-rg350-44159533936ff68da1d92639003ae30fc7611cf1.zip
GOB: Add constants for different surfaces/sprites
Add static const int kFrontSurface = 20; static const int kBackSurface = 21; static const int kAnimSurface = 22; static const int kCursorSurface = 23; static const int kCaptureSurface = 30; to class Draw and substitute the raw numbers in other files with those aliases, for readability. svn-id: r51852
Diffstat (limited to 'engines/gob')
-rw-r--r--engines/gob/draw.cpp12
-rw-r--r--engines/gob/draw.h7
-rw-r--r--engines/gob/draw_fascin.cpp12
-rw-r--r--engines/gob/draw_playtoons.cpp10
-rw-r--r--engines/gob/draw_v1.cpp10
-rw-r--r--engines/gob/draw_v2.cpp30
-rw-r--r--engines/gob/game.cpp16
-rw-r--r--engines/gob/hotspots.cpp2
-rw-r--r--engines/gob/inter_playtoons.cpp2
-rw-r--r--engines/gob/inter_v1.cpp14
-rw-r--r--engines/gob/inter_v2.cpp12
-rw-r--r--engines/gob/inter_v3.cpp4
-rw-r--r--engines/gob/mult.cpp4
-rw-r--r--engines/gob/mult_v1.cpp8
-rw-r--r--engines/gob/mult_v2.cpp18
-rw-r--r--engines/gob/scenery.cpp14
-rw-r--r--engines/gob/videoplayer.cpp4
17 files changed, 92 insertions, 87 deletions
diff --git a/engines/gob/draw.cpp b/engines/gob/draw.cpp
index ff6d558998..36b75dc2eb 100644
--- a/engines/gob/draw.cpp
+++ b/engines/gob/draw.cpp
@@ -914,7 +914,7 @@ void Draw::winDraw(int16 fct) {
int table[10];
SurfaceDescPtr tempSrf;
- if (_destSurface == 21) {
+ if (_destSurface == kBackSurface) {
if (_vm->_global->_curWinId) {
if (_fascinWin[_vm->_global->_curWinId].id == -1)
@@ -1032,7 +1032,7 @@ void Draw::winDraw(int16 fct) {
table[_fascinWin[i].id] = i;
}
- if ((_sourceSurface == 21) && (fct == 0)) {
+ if ((_sourceSurface == kBackSurface) && (fct == 0)) {
_vm->_video->drawSprite(*_spritesArray[_sourceSurface], *_spritesArray[_destSurface],
_spriteLeft, _spriteTop, _spriteLeft + _spriteRight - 1,
_spriteTop + _spriteBottom - 1, _destSpriteX, _destSpriteY, _transparency);
@@ -1267,11 +1267,11 @@ void Draw::winDraw(int16 fct) {
}
if (_renderFlags & 16) {
- if (_sourceSurface == 21) {
+ if (_sourceSurface == kBackSurface) {
_spriteLeft -= _backDeltaX;
_spriteTop -= _backDeltaY;
}
- if (_destSurface == 21) {
+ if (_destSurface == kBackSurface) {
_destSpriteX -= _backDeltaX;
_destSpriteY -= _backDeltaY;
}
@@ -1323,9 +1323,9 @@ void Draw::forceBlit(bool backwards) {
return;
if (_frontSurface == _backSurface)
return;
- if (_spritesArray[20] != _frontSurface)
+ if (_spritesArray[kFrontSurface] != _frontSurface)
return;
- if (_spritesArray[21] != _backSurface)
+ if (_spritesArray[kBackSurface] != _backSurface)
return;
if (!backwards) {
diff --git a/engines/gob/draw.h b/engines/gob/draw.h
index 8997c53362..fa3cbb84cc 100644
--- a/engines/gob/draw.h
+++ b/engines/gob/draw.h
@@ -45,7 +45,12 @@ namespace Gob {
class Draw {
public:
- static const int kFontCount = 8;
+ static const int kFontCount = 8;
+ static const int kFrontSurface = 20;
+ static const int kBackSurface = 21;
+ static const int kAnimSurface = 22;
+ static const int kCursorSurface = 23;
+ static const int kCaptureSurface = 30;
struct FontToSprite {
int8 sprite;
diff --git a/engines/gob/draw_fascin.cpp b/engines/gob/draw_fascin.cpp
index 9d30faa972..1e01db7dfb 100644
--- a/engines/gob/draw_fascin.cpp
+++ b/engines/gob/draw_fascin.cpp
@@ -53,12 +53,12 @@ void Draw_Fascination::spriteOperation(int16 operation) {
_destSurface -= 80;
if ((_renderFlags & RENDERFLAG_USEDELTAS) && !deltaVeto) {
- if ((_sourceSurface == 21) && (operation != DRAW_LOADSPRITE)) {
+ if ((_sourceSurface == kBackSurface) && (operation != DRAW_LOADSPRITE)) {
_spriteLeft += _backDeltaX;
_spriteTop += _backDeltaY;
}
- if (_destSurface == 21) {
+ if (_destSurface == kBackSurface) {
_destSpriteX += _backDeltaX;
_destSpriteY += _backDeltaY;
if ((operation == DRAW_DRAWLINE) ||
@@ -70,7 +70,7 @@ void Draw_Fascination::spriteOperation(int16 operation) {
}
if (_renderFlags & 0x20) {
- if (_destSurface == 21 || (operation == 0 && _sourceSurface == 21)) {
+ if (_destSurface == kBackSurface || (operation == 0 && _sourceSurface == kBackSurface)) {
winDraw(operation);
return;
}
@@ -86,7 +86,7 @@ void Draw_Fascination::spriteOperation(int16 operation) {
int16 destSurface = _destSurface;
int16 sourceSurface = _sourceSurface;
- if (_vm->_video->_splitSurf && ((_destSurface == 20) || (_destSurface == 21))) {
+ if (_vm->_video->_splitSurf && ((_destSurface == kFrontSurface) || (_destSurface == kBackSurface))) {
if ((_destSpriteY >= _vm->_video->_splitStart)) {
_destSpriteY -= _vm->_video->_splitStart;
if ((operation == DRAW_DRAWLINE) ||
@@ -340,12 +340,12 @@ void Draw_Fascination::spriteOperation(int16 operation) {
}
if ((_renderFlags & RENDERFLAG_USEDELTAS) && !deltaVeto) {
- if (_sourceSurface == 21) {
+ if (_sourceSurface == kBackSurface) {
_spriteLeft -= _backDeltaX;
_spriteTop -= _backDeltaY;
}
- if (_destSurface == 21) {
+ if (_destSurface == kBackSurface) {
_destSpriteX -= _backDeltaX;
_destSpriteY -= _backDeltaY;
}
diff --git a/engines/gob/draw_playtoons.cpp b/engines/gob/draw_playtoons.cpp
index 862cdd33eb..583d13986e 100644
--- a/engines/gob/draw_playtoons.cpp
+++ b/engines/gob/draw_playtoons.cpp
@@ -53,12 +53,12 @@ void Draw_Playtoons::spriteOperation(int16 operation) {
_destSurface -= 80;
if ((_renderFlags & RENDERFLAG_USEDELTAS) && !deltaVeto) {
- if ((_sourceSurface == 21) && (operation != DRAW_LOADSPRITE)) {
+ if ((_sourceSurface == kBackSurface) && (operation != DRAW_LOADSPRITE)) {
_spriteLeft += _backDeltaX;
_spriteTop += _backDeltaY;
}
- if (_destSurface == 21) {
+ if (_destSurface == kBackSurface) {
_destSpriteX += _backDeltaX;
_destSpriteY += _backDeltaY;
if ((operation == DRAW_DRAWLINE) ||
@@ -78,7 +78,7 @@ void Draw_Playtoons::spriteOperation(int16 operation) {
int16 destSurface = _destSurface;
int16 sourceSurface = _sourceSurface;
- if (_vm->_video->_splitSurf && ((_destSurface == 20) || (_destSurface == 21))) {
+ if (_vm->_video->_splitSurf && ((_destSurface == kFrontSurface) || (_destSurface == kBackSurface))) {
if ((_destSpriteY >= _vm->_video->_splitStart)) {
_destSpriteY -= _vm->_video->_splitStart;
if ((operation == DRAW_DRAWLINE) ||
@@ -409,12 +409,12 @@ void Draw_Playtoons::spriteOperation(int16 operation) {
}
if ((_renderFlags & RENDERFLAG_USEDELTAS) && !deltaVeto) {
- if (_sourceSurface == 21) {
+ if (_sourceSurface == kBackSurface) {
_spriteLeft -= _backDeltaX;
_spriteTop -= _backDeltaY;
}
- if (_destSurface == 21) {
+ if (_destSurface == kBackSurface) {
_destSpriteX -= _backDeltaX;
_destSpriteY -= _backDeltaY;
}
diff --git a/engines/gob/draw_v1.cpp b/engines/gob/draw_v1.cpp
index 719945fd6f..1cec15ce04 100644
--- a/engines/gob/draw_v1.cpp
+++ b/engines/gob/draw_v1.cpp
@@ -184,7 +184,7 @@ void Draw_v1::printTotText(int16 id) {
_destSpriteY = destY;
_spriteRight = spriteRight;
_spriteBottom = spriteBottom;
- _destSurface = 21;
+ _destSurface = kBackSurface;
_backColor = *ptr++;
_transparency = 1;
@@ -326,12 +326,12 @@ void Draw_v1::spriteOperation(int16 operation) {
_destSurface -= 80;
if (_renderFlags & RENDERFLAG_USEDELTAS) {
- if (_sourceSurface == 21) {
+ if (_sourceSurface == kBackSurface) {
_spriteLeft += _backDeltaX;
_spriteTop += _backDeltaY;
}
- if (_destSurface == 21) {
+ if (_destSurface == kBackSurface) {
_destSpriteX += _backDeltaX;
_destSpriteY += _backDeltaY;
if ((operation == DRAW_DRAWLINE) ||
@@ -508,12 +508,12 @@ void Draw_v1::spriteOperation(int16 operation) {
}
if (_renderFlags & RENDERFLAG_USEDELTAS) {
- if (_sourceSurface == 21) {
+ if (_sourceSurface == kBackSurface) {
_spriteLeft -= _backDeltaX;
_spriteTop -= _backDeltaY;
}
- if (_destSurface == 21) {
+ if (_destSurface == kBackSurface) {
_destSpriteX -= _backDeltaX;
_destSpriteY -= _backDeltaY;
}
diff --git a/engines/gob/draw_v2.cpp b/engines/gob/draw_v2.cpp
index 985f84aaef..5d001f4b59 100644
--- a/engines/gob/draw_v2.cpp
+++ b/engines/gob/draw_v2.cpp
@@ -51,30 +51,30 @@ void Draw_v2::initScreen() {
_scrollOffsetX = 0;
_scrollOffsetY = 0;
- initSpriteSurf(21, _vm->_video->_surfWidth, _vm->_video->_surfHeight, 0);
- _backSurface = _spritesArray[21];
+ initSpriteSurf(kBackSurface, _vm->_video->_surfWidth, _vm->_video->_surfHeight, 0);
+ _backSurface = _spritesArray[kBackSurface];
_vm->_video->clearSurf(*_backSurface);
- if (!_spritesArray[23]) {
- initSpriteSurf(23, 32, 16, 2);
- _cursorSpritesBack = _spritesArray[23];
+ if (!_spritesArray[kCursorSurface]) {
+ initSpriteSurf(kCursorSurface, 32, 16, 2);
+ _cursorSpritesBack = _spritesArray[kCursorSurface];
_cursorSprites = _cursorSpritesBack;
_scummvmCursor =
_vm->_video->initSurfDesc(_vm->_global->_videoMode, 16, 16, SCUMMVM_CURSOR);
}
- _spritesArray[20] = _frontSurface;
- _spritesArray[21] = _backSurface;
+ _spritesArray[kFrontSurface] = _frontSurface;
+ _spritesArray[kBackSurface ] = _backSurface;
_vm->_video->dirtyRectsAll();
}
void Draw_v2::closeScreen() {
- //freeSprite(23);
+ //freeSprite(kCursorSurface);
//_cursorSprites = 0;
//_cursorSpritesBack = 0;
//_scummvmCursor = 0;
- freeSprite(21);
+ freeSprite(kBackSurface);
}
void Draw_v2::blitCursor() {
@@ -273,7 +273,7 @@ void Draw_v2::printTotText(int16 id) {
_destSpriteY = destY;
_spriteRight = spriteRight;
_spriteBottom = spriteBottom;
- _destSurface = 21;
+ _destSurface = kBackSurface;
_backColor = *ptr++;
_transparency = 1;
@@ -629,12 +629,12 @@ void Draw_v2::spriteOperation(int16 operation) {
_destSurface -= 80;
if ((_renderFlags & RENDERFLAG_USEDELTAS) && !deltaVeto) {
- if ((_sourceSurface == 21) && (operation != DRAW_LOADSPRITE)) {
+ if ((_sourceSurface == kBackSurface) && (operation != DRAW_LOADSPRITE)) {
_spriteLeft += _backDeltaX;
_spriteTop += _backDeltaY;
}
- if (_destSurface == 21) {
+ if (_destSurface == kBackSurface) {
_destSpriteX += _backDeltaX;
_destSpriteY += _backDeltaY;
if ((operation == DRAW_DRAWLINE) ||
@@ -654,7 +654,7 @@ void Draw_v2::spriteOperation(int16 operation) {
int16 destSurface = _destSurface;
int16 sourceSurface = _sourceSurface;
- if (_vm->_video->_splitSurf && ((_destSurface == 20) || (_destSurface == 21))) {
+ if (_vm->_video->_splitSurf && ((_destSurface == kFrontSurface) || (_destSurface == kBackSurface))) {
if ((_destSpriteY >= _vm->_video->_splitStart)) {
_destSpriteY -= _vm->_video->_splitStart;
if ((operation == DRAW_DRAWLINE) ||
@@ -908,12 +908,12 @@ void Draw_v2::spriteOperation(int16 operation) {
}
if ((_renderFlags & RENDERFLAG_USEDELTAS) && !deltaVeto) {
- if (_sourceSurface == 21) {
+ if (_sourceSurface == kBackSurface) {
_spriteLeft -= _backDeltaX;
_spriteTop -= _backDeltaY;
}
- if (_destSurface == 21) {
+ if (_destSurface == kBackSurface) {
_destSpriteX -= _backDeltaX;
_destSpriteY -= _backDeltaY;
}
diff --git a/engines/gob/game.cpp b/engines/gob/game.cpp
index ddf095a5d1..1e6f078499 100644
--- a/engines/gob/game.cpp
+++ b/engines/gob/game.cpp
@@ -286,8 +286,8 @@ void Game::playTot(int16 skipPlay) {
_vm->_mult->initAll();
_vm->_mult->zeroMultData();
- _vm->_draw->_spritesArray[20] = _vm->_draw->_frontSurface;
- _vm->_draw->_spritesArray[21] = _vm->_draw->_backSurface;
+ _vm->_draw->_spritesArray[Draw::kFrontSurface] = _vm->_draw->_frontSurface;
+ _vm->_draw->_spritesArray[Draw::kBackSurface ] = _vm->_draw->_backSurface;
_vm->_draw->_cursorSpritesBack = _vm->_draw->_cursorSprites;
} else
_vm->_inter->initControlVars(0);
@@ -397,10 +397,10 @@ void Game::capturePush(int16 left, int16 top, int16 width, int16 height) {
left &= 0xFFF0;
right |= 0xF;
- _vm->_draw->initSpriteSurf(30 + _captureCount, right - left + 1, height, 0);
+ _vm->_draw->initSpriteSurf(Draw::kCaptureSurface + _captureCount, right - left + 1, height, 0);
- _vm->_draw->_sourceSurface = 21;
- _vm->_draw->_destSurface = 30 + _captureCount;
+ _vm->_draw->_sourceSurface = Draw::kBackSurface;
+ _vm->_draw->_destSurface = Draw::kCaptureSurface + _captureCount;
_vm->_draw->_spriteLeft = left;
_vm->_draw->_spriteRight = right - left + 1;
@@ -425,13 +425,13 @@ void Game::capturePop(char doDraw) {
_captureStack[_captureCount].height();
_vm->_draw->_transparency = 0;
- _vm->_draw->_sourceSurface = 30 + _captureCount;
- _vm->_draw->_destSurface = 21;
+ _vm->_draw->_sourceSurface = Draw::kCaptureSurface + _captureCount;
+ _vm->_draw->_destSurface = Draw::kBackSurface;
_vm->_draw->_spriteLeft = _vm->_draw->_destSpriteX & 0xF;
_vm->_draw->_spriteTop = 0;
_vm->_draw->spriteOperation(0);
}
- _vm->_draw->freeSprite(30 + _captureCount);
+ _vm->_draw->freeSprite(Draw::kCaptureSurface + _captureCount);
}
void Game::freeSoundSlot(int16 slot) {
diff --git a/engines/gob/hotspots.cpp b/engines/gob/hotspots.cpp
index abdf513393..396d9f0a22 100644
--- a/engines/gob/hotspots.cpp
+++ b/engines/gob/hotspots.cpp
@@ -2082,7 +2082,7 @@ void Hotspots::getTextCursorPos(const Font &font, const char *str,
}
void Hotspots::fillRect(uint16 x, uint16 y, uint16 width, uint16 height, uint16 color) const {
- _vm->_draw->_destSurface = 21;
+ _vm->_draw->_destSurface = Draw::kBackSurface;
_vm->_draw->_destSpriteX = x;
_vm->_draw->_destSpriteY = y;
_vm->_draw->_spriteRight = width;
diff --git a/engines/gob/inter_playtoons.cpp b/engines/gob/inter_playtoons.cpp
index 142467b47f..befed4b1c2 100644
--- a/engines/gob/inter_playtoons.cpp
+++ b/engines/gob/inter_playtoons.cpp
@@ -107,7 +107,7 @@ bool Inter_Playtoons::oPlaytoons_printText(OpFuncParams &params) {
_vm->_draw->_backColor = _vm->_game->_script->readValExpr();
_vm->_draw->_frontColor = _vm->_game->_script->readValExpr();
_vm->_draw->_fontIndex = _vm->_game->_script->readValExpr();
- _vm->_draw->_destSurface = 21;
+ _vm->_draw->_destSurface = Draw::kBackSurface;
_vm->_draw->_textToPrint = buf;
_vm->_draw->_transparency = 0;
diff --git a/engines/gob/inter_v1.cpp b/engines/gob/inter_v1.cpp
index 9e841e7e68..11fe0c9c5e 100644
--- a/engines/gob/inter_v1.cpp
+++ b/engines/gob/inter_v1.cpp
@@ -328,7 +328,7 @@ void Inter_v1::o1_initCursor() {
(height != _vm->_draw->_cursorHeight) ||
(_vm->_draw->_cursorSprites->getWidth() != (width * count))) {
- _vm->_draw->freeSprite(23);
+ _vm->_draw->freeSprite(Draw::kCursorSurface);
_vm->_draw->_cursorSprites.reset();
_vm->_draw->_cursorSpritesBack.reset();
_vm->_draw->_scummvmCursor.reset();
@@ -344,9 +344,9 @@ void Inter_v1::o1_initCursor() {
if (count > 0x80)
count -= 0x80;
- _vm->_draw->initSpriteSurf(23, _vm->_draw->_cursorWidth * count,
+ _vm->_draw->initSpriteSurf(Draw::kCursorSurface, _vm->_draw->_cursorWidth * count,
_vm->_draw->_cursorHeight, 2);
- _vm->_draw->_cursorSpritesBack = _vm->_draw->_spritesArray[23];
+ _vm->_draw->_cursorSpritesBack = _vm->_draw->_spritesArray[Draw::kCursorSurface];
_vm->_draw->_cursorSprites = _vm->_draw->_cursorSpritesBack;
_vm->_draw->_scummvmCursor =
@@ -482,14 +482,14 @@ void Inter_v1::o1_initMult() {
if (_vm->_mult->_animSurf &&
((oldAnimWidth != _vm->_mult->_animWidth) ||
(oldAnimHeight != _vm->_mult->_animHeight))) {
- _vm->_draw->freeSprite(22);
+ _vm->_draw->freeSprite(Draw::kAnimSurface);
_vm->_mult->_animSurf.reset();
}
if (!_vm->_mult->_animSurf) {
- _vm->_draw->initSpriteSurf(22, _vm->_mult->_animWidth,
+ _vm->_draw->initSpriteSurf(Draw::kAnimSurface, _vm->_mult->_animWidth,
_vm->_mult->_animHeight, 0);
- _vm->_mult->_animSurf = _vm->_draw->_spritesArray[22];
+ _vm->_mult->_animSurf = _vm->_draw->_spritesArray[Draw::kAnimSurface];
}
_vm->_video->drawSprite(*_vm->_draw->_backSurface, *_vm->_mult->_animSurf,
@@ -922,7 +922,7 @@ bool Inter_v1::o1_printText(OpFuncParams &params) {
_vm->_draw->_backColor = _vm->_game->_script->readValExpr();
_vm->_draw->_frontColor = _vm->_game->_script->readValExpr();
_vm->_draw->_fontIndex = _vm->_game->_script->readValExpr();
- _vm->_draw->_destSurface = 21;
+ _vm->_draw->_destSurface = Draw::kBackSurface;
_vm->_draw->_textToPrint = buf;
_vm->_draw->_transparency = 0;
diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp
index 72764eec8d..ffca639cc4 100644
--- a/engines/gob/inter_v2.cpp
+++ b/engines/gob/inter_v2.cpp
@@ -360,24 +360,24 @@ void Inter_v2::o2_initMult() {
if (_vm->_mult->_animSurf &&
((oldAnimWidth != _vm->_mult->_animWidth) ||
(oldAnimHeight != _vm->_mult->_animHeight))) {
- _vm->_draw->freeSprite(22);
+ _vm->_draw->freeSprite(Draw::kAnimSurface);
_vm->_mult->_animSurf.reset();
}
_vm->_draw->adjustCoords(0,
&_vm->_mult->_animWidth, &_vm->_mult->_animHeight);
if (!_vm->_mult->_animSurf) {
- _vm->_draw->initSpriteSurf(22, _vm->_mult->_animWidth,
+ _vm->_draw->initSpriteSurf(Draw::kAnimSurface, _vm->_mult->_animWidth,
_vm->_mult->_animHeight, 0);
- _vm->_mult->_animSurf = _vm->_draw->_spritesArray[22];
+ _vm->_mult->_animSurf = _vm->_draw->_spritesArray[Draw::kAnimSurface];
if (_terminate)
return;
}
_vm->_draw->adjustCoords(1,
&_vm->_mult->_animWidth, &_vm->_mult->_animHeight);
- _vm->_draw->_sourceSurface = 21;
- _vm->_draw->_destSurface = 22;
+ _vm->_draw->_sourceSurface = Draw::kBackSurface;
+ _vm->_draw->_destSurface = Draw::kAnimSurface;
_vm->_draw->_spriteLeft = _vm->_mult->_animLeft;
_vm->_draw->_spriteTop = _vm->_mult->_animTop;
_vm->_draw->_spriteRight = _vm->_mult->_animWidth;
@@ -1106,7 +1106,7 @@ bool Inter_v2::o2_printText(OpFuncParams &params) {
_vm->_draw->_backColor = _vm->_game->_script->readValExpr();
_vm->_draw->_frontColor = _vm->_game->_script->readValExpr();
_vm->_draw->_fontIndex = _vm->_game->_script->readValExpr();
- _vm->_draw->_destSurface = 21;
+ _vm->_draw->_destSurface = Draw::kBackSurface;
_vm->_draw->_textToPrint = buf;
_vm->_draw->_transparency = 0;
diff --git a/engines/gob/inter_v3.cpp b/engines/gob/inter_v3.cpp
index beace1b7d8..10ed23619d 100644
--- a/engines/gob/inter_v3.cpp
+++ b/engines/gob/inter_v3.cpp
@@ -253,8 +253,8 @@ bool Inter_v3::o3_copySprite(OpFuncParams &params) {
o1_copySprite(params);
// For the close-up "fading" in the CD version
- if (_vm->_draw->_destSurface == 20)
- _vm->_video->sparseRetrace(20);
+ if (_vm->_draw->_destSurface == Draw::kFrontSurface)
+ _vm->_video->sparseRetrace(Draw::kFrontSurface);
return false;
}
diff --git a/engines/gob/mult.cpp b/engines/gob/mult.cpp
index 327b3ed1bd..667cd0d758 100644
--- a/engines/gob/mult.cpp
+++ b/engines/gob/mult.cpp
@@ -146,7 +146,7 @@ void Mult::freeMult() {
_orderArray = 0;
_animSurf.reset();
- _vm->_draw->freeSprite(22);
+ _vm->_draw->freeSprite(Draw::kAnimSurface);
}
void Mult::checkFreeMult() {
@@ -238,7 +238,7 @@ void Mult::playMult(int16 startFrame, int16 endFrame, char checkEscape,
_orderArray = 0;
_animSurf.reset();
- _vm->_draw->freeSprite(22);
+ _vm->_draw->freeSprite(Draw::kAnimSurface);
_animDataAllocated = false;
}
diff --git a/engines/gob/mult_v1.cpp b/engines/gob/mult_v1.cpp
index 1bb162c789..84869066e1 100644
--- a/engines/gob/mult_v1.cpp
+++ b/engines/gob/mult_v1.cpp
@@ -236,7 +236,7 @@ void Mult_v1::freeMultKeys() {
_animArrayData = 0;
_animSurf.reset();
- _vm->_draw->freeSprite(22);
+ _vm->_draw->freeSprite(Draw::kAnimSurface);
_animDataAllocated = false;
}
@@ -318,7 +318,7 @@ void Mult_v1::playMultInit() {
_animSurf = _vm->_video->initSurfDesc(_vm->_global->_videoMode,
320, 200, 0);
- _vm->_draw->_spritesArray[22] = _animSurf;
+ _vm->_draw->_spritesArray[Draw::kAnimSurface] = _animSurf;
_vm->_video->drawSprite(*_vm->_draw->_backSurface,
*_animSurf, 0, 0, 319, 199, 0, 0, 0);
@@ -579,8 +579,8 @@ void Mult_v1::animate() {
if ((pNeedRedraw[i] == 0) || (_objects[i].lastLeft == -1))
continue;
- _vm->_draw->_sourceSurface = 22;
- _vm->_draw->_destSurface = 21;
+ _vm->_draw->_sourceSurface = Draw::kAnimSurface;
+ _vm->_draw->_destSurface = Draw::kBackSurface;
_vm->_draw->_spriteLeft = pDirtyLefts[i] - _animLeft;
_vm->_draw->_spriteTop = pDirtyTops[i] - _animTop;
_vm->_draw->_spriteRight = pDirtyRights[i] - pDirtyLefts[i] + 1;
diff --git a/engines/gob/mult_v2.cpp b/engines/gob/mult_v2.cpp
index 6dcc01f836..9faf446a5b 100644
--- a/engines/gob/mult_v2.cpp
+++ b/engines/gob/mult_v2.cpp
@@ -579,11 +579,11 @@ void Mult_v2::playMultInit() {
width = _animWidth;
height = _animHeight;
_vm->_draw->adjustCoords(0, &width, &height);
- _vm->_draw->initSpriteSurf(22, width, height, 0);
- _animSurf = _vm->_draw->_spritesArray[22];
+ _vm->_draw->initSpriteSurf(Draw::kAnimSurface, width, height, 0);
+ _animSurf = _vm->_draw->_spritesArray[Draw::kAnimSurface];
- _vm->_video->drawSprite(*_vm->_draw->_spritesArray[21],
- *_vm->_draw->_spritesArray[22], 0, 0,
+ _vm->_video->drawSprite(*_vm->_draw->_spritesArray[Draw::kBackSurface],
+ *_vm->_draw->_spritesArray[Draw::kAnimSurface], 0, 0,
_vm->_video->_surfWidth, _vm->_video->_surfHeight, 0, 0, 0);
for (_counter = 0; _counter < _objCount; _counter++)
@@ -633,14 +633,14 @@ void Mult_v2::drawStatics(bool &stop) {
READ_LE_UINT16(_multData->execPtr + layer * 2);
_vm->_draw->_destSpriteX = 0;
_vm->_draw->_destSpriteY = 0;
- _vm->_draw->_destSurface = 21;
+ _vm->_draw->_destSurface = Draw::kBackSurface;
_vm->_draw->_transparency = 0;
_vm->_draw->spriteOperation(DRAW_LOADSPRITE);
_vm->_scenery->_curStatic = -1;
}
- _vm->_video->drawSprite(*_vm->_draw->_spritesArray[21],
- *_vm->_draw->_spritesArray[22], 0, 0,
+ _vm->_video->drawSprite(*_vm->_draw->_spritesArray[Draw::kBackSurface],
+ *_vm->_draw->_spritesArray[Draw::kAnimSurface], 0, 0,
_vm->_video->_surfWidth, _vm->_video->_surfHeight, 0, 0, 0);
}
}
@@ -937,8 +937,8 @@ void Mult_v2::animate() {
if ((right <= 0) || (bottom <= 0))
continue;
- _vm->_draw->_sourceSurface = 22;
- _vm->_draw->_destSurface = 21;
+ _vm->_draw->_sourceSurface = Draw::kAnimSurface;
+ _vm->_draw->_destSurface = Draw::kBackSurface;
_vm->_draw->_spriteLeft = maxleft - _animLeft;
_vm->_draw->_spriteTop = maxtop - _animTop;
_vm->_draw->_spriteRight = right;
diff --git a/engines/gob/scenery.cpp b/engines/gob/scenery.cpp
index edd2051f1a..89adffc5ea 100644
--- a/engines/gob/scenery.cpp
+++ b/engines/gob/scenery.cpp
@@ -261,10 +261,10 @@ void Scenery::renderStatic(int16 scenery, int16 layer) {
_vm->_draw->_spriteLeft = layerPtr->backResId;
if (_vm->_draw->_spriteLeft != -1) {
- _vm->_draw->_destSpriteX = 0;
- _vm->_draw->_destSpriteY = 0;
- _vm->_draw->_destSurface = 21;
- _vm->_draw->_transparency = 0;
+ _vm->_draw->_destSpriteX = 0;
+ _vm->_draw->_destSpriteY = 0;
+ _vm->_draw->_destSurface = Draw::kBackSurface;
+ _vm->_draw->_transparency = 0;
_vm->_draw->spriteOperation(DRAW_LOADSPRITE);
}
@@ -295,7 +295,7 @@ void Scenery::renderStatic(int16 scenery, int16 layer) {
_vm->_draw->_sourceSurface =
_staticPictToSprite[scenery * 7 + pictIndex];
- _vm->_draw->_destSurface = 21;
+ _vm->_draw->_destSurface = Draw::kBackSurface;
_vm->_draw->_spriteLeft = left;
_vm->_draw->_spriteTop = top;
_vm->_draw->_spriteRight = right - left + 1;
@@ -392,7 +392,7 @@ void Scenery::updateStatic(int16 orderFrom, byte index, byte layer) {
_vm->_draw->_sourceSurface =
_staticPictToSprite[index * 7 + pictIndex];
- _vm->_draw->_destSurface = 21;
+ _vm->_draw->_destSurface = Draw::kBackSurface;
_vm->_draw->_transparency = planePtr->transp ? 3 : 0;
_vm->_draw->spriteOperation(DRAW_BLITSURF);
}
@@ -880,7 +880,7 @@ void Scenery::updateAnim(int16 layer, int16 frame, int16 animation, int16 flags,
if (doDraw) {
_vm->_draw->_sourceSurface =
_animPictToSprite[animation * 7 + pictIndex];
- _vm->_draw->_destSurface = 21;
+ _vm->_draw->_destSurface = Draw::kBackSurface;
_vm->_draw->_spriteLeft = left;
_vm->_draw->_spriteTop = top;
diff --git a/engines/gob/videoplayer.cpp b/engines/gob/videoplayer.cpp
index bdab7fcac1..50cb64dfad 100644
--- a/engines/gob/videoplayer.cpp
+++ b/engines/gob/videoplayer.cpp
@@ -38,7 +38,7 @@
namespace Gob {
-VideoPlayer::Properties::Properties() : type(kVideoTypeTry), sprite(20),
+VideoPlayer::Properties::Properties() : type(kVideoTypeTry), sprite(Draw::kFrontSurface),
x(-1), y(-1), width(-1), height(-1), flags(kFlagFrontSurface),
startFrame(-1), lastFrame(-1), breakKey(kShortKeyEscape),
palCmd(8), palStart(0), palEnd(255), palFrame(-1), fade(false) {
@@ -418,7 +418,7 @@ bool VideoPlayer::primaryOpen(const char *videoFile, int16 x, int16 y,
_vm->_draw->_spritesArray[0] = surf;
} else {
_backSurf = ((flags & kFlagFrontSurface) == 0);
- surf = _vm->_draw->_spritesArray[_backSurf ? 21 : 20];
+ surf = _vm->_draw->_spritesArray[_backSurf ? Draw::kBackSurface : Draw::kFrontSurface];
}
/*