Ticket #4380: sky_grid.patch

File sky_grid.patch, 1.2 KB (added by peres, 12 years ago)

Patch for bug #2813472

  • engines/sky/grid.cpp

     
    255255}
    256256
    257257uint8 *Grid::giveGrid(uint32 pScreen) {
    258         assert((_gridConvertTable[pScreen] >= 0) && (_gridConvertTable[pScreen] < TOT_NO_GRIDS));
    259         return _gameGrids[_gridConvertTable[pScreen]];
     258        if ((_gridConvertTable[pScreen] >= 0) && (_gridConvertTable[pScreen] < TOT_NO_GRIDS)) {
     259                return _gameGrids[_gridConvertTable[pScreen]];
     260        }
     261        return 0;
    260262}
    261263
    262264} // End of namespace Sky
  • engines/sky/sky.cpp

     
    208208                _skyScreen->recreate();
    209209                _skyScreen->spriteEngine();
    210210                if (_debugger->showGrid()) {
    211                         _skyScreen->showGrid(_skyLogic->_skyGrid->giveGrid(Logic::_scriptVariables[SCREEN]));
    212                         _skyScreen->forceRefresh();
     211                        uint8 *grid = _skyLogic->_skyGrid->giveGrid(Logic::_scriptVariables[SCREEN]);
     212                        if (grid) {
     213                                _skyScreen->showGrid(grid);
     214                                _skyScreen->forceRefresh();
     215                        }
    213216                }
    214217                _skyScreen->flip();
    215218