aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMax Horn2009-12-09 21:03:22 +0000
committerMax Horn2009-12-09 21:03:22 +0000
commitf3420c63721dd6a8d857d9c44f794c83beaa7cf8 (patch)
tree80a9097dc2de4825af4d1e7160e0cf5a0b9f9c6a /engines
parent5cd176052c0016516b04ef208a9e262a4200920a (diff)
downloadscummvm-rg350-f3420c63721dd6a8d857d9c44f794c83beaa7cf8.tar.gz
scummvm-rg350-f3420c63721dd6a8d857d9c44f794c83beaa7cf8.tar.bz2
scummvm-rg350-f3420c63721dd6a8d857d9c44f794c83beaa7cf8.zip
DRACI: Reduce header interdependencies; some cleanup
svn-id: r46320
Diffstat (limited to 'engines')
-rw-r--r--engines/draci/animation.cpp8
-rw-r--r--engines/draci/animation.h7
-rw-r--r--engines/draci/barchive.cpp3
-rw-r--r--engines/draci/detection.cpp1
-rw-r--r--engines/draci/draci.cpp10
-rw-r--r--engines/draci/draci.h26
-rw-r--r--engines/draci/font.cpp1
-rw-r--r--engines/draci/font.h2
-rw-r--r--engines/draci/game.cpp11
-rw-r--r--engines/draci/game.h9
-rw-r--r--engines/draci/module.mk16
-rw-r--r--engines/draci/mouse.cpp6
-rw-r--r--engines/draci/mouse.h3
-rw-r--r--engines/draci/saveload.cpp1
-rw-r--r--engines/draci/screen.cpp6
-rw-r--r--engines/draci/screen.h4
-rw-r--r--engines/draci/script.cpp10
-rw-r--r--engines/draci/script.h24
-rw-r--r--engines/draci/sprite.cpp4
-rw-r--r--engines/draci/sprite.h12
-rw-r--r--engines/draci/walking.cpp5
21 files changed, 104 insertions, 65 deletions
diff --git a/engines/draci/animation.cpp b/engines/draci/animation.cpp
index b93c417602..ff1d07197f 100644
--- a/engines/draci/animation.cpp
+++ b/engines/draci/animation.cpp
@@ -1,4 +1,3 @@
-
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
@@ -26,6 +25,11 @@
#include "draci/draci.h"
#include "draci/animation.h"
+#include "draci/barchive.h"
+#include "draci/game.h"
+#include "draci/screen.h"
+#include "draci/sound.h"
+#include "draci/surface.h"
namespace Draci {
@@ -611,4 +615,4 @@ Animation *AnimationManager::load(uint animNum) {
return anim;
}
-}
+} // End of namespace Draci
diff --git a/engines/draci/animation.h b/engines/draci/animation.h
index 6f070cf9a7..b6e6e9fa1b 100644
--- a/engines/draci/animation.h
+++ b/engines/draci/animation.h
@@ -26,9 +26,8 @@
#ifndef DRACI_ANIMATION_H
#define DRACI_ANIMATION_H
-#include "draci/sprite.h"
-#include "draci/sound.h"
#include "common/rect.h"
+#include "draci/sprite.h"
namespace Draci {
@@ -56,6 +55,8 @@ enum {
enum { kIgnoreIndex = -2 };
class DraciEngine;
+class Surface;
+struct SoundSample;
class Animation {
@@ -215,6 +216,6 @@ private:
int _lastIndex;
};
-}
+} // End of namespace Draci
#endif // DRACI_ANIMATION_H
diff --git a/engines/draci/barchive.cpp b/engines/draci/barchive.cpp
index c9703559b8..2ed2a9b591 100644
--- a/engines/draci/barchive.cpp
+++ b/engines/draci/barchive.cpp
@@ -402,6 +402,3 @@ const BAFile *BArchive::getFile(uint i) {
}
} // End of namespace Draci
-
-
-
diff --git a/engines/draci/detection.cpp b/engines/draci/detection.cpp
index 26987b2bc0..e467935f48 100644
--- a/engines/draci/detection.cpp
+++ b/engines/draci/detection.cpp
@@ -27,6 +27,7 @@
#include "draci/saveload.h"
#include "base/plugins.h"
+#include "common/system.h"
#include "engines/advancedDetector.h"
#include "engines/metaengine.h"
diff --git a/engines/draci/draci.cpp b/engines/draci/draci.cpp
index 9ccd1b598a..e098dc969e 100644
--- a/engines/draci/draci.cpp
+++ b/engines/draci/draci.cpp
@@ -35,13 +35,17 @@
#include "graphics/font.h"
#include "draci/draci.h"
+#include "draci/animation.h"
#include "draci/barchive.h"
-#include "draci/script.h"
#include "draci/font.h"
-#include "draci/sprite.h"
-#include "draci/screen.h"
+#include "draci/game.h"
#include "draci/mouse.h"
+#include "draci/music.h"
#include "draci/saveload.h"
+#include "draci/screen.h"
+#include "draci/script.h"
+#include "draci/sound.h"
+#include "draci/sprite.h"
namespace Draci {
diff --git a/engines/draci/draci.h b/engines/draci/draci.h
index 82a8044ea0..338c751079 100644
--- a/engines/draci/draci.h
+++ b/engines/draci/draci.h
@@ -28,21 +28,13 @@
#include <math.h>
-#include "common/system.h"
#include "engines/engine.h"
-#include "draci/game.h"
-#include "draci/mouse.h"
-#include "draci/screen.h"
-#include "draci/font.h"
-#include "draci/script.h"
-#include "draci/barchive.h"
-#include "draci/animation.h"
-#include "draci/sound.h"
-#include "draci/music.h"
-
struct ADGameDescription;
+class MidiDriver;
+class OSystem;
+
/**
* This is the namespace of the Draci engine.
*
@@ -53,6 +45,17 @@ struct ADGameDescription;
*/
namespace Draci {
+class Screen;
+class Mouse;
+class Game;
+class Script;
+class AnimationManager;
+class Sound;
+class MusicPlayer;
+class Font;
+class BArchive;
+class SoundArchive;
+
class DraciEngine : public Engine {
public:
DraciEngine(OSystem *syst, const ADGameDescription *gameDesc);
@@ -125,4 +128,3 @@ static inline long scummvm_lround(double val) { return (long)floor(val + 0.5); }
} // End of namespace Draci
#endif // DRACI_H
-
diff --git a/engines/draci/font.cpp b/engines/draci/font.cpp
index 7c4bd7bbaa..b9231bb237 100644
--- a/engines/draci/font.cpp
+++ b/engines/draci/font.cpp
@@ -27,6 +27,7 @@
#include "draci/draci.h"
#include "draci/font.h"
+#include "draci/surface.h"
namespace Draci {
diff --git a/engines/draci/font.h b/engines/draci/font.h
index 0d1c35e9fa..b80a2fbedf 100644
--- a/engines/draci/font.h
+++ b/engines/draci/font.h
@@ -33,6 +33,8 @@ namespace Draci {
extern const char * const kFontSmall;
extern const char * const kFontBig;
+class Surface;
+
/**
* Default font colours. They all seem to remain constant except for the
* first one which varies depending on the character speaking.
diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp
index 19646cca27..d76369e638 100644
--- a/engines/draci/game.cpp
+++ b/engines/draci/game.cpp
@@ -23,14 +23,21 @@
*
*/
+#include "common/serializer.h"
#include "common/stream.h"
+#include "common/system.h"
#include "common/util.h"
#include "draci/draci.h"
+#include "draci/animation.h"
#include "draci/game.h"
#include "draci/barchive.h"
+#include "draci/font.h"
+#include "draci/mouse.h"
+#include "draci/screen.h"
#include "draci/script.h"
-#include "draci/animation.h"
+#include "draci/sound.h"
+#include "draci/surface.h"
namespace Draci {
@@ -1689,4 +1696,4 @@ void Room::load(int roomNum, BArchive *archive) {
_program._length = f->_length;
}
-}
+} // End of namespace Draci
diff --git a/engines/draci/game.h b/engines/draci/game.h
index 8f688aeb5e..e2aa1dcced 100644
--- a/engines/draci/game.h
+++ b/engines/draci/game.h
@@ -27,15 +27,16 @@
#define DRACI_GAME_H
#include "common/str.h"
-#include "common/serializer.h"
-#include "draci/barchive.h"
#include "draci/script.h"
-#include "draci/animation.h"
-#include "draci/sprite.h"
#include "draci/walking.h"
+namespace Common {
+ class Serializer;
+}
+
namespace Draci {
+class BArchive;
class DraciEngine;
enum {
diff --git a/engines/draci/module.mk b/engines/draci/module.mk
index b5f25d1b33..a172e4b939 100644
--- a/engines/draci/module.mk
+++ b/engines/draci/module.mk
@@ -1,20 +1,20 @@
MODULE := engines/draci
MODULE_OBJS := \
- draci.o \
- detection.o \
+ animation.o \
barchive.o \
- script.o \
+ detection.o \
+ draci.o \
font.o \
+ game.o \
+ mouse.o \
+ music.o \
saveload.o \
+ screen.o \
+ script.o \
sound.o \
- music.o \
sprite.o \
- screen.o \
surface.o \
- mouse.o \
- game.o \
- animation.o \
walking.o
MODULE_DIRS += \
diff --git a/engines/draci/mouse.cpp b/engines/draci/mouse.cpp
index 4d15d2e3f6..15fcc42760 100644
--- a/engines/draci/mouse.cpp
+++ b/engines/draci/mouse.cpp
@@ -27,6 +27,10 @@
#include "draci/game.h"
#include "draci/mouse.h"
#include "draci/barchive.h"
+#include "draci/screen.h"
+#include "draci/sprite.h"
+
+#include "graphics/cursorman.h"
namespace Draci {
@@ -123,4 +127,4 @@ void Mouse::loadItemCursor(const GameItem *item, bool highlighted) {
sp.getWidth() / 2, sp.getHeight() / 2);
}
-}
+} // End of namespace Draci
diff --git a/engines/draci/mouse.h b/engines/draci/mouse.h
index 87af2a3993..c47ce5b33c 100644
--- a/engines/draci/mouse.h
+++ b/engines/draci/mouse.h
@@ -27,7 +27,6 @@
#define DRACI_MOUSE_H
#include "common/events.h"
-#include "graphics/cursorman.h"
namespace Draci {
@@ -75,6 +74,6 @@ private:
DraciEngine *_vm;
};
-}
+} // End of namespace Draci
#endif // DRACI_MOUSE_H
diff --git a/engines/draci/saveload.cpp b/engines/draci/saveload.cpp
index b0c5dd1f78..856e6da832 100644
--- a/engines/draci/saveload.cpp
+++ b/engines/draci/saveload.cpp
@@ -24,6 +24,7 @@
*/
#include "draci/draci.h"
+#include "draci/game.h"
#include "draci/saveload.h"
#include "common/serializer.h"
diff --git a/engines/draci/screen.cpp b/engines/draci/screen.cpp
index a17e3c8ca7..9e91a14cfc 100644
--- a/engines/draci/screen.cpp
+++ b/engines/draci/screen.cpp
@@ -24,9 +24,13 @@
*/
#include "common/stream.h"
+#include "common/system.h"
#include "draci/draci.h"
#include "draci/screen.h"
+#include "draci/surface.h"
+#include "draci/sprite.h"
+
namespace Draci {
@@ -145,5 +149,3 @@ void Screen::clearScreen() {
}
} // End of namespace Draci
-
-
diff --git a/engines/draci/screen.h b/engines/draci/screen.h
index 648d3c40ed..dc1aca092d 100644
--- a/engines/draci/screen.h
+++ b/engines/draci/screen.h
@@ -26,8 +26,7 @@
#ifndef DRACI_SCREEN_H
#define DRACI_SCREEN_H
-#include "draci/surface.h"
-#include "draci/sprite.h"
+#include "common/scummsys.h"
namespace Draci {
@@ -39,6 +38,7 @@ enum ScreenParameters {
};
class DraciEngine;
+class Surface;
class Screen {
diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp
index 90f20920fc..a366740526 100644
--- a/engines/draci/script.cpp
+++ b/engines/draci/script.cpp
@@ -29,8 +29,15 @@
#include "common/stack.h"
#include "draci/draci.h"
-#include "draci/script.h"
+#include "draci/animation.h"
+#include "draci/barchive.h"
#include "draci/game.h"
+#include "draci/mouse.h"
+#include "draci/music.h"
+#include "draci/screen.h"
+#include "draci/script.h"
+#include "draci/sound.h"
+#include "draci/surface.h"
namespace Draci {
@@ -1201,4 +1208,3 @@ void Script::runWrapper(const GPL2Program &program, uint16 offset, bool disableC
}
} // End of namespace Draci
-
diff --git a/engines/draci/script.h b/engines/draci/script.h
index d6d0735b77..3d5880575d 100644
--- a/engines/draci/script.h
+++ b/engines/draci/script.h
@@ -27,31 +27,33 @@
#define DRACI_SCRIPT_H
#include "common/array.h"
-#include "common/str.h"
#include "common/stream.h"
-namespace Draci {
-
-/** The maximum number of parameters for a GPL command */
-const int kMaxParams = 3;
+namespace Common {
+ class MemoryReadStream;
+}
-class DraciEngine;
-class Script;
+namespace Draci {
enum {
+ /** The maximum number of parameters for a GPL command */
+ kMaxParams = 3,
+
kNumCommands = 55
};
+class DraciEngine;
+class Script;
+
typedef void (Script::*GPLHandler)(const Common::Array<int> &);
typedef int (Script::*GPLOperatorHandler)(int, int) const;
typedef int (Script::*GPLFunctionHandler)(int) const;
/**
- * Represents a single command in the GPL scripting language bytecode.
- * Each command is represented in the bytecode by a command number and a
- * subnumber.
+ * Represents a single command in the GPL scripting language bytecode.
+ * Each command is represented in the bytecode by a command number and a
+ * subnumber.
*/
-
enum GPL2ParameterType {
kGPL2Num = 1,
kGPL2Str = 2,
diff --git a/engines/draci/sprite.cpp b/engines/draci/sprite.cpp
index aa091a2688..cb3aa58cfa 100644
--- a/engines/draci/sprite.cpp
+++ b/engines/draci/sprite.cpp
@@ -26,8 +26,9 @@
#include "common/stream.h"
#include "draci/draci.h"
-#include "draci/sprite.h"
#include "draci/font.h"
+#include "draci/sprite.h"
+#include "draci/surface.h"
namespace Draci {
@@ -351,4 +352,3 @@ void Text::splitLinesLongerThan(uint maxWidth) {
}
} // End of namespace Draci
-
diff --git a/engines/draci/sprite.h b/engines/draci/sprite.h
index cc50ada477..b889603e63 100644
--- a/engines/draci/sprite.h
+++ b/engines/draci/sprite.h
@@ -26,8 +26,8 @@
#ifndef DRACI_SPRITE_H
#define DRACI_SPRITE_H
-#include "draci/surface.h"
-#include "draci/font.h"
+#include "common/scummsys.h"
+#include "common/rect.h"
namespace Draci {
@@ -37,11 +37,15 @@ enum DrawableType {
};
struct Displacement {
- int relX, relY;
- double extraScaleX, extraScaleY;
+ int relX, relY;
+ double extraScaleX, extraScaleY;
};
+
extern const Displacement kNoDisplacement;
+class Surface;
+class Font;
+
class Drawable {
public:
virtual void draw(Surface *surface, bool markDirty, int relX, int relY) const = 0;
diff --git a/engines/draci/walking.cpp b/engines/draci/walking.cpp
index 3764b64bc8..e57972fbc5 100644
--- a/engines/draci/walking.cpp
+++ b/engines/draci/walking.cpp
@@ -27,8 +27,9 @@
#include "common/stream.h"
-#include "draci/animation.h"
#include "draci/draci.h"
+#include "draci/animation.h"
+#include "draci/game.h"
#include "draci/walking.h"
#include "draci/sprite.h"
@@ -764,4 +765,4 @@ defaultCase:
}
}
-}
+} // End of namespace Draci