aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/xeen/interface.cpp90
-rw-r--r--engines/xeen/interface.h22
-rw-r--r--engines/xeen/map.cpp16
-rw-r--r--engines/xeen/map.h2
-rw-r--r--engines/xeen/screen.h4
-rw-r--r--engines/xeen/xeen.cpp27
-rw-r--r--engines/xeen/xeen.h3
7 files changed, 149 insertions, 15 deletions
diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp
index 08128e54f0..4f40c4730d 100644
--- a/engines/xeen/interface.cpp
+++ b/engines/xeen/interface.cpp
@@ -44,10 +44,31 @@ Interface::Interface(XeenEngine *vm) : ButtonContainer(), _vm(vm) {
Common::fill(&_combatCharIds[0], &_combatCharIds[8], 0);
_intrIndex1 = 0;
- _faceDrawStructs[0] = DrawStruct(nullptr, 0, 0, 0);
- _faceDrawStructs[1] = DrawStruct(nullptr, 0, 101, 0);
- _faceDrawStructs[2] = DrawStruct(nullptr, 0, 0, 43);
- _faceDrawStructs[3] = DrawStruct(nullptr, 0, 101, 43);
+ initDrawStructs();
+}
+
+void Interface::initDrawStructs() {
+ _faceDrawStructs[0] = DrawStruct(0, 0, 0);
+ _faceDrawStructs[1] = DrawStruct(0, 101, 0);
+ _faceDrawStructs[2] = DrawStruct(0, 0, 43);
+ _faceDrawStructs[3] = DrawStruct(0, 101, 43);
+
+ _mainList[0] = DrawStruct(7, 232, 74);
+ _mainList[1] = DrawStruct(0, 235, 75);
+ _mainList[2] = DrawStruct(2, 260, 75);
+ _mainList[3] = DrawStruct(4, 286, 75);
+ _mainList[4] = DrawStruct(6, 235, 96);
+ _mainList[5] = DrawStruct(8, 260, 96);
+ _mainList[6] = DrawStruct(10, 286, 96);
+ _mainList[7] = DrawStruct(12, 235, 117);
+ _mainList[8] = DrawStruct(14, 260, 117);
+ _mainList[9] = DrawStruct(16, 286, 117);
+ _mainList[10] = DrawStruct(20, 235, 148);
+ _mainList[11] = DrawStruct(22, 260, 148);
+ _mainList[12] = DrawStruct(24, 286, 148);
+ _mainList[13] = DrawStruct(26, 235, 169);
+ _mainList[14] = DrawStruct(28, 260, 169);
+ _mainList[15] = DrawStruct(30, 286, 169);
}
void Interface::manageCharacters(bool soundPlayed) {
@@ -82,7 +103,7 @@ start:
if (!_partyFaces[0]) {
// Xeen only uses 24 of possible 30 character slots
- loadCharIcons(XEEN_TOTAL_CHARACTERS);
+ loadCharIcons();
for (int i = 0; i < _vm->_party._partyCount; ++i)
_partyFaces[i] = &_charFaces[_vm->_party._partyMembers[i]];
@@ -255,8 +276,8 @@ start:
_uiSprites.clear();
}
-void Interface::loadCharIcons(int numChars) {
- for (int i = 0; i < numChars; ++i) {
+void Interface::loadCharIcons() {
+ for (int i = 0; i < XEEN_TOTAL_CHARACTERS; ++i) {
// Load new character resource
Common::String name = Common::String::format("char%02d.fac", i);
_charFaces[i].load(name);
@@ -265,6 +286,11 @@ void Interface::loadCharIcons(int numChars) {
_dseFace.load("dse.fac");
}
+void Interface::loadPartyIcons() {
+ for (int i = 0; i < _vm->_party._partyCount; ++i)
+ _partyFaces[i] = &_charFaces[_vm->_party._partyMembers[i]];
+}
+
void Interface::setupBackground() {
_vm->_screen->loadBackground("back.raw");
assembleBorder();
@@ -508,4 +534,54 @@ void Interface::draw3d(bool flag) {
warning("TODO");
}
+void Interface::animate3d() {
+
+}
+
+void Interface::setMonsters() {
+
+}
+
+void Interface::setObjects() {
+
+}
+
+void Interface::setOutdoorsMonsters() {
+
+}
+
+void Interface::setOutdoorsObjects() {
+
+}
+
+void Interface::startup() {
+ Screen &screen = *_vm->_screen;
+ _iconSprites.load("main.icn");
+
+ animate3d();
+ if (_vm->_map->_isOutdoors) {
+ setMonsters();
+ setObjects();
+ } else {
+ setOutdoorsMonsters();
+ setOutdoorsObjects();
+ }
+ draw3d(false);
+
+ _globalSprites.draw(screen._windows[1], 5, Common::Point(232, 9));
+ charIconsPrint(false);
+
+ _mainList[0]._sprites = &_globalSprites;
+ for (int i = 1; i < 16; ++i)
+ _mainList[i]._sprites = &_iconSprites;
+}
+
+void Interface::mainIconsPrint() {
+ Screen &screen = *_vm->_screen;
+ screen._windows[38].close();
+ screen._windows[12].close();
+ screen._windows[0].drawList(_mainList, 16);
+ screen._windows[34].update();
+}
+
} // End of namespace Xeen
diff --git a/engines/xeen/interface.h b/engines/xeen/interface.h
index 1ed7afe628..f455957699 100644
--- a/engines/xeen/interface.h
+++ b/engines/xeen/interface.h
@@ -44,9 +44,11 @@ private:
SpriteResource _restoreSprites;
SpriteResource _hpSprites;
SpriteResource _uiSprites;
+ SpriteResource _iconSprites;
SpriteResource _charFaces[TOTAL_CHARACTERS];
SpriteResource *_partyFaces[MAX_ACTIVE_PARTY];
DrawStruct _faceDrawStructs[4];
+ DrawStruct _mainList[16];
int _combatCharIds[8];
int _batUIFrame;
@@ -64,6 +66,8 @@ private:
int _hiliteChar;
int _intrIndex1;
+ void initDrawStructs();
+
void assembleBorder();
void setupBackground();
@@ -75,14 +79,30 @@ private:
void drawViewBackground(int bgType);
void addCharacterToRoster();
+
+ void animate3d();
+
+ void setMonsters();
+
+ void setObjects();
+
+ void setOutdoorsMonsters();
+
+ void setOutdoorsObjects();
public:
Interface(XeenEngine *vm);
void manageCharacters(bool soundPlayed);
- void loadCharIcons(int numChars);
+ void loadCharIcons();
+
+ void loadPartyIcons();
void draw3d(bool flag);
+
+ void startup();
+
+ void mainIconsPrint();
};
} // End of namespace Xeen
diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp
index 4a3eda6b11..5179b929f2 100644
--- a/engines/xeen/map.cpp
+++ b/engines/xeen/map.cpp
@@ -475,7 +475,7 @@ void MonsterData::load(const Common::String &name) {
void MonsterData::synchronize(Common::SeekableReadStream &s) {
clear();
- MonsterData spr;
+ MonsterStruct spr;
while (!s.eos()) {
spr.synchronize(s);
push_back(spr);
@@ -710,6 +710,7 @@ Map::Map(XeenEngine *vm) : _vm(vm), _mobData(vm) {
_sideObj = 0;
_sideMon = 0;
_isOutdoors = false;
+ _stepped = false;
}
void Map::load(int mapId) {
@@ -722,6 +723,11 @@ void Map::load(int mapId) {
PleaseWait::show(_vm);
}
+ _stepped = true;
+ _vm->_party._mazeId = mapId;
+ _vm->_events->clearEvents();
+
+
if (mapId >= 113 && mapId <= 127) {
_townPortalSide = 0;
} else {
@@ -856,7 +862,13 @@ void Map::load(int mapId) {
_mobData.synchronize(mobFile, _isOutdoors, _monsterData);
mobFile.close();
- // TODO: Loop loading moer data
+ // TODO: Loop loading moer data / other / cbr? data
+
+ if (_isOutdoors) {
+
+ } else {
+
+ }
}
} // End of namespace Xeen
diff --git a/engines/xeen/map.h b/engines/xeen/map.h
index e52e978106..882e495a58 100644
--- a/engines/xeen/map.h
+++ b/engines/xeen/map.h
@@ -258,6 +258,8 @@ private:
int _townPortalSide;
int _sideObj;
int _sideMon;
+ bool _stepped;
+public:
bool _isOutdoors;
public:
Map(XeenEngine *vm);
diff --git a/engines/xeen/screen.h b/engines/xeen/screen.h
index 1e164a3166..adf956e9bc 100644
--- a/engines/xeen/screen.h
+++ b/engines/xeen/screen.h
@@ -50,8 +50,8 @@ struct DrawStruct {
int _scale;
int _flags;
- DrawStruct(SpriteResource *sprites, int frame, int x, int y, int scale = 0, int flags = 0) :
- _sprites(sprites), _frame(frame), _x(x), _y(y), _scale(scale), _flags(flags) {}
+ DrawStruct(int frame, int x, int y, int scale = 0, int flags = 0) :
+ _sprites(nullptr), _frame(frame), _x(x), _y(y), _scale(scale), _flags(flags) {}
DrawStruct(): _sprites(nullptr), _frame(0), _x(0), _y(0), _scale(0), _flags(0) {}
};
diff --git a/engines/xeen/xeen.cpp b/engines/xeen/xeen.cpp
index b3ac7433a3..7321befb08 100644
--- a/engines/xeen/xeen.cpp
+++ b/engines/xeen/xeen.cpp
@@ -52,6 +52,8 @@ XeenEngine::XeenEngine(OSystem *syst, const XeenGameDescription *gameDesc)
_face2State = 0;
_noDirectionSense = false;
_falling = false;
+ _tillMove = false;
+ _moveMonsters = false;
}
XeenEngine::~XeenEngine() {
@@ -271,8 +273,7 @@ void XeenEngine::play() {
_screen->loadBackground("back.raw");
_screen->loadPalette("mm4.pal");
- _interface->loadCharIcons(_party._partyCount);
- _iconsSprites.load("main.icn");
+ _interface->loadPartyIcons();
if (getGameID() != GType_WorldOfXeen && !_loadDarkSide) {
_loadDarkSide = true;
@@ -283,6 +284,28 @@ void XeenEngine::play() {
}
_map->load(_party._mazeId);
+
+ _interface->startup();
+ if (_mode == MODE_0) {
+ _screen->fadeOut(4);
+ }
+
+ _screen->_windows[0].update();
+ _interface->mainIconsPrint();
+ _screen->_windows[0].update();
+ _events->setCursor(0);
+
+ _moveMonsters = true;
+ _tillMove = false;
+ if (_mode == MODE_0) {
+ _mode = MODE_1;
+ _screen->fadeIn(4);
+ }
+
+ // Main game loop
+ while (!shouldQuit()) {
+ _events->pollEventsAndWait();
+ }
}
} // End of namespace Xeen
diff --git a/engines/xeen/xeen.h b/engines/xeen/xeen.h
index 9938519b9b..776f3196cd 100644
--- a/engines/xeen/xeen.h
+++ b/engines/xeen/xeen.h
@@ -93,7 +93,8 @@ private:
const XeenGameDescription *_gameDescription;
Common::RandomSource _randomSource;
int _loadSaveSlot;
- SpriteResource _iconsSprites;
+ bool _moveMonsters;
+ bool _tillMove;
void showIntro();