diff options
author | Paul Gilbert | 2015-02-15 12:01:04 -0500 |
---|---|---|
committer | Paul Gilbert | 2015-02-15 12:01:04 -0500 |
commit | cc9f62fcb936f86468566cd33602ff394040d33a (patch) | |
tree | e5016b6790e6b48339a265ca7cf57655f8d1a32a /engines | |
parent | dae789369ed3ec4568e8149d9e5a3eca1d6b5d7b (diff) | |
download | scummvm-rg350-cc9f62fcb936f86468566cd33602ff394040d33a.tar.gz scummvm-rg350-cc9f62fcb936f86468566cd33602ff394040d33a.tar.bz2 scummvm-rg350-cc9f62fcb936f86468566cd33602ff394040d33a.zip |
XEEN: Split up draw3d between Interface and InterfaceMap, start of fall code
Diffstat (limited to 'engines')
-rw-r--r-- | engines/xeen/interface.cpp | 111 | ||||
-rw-r--r-- | engines/xeen/interface.h | 10 | ||||
-rw-r--r-- | engines/xeen/interface_map.cpp | 43 | ||||
-rw-r--r-- | engines/xeen/interface_map.h | 4 |
4 files changed, 124 insertions, 44 deletions
diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp index dc35b216b1..51a59e1f6f 100644 --- a/engines/xeen/interface.cpp +++ b/engines/xeen/interface.cpp @@ -932,5 +932,116 @@ void Interface::bash(const Common::Point &pt, Direction direction) { drawParty(true); } +void Interface::draw3d(bool updateFlag) { + Combat &combat = *_vm->_combat; + EventsManager &events = *_vm->_events; + Party &party = *_vm->_party; + Screen &screen = *_vm->_screen; + + if (screen._windows[11]._enabled) + return; + + // Draw the map + drawMap(updateFlag); + + // Draw the minimap + drawMiniMap(); + + if (party._falling == 1) + handleFalling(); + + if (party._falling == 2) { + screen.saveBackground(1); + } + + assembleBorder(); + + // Draw any on-screen text if flagged to do so + if (_upDoorText && combat._attackMonsters[0] == -1) { + screen._windows[3].writeString(_screenText); + } + + if (updateFlag) { + screen._windows[1].update(); + screen._windows[3].update(); + } + + // TODO: more stuff + + _vm->_party->_stepped = false; + if (_vm->_mode == MODE_9) { + // TODO + } + + // TODO: Check use of updateFlag here. Original doesn't have it, but I + // wanted to ensure in places like the AutoMapDialog, that the draw3d + // doesn't result in the screen updating until the dialog has had + // a chance to full render itself + if (updateFlag) + events.wait(2); +} + +void Interface::handleFalling() { + Party &party = *_vm->_party; + Screen &screen = *_vm->_screen; + SoundManager &sound = *_vm->_sound; + Window &w = screen._windows[3]; + File voc1("scream.voc"); + File voc2("unnh.voc"); + saveFall(); + + for (uint idx = 0; idx < party._activeParty.size(); ++idx) { + party._activeParty[idx]._faceSprites->draw(screen._windows[0], 4, + Common::Point(CHAR_FACES_X[idx], 150)); + } + + screen._windows[33].update(); + sound.playFX(11); + sound.playSample(&voc1, 0); + + for (int idx = 0, incr = 2; idx < 133; ++incr, idx += incr) { + fall(idx); + assembleBorder(); + w.update(); + } + + fall(132); + assembleBorder(); + w.update(); + + sound.playSample(nullptr, 0); + sound.playSample(&voc2, 0); + sound.playFX(31); + + fall(127); + assembleBorder(); + w.update(); + + fall(132); + assembleBorder(); + w.update(); + + fall(129); + assembleBorder(); + w.update(); + + fall(132); + assembleBorder(); + w.update(); + + shake(); +} + +void Interface::saveFall() { + +} + +void Interface::fall(int v) { + +} + +void Interface::shake() { + +} } // End of namespace Xeen diff --git a/engines/xeen/interface.h b/engines/xeen/interface.h index 59801757be..57db3f2bcd 100644 --- a/engines/xeen/interface.h +++ b/engines/xeen/interface.h @@ -85,6 +85,14 @@ private: void doStepCode(); bool checkMoveDirection(int key); + + void handleFalling(); + + void saveFall(); + + void fall(int v); + + void shake(); public: int _intrIndex1; Common::String _interfaceText; @@ -108,6 +116,8 @@ public: void rest(); void bash(const Common::Point &pt, Direction direction); + + void draw3d(bool updateFlag); }; } // End of namespace Xeen diff --git a/engines/xeen/interface_map.cpp b/engines/xeen/interface_map.cpp index 262c9455fd..6893c7114a 100644 --- a/engines/xeen/interface_map.cpp +++ b/engines/xeen/interface_map.cpp @@ -406,12 +406,9 @@ void InterfaceMap::setup() { _charPowSprites.load("charpow.icn"); } -void InterfaceMap::draw3d(bool updateFlag) { +void InterfaceMap::drawMap(bool updateFlag) { Combat &combat = *_vm->_combat; - EventsManager &events = *_vm->_events; Map &map = *_vm->_map; - Party &party = *_vm->_party; - Screen &screen = *_vm->_screen; Scripts &scripts = *_vm->_scripts; const int COMBAT_POS_X[3][2] = { { 102, 134 }, { 36, 67 }, { 161, 161 } }; @@ -419,9 +416,6 @@ void InterfaceMap::draw3d(bool updateFlag) { const int OUTDOOR_INDEXES[3] = { 119, 113, 116 }; const int COMBAT_OFFSET_X[4] = { 8, 6, 4, 2 }; - if (screen._windows[11]._enabled) - return; - _flipUIFrame = (_flipUIFrame + 1) % 4; if (_flipUIFrame == 0) _flipWater = !_flipWater; @@ -727,41 +721,6 @@ void InterfaceMap::draw3d(bool updateFlag) { } animate3d(); - drawMiniMap(); - - if (party._falling == 1) { - error("TODO: Indoor falling"); - } - - if (party._falling == 2) { - screen.saveBackground(1); - } - - assembleBorder(); - - // Draw any on-screen text if flagged to do so - if (_upDoorText && combat._attackMonsters[0] == -1) { - screen._windows[3].writeString(_screenText); - } - - if (updateFlag) { - screen._windows[1].update(); - screen._windows[3].update(); - } - - // TODO: more stuff - - _vm->_party->_stepped = false; - if (_vm->_mode == MODE_9) { - // TODO - } - - // TODO: Check use of updateFlag here. Original doesn't have it, but I - // wanted to ensure in places like the AutoMapDialog, that the draw3d - // doesn't result in the screen updating until the dialog has had - // a chance to full render itself - if (updateFlag) - events.wait(2); } /** diff --git a/engines/xeen/interface_map.h b/engines/xeen/interface_map.h index 660213a98e..b65b7d6fb9 100644 --- a/engines/xeen/interface_map.h +++ b/engines/xeen/interface_map.h @@ -126,6 +126,8 @@ protected: void drawMiniMap(); virtual void setup(); + + void drawMap(bool updateFlag); public: OutdoorDrawList _outdoorList; IndoorDrawList _indoorList; @@ -146,8 +148,6 @@ public: virtual ~InterfaceMap() {} - void draw3d(bool updateFlag); - void setIndoorsMonsters(); void setIndoorsObjects(); |