diff options
author | Paul Gilbert | 2015-01-20 21:37:57 -0500 |
---|---|---|
committer | Paul Gilbert | 2015-01-20 21:37:57 -0500 |
commit | adce5f9c2030813936268c0b7e58a33b6cfce003 (patch) | |
tree | cddeb440c6fbe5cb80ee4b8f2a621baec74166e3 | |
parent | 397a10eae5d63d148815386d782fd7b035c195fd (diff) | |
download | scummvm-rg350-adce5f9c2030813936268c0b7e58a33b6cfce003.tar.gz scummvm-rg350-adce5f9c2030813936268c0b7e58a33b6cfce003.tar.bz2 scummvm-rg350-adce5f9c2030813936268c0b7e58a33b6cfce003.zip |
XEEN: Convert map _skySprites into a 2 element array
-rw-r--r-- | engines/xeen/interface_map.cpp | 8 | ||||
-rw-r--r-- | engines/xeen/map.cpp | 10 | ||||
-rw-r--r-- | engines/xeen/map.h | 5 |
3 files changed, 10 insertions, 13 deletions
diff --git a/engines/xeen/interface_map.cpp b/engines/xeen/interface_map.cpp index c551e5818a..2c1b973fd6 100644 --- a/engines/xeen/interface_map.cpp +++ b/engines/xeen/interface_map.cpp @@ -3418,10 +3418,8 @@ void InterfaceMap::drawIndoors() { map.cellFlagLookup(_vm->_party->_mazePosition); - // WORKAROUND: Original did an array lookup on _skySprites. - // Was this a feature for multiple skys that was abandoned? - assert(!map._currentSky); - _indoorList[0]._sprites = &map._skySprites; + assert(map._currentSky < 2); + _indoorList[0]._sprites = &map._skySprites[map._currentSky]; _indoorList[0]._flags = _flipSky ? SPRFLAG_HORIZ_FLIPPED : 0; if (_vm->_openDoor) { @@ -3433,7 +3431,7 @@ void InterfaceMap::drawIndoors() { ); map.cellFlagLookup(pt); - _indoorList._sky2._sprites = &map._skySprites; + _indoorList._sky2._sprites = &map._skySprites[0]; } else { _indoorList._sky2._sprites = _indoorList[0]._sprites; } diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp index 6b577ebd45..e541d374d6 100644 --- a/engines/xeen/map.cpp +++ b/engines/xeen/map.cpp @@ -868,7 +868,7 @@ Map::Map(XeenEngine *vm) : _vm(vm), _mobData(vm) { _currentCantRest = false; _currentIsDrain = false; _currentIsEvent = false; - _currentSky = false; + _currentSky = 0; _currentMonsterFlags = 0; } @@ -1082,7 +1082,7 @@ void Map::load(int mapId) { _groundSprites.load("water.out"); _tileSprites.load("outdoor.til"); - outdoorList._skySprite._sprites = &_skySprites; + outdoorList._skySprite._sprites = &_skySprites[0]; outdoorList._groundSprite._sprites = &_groundSprites; for (int i = 0; i < TOTAL_SURFACES; ++i) { @@ -1100,7 +1100,7 @@ void Map::load(int mapId) { } else { warning("TODO"); // Sound loading - _mazeSkySprites.load(Common::String::format("%s.sky", + _skySprites[1].load(Common::String::format("%s.sky", TERRAIN_TYPES[_mazeData[0]._wallKind])); _groundSprites.load(Common::String::format("%s.gnd", TERRAIN_TYPES[_mazeData[0]._wallKind])); @@ -1354,7 +1354,7 @@ void Map::cellFlagLookup(const Common::Point &pt) { _currentCantRest = cell._flags & FLAG_WATER; _currentIsDrain = cell._flags & OUTFLAG_DRAIN; _currentIsEvent = cell._flags & FLAG_AUTOEXECUTE_EVENT; - _currentSky = cell._flags & OUTFLAG_OBJECT_EXISTS; + _currentSky = (cell._flags & OUTFLAG_OBJECT_EXISTS) ? 1 : 0; _currentMonsterFlags = cell._flags & 7; } @@ -1495,7 +1495,7 @@ void Map::loadSky() { Party &party = *_vm->_party; party._isNight = party._minutes < (5 * 60) || party._minutes >= (21 * 60); - _skySprites.load(((party._mazeId >= 89 && party._mazeId <= 112) || + _skySprites[0].load(((party._mazeId >= 89 && party._mazeId <= 112) || party._mazeId == 128 || party._mazeId == 129) || !party._isNight ? "sky.sky" : "night.sky"); } diff --git a/engines/xeen/map.h b/engines/xeen/map.h index 32418257f4..d8444eb0ff 100644 --- a/engines/xeen/map.h +++ b/engines/xeen/map.h @@ -354,8 +354,7 @@ public: MazeEvents _events; HeadData _headData; AnimationInfo _animationInfo; - SpriteResource _skySprites; - SpriteResource _mazeSkySprites; + SpriteResource _skySprites[2]; SpriteResource _groundSprites; SpriteResource _tileSprites; SpriteResource _surfaceSprites[TOTAL_SURFACES]; @@ -364,7 +363,7 @@ public: bool _currentCantRest; bool _currentIsDrain; bool _currentIsEvent; - bool _currentSky; + int _currentSky; int _currentMonsterFlags; MazeWallLayers _currentWall; int _currentTile; |