diff options
author | Paul Gilbert | 2015-01-20 08:20:07 -0500 |
---|---|---|
committer | Paul Gilbert | 2015-01-20 08:20:07 -0500 |
commit | 2427f203ee9b98d639ecb0bde6aad17c35875a43 (patch) | |
tree | f1a92a4a64acd145d08226a12465bbcef5799217 /engines/xeen | |
parent | aab62d606ec726b6363f067cee17c284d8b396d1 (diff) | |
download | scummvm-rg350-2427f203ee9b98d639ecb0bde6aad17c35875a43.tar.gz scummvm-rg350-2427f203ee9b98d639ecb0bde6aad17c35875a43.tar.bz2 scummvm-rg350-2427f203ee9b98d639ecb0bde6aad17c35875a43.zip |
XEEN: Implemented handleLight
Diffstat (limited to 'engines/xeen')
-rw-r--r-- | engines/xeen/interface.cpp | 8 | ||||
-rw-r--r-- | engines/xeen/interface.h | 3 | ||||
-rw-r--r-- | engines/xeen/map.cpp | 7 | ||||
-rw-r--r-- | engines/xeen/map.h | 1 | ||||
-rw-r--r-- | engines/xeen/party.cpp | 17 | ||||
-rw-r--r-- | engines/xeen/party.h | 3 |
6 files changed, 32 insertions, 7 deletions
diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp index 16ded9ec19..e117813756 100644 --- a/engines/xeen/interface.cpp +++ b/engines/xeen/interface.cpp @@ -743,6 +743,10 @@ void Interface::draw3d(bool updateFlag) { // TODO: more stuff + _vm->_party->_stepped = false; + if (_vm->_mode == MODE_9) { + // TODO + } events.wait(2); } @@ -933,6 +937,8 @@ void Interface::setMazeBits() { break; } + _vm->_party->handleLight(); + switch (_vm->_map->getCell(3) - 1) { case 1: ++_wo[73]; @@ -3015,7 +3021,7 @@ bool Interface::checkMoveDirection(int key) { } else { party._mazeDirection = dir; - if (surfaceId == SURFTYPE_SWAMP || party.checkSkill(SWIMMING) || + if (startSurfaceId == SURFTYPE_SWAMP || party.checkSkill(SWIMMING) || party._walkOnWaterActive) { sound.playFX(46); return false; diff --git a/engines/xeen/interface.h b/engines/xeen/interface.h index 8497cc6c26..9634788df3 100644 --- a/engines/xeen/interface.h +++ b/engines/xeen/interface.h @@ -68,7 +68,6 @@ private: bool _buttonsLoaded; Common::String _interfaceText; int _hiliteChar; - int _intrIndex1; bool _flag1; int _animCounter; bool _isAnimReset; @@ -110,6 +109,8 @@ private: bool checkMoveDirection(int key); public: + int _intrIndex1; +public: Interface(XeenEngine *vm); void setup(); diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp index bf03905818..655412543b 100644 --- a/engines/xeen/map.cpp +++ b/engines/xeen/map.cpp @@ -544,8 +544,8 @@ MazeData::MazeData() { for (int y = 0; y < MAP_HEIGHT; ++y) { for (int x = 0; x < MAP_WIDTH; ++x) _wallData[y][x]._data = 0; - Common::fill(&_seenTiles[y][0], &_seenTiles[y][MAP_WIDTH], 0); - Common::fill(&_steppedOnTiles[y][0], &_steppedOnTiles[y][MAP_WIDTH], 0); + Common::fill(&_seenTiles[y][0], &_seenTiles[y][MAP_WIDTH], false); + Common::fill(&_steppedOnTiles[y][0], &_steppedOnTiles[y][MAP_WIDTH], false); _wallTypes[y] = 0; _surfaceTypes[y] = 0; } @@ -859,7 +859,6 @@ Map::Map(XeenEngine *vm) : _vm(vm), _mobData(vm) { _sideMonsters = 0; _sidePictures = 0; _isOutdoors = false; - _stepped = false; _mazeDataIndex = 0; _currentSteppedOn = false; _currentSurfaceId = 0; @@ -886,7 +885,7 @@ void Map::load(int mapId) { PleaseWait::show(_vm); } - _stepped = true; + _vm->_party->_stepped = true; _vm->_party->_mazeId = mapId; _vm->_events->clearEvents(); diff --git a/engines/xeen/map.h b/engines/xeen/map.h index 9b19b3a53a..80c46dd607 100644 --- a/engines/xeen/map.h +++ b/engines/xeen/map.h @@ -361,7 +361,6 @@ private: int _sidePictures; int _sideObjects; int _sideMonsters; - bool _stepped; int _mazeDataIndex; void loadEvents(int mapId); diff --git a/engines/xeen/party.cpp b/engines/xeen/party.cpp index 4571bbe518..3736869eb4 100644 --- a/engines/xeen/party.cpp +++ b/engines/xeen/party.cpp @@ -231,6 +231,7 @@ Party::Party(XeenEngine *vm): _vm(vm) { _partyDead = false; _newDay = false; _isNight = false; + _stepped = false; } void Party::synchronize(Common::Serializer &s) { @@ -543,5 +544,21 @@ void Party::resetTemps() { _blessedActive = false; } +void Party::handleLight() { + Map &map = *_vm->_map; + + if (_stepped) { + map.cellFlagLookup(_mazePosition); + if (map._currentIsDrain && _lightCount) + --_lightCount; + + if (checkSkill(CARTOGRAPHER)) { + map.mazeDataCurrent()._steppedOnTiles[_mazePosition.y & 15][_mazePosition.x & 15] = true; + } + } + + _vm->_interface->_intrIndex1 = _lightCount || + (map.mazeData()._mazeFlags2 & FLAG_IS_DARK) == 0 ? 4 : 0; +} } // End of namespace Xeen diff --git a/engines/xeen/party.h b/engines/xeen/party.h index 8db52df1a6..e2180e535d 100644 --- a/engines/xeen/party.h +++ b/engines/xeen/party.h @@ -212,6 +212,7 @@ public: bool _partyDead; bool _newDay; bool _isNight; + bool _stepped; public: Party(XeenEngine *vm); @@ -228,6 +229,8 @@ public: void addTime(int numMinutes); void resetTemps(); + + void handleLight(); }; } // End of namespace Xeen |