diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/gob/draw.cpp | 98 | ||||
-rw-r--r-- | engines/gob/draw.h | 8 | ||||
-rw-r--r-- | engines/gob/inter.h | 3 | ||||
-rw-r--r-- | engines/gob/inter_v1.cpp | 72 | ||||
-rw-r--r-- | engines/gob/inter_v2.cpp | 140 | ||||
-rw-r--r-- | engines/gob/mult.cpp | 69 | ||||
-rw-r--r-- | engines/gob/mult.h | 1 | ||||
-rw-r--r-- | engines/gob/scenery.cpp | 5 | ||||
-rw-r--r-- | engines/gob/scenery.h | 1 | ||||
-rw-r--r-- | engines/gob/video.cpp | 2 |
10 files changed, 317 insertions, 82 deletions
diff --git a/engines/gob/draw.cpp b/engines/gob/draw.cpp index f0e09a96ae..62213b607e 100644 --- a/engines/gob/draw.cpp +++ b/engines/gob/draw.cpp @@ -60,8 +60,13 @@ Draw::Draw(GobEngine *vm) : _vm(vm) { _textToPrint = 0; _transparency = 0; - for (i = 0; i < 50; i++) + for (i = 0; i < 50; i++) { _spritesArray[i] = 0; + _sprites1[i] = 0; + _sprites2[i] = 0; + _sprites3[i] = 0; + _spritesWidths[i] = 0; + } _invalidatedCount = 0; for (i = 0; i < 30; i++) { @@ -871,4 +876,95 @@ void Draw::printText(void) { } } +void Draw::freeSprite(int16 index) { + // .-- sub_CD84 --- + if (_spritesArray[index] == 0) + return; + _vm->_video->freeSurfDesc(_spritesArray[index]); + +// warning("GOB2 Stub! freeSprite: dword_2EFB4, dword_2EFB8, dword_2EFBC"); + + if (_sprites1[index] != 0) + _vm->_video->freeSurfDesc(_sprites1[index]); + if (_sprites2[index] != 0) + _vm->_video->freeSurfDesc(_sprites2[index]); + if (_sprites3[index] != 0) + _vm->_video->freeSurfDesc(_sprites3[index]); + + // '------ + + _spritesArray[index] = 0; +} + +void Draw::adjustCoords(int16 *coord1, int16 *coord2, char adjust) { + warning("GOB2 Stub! if (word_2E8E2 == 2) return;"); + if (adjust == 0) { + if (coord2 != 0) + *coord2 *= 2; + if (coord1 != 0) + *coord2 *= 2; + } + else if (adjust == 1) { + if (coord2 != 0) + *coord2 = (signed) ((unsigned) (*coord2 + 1) / 2); + if (coord1 != 0) + *coord1 = (signed) ((unsigned) (*coord1 + 1) / 2); + } + else if (adjust == 2) { + if (coord2 != 0) + *coord2 = *coord2 * 2 + 1; + if (coord1 != 0) + *coord1 = *coord1 * 2 + 1; + } +} + +// sub_EDFC(0x16, _anim_animAreaWidth, _anim_animAreaHeight, 0); +void Draw::initBigSprite(int16 index, int16 height, int16 width, int16 flags) { + int16 realwidth; + int16 widthdiff; + Gob::Video::SurfaceDesc **fragment; + + if (flags != 0) + flags = 2; + + // .-- sub_CBD0 --- + + _sprites1[index] = 0; + _sprites2[index] = 0; + _sprites3[index] = 0; + _spritesWidths[index] = width; + + if (_vm->_video->getRectSize(width, height, flags, _vm->_global->_videoMode) > 6500) { + _spritesWidths[index] = width & 0xFFFE; + while (_vm->_video->getRectSize(_spritesWidths[index], + height, flags, _vm->_global->_videoMode) > 6500) + _spritesWidths[index] -= 2; + + realwidth = _spritesWidths[index]; + _spritesArray[index] = + _vm->_video->initSurfDesc(realwidth, height, flags, _vm->_global->_videoMode); + + fragment = _sprites1 + index; + while (realwidth < width) { + widthdiff = width - realwidth; + if (_spritesWidths[index] >= widthdiff) { + *fragment = _vm->_video->initSurfDesc(widthdiff, height, flags, _vm->_global->_videoMode); + realwidth = width; + } + else { + *fragment = _vm->_video->initSurfDesc(_spritesWidths[index], height, + flags, _vm->_global->_videoMode); + realwidth += _spritesWidths[index]; + } + _vm->_video->clearSurf(*fragment++); + } + } else + _spritesArray[index] = + _vm->_video->initSurfDesc(width, height, flags, _vm->_global->_videoMode); + + _vm->_video->clearSurf(_spritesArray[index]); + + // '------ +} + } // End of namespace Gob diff --git a/engines/gob/draw.h b/engines/gob/draw.h index 77fcd3f349..1364c90a07 100644 --- a/engines/gob/draw.h +++ b/engines/gob/draw.h @@ -62,6 +62,10 @@ public: char *_textToPrint; int16 _transparency; Video::SurfaceDesc *_spritesArray[50]; + Video::SurfaceDesc *_sprites1[50]; + Video::SurfaceDesc *_sprites2[50]; + Video::SurfaceDesc *_sprites3[50]; + uint16 _spritesWidths[50]; int16 _invalidatedCount; int16 _invalidatedTops[30]; @@ -114,6 +118,10 @@ public: void animateCursor(int16 cursor); void printText(void); + void freeSprite(int16 index); + void adjustCoords(int16 *coord1, int16 *coord2, char adjust); + void initBigSprite(int16 index, int16 height, int16 width, int16 flags); + Draw(GobEngine *vm); protected: diff --git a/engines/gob/inter.h b/engines/gob/inter.h index ed55dfbcc3..7649e73984 100644 --- a/engines/gob/inter.h +++ b/engines/gob/inter.h @@ -306,6 +306,9 @@ protected: bool o2_palLoad(char &cmdCount, int16 &counter, int16 &retFlag); void o2_setRenderFlags(void); bool o2_loadTot(char &cmdCount, int16 &counter, int16 &retFlag); + void o2_initMult(void); + bool o2_freeSprite(char &cmdCount, int16 &counter, int16 &retFlag); + void o2_loadCurLayer(void); }; } // End of namespace Gob diff --git a/engines/gob/inter_v1.cpp b/engines/gob/inter_v1.cpp index 747a852c19..6f541986a5 100644 --- a/engines/gob/inter_v1.cpp +++ b/engines/gob/inter_v1.cpp @@ -34,6 +34,7 @@ #include "gob/music.h" #include "gob/map.h" #include "gob/palanim.h" +#include "gob/anim.h" namespace Gob { @@ -1480,7 +1481,73 @@ void Inter_v1::o1_updateAnim(void) { } void Inter_v1::o1_initMult(void) { - _vm->_mult->interInitMult(); + int16 oldAnimHeight; + int16 oldAnimWidth; + int16 oldObjCount; + int16 i; + int16 posXVar; + int16 posYVar; + int16 animDataVar; + + oldAnimWidth = _vm->_anim->_areaWidth; + oldAnimHeight = _vm->_anim->_areaHeight; + oldObjCount = _vm->_mult->_objCount; + + _vm->_anim->_areaLeft = load16(); + _vm->_anim->_areaTop = load16(); + _vm->_anim->_areaWidth = load16(); + _vm->_anim->_areaHeight = load16(); + _vm->_mult->_objCount = load16(); + posXVar = _vm->_parse->parseVarIndex(); + posYVar = _vm->_parse->parseVarIndex(); + animDataVar = _vm->_parse->parseVarIndex(); + + if (_vm->_mult->_objects == 0) { + _vm->_mult->_renderData = new int16[_vm->_mult->_objCount * 9]; + _vm->_mult->_objects = new Mult::Mult_Object[_vm->_mult->_objCount]; + + for (i = 0; i < _vm->_mult->_objCount; i++) { + _vm->_mult->_objects[i].pPosX = (int32 *)(_vm->_global->_inter_variables + i * 4 + (posXVar / 4) * 4); + _vm->_mult->_objects[i].pPosY = (int32 *)(_vm->_global->_inter_variables + i * 4 + (posYVar / 4) * 4); + _vm->_mult->_objects[i].pAnimData = + (Mult::Mult_AnimData *) (_vm->_global->_inter_variables + animDataVar + + i * 4 * _vm->_global->_inter_animDataSize); + + _vm->_mult->_objects[i].pAnimData->isStatic = 1; + _vm->_mult->_objects[i].tick = 0; + _vm->_mult->_objects[i].lastLeft = -1; + _vm->_mult->_objects[i].lastRight = -1; + _vm->_mult->_objects[i].lastTop = -1; + _vm->_mult->_objects[i].lastBottom = -1; + } + } else if (oldObjCount != _vm->_mult->_objCount) { + error("o1_initMult: Object count changed, but storage didn't (old count = %d, new count = %d)", + oldObjCount, _vm->_mult->_objCount); + } + + if (_vm->_anim->_animSurf != 0 && + (oldAnimWidth != _vm->_anim->_areaWidth + || oldAnimHeight != _vm->_anim->_areaHeight)) { + _vm->_video->freeSurfDesc(_vm->_anim->_animSurf); + _vm->_anim->_animSurf = 0; + } + + if (_vm->_anim->_animSurf == 0) { + _vm->_anim->_animSurf = _vm->_video->initSurfDesc(_vm->_global->_videoMode, + _vm->_anim->_areaWidth, _vm->_anim->_areaHeight, 0); + + _vm->_draw->_spritesArray[22] = _vm->_anim->_animSurf; + } + + _vm->_video->drawSprite(_vm->_draw->_backSurface, _vm->_anim->_animSurf, + _vm->_anim->_areaLeft, _vm->_anim->_areaTop, + _vm->_anim->_areaLeft + _vm->_anim->_areaWidth - 1, + _vm->_anim->_areaTop + _vm->_anim->_areaHeight - 1, 0, 0, 0); + + debug(4, "o1_initMult: x = %d, y = %d, w = %d, h = %d", + _vm->_anim->_areaLeft, _vm->_anim->_areaTop, _vm->_anim->_areaWidth, _vm->_anim->_areaHeight); + debug(4, " _vm->_mult->_objCount = %d, animation data size = %d", _vm->_mult->_objCount, _vm->_global->_inter_animDataSize); +// _vm->_mult->interInitMult(); } void Inter_v1::o1_multFreeMult(void) { @@ -1516,7 +1583,8 @@ void Inter_v1::o1_renderStatic(void) { } void Inter_v1::o1_loadCurLayer(void) { - _vm->_scenery->interLoadCurLayer(); + evalExpr(&_vm->_scenery->_curStatic); + evalExpr(&_vm->_scenery->_curStaticLayer); } void Inter_v1::o1_playCDTrack(void) { diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp index 672a662670..42079d4e6f 100644 --- a/engines/gob/inter_v2.cpp +++ b/engines/gob/inter_v2.cpp @@ -32,6 +32,7 @@ #include "gob/goblin.h" #include "gob/cdrom.h" #include "gob/palanim.h" +#include "gob/anim.h" namespace Gob { @@ -143,7 +144,7 @@ void Inter_v2::setupOpcodes(void) { OPCODE(o1_updateAnim), OPCODE(o2_drawStub), /* 14 */ - OPCODE(o1_initMult), + OPCODE(o2_initMult), OPCODE(o1_multFreeMult), OPCODE(o1_animate), OPCODE(o1_multLoadMult), @@ -154,7 +155,7 @@ void Inter_v2::setupOpcodes(void) { OPCODE(o1_freeStatic), /* 1C */ OPCODE(o1_renderStatic), - OPCODE(o1_loadCurLayer), + OPCODE(o2_loadCurLayer), {NULL, ""}, {NULL, ""}, /* 20 */ @@ -489,7 +490,7 @@ void Inter_v2::setupOpcodes(void) { OPCODE(o1_putPixel), OPCODE(o1_goblinFunc), OPCODE(o1_createSprite), - OPCODE(o1_freeSprite), + OPCODE(o2_freeSprite), /* 28 */ {NULL, ""}, {NULL, ""}, @@ -994,4 +995,137 @@ bool Inter_v2::o2_loadTot(char &cmdCount, int16 &counter, int16 &retFlag) { return false; } +void Inter_v2::o2_initMult(void) { + int16 oldAnimHeight; + int16 oldAnimWidth; + int16 oldObjCount; + int16 i; + int16 posXVar; + int16 posYVar; + int16 animDataVar; + + oldAnimWidth = _vm->_anim->_areaWidth; + oldAnimHeight = _vm->_anim->_areaHeight; + oldObjCount = _vm->_mult->_objCount; + + _vm->_anim->_areaLeft = load16(); + _vm->_anim->_areaTop = load16(); + _vm->_anim->_areaWidth = load16(); + _vm->_anim->_areaHeight = load16(); + _vm->_mult->_objCount = load16(); + posXVar = _vm->_parse->parseVarIndex(); + posYVar = _vm->_parse->parseVarIndex(); + animDataVar = _vm->_parse->parseVarIndex(); + + if (_vm->_mult->_objects == 0) { + // GOB2: _vm->_mult->_renderData = new int16[_vm->_mult->_objCount * 2]; + _vm->_mult->_renderData = new int16[_vm->_mult->_objCount * 9]; + if (_vm->_inter->_terminate) + return; + warning("GOB2 Stub! dword_2FC74 = new int8[_vm->_mult->_objCount];"); + _vm->_mult->_objects = new Mult::Mult_Object[_vm->_mult->_objCount]; + + for (i = 0; i < _vm->_mult->_objCount; i++) { + _vm->_mult->_objects[i].pPosX = (int32 *)(_vm->_global->_inter_variables + i * 4 + (posXVar / 4) * 4); + _vm->_mult->_objects[i].pPosY = (int32 *)(_vm->_global->_inter_variables + i * 4 + (posYVar / 4) * 4); + _vm->_mult->_objects[i].pAnimData = + (Mult::Mult_AnimData *) (_vm->_global->_inter_variables + animDataVar + + i * 4 * _vm->_global->_inter_animDataSize); + + _vm->_mult->_objects[i].pAnimData->isStatic = 1; + _vm->_mult->_objects[i].tick = 0; + _vm->_mult->_objects[i].lastLeft = -1; + _vm->_mult->_objects[i].lastRight = -1; + _vm->_mult->_objects[i].lastTop = -1; + _vm->_mult->_objects[i].lastBottom = -1; + } + } else if (oldObjCount != _vm->_mult->_objCount) { + error("o2_initMult: Object count changed, but storage didn't (old count = %d, new count = %d)", + oldObjCount, _vm->_mult->_objCount); + } + + if (_vm->_anim->_animSurf != 0 && + (oldAnimWidth != _vm->_anim->_areaWidth + || oldAnimHeight != _vm->_anim->_areaHeight)) { + if (_vm->_anim->_animSurf->flag & 0x80) + delete _vm->_anim->_animSurf; + else + _vm->_draw->freeSprite(0x16); + } + + _vm->_draw->adjustCoords(&_vm->_anim->_areaHeight, &_vm->_anim->_areaWidth, 0); + + warning("===> %d", _vm->_global->_videoMode); + if (_vm->_anim->_animSurf == 0) { + if (_vm->_global->_videoMode == 18) { + _vm->_anim->_animSurf = new Video::SurfaceDesc; + memcpy(_vm->_anim->_animSurf, _vm->_draw->_frontSurface, sizeof(Video::SurfaceDesc)); + _vm->_anim->_animSurf->width = (_vm->_anim->_areaLeft + _vm->_anim->_areaWidth - 1) | 7; + _vm->_anim->_animSurf->width -= (_vm->_anim->_areaLeft & 0x0FF8) - 1; + _vm->_anim->_animSurf->height = _vm->_anim->_areaHeight; + _vm->_anim->_animSurf->vidPtr += 0x0C000; + } else { + if (_vm->_global->_videoMode == 20) { + if (((_vm->_draw->_backSurface->width * _vm->_draw->_backSurface->height) / 2 + + (_vm->_anim->_areaWidth * _vm->_anim->_areaHeight) / 4) < 65536) { + _vm->_anim->_animSurf = new Video::SurfaceDesc; + memcpy(_vm->_anim->_animSurf, _vm->_draw->_frontSurface, sizeof(Video::SurfaceDesc)); + _vm->_anim->_animSurf->width = (_vm->_anim->_areaLeft + _vm->_anim->_areaWidth - 1) | 7; + _vm->_anim->_animSurf->width -= (_vm->_anim->_areaLeft & 0x0FF8) - 1; + _vm->_anim->_animSurf->height = _vm->_anim->_areaHeight; + _vm->_anim->_animSurf->vidPtr = _vm->_draw->_backSurface->vidPtr + + _vm->_draw->_backSurface->width * _vm->_draw->_backSurface->height / 4; + } else + _vm->_draw->initBigSprite(0x16, _vm->_anim->_areaWidth, _vm->_anim->_areaHeight, 0); + } else + _vm->_draw->initBigSprite(0x16, _vm->_anim->_areaWidth, _vm->_anim->_areaHeight, 0); + } + if (_terminate) + return; + +/* _vm->_anim->_animSurf = _vm->_video->initSurfDesc(_vm->_global->_videoMode, + _vm->_anim->_areaWidth, _vm->_anim->_areaHeight, 0); + + _vm->_draw->_spritesArray[22] = _vm->_anim->_animSurf;*/ + } + + _vm->_draw->adjustCoords(&_vm->_anim->_areaHeight, &_vm->_anim->_areaWidth, 1); + +/* _vm->_video->drawSprite(_vm->_draw->_backSurface, _vm->_anim->_animSurf, + _vm->_anim->_areaLeft, _vm->_anim->_areaTop, + _vm->_anim->_areaLeft + _vm->_anim->_areaWidth - 1, + _vm->_anim->_areaTop + _vm->_anim->_areaHeight - 1, 0, 0, 0);*/ + + _vm->_draw->_sourceSurface = 21; + _vm->_draw->_destSurface = 22; + _vm->_draw->_spriteLeft = _vm->_anim->_areaLeft; + _vm->_draw->_spriteTop = _vm->_anim->_areaTop; + _vm->_draw->_spriteRight = _vm->_anim->_areaWidth; + _vm->_draw->_spriteBottom = _vm->_anim->_areaHeight; + _vm->_draw->_destSpriteX = 0; + _vm->_draw->_destSpriteY = 0; + _vm->_draw->spriteOperation(0); + + debug(4, "o2_initMult: x = %d, y = %d, w = %d, h = %d", + _vm->_anim->_areaLeft, _vm->_anim->_areaTop, _vm->_anim->_areaWidth, _vm->_anim->_areaHeight); + debug(4, " _vm->_mult->_objCount = %d, animation data size = %d", _vm->_mult->_objCount, _vm->_global->_inter_animDataSize); +} + +bool Inter_v2::o2_freeSprite(char &cmdCount, int16 &counter, int16 &retFlag) { + int16 index; + + index = load16(); + if (_vm->_draw->_spritesArray[index] == 0) + return false; + + _vm->_draw->freeSprite(index); + + return false; +} + +void Inter_v2::o2_loadCurLayer(void) { + _vm->_scenery->_curStatic = _vm->_parse->parseValExpr(); + _vm->_scenery->_curStaticLayer = _vm->_parse->parseValExpr(); +} + } // End of namespace Gob diff --git a/engines/gob/mult.cpp b/engines/gob/mult.cpp index 96bffa80d1..25e8a15079 100644 --- a/engines/gob/mult.cpp +++ b/engines/gob/mult.cpp @@ -416,75 +416,6 @@ void Mult::interGetObjAnimSize(void) { WRITE_VAR_OFFSET(_vm->_parse->parseVarIndex(), _vm->_scenery->_toRedrawBottom); } -void Mult::interInitMult(void) { - int16 oldAnimHeight; - int16 oldAnimWidth; - int16 oldObjCount; - int16 i; - int16 posXVar; - int16 posYVar; - int16 animDataVar; - - oldAnimWidth = _vm->_anim->_areaWidth; - oldAnimHeight = _vm->_anim->_areaHeight; - oldObjCount = _objCount; - - _vm->_anim->_areaLeft = _vm->_inter->load16(); - _vm->_anim->_areaTop = _vm->_inter->load16(); - _vm->_anim->_areaWidth = _vm->_inter->load16(); - _vm->_anim->_areaHeight = _vm->_inter->load16(); - _objCount = _vm->_inter->load16(); - posXVar = _vm->_parse->parseVarIndex(); - posYVar = _vm->_parse->parseVarIndex(); - animDataVar = _vm->_parse->parseVarIndex(); - - if (_objects == 0) { - _renderData = new int16[_objCount * 9]; - _objects = new Mult_Object[_objCount]; - - for (i = 0; i < _objCount; i++) { - _objects[i].pPosX = (int32 *)(_vm->_global->_inter_variables + i * 4 + (posXVar / 4) * 4); - _objects[i].pPosY = (int32 *)(_vm->_global->_inter_variables + i * 4 + (posYVar / 4) * 4); - _objects[i].pAnimData = - (Mult_AnimData *) (_vm->_global->_inter_variables + animDataVar + - i * 4 * _vm->_global->_inter_animDataSize); - - _objects[i].pAnimData->isStatic = 1; - _objects[i].tick = 0; - _objects[i].lastLeft = -1; - _objects[i].lastRight = -1; - _objects[i].lastTop = -1; - _objects[i].lastBottom = -1; - } - } else if (oldObjCount != _objCount) { - error("interInitMult: Object count changed, but storage didn't (old count = %d, new count = %d)", - oldObjCount, _objCount); - } - - if (_vm->_anim->_animSurf != 0 && - (oldAnimWidth != _vm->_anim->_areaWidth - || oldAnimHeight != _vm->_anim->_areaHeight)) { - _vm->_video->freeSurfDesc(_vm->_anim->_animSurf); - _vm->_anim->_animSurf = 0; - } - - if (_vm->_anim->_animSurf == 0) { - _vm->_anim->_animSurf = _vm->_video->initSurfDesc(_vm->_global->_videoMode, - _vm->_anim->_areaWidth, _vm->_anim->_areaHeight, 0); - - _vm->_draw->_spritesArray[22] = _vm->_anim->_animSurf; - } - - _vm->_video->drawSprite(_vm->_draw->_backSurface, _vm->_anim->_animSurf, - _vm->_anim->_areaLeft, _vm->_anim->_areaTop, - _vm->_anim->_areaLeft + _vm->_anim->_areaWidth - 1, - _vm->_anim->_areaTop + _vm->_anim->_areaHeight - 1, 0, 0, 0); - - debug(4, "interInitMult: x = %d, y = %d, w = %d, h = %d", - _vm->_anim->_areaLeft, _vm->_anim->_areaTop, _vm->_anim->_areaWidth, _vm->_anim->_areaHeight); - debug(4, " _objCount = %d, animation data size = %d", _objCount, _vm->_global->_inter_animDataSize); -} - void Mult::freeMult(void) { if (_vm->_anim->_animSurf != 0) _vm->_video->freeSurfDesc(_vm->_anim->_animSurf); diff --git a/engines/gob/mult.h b/engines/gob/mult.h index 992c01cba3..5fa84a04c3 100644 --- a/engines/gob/mult.h +++ b/engines/gob/mult.h @@ -180,7 +180,6 @@ public: char handleMouse); void animate(void); void interGetObjAnimSize(void); - void interInitMult(void); void freeMult(void); void interLoadMult(void); void freeAll(void); diff --git a/engines/gob/scenery.cpp b/engines/gob/scenery.cpp index 6061e75272..917c1995c5 100644 --- a/engines/gob/scenery.cpp +++ b/engines/gob/scenery.cpp @@ -290,11 +290,6 @@ void Scenery::interRenderStatic(void) { renderStatic(index, layer); } -void Scenery::interLoadCurLayer(void) { - _vm->_inter->evalExpr(&_curStatic); - _vm->_inter->evalExpr(&_curStaticLayer); -} - void Scenery::updateStatic(int16 orderFrom) { StaticLayer *layerPtr; PieceDesc **pictPtr; diff --git a/engines/gob/scenery.h b/engines/gob/scenery.h index 119055f7bd..ce5a953399 100644 --- a/engines/gob/scenery.h +++ b/engines/gob/scenery.h @@ -128,7 +128,6 @@ public: void freeStatic(int16 index); void renderStatic(int16 scenery, int16 layer); void interRenderStatic(void); - void interLoadCurLayer(void); void updateStatic(int16 orderFrom); int16 loadAnim(char search); void updateAnim(int16 layer, int16 frame, int16 animation, int16 flags, diff --git a/engines/gob/video.cpp b/engines/gob/video.cpp index 83259c068d..1b52918a5b 100644 --- a/engines/gob/video.cpp +++ b/engines/gob/video.cpp @@ -151,6 +151,8 @@ Video::SurfaceDesc *Video::initSurfDesc(int16 vidMode, int16 width, int16 height void Video::freeSurfDesc(SurfaceDesc * surfDesc) { delete[] surfDesc->vidPtr; + // GOB2: surfDesc != _vm->_draw->_frontSurface (since _frontSurface is set + // to _pPrimarySurfDesc in Game::prepareStart(), is there a difference?) if (surfDesc != _vm->_global->_pPrimarySurfDesc) { _vm->_global->_sprAllocated--; delete surfDesc; |