aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2016-09-21 07:26:24 -0400
committerPaul Gilbert2016-09-21 07:26:24 -0400
commit2e4fc11320b90db0485a937ec14b3464f3195e0a (patch)
tree9590126c8a443ff25864cc4403632c36139c7b69
parent41fea11ce68d21f900f39e65c35f766f2d7a5509 (diff)
downloadscummvm-rg350-2e4fc11320b90db0485a937ec14b3464f3195e0a.tar.gz
scummvm-rg350-2e4fc11320b90db0485a937ec14b3464f3195e0a.tar.bz2
scummvm-rg350-2e4fc11320b90db0485a937ec14b3464f3195e0a.zip
XEEN: Refactored doScroll to have it available to cutscenes
-rw-r--r--engines/xeen/cutscenes.cpp (renamed from engines/xeen/worldofxeen/cutscenes.cpp)96
-rw-r--r--engines/xeen/cutscenes.h (renamed from engines/xeen/worldofxeen/cutscenes.h)11
-rw-r--r--engines/xeen/dialogs.cpp118
-rw-r--r--engines/xeen/dialogs.h19
-rw-r--r--engines/xeen/dialogs_automap.h4
-rw-r--r--engines/xeen/dialogs_char_info.h3
-rw-r--r--engines/xeen/dialogs_control_panel.h4
-rw-r--r--engines/xeen/dialogs_dismiss.h3
-rw-r--r--engines/xeen/dialogs_error.h8
-rw-r--r--engines/xeen/dialogs_exchange.h3
-rw-r--r--engines/xeen/dialogs_fight_options.h4
-rw-r--r--engines/xeen/dialogs_info.h3
-rw-r--r--engines/xeen/dialogs_input.h6
-rw-r--r--engines/xeen/dialogs_items.h4
-rw-r--r--engines/xeen/dialogs_party.cpp4
-rw-r--r--engines/xeen/dialogs_query.h8
-rw-r--r--engines/xeen/dialogs_quests.h3
-rw-r--r--engines/xeen/dialogs_quick_ref.h4
-rw-r--r--engines/xeen/dialogs_spells.h31
-rw-r--r--engines/xeen/dialogs_whowill.h4
-rw-r--r--engines/xeen/interface.cpp2
-rw-r--r--engines/xeen/module.mk2
-rw-r--r--engines/xeen/town.cpp2
-rw-r--r--engines/xeen/town.h4
-rw-r--r--engines/xeen/worldofxeen/clouds_cutscenes.h2
-rw-r--r--engines/xeen/worldofxeen/darkside_cutscenes.h2
26 files changed, 159 insertions, 195 deletions
diff --git a/engines/xeen/worldofxeen/cutscenes.cpp b/engines/xeen/cutscenes.cpp
index 971070487f..230d574d86 100644
--- a/engines/xeen/worldofxeen/cutscenes.cpp
+++ b/engines/xeen/cutscenes.cpp
@@ -20,7 +20,7 @@
*
*/
-#include "xeen/worldofxeen/cutscenes.h"
+#include "xeen/cutscenes.h"
#include "xeen/xeen.h"
namespace Xeen {
@@ -103,4 +103,98 @@ uint Cutscenes::getSpeakingFrame(uint minFrame, uint maxFrame) {
return minFrame + interval % (maxFrame + 1 - minFrame);
}
+void Cutscenes::doScroll(bool drawFlag, bool doFade) {
+ Screen &screen = *_vm->_screen;
+ EventsManager &events = *_vm->_events;
+
+ if (_vm->getGameID() != GType_Clouds) {
+ if (doFade) {
+ screen.fadeIn(2);
+ }
+ return;
+ }
+
+ const int SCROLL_L[8] = { 29, 23, 15, 251, 245, 233, 207, 185 };
+ const int SCROLL_R[8] = { 165, 171, 198, 218, 228, 245, 264, 281 };
+
+ screen.saveBackground();
+
+ // Load hand vga files
+ SpriteResource *hand[16];
+ for (int i = 0; i < 16; ++i) {
+ Common::String name = Common::String::format("hand%02d.vga", i);
+ hand[i] = new SpriteResource(name);
+ }
+
+ // Load marb vga files
+ SpriteResource *marb[5];
+ for (int i = 1; i < 5; ++i) {
+ Common::String name = Common::String::format("marb%02d.vga", i);
+ marb[i] = new SpriteResource(name);
+ }
+
+ if (drawFlag) {
+ for (int i = 22; i > 0; --i) {
+ events.updateGameCounter();
+ screen.restoreBackground();
+
+ if (i > 0 && i <= 14) {
+ hand[i - 1]->draw(screen, 0);
+ } else {
+ hand[14]->draw(screen, 0, Common::Point(SCROLL_L[i - 14], 0), SPRFLAG_800);
+ marb[15]->draw(screen, 0, Common::Point(SCROLL_R[i - 14], 0), SPRFLAG_800);
+ }
+
+ if (i <= 20) {
+ marb[i / 5]->draw(screen, i % 5);
+ }
+
+ while (!_vm->shouldQuit() && events.timeElapsed() == 0)
+ events.pollEventsAndWait();
+
+ screen._windows[0].update();
+ if (i == 0 && doFade)
+ screen.fadeIn(2);
+ }
+ } else {
+ for (int i = 0; i < 22 && !events.isKeyMousePressed(); ++i) {
+ events.updateGameCounter();
+ screen.restoreBackground();
+
+ if (i < 14) {
+ hand[i]->draw(screen, 0);
+ } else {
+ hand[14]->draw(screen, 0, Common::Point(SCROLL_L[i - 7], 0), SPRFLAG_800);
+ marb[15]->draw(screen, 0, Common::Point(SCROLL_R[i - 7], 0), SPRFLAG_800);
+ }
+
+ if (i < 20) {
+ marb[i / 5]->draw(screen, i % 5);
+ }
+
+ while (!_vm->shouldQuit() && events.timeElapsed() == 0)
+ events.pollEventsAndWait();
+
+ screen._windows[0].update();
+ if (i == 0 && doFade)
+ screen.fadeIn(2);
+ }
+ }
+
+ if (drawFlag) {
+ hand[0]->draw(screen, 0);
+ marb[0]->draw(screen, 0);
+ } else {
+ screen.restoreBackground();
+ }
+
+ screen._windows[0].update();
+
+ // Free resources
+ for (int i = 1; i < 5; ++i)
+ delete marb[i];
+ for (int i = 0; i < 16; ++i)
+ delete hand[i];
+}
+
} // End of namespace Xeen
diff --git a/engines/xeen/worldofxeen/cutscenes.h b/engines/xeen/cutscenes.h
index f4cb18e9c2..ba90f03426 100644
--- a/engines/xeen/worldofxeen/cutscenes.h
+++ b/engines/xeen/cutscenes.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef XEEN_WORLDOFXEEN_CUTSCENES_H
-#define XEEN_WORLDOFXEEN_CUTSCENES_H
+#ifndef XEEN_CUTSCENES_H
+#define XEEN_CUTSCENES_H
#include "xeen/files.h"
#include "xeen/sprites.h"
@@ -81,8 +81,13 @@ protected:
* Get a speaking frame from a range
*/
uint getSpeakingFrame(uint minFrame, uint maxFrame);
+
+ /**
+ * Draws the scroll in the background
+ */
+ virtual void doScroll(bool drawFlag, bool doFade);
};
} // End of namespace Xeen
-#endif /* XEEN_WORLDOFXEEN_CUTSCENES_H */
+#endif /* XEEN_CUTSCENES_H */
diff --git a/engines/xeen/dialogs.cpp b/engines/xeen/dialogs.cpp
index 4ecd1c775c..02546adabd 100644
--- a/engines/xeen/dialogs.cpp
+++ b/engines/xeen/dialogs.cpp
@@ -97,107 +97,6 @@ bool ButtonContainer::checkEvents(XeenEngine *vm) {
return false;
}
-void ButtonContainer::doScroll(XeenEngine *vm, bool drawFlag, bool doFade) {
- Screen &screen = *vm->_screen;
- EventsManager &events = *vm->_events;
-
- if (vm->getGameID() != GType_Clouds) {
- if (doFade) {
- screen.fadeIn(2);
- }
- return;
- }
-
- const int SCROLL_L[8] = { 29, 23, 15, 251, 245, 233, 207, 185 };
- const int SCROLL_R[8] = { 165, 171, 198, 218, 228, 245, 264, 281 };
-
- saveButtons();
- clearButtons();
- screen.saveBackground();
-
- // Load hand vga files
- SpriteResource *hand[16];
- for (int i = 0; i < 16; ++i) {
- Common::String name = Common::String::format("hand%02d.vga", i);
- hand[i] = new SpriteResource(name);
- }
-
- // Load marb vga files
- SpriteResource *marb[5];
- for (int i = 1; i < 5; ++i) {
- Common::String name = Common::String::format("marb%02d.vga", i);
- marb[i] = new SpriteResource(name);
- }
-
- if (drawFlag) {
- for (int i = 22; i > 0; --i) {
- events.updateGameCounter();
- screen.restoreBackground();
-
- if (i > 0 && i <= 14) {
- hand[i - 1]->draw(screen, 0);
- }
- else {
- // TODO: Check '800h'.. horizontal reverse maybe?
- hand[14]->draw(screen, 0, Common::Point(SCROLL_L[i - 14], 0));
- marb[15]->draw(screen, 0, Common::Point(SCROLL_R[i - 14], 0));
- }
-
- if (i <= 20) {
- marb[i / 5]->draw(screen, i % 5);
- }
-
- while (!vm->shouldQuit() && events.timeElapsed() == 0)
- events.pollEventsAndWait();
-
- screen._windows[0].update();
- if (i == 0 && doFade)
- screen.fadeIn(2);
- }
- } else {
- for (int i = 0; i < 22 && !events.isKeyMousePressed(); ++i) {
- events.updateGameCounter();
- screen.restoreBackground();
-
- if (i < 14) {
- hand[i]->draw(screen, 0);
- } else {
- // TODO: Check '800h'.. horizontal reverse maybe?
- hand[14]->draw(screen, 0, Common::Point(SCROLL_L[i - 7], 0));
- marb[15]->draw(screen, 0, Common::Point(SCROLL_R[i - 7], 0));
- }
-
- if (i < 20) {
- marb[i / 5]->draw(screen, i % 5);
- }
-
- while (!vm->shouldQuit() && events.timeElapsed() == 0)
- events.pollEventsAndWait();
-
- screen._windows[0].update();
- if (i == 0 && doFade)
- screen.fadeIn(2);
- }
- }
-
- if (drawFlag) {
- hand[0]->draw(screen, 0);
- marb[0]->draw(screen, 0);
- }
- else {
- screen.restoreBackground();
- }
-
- screen._windows[0].update();
- restoreButtons();
-
- // Free resources
- for (int i = 1; i < 5; ++i)
- delete marb[i];
- for (int i = 0; i < 16; ++i)
- delete hand[i];
-}
-
void ButtonContainer::drawButtons(XSurface *surface) {
for (uint btnIndex = 0; btnIndex < _buttons.size(); ++btnIndex) {
UIButton &btn = _buttons[btnIndex];
@@ -208,6 +107,17 @@ void ButtonContainer::drawButtons(XSurface *surface) {
}
}
+void ButtonContainer::doScroll(bool drawFlag, bool doFade) {
+ if (_vm->getGameID() == GType_Clouds) {
+ saveButtons();
+ clearButtons();
+ Cutscenes::doScroll(drawFlag, doFade);
+ restoreButtons();
+ } else {
+ Cutscenes::doScroll(drawFlag, doFade);
+ }
+}
+
/*------------------------------------------------------------------------*/
void SettingsBaseDialog::showContents(SpriteResource &title1, bool waitFlag) {
@@ -228,12 +138,12 @@ void CreditsScreen::execute() {
EventsManager &events = *_vm->_events;
// Handle drawing the credits screen
- doScroll(_vm, true, false);
+ doScroll(true, false);
screen._windows[GAME_WINDOW].close();
screen.loadBackground("marb.raw");
screen._windows[0].writeString(CREDITS);
- doScroll(_vm, false, false);
+ doScroll(false, false);
events.setCursor(0);
screen._windows[0].update();
@@ -243,7 +153,7 @@ void CreditsScreen::execute() {
while (!events.isKeyMousePressed())
events.pollEventsAndWait();
- doScroll(_vm, true, false);
+ doScroll(true, false);
}
/*------------------------------------------------------------------------*/
diff --git a/engines/xeen/dialogs.h b/engines/xeen/dialogs.h
index 51eafa5f54..93e9a86685 100644
--- a/engines/xeen/dialogs.h
+++ b/engines/xeen/dialogs.h
@@ -26,6 +26,7 @@
#include "common/array.h"
#include "common/stack.h"
#include "common/rect.h"
+#include "xeen/cutscenes.h"
#include "xeen/sprites.h"
#include "xeen/xsurface.h"
@@ -46,21 +47,21 @@ public:
UIButton() : _value(0), _sprites(nullptr), _draw(false) {}
};
-class ButtonContainer {
+class ButtonContainer : public Cutscenes {
private:
Common::Stack< Common::Array<UIButton> > _savedButtons;
protected:
Common::Array<UIButton> _buttons;
int _buttonValue;
+ bool checkEvents(XeenEngine *vm);
+
/**
* Draws the scroll in the background
*/
- void doScroll(XeenEngine *vm, bool drawFlag, bool doFade);
-
- bool checkEvents(XeenEngine *vm);
+ virtual void doScroll(bool drawFlag, bool doFade);
public:
- ButtonContainer() : _buttonValue(0) {}
+ ButtonContainer(XeenEngine *vm) : Cutscenes(vm), _buttonValue(0) {}
/**
* Saves the current list of buttons
@@ -85,20 +86,16 @@ public:
class SettingsBaseDialog : public ButtonContainer {
protected:
- XeenEngine *_vm;
-
virtual void showContents(SpriteResource &title1, bool mode);
public:
- SettingsBaseDialog(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ SettingsBaseDialog(XeenEngine *vm) : ButtonContainer(vm) {}
virtual ~SettingsBaseDialog() {}
};
class CreditsScreen: public ButtonContainer {
private:
- XeenEngine *_vm;
-
- CreditsScreen(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ CreditsScreen(XeenEngine *vm) : ButtonContainer(vm) {}
void execute();
public:
diff --git a/engines/xeen/dialogs_automap.h b/engines/xeen/dialogs_automap.h
index f20f9b0104..239a73a932 100644
--- a/engines/xeen/dialogs_automap.h
+++ b/engines/xeen/dialogs_automap.h
@@ -31,9 +31,7 @@ class XeenEngine;
class AutoMapDialog: public ButtonContainer {
private:
- XeenEngine *_vm;
-
- AutoMapDialog(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ AutoMapDialog(XeenEngine *vm) : ButtonContainer(vm) {}
void execute();
public:
diff --git a/engines/xeen/dialogs_char_info.h b/engines/xeen/dialogs_char_info.h
index 90b35a9f6b..cddd4ec89c 100644
--- a/engines/xeen/dialogs_char_info.h
+++ b/engines/xeen/dialogs_char_info.h
@@ -31,12 +31,11 @@ namespace Xeen {
class CharacterInfo : public ButtonContainer {
private:
- XeenEngine *_vm;
SpriteResource _iconSprites;
DrawStruct _drawList[24];
int _cursorCell;
- CharacterInfo(XeenEngine *vm) : ButtonContainer(), _vm(vm), _cursorCell(0) {}
+ CharacterInfo(XeenEngine *vm) : ButtonContainer(vm), _cursorCell(0) {}
void execute(int charIndex);
diff --git a/engines/xeen/dialogs_control_panel.h b/engines/xeen/dialogs_control_panel.h
index 16c3781789..ef86acf245 100644
--- a/engines/xeen/dialogs_control_panel.h
+++ b/engines/xeen/dialogs_control_panel.h
@@ -29,9 +29,7 @@ namespace Xeen {
class ControlPanel : public ButtonContainer {
private:
- XeenEngine *_vm;
-
- ControlPanel(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ ControlPanel(XeenEngine *vm) : ButtonContainer(vm) {}
int execute();
public:
diff --git a/engines/xeen/dialogs_dismiss.h b/engines/xeen/dialogs_dismiss.h
index ec40e87f7c..7b73fc6f03 100644
--- a/engines/xeen/dialogs_dismiss.h
+++ b/engines/xeen/dialogs_dismiss.h
@@ -30,10 +30,9 @@ namespace Xeen {
class Dismiss : public ButtonContainer {
private:
- XeenEngine *_vm;
SpriteResource _iconSprites;
- Dismiss(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ Dismiss(XeenEngine *vm) : ButtonContainer(vm) {}
void execute();
diff --git a/engines/xeen/dialogs_error.h b/engines/xeen/dialogs_error.h
index 46efdb1683..56e30bc9de 100644
--- a/engines/xeen/dialogs_error.h
+++ b/engines/xeen/dialogs_error.h
@@ -33,9 +33,7 @@ enum ErrorWaitType { WT_FREEZE_WAIT = 0, WT_NONFREEZED_WAIT = 1,
class ErrorDialog : public ButtonContainer {
private:
- XeenEngine *_vm;
-
- ErrorDialog(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ ErrorDialog(XeenEngine *vm) : ButtonContainer(vm) {}
void execute(const Common::String &msg, ErrorWaitType waitType);
public:
@@ -51,9 +49,7 @@ public:
class CantCast: public ButtonContainer {
private:
- XeenEngine *_vm;
-
- CantCast(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ CantCast(XeenEngine *vm) : ButtonContainer(vm) {}
void execute(int spellId, int componentNum);
public:
diff --git a/engines/xeen/dialogs_exchange.h b/engines/xeen/dialogs_exchange.h
index e8c4a2dfb1..e67c315133 100644
--- a/engines/xeen/dialogs_exchange.h
+++ b/engines/xeen/dialogs_exchange.h
@@ -30,10 +30,9 @@ namespace Xeen {
class ExchangeDialog : public ButtonContainer {
private:
- XeenEngine *_vm;
SpriteResource _iconSprites;
- ExchangeDialog(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ ExchangeDialog(XeenEngine *vm) : ButtonContainer(vm) {}
void execute(Character *&c, int &charIndex);
diff --git a/engines/xeen/dialogs_fight_options.h b/engines/xeen/dialogs_fight_options.h
index 7b058bc6e9..823a716790 100644
--- a/engines/xeen/dialogs_fight_options.h
+++ b/engines/xeen/dialogs_fight_options.h
@@ -29,9 +29,7 @@ namespace Xeen {
class FightOptions : public ButtonContainer {
private:
- XeenEngine *_vm;
-
- FightOptions(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ FightOptions(XeenEngine *vm) : ButtonContainer(vm) {}
void execute();
public:
diff --git a/engines/xeen/dialogs_info.h b/engines/xeen/dialogs_info.h
index 66b915788b..68c8403545 100644
--- a/engines/xeen/dialogs_info.h
+++ b/engines/xeen/dialogs_info.h
@@ -30,10 +30,9 @@ namespace Xeen {
class InfoDialog : public ButtonContainer {
private:
- XeenEngine *_vm;
Common::StringArray _lines;
- InfoDialog(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ InfoDialog(XeenEngine *vm) : ButtonContainer(vm) {}
void execute();
diff --git a/engines/xeen/dialogs_input.h b/engines/xeen/dialogs_input.h
index e824d17f57..ce159c77a3 100644
--- a/engines/xeen/dialogs_input.h
+++ b/engines/xeen/dialogs_input.h
@@ -36,7 +36,6 @@ private:
*/
Common::KeyCode doCursor(const Common::String &msg);
protected:
- XeenEngine *_vm;
Window *_window;
/**
@@ -44,7 +43,7 @@ protected:
*/
int getString(Common::String &line, uint maxLen, int maxWidth, bool isNumeric);
- Input(XeenEngine *vm, Window *window) : _vm(vm), _window(window) {}
+ Input(XeenEngine *vm, Window *window) : ButtonContainer(vm), _window(window) {}
public:
static int show(XeenEngine *vm, Window *window, Common::String &line,
uint maxLen, int maxWidth, bool isNumeric = false);
@@ -72,10 +71,9 @@ public:
class Choose123 : public ButtonContainer {
private:
- XeenEngine *_vm;
SpriteResource _iconSprites;
- Choose123(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ Choose123(XeenEngine *vm) : ButtonContainer(vm) {}
int execute(int numOptions);
diff --git a/engines/xeen/dialogs_items.h b/engines/xeen/dialogs_items.h
index 6069ca823b..c161b0721b 100644
--- a/engines/xeen/dialogs_items.h
+++ b/engines/xeen/dialogs_items.h
@@ -37,15 +37,13 @@ enum ItemsMode {
class ItemsDialog : public ButtonContainer {
private:
- XeenEngine *_vm;
SpriteResource _iconSprites;
SpriteResource _equipSprites;
Character _itemsCharacter;
Character *_oldCharacter;
DrawStruct _itemsDrawList[INV_ITEMS_TOTAL];
- ItemsDialog(XeenEngine *vm) : ButtonContainer(),
- _vm(vm), _oldCharacter(nullptr) {}
+ ItemsDialog(XeenEngine *vm) : ButtonContainer(vm), _oldCharacter(nullptr) {}
Character *execute(Character *c, ItemsMode mode);
diff --git a/engines/xeen/dialogs_party.cpp b/engines/xeen/dialogs_party.cpp
index ced778f714..a297ed56fe 100644
--- a/engines/xeen/dialogs_party.cpp
+++ b/engines/xeen/dialogs_party.cpp
@@ -32,7 +32,7 @@
namespace Xeen {
-PartyDialog::PartyDialog(XeenEngine *vm) : ButtonContainer(),
+PartyDialog::PartyDialog(XeenEngine *vm) : ButtonContainer(vm),
PartyDrawer(vm), _vm(vm) {
initDrawStructs();
}
@@ -93,7 +93,7 @@ void PartyDialog::execute() {
screen._windows[0].update();
}
- doScroll(_vm, false, false);
+ doScroll(false, false);
events.setCursor(0);
if (_vm->getGameID() == GType_DarkSide) {
diff --git a/engines/xeen/dialogs_query.h b/engines/xeen/dialogs_query.h
index 96ae488b97..0b9b2687ac 100644
--- a/engines/xeen/dialogs_query.h
+++ b/engines/xeen/dialogs_query.h
@@ -29,9 +29,7 @@ namespace Xeen {
class Confirm : public ButtonContainer {
private:
- XeenEngine *_vm;
-
- Confirm(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ Confirm(XeenEngine *vm) : ButtonContainer(vm) {}
bool execute(const Common::String &msg, int mode);
public:
@@ -40,9 +38,7 @@ public:
class YesNo : public ButtonContainer {
private:
- XeenEngine *_vm;
-
- YesNo(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ YesNo(XeenEngine *vm) : ButtonContainer(vm) {}
bool execute(bool type, bool townFlag);
public:
diff --git a/engines/xeen/dialogs_quests.h b/engines/xeen/dialogs_quests.h
index 234accded6..dd1461f75b 100644
--- a/engines/xeen/dialogs_quests.h
+++ b/engines/xeen/dialogs_quests.h
@@ -30,11 +30,10 @@ namespace Xeen {
class Quests : public ButtonContainer {
private:
- XeenEngine *_vm;
SpriteResource _iconSprites;
Common::StringArray _questNotes;
- Quests(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ Quests(XeenEngine *vm) : ButtonContainer(vm) {}
void execute();
diff --git a/engines/xeen/dialogs_quick_ref.h b/engines/xeen/dialogs_quick_ref.h
index 0c1b8e3f91..eaafd99537 100644
--- a/engines/xeen/dialogs_quick_ref.h
+++ b/engines/xeen/dialogs_quick_ref.h
@@ -29,9 +29,7 @@ namespace Xeen {
class QuickReferenceDialog : public ButtonContainer {
private:
- XeenEngine *_vm;
-
- QuickReferenceDialog(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ QuickReferenceDialog(XeenEngine *vm) : ButtonContainer(vm) {}
void execute();
public:
diff --git a/engines/xeen/dialogs_spells.h b/engines/xeen/dialogs_spells.h
index 35b2708f7a..3ccdb836a3 100644
--- a/engines/xeen/dialogs_spells.h
+++ b/engines/xeen/dialogs_spells.h
@@ -41,12 +41,11 @@ struct SpellEntry {
class SpellsDialog : public ButtonContainer {
private:
- XeenEngine *_vm;
SpriteResource _iconSprites;
SpriteResource _scrollSprites;
Common::Array<SpellEntry> _spells;
- SpellsDialog(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ SpellsDialog(XeenEngine *vm) : ButtonContainer(vm) {}
Character *execute(ButtonContainer *priorDialog, Character *c, int isCasting);
@@ -60,10 +59,9 @@ public:
class CastSpell : public ButtonContainer {
private:
- XeenEngine *_vm;
SpriteResource _iconSprites;
- CastSpell(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ CastSpell(XeenEngine *vm) : ButtonContainer(vm) {}
int execute(Character *&c);
@@ -75,9 +73,7 @@ public:
class SpellOnWho : public ButtonContainer {
private:
- XeenEngine *_vm;
-
- SpellOnWho(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ SpellOnWho(XeenEngine *vm) : ButtonContainer(vm) {}
int execute(int spellId);
public:
@@ -86,10 +82,9 @@ public:
class SelectElement : public ButtonContainer {
private:
- XeenEngine *_vm;
SpriteResource _iconSprites;
- SelectElement(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ SelectElement(XeenEngine *vm) : ButtonContainer(vm) {}
int execute(int spellId);
@@ -100,9 +95,7 @@ public:
class NotWhileEngaged : public ButtonContainer {
private:
- XeenEngine *_vm;
-
- NotWhileEngaged(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ NotWhileEngaged(XeenEngine *vm) : ButtonContainer(vm) {}
void execute(int spellId);
public:
@@ -111,10 +104,9 @@ public:
class LloydsBeacon : public ButtonContainer {
private:
- XeenEngine *_vm;
SpriteResource _iconSprites;
- LloydsBeacon(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ LloydsBeacon(XeenEngine *vm) : ButtonContainer(vm) {}
bool execute();
@@ -125,10 +117,9 @@ public:
class Teleport : public ButtonContainer {
private:
- XeenEngine *_vm;
SpriteResource _iconSprites;
- Teleport(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ Teleport(XeenEngine *vm) : ButtonContainer(vm) {}
int execute();
public:
@@ -137,9 +128,7 @@ public:
class TownPortal : public ButtonContainer {
private:
- XeenEngine *_vm;
-
- TownPortal(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ TownPortal(XeenEngine *vm) : ButtonContainer(vm) {}
int execute();
public:
@@ -148,9 +137,7 @@ public:
class IdentifyMonster : public ButtonContainer {
private:
- XeenEngine *_vm;
-
- IdentifyMonster(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ IdentifyMonster(XeenEngine *vm) : ButtonContainer(vm) {}
void execute();
public:
diff --git a/engines/xeen/dialogs_whowill.h b/engines/xeen/dialogs_whowill.h
index 8080c36ddb..8018cbb0ef 100644
--- a/engines/xeen/dialogs_whowill.h
+++ b/engines/xeen/dialogs_whowill.h
@@ -29,9 +29,7 @@ namespace Xeen {
class WhoWill : public ButtonContainer {
private:
- XeenEngine *_vm;
-
- WhoWill(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ WhoWill(XeenEngine *vm) : ButtonContainer(vm) {}
int execute(int message, int action, bool type);
public:
diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp
index 6c09b05b60..8bf90984a4 100644
--- a/engines/xeen/interface.cpp
+++ b/engines/xeen/interface.cpp
@@ -130,7 +130,7 @@ void PartyDrawer::resetHighlight() {
}
/*------------------------------------------------------------------------*/
-Interface::Interface(XeenEngine *vm) : ButtonContainer(), InterfaceMap(vm),
+Interface::Interface(XeenEngine *vm) : ButtonContainer(vm), InterfaceMap(vm),
PartyDrawer(vm), _vm(vm) {
_buttonsLoaded = false;
_intrIndex1 = 0;
diff --git a/engines/xeen/module.mk b/engines/xeen/module.mk
index 833b8cf1d2..968a30c23d 100644
--- a/engines/xeen/module.mk
+++ b/engines/xeen/module.mk
@@ -1,12 +1,12 @@
MODULE := engines/xeen
MODULE_OBJS := \
- worldofxeen/cutscenes.o \
worldofxeen/clouds_cutscenes.o \
worldofxeen/darkside_cutscenes.o \
worldofxeen/worldofxeen.o \
character.o \
combat.o \
+ cutscenes.o \
debugger.o \
detection.o \
dialogs.o \
diff --git a/engines/xeen/town.cpp b/engines/xeen/town.cpp
index 1947129c57..1fe0487ad2 100644
--- a/engines/xeen/town.cpp
+++ b/engines/xeen/town.cpp
@@ -30,7 +30,7 @@
namespace Xeen {
-Town::Town(XeenEngine *vm) : _vm(vm) {
+Town::Town(XeenEngine *vm) : ButtonContainer(vm) {
Common::fill(&_arr1[0], &_arr1[6], 0);
_townMaxId = 0;
_townActionId = 0;
diff --git a/engines/xeen/town.h b/engines/xeen/town.h
index f56f24ca73..0767638f8a 100644
--- a/engines/xeen/town.h
+++ b/engines/xeen/town.h
@@ -37,7 +37,6 @@ class TownMessage;
class Town: public ButtonContainer {
friend class TownMessage;
private:
- XeenEngine *_vm;
SpriteResource _icons1, _icons2;
Common::StringArray _textStrings;
Common::Array<SpriteResource> _townSprites;
@@ -114,10 +113,9 @@ public:
class TownMessage : public ButtonContainer {
private:
- XeenEngine *_vm;
SpriteResource _iconSprites;
- TownMessage(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ TownMessage(XeenEngine *vm) : ButtonContainer(vm) {}
bool execute(int portrait, const Common::String &name,
const Common::String &text, int confirm);
diff --git a/engines/xeen/worldofxeen/clouds_cutscenes.h b/engines/xeen/worldofxeen/clouds_cutscenes.h
index ff935a75fe..1440458c10 100644
--- a/engines/xeen/worldofxeen/clouds_cutscenes.h
+++ b/engines/xeen/worldofxeen/clouds_cutscenes.h
@@ -23,7 +23,7 @@
#ifndef XEEN_WORLDOFXEEN_CLOUDS_CUTSCENES_H
#define XEEN_WORLDOFXEEN_CLOUDS_CUTSCENES_H
-#include "xeen/worldofxeen/cutscenes.h"
+#include "xeen/cutscenes.h"
#include "xeen/xeen.h"
namespace Xeen {
diff --git a/engines/xeen/worldofxeen/darkside_cutscenes.h b/engines/xeen/worldofxeen/darkside_cutscenes.h
index cbd961069f..7c6a1bfb08 100644
--- a/engines/xeen/worldofxeen/darkside_cutscenes.h
+++ b/engines/xeen/worldofxeen/darkside_cutscenes.h
@@ -23,7 +23,7 @@
#ifndef XEEN_WORLDOFXEEN_DARKSIDE_CUTSCENES_H
#define XEEN_WORLDOFXEEN_DARKSIDE_CUTSCENES_H
-#include "xeen/worldofxeen/cutscenes.h"
+#include "xeen/cutscenes.h"
namespace Xeen {