aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sword2/anims.cpp1
-rw-r--r--sword2/build_display.cpp1
-rw-r--r--sword2/console.cpp1
-rw-r--r--sword2/console.h1
-rw-r--r--sword2/controls.cpp1
-rw-r--r--sword2/debug.cpp2
-rw-r--r--sword2/events.cpp1
-rw-r--r--sword2/function.cpp2
-rw-r--r--sword2/icons.cpp1
-rw-r--r--sword2/interpreter.cpp1
-rw-r--r--sword2/logic.cpp19
-rw-r--r--sword2/logic.h24
-rw-r--r--sword2/memory.cpp1
-rw-r--r--sword2/mouse.cpp2
-rw-r--r--sword2/resman.cpp2
-rw-r--r--sword2/save_rest.cpp2
-rw-r--r--sword2/sound.cpp1
-rw-r--r--sword2/speech.cpp2
-rw-r--r--sword2/startup.cpp3
-rw-r--r--sword2/sword2.cpp3
-rw-r--r--sword2/sword2.h4
-rw-r--r--sword2/walker.cpp2
22 files changed, 52 insertions, 25 deletions
diff --git a/sword2/anims.cpp b/sword2/anims.cpp
index 6d2a89ab36..12c67645ce 100644
--- a/sword2/anims.cpp
+++ b/sword2/anims.cpp
@@ -31,6 +31,7 @@
#include "sword2/interpreter.h"
#include "sword2/logic.h"
#include "sword2/maketext.h"
+#include "sword2/memory.h"
#include "sword2/resman.h"
#include "sword2/driver/animation.h"
#include "sword2/driver/d_draw.h"
diff --git a/sword2/build_display.cpp b/sword2/build_display.cpp
index dd000590e0..eb1835cba4 100644
--- a/sword2/build_display.cpp
+++ b/sword2/build_display.cpp
@@ -28,6 +28,7 @@
#include "sword2/interpreter.h"
#include "sword2/logic.h"
#include "sword2/maketext.h"
+#include "sword2/memory.h"
#include "sword2/resman.h"
#include "sword2/driver/d_draw.h"
diff --git a/sword2/console.cpp b/sword2/console.cpp
index efedb92490..99b13c47b5 100644
--- a/sword2/console.cpp
+++ b/sword2/console.cpp
@@ -23,6 +23,7 @@
#include "sword2/console.h"
#include "sword2/logic.h"
#include "sword2/maketext.h"
+#include "sword2/memory.h"
#include "sword2/resman.h"
#include "sword2/driver/d_draw.h"
#include "sword2/driver/d_sound.h"
diff --git a/sword2/console.h b/sword2/console.h
index dd95670264..68476ee635 100644
--- a/sword2/console.h
+++ b/sword2/console.h
@@ -22,7 +22,6 @@
#include "common/debugger.h"
#include "sword2/debug.h"
-#include "sword2/object.h"
namespace Sword2 {
diff --git a/sword2/controls.cpp b/sword2/controls.cpp
index 77700f6129..899bb40d4d 100644
--- a/sword2/controls.cpp
+++ b/sword2/controls.cpp
@@ -25,6 +25,7 @@
#include "sword2/defs.h"
#include "sword2/logic.h"
#include "sword2/resman.h"
+#include "sword2/router.h"
#include "sword2/driver/d_draw.h"
#include "sword2/driver/d_sound.h"
diff --git a/sword2/debug.cpp b/sword2/debug.cpp
index 347f14630a..4cae752841 100644
--- a/sword2/debug.cpp
+++ b/sword2/debug.cpp
@@ -23,7 +23,9 @@
#include "sword2/defs.h"
#include "sword2/logic.h"
#include "sword2/maketext.h"
+#include "sword2/memory.h"
#include "sword2/resman.h"
+#include "sword2/router.h"
#include "sword2/driver/d_draw.h"
namespace Sword2 {
diff --git a/sword2/events.cpp b/sword2/events.cpp
index e318529efb..0d453c3c71 100644
--- a/sword2/events.cpp
+++ b/sword2/events.cpp
@@ -23,6 +23,7 @@
#include "sword2/console.h"
#include "sword2/interpreter.h"
#include "sword2/logic.h"
+#include "sword2/memory.h"
#include "sword2/resman.h"
#define Debug_Printf _vm->_debugger->DebugPrintf
diff --git a/sword2/function.cpp b/sword2/function.cpp
index 3a70407d61..dd890ee610 100644
--- a/sword2/function.cpp
+++ b/sword2/function.cpp
@@ -24,7 +24,9 @@
#include "sword2/interpreter.h"
#include "sword2/logic.h"
#include "sword2/maketext.h"
+#include "sword2/memory.h"
#include "sword2/resman.h"
+#include "sword2/sound.h"
#include "sword2/driver/d_draw.h"
#include "sword2/driver/d_sound.h"
#include "sword2/driver/render.h"
diff --git a/sword2/icons.cpp b/sword2/icons.cpp
index c782826a85..2348169b46 100644
--- a/sword2/icons.cpp
+++ b/sword2/icons.cpp
@@ -22,6 +22,7 @@
#include "sword2/defs.h"
#include "sword2/interpreter.h"
#include "sword2/logic.h"
+#include "sword2/memory.h"
#include "sword2/resman.h"
#include "sword2/driver/d_draw.h"
diff --git a/sword2/interpreter.cpp b/sword2/interpreter.cpp
index 88b924c2b6..cb6fbc8ea8 100644
--- a/sword2/interpreter.cpp
+++ b/sword2/interpreter.cpp
@@ -22,6 +22,7 @@
#include "sword2/sword2.h"
#include "sword2/interpreter.h"
#include "sword2/logic.h"
+#include "sword2/memory.h"
namespace Sword2 {
diff --git a/sword2/logic.cpp b/sword2/logic.cpp
index 6a9ce94dc0..d1e28b46b8 100644
--- a/sword2/logic.cpp
+++ b/sword2/logic.cpp
@@ -24,6 +24,7 @@
#include "sword2/interpreter.h"
#include "sword2/logic.h"
#include "sword2/resman.h"
+#include "sword2/router.h"
#define LEVEL (_curObjectHub->logic_level)
@@ -31,6 +32,24 @@
namespace Sword2 {
+Logic::Logic(Sword2Engine *vm) :
+ _vm(vm), _kills(0), _smackerLeadOut(0), _sequenceTextLines(0),
+ _speechTime(0), _animId(0), _speechAnimType(0), _leftClickDelay(0),
+ _rightClickDelay(0), _defaultResponseId(0), _totalStartups(0),
+ _totalScreenManagers(0), _officialTextNumber(0), _speechTextBlocNo(0),
+ _choosing(false) {
+ _scriptVars = NULL;
+ memset(_subjectList, 0, sizeof(_subjectList));
+ memset(_eventList, 0, sizeof(_eventList));
+ memset(_syncList, 0, sizeof(_syncList));
+ _router = new Router(_vm);
+ initStartMenu();
+}
+
+Logic::~Logic() {
+ delete _router;
+}
+
/**
* Do one cycle of the current session.
*/
diff --git a/sword2/logic.h b/sword2/logic.h
index aac49a7404..8b3217963f 100644
--- a/sword2/logic.h
+++ b/sword2/logic.h
@@ -22,9 +22,6 @@
#ifndef _LOGIC
#define _LOGIC
-#include "sword2/header.h"
-#include "sword2/memory.h"
-#include "sword2/router.h"
#include "sword2/speech.h"
#include "sword2/startup.h"
@@ -43,6 +40,7 @@ namespace Sword2 {
#define MAX_SEQUENCE_TEXT_LINES 15
class Sword2Engine;
+class Router;
class Logic {
private:
@@ -164,24 +162,8 @@ private:
ObjectMega _engineMega;
public:
- Logic(Sword2Engine *vm) :
- _vm(vm), _kills(0), _smackerLeadOut(0),
- _sequenceTextLines(0), _speechTime(0), _animId(0),
- _speechAnimType(0), _leftClickDelay(0), _rightClickDelay(0),
- _defaultResponseId(0), _totalStartups(0),
- _totalScreenManagers(0), _officialTextNumber(0),
- _speechTextBlocNo(0), _choosing(false) {
- _scriptVars = NULL;
- memset(_subjectList, 0, sizeof(_subjectList));
- memset(_eventList, 0, sizeof(_eventList));
- memset(_syncList, 0, sizeof(_syncList));
- _router = new Router(_vm);
- initStartMenu();
- }
-
- ~Logic() {
- delete _router;
- }
+ Logic(Sword2Engine *vm);
+ ~Logic();
// Point to the global variable data
static uint32 *_scriptVars;
diff --git a/sword2/memory.cpp b/sword2/memory.cpp
index 784b359420..de9110466e 100644
--- a/sword2/memory.cpp
+++ b/sword2/memory.cpp
@@ -43,6 +43,7 @@
#include "common/stdafx.h"
#include "sword2/sword2.h"
#include "sword2/console.h"
+#include "sword2/memory.h"
namespace Sword2 {
diff --git a/sword2/mouse.cpp b/sword2/mouse.cpp
index 1e7a42718f..9c38a0f21a 100644
--- a/sword2/mouse.cpp
+++ b/sword2/mouse.cpp
@@ -25,7 +25,9 @@
#include "sword2/interpreter.h"
#include "sword2/logic.h"
#include "sword2/maketext.h"
+#include "sword2/memory.h"
#include "sword2/resman.h"
+#include "sword2/sound.h"
#include "sword2/driver/d_draw.h"
#include "sword2/driver/d_sound.h"
diff --git a/sword2/resman.cpp b/sword2/resman.cpp
index 7bf09daaab..76f3799de0 100644
--- a/sword2/resman.cpp
+++ b/sword2/resman.cpp
@@ -23,7 +23,9 @@
#include "sword2/console.h"
#include "sword2/defs.h"
#include "sword2/logic.h"
+#include "sword2/memory.h"
#include "sword2/resman.h"
+#include "sword2/router.h"
#include "sword2/driver/d_draw.h"
#define Debug_Printf _vm->_debugger->DebugPrintf
diff --git a/sword2/save_rest.cpp b/sword2/save_rest.cpp
index a12d498c43..0f2a6e74a5 100644
--- a/sword2/save_rest.cpp
+++ b/sword2/save_rest.cpp
@@ -31,7 +31,9 @@
#include "sword2/defs.h"
#include "sword2/interpreter.h"
#include "sword2/logic.h"
+#include "sword2/memory.h"
#include "sword2/resman.h"
+#include "sword2/sound.h"
namespace Sword2 {
diff --git a/sword2/sound.cpp b/sword2/sound.cpp
index bf0e79c1c8..4360358d39 100644
--- a/sword2/sound.cpp
+++ b/sword2/sound.cpp
@@ -34,6 +34,7 @@
#include "sword2/interpreter.h"
#include "sword2/logic.h"
#include "sword2/resman.h"
+#include "sword2/sound.h"
#include "sword2/driver/d_sound.h"
namespace Sword2 {
diff --git a/sword2/speech.cpp b/sword2/speech.cpp
index 99876bc08a..84e8a75690 100644
--- a/sword2/speech.cpp
+++ b/sword2/speech.cpp
@@ -19,6 +19,7 @@
#include "common/stdafx.h"
#include "common/file.h"
+
#include "sword2/sword2.h"
#include "sword2/console.h"
#include "sword2/controls.h"
@@ -26,6 +27,7 @@
#include "sword2/interpreter.h"
#include "sword2/logic.h"
#include "sword2/maketext.h"
+#include "sword2/memory.h"
#include "sword2/resman.h"
#include "sword2/driver/d_draw.h"
#include "sword2/driver/d_sound.h"
diff --git a/sword2/startup.cpp b/sword2/startup.cpp
index c7b5a49ac3..107750becb 100644
--- a/sword2/startup.cpp
+++ b/sword2/startup.cpp
@@ -19,13 +19,16 @@
#include "common/stdafx.h"
#include "common/file.h"
+
#include "sword2/sword2.h"
#include "sword2/console.h"
#include "sword2/defs.h"
#include "sword2/interpreter.h"
#include "sword2/logic.h"
#include "sword2/maketext.h"
+#include "sword2/memory.h"
#include "sword2/resman.h"
+#include "sword2/router.h"
#include "sword2/driver/d_sound.h"
#define Debug_Printf _vm->_debugger->DebugPrintf
diff --git a/sword2/sword2.cpp b/sword2/sword2.cpp
index 018687b07a..941c6a36d9 100644
--- a/sword2/sword2.cpp
+++ b/sword2/sword2.cpp
@@ -23,13 +23,16 @@
#include "base/plugins.h"
#include "common/config-manager.h"
#include "common/file.h"
+
#include "sword2/sword2.h"
#include "sword2/console.h"
#include "sword2/controls.h"
#include "sword2/defs.h"
#include "sword2/logic.h"
#include "sword2/maketext.h"
+#include "sword2/memory.h"
#include "sword2/resman.h"
+#include "sword2/sound.h"
#include "sword2/driver/d_draw.h"
#include "sword2/driver/d_sound.h"
diff --git a/sword2/sword2.h b/sword2/sword2.h
index 69cbc42b45..747b3f22d9 100644
--- a/sword2/sword2.h
+++ b/sword2/sword2.h
@@ -28,18 +28,15 @@
#define RIGHT_CLICK_CLEARS_LUGGAGE 0
#include "base/engine.h"
-#include "common/util.h"
#include "sword2/driver/driver96.h"
#include "sword2/build_display.h"
#include "sword2/header.h"
#include "sword2/icons.h"
#include "sword2/layers.h"
-#include "sword2/memory.h"
#include "sword2/mouse.h"
#include "sword2/object.h"
#include "sword2/save_rest.h"
-#include "sword2/sound.h"
class GameDetector;
@@ -49,6 +46,7 @@ enum {
GF_DEMO = 1 << 0
};
+class MemoryManager;
class ResourceManager;
class Sound;
class Graphics;
diff --git a/sword2/walker.cpp b/sword2/walker.cpp
index fd831e2d11..ee6c5a5e05 100644
--- a/sword2/walker.cpp
+++ b/sword2/walker.cpp
@@ -27,7 +27,9 @@
#include "sword2/defs.h"
#include "sword2/interpreter.h"
#include "sword2/logic.h"
+#include "sword2/memory.h"
#include "sword2/resman.h"
+#include "sword2/router.h"
#include "sword2/driver/d_draw.h"
namespace Sword2 {