Skip to content

Commit

Permalink
XEEN: Implemented more code from end of draw3d
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Feb 15, 2015
1 parent cc9f62f commit 6605a0c
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 9 deletions.
6 changes: 6 additions & 0 deletions engines/xeen/combat.cpp
Expand Up @@ -22,6 +22,7 @@

#include "xeen/combat.h"
#include "common/algorithm.h"
#include "common/textconsole.h"

namespace Xeen {

Expand All @@ -42,4 +43,9 @@ void Combat::clear() {
Common::fill(&_attackMonsters[0], &_attackMonsters[26], -1);
}

void Combat::doCombat() {
error("TODO: doCombat");
}


} // End of namespace Xeen
2 changes: 2 additions & 0 deletions engines/xeen/combat.h
Expand Up @@ -65,6 +65,8 @@ class Combat {
Combat(XeenEngine *vm);

void clear();

void doCombat();
};

} // End of namespace Xeen
Expand Down
22 changes: 16 additions & 6 deletions engines/xeen/interface.cpp
Expand Up @@ -937,12 +937,13 @@ void Interface::draw3d(bool updateFlag) {
EventsManager &events = *_vm->_events;
Party &party = *_vm->_party;
Screen &screen = *_vm->_screen;
Scripts &scripts = *_vm->_scripts;

if (screen._windows[11]._enabled)
return;

// Draw the map
drawMap(updateFlag);
drawMap();

// Draw the minimap
drawMiniMap();
Expand All @@ -966,11 +967,20 @@ void Interface::draw3d(bool updateFlag) {
screen._windows[3].update();
}

// TODO: more stuff
if (combat._attackMonsters[0] != -1 || combat._attackMonsters[1] != -1
|| combat._attackMonsters[2] != -1) {
if ((_vm->_mode == MODE_1 || _vm->_mode == MODE_SLEEPING) && !_flag1
&& !_charsShooting && _vm->_moveMonsters) {
combat.doCombat();
if (scripts._eventSkipped)
scripts.checkEvents();
}
}

_vm->_party->_stepped = false;
party._stepped = false;
if (_vm->_mode == MODE_9) {
// TODO
// TODO: Save current scripts data?
error("TODO: save scripts?");
}

// TODO: Check use of updateFlag here. Original doesn't have it, but I
Expand Down Expand Up @@ -1029,7 +1039,7 @@ void Interface::handleFalling() {
assembleBorder();
w.update();

shake();
shake(10);
}

void Interface::saveFall() {
Expand All @@ -1040,7 +1050,7 @@ void Interface::fall(int v) {

}

void Interface::shake() {
void Interface::shake(int time) {

}

Expand Down
2 changes: 1 addition & 1 deletion engines/xeen/interface.h
Expand Up @@ -92,7 +92,7 @@ class Interface: public ButtonContainer, public InterfaceMap, public PartyDrawer

void fall(int v);

void shake();
void shake(int time);
public:
int _intrIndex1;
Common::String _interfaceText;
Expand Down
2 changes: 1 addition & 1 deletion engines/xeen/interface_map.cpp
Expand Up @@ -406,7 +406,7 @@ void InterfaceMap::setup() {
_charPowSprites.load("charpow.icn");
}

void InterfaceMap::drawMap(bool updateFlag) {
void InterfaceMap::drawMap() {
Combat &combat = *_vm->_combat;
Map &map = *_vm->_map;
Scripts &scripts = *_vm->_scripts;
Expand Down
2 changes: 1 addition & 1 deletion engines/xeen/interface_map.h
Expand Up @@ -127,7 +127,7 @@ class InterfaceMap {

virtual void setup();

void drawMap(bool updateFlag);
void drawMap();
public:
OutdoorDrawList _outdoorList;
IndoorDrawList _indoorList;
Expand Down

0 comments on commit 6605a0c

Please sign in to comment.