diff options
author | Joost Peters | 2009-07-14 09:44:56 +0000 |
---|---|---|
committer | Joost Peters | 2009-07-14 09:44:56 +0000 |
commit | 72e2b9fe5aa5ed58ae742bec39257ca7532994f1 (patch) | |
tree | f3cb23f900817e9262d5c42f384584363de7748c /engines | |
parent | aac58c80cc6f21c3ee7dc402520a219c3098d688 (diff) | |
download | scummvm-rg350-72e2b9fe5aa5ed58ae742bec39257ca7532994f1.tar.gz scummvm-rg350-72e2b9fe5aa5ed58ae742bec39257ca7532994f1.tar.bz2 scummvm-rg350-72e2b9fe5aa5ed58ae742bec39257ca7532994f1.zip |
commit peres' patch for #2813472: BASS: "showgrid" enabled triggers an assert
svn-id: r42470
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sky/grid.cpp | 6 | ||||
-rw-r--r-- | engines/sky/sky.cpp | 7 |
2 files changed, 9 insertions, 4 deletions
diff --git a/engines/sky/grid.cpp b/engines/sky/grid.cpp index d9b7a17351..7b473c7934 100644 --- a/engines/sky/grid.cpp +++ b/engines/sky/grid.cpp @@ -255,8 +255,10 @@ void Grid::removeGrid(uint32 x, uint32 y, uint32 width, Compact *cpt) { } uint8 *Grid::giveGrid(uint32 pScreen) { - assert((_gridConvertTable[pScreen] >= 0) && (_gridConvertTable[pScreen] < TOT_NO_GRIDS)); - return _gameGrids[_gridConvertTable[pScreen]]; + if ((_gridConvertTable[pScreen] >= 0) && (_gridConvertTable[pScreen] < TOT_NO_GRIDS)) { + return _gameGrids[_gridConvertTable[pScreen]]; + } + return 0; } } // End of namespace Sky diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp index 47cc65e96d..e85da6297a 100644 --- a/engines/sky/sky.cpp +++ b/engines/sky/sky.cpp @@ -208,8 +208,11 @@ Common::Error SkyEngine::go() { _skyScreen->recreate(); _skyScreen->spriteEngine(); if (_debugger->showGrid()) { - _skyScreen->showGrid(_skyLogic->_skyGrid->giveGrid(Logic::_scriptVariables[SCREEN])); - _skyScreen->forceRefresh(); + uint8 *grid = _skyLogic->_skyGrid->giveGrid(Logic::_scriptVariables[SCREEN]); + if (grid) { + _skyScreen->showGrid(grid); + _skyScreen->forceRefresh(); + } } _skyScreen->flip(); |