aboutsummaryrefslogtreecommitdiff
path: root/sword2
diff options
context:
space:
mode:
authorMax Horn2005-01-10 22:06:49 +0000
committerMax Horn2005-01-10 22:06:49 +0000
commitcffd917165a14e981d61342458a9d054d3c14705 (patch)
tree3aa6658993fa842477a7ab10b2a21dbf7625a531 /sword2
parente79458130835528ddf693fba868243cbbfb4ee9a (diff)
downloadscummvm-rg350-cffd917165a14e981d61342458a9d054d3c14705.tar.gz
scummvm-rg350-cffd917165a14e981d61342458a9d054d3c14705.tar.bz2
scummvm-rg350-cffd917165a14e981d61342458a9d054d3c14705.zip
system.h was being included in tons of places, without any good reason; reduced this (total dependencies on system.h went down from 193 to 85 files)
svn-id: r16527
Diffstat (limited to 'sword2')
-rw-r--r--sword2/build_display.cpp7
-rw-r--r--sword2/controls.cpp1
-rw-r--r--sword2/debug.cpp2
-rw-r--r--sword2/driver/_mouse.cpp1
-rw-r--r--sword2/driver/animation.cpp1
-rw-r--r--sword2/driver/d_draw.cpp1
-rw-r--r--sword2/driver/d_sound.cpp1
-rw-r--r--sword2/driver/d_sound.h2
-rw-r--r--sword2/driver/menu.cpp4
-rw-r--r--sword2/driver/palette.cpp1
-rw-r--r--sword2/driver/rdwin.cpp1
-rw-r--r--sword2/driver/render.cpp1
-rw-r--r--sword2/function.cpp3
-rw-r--r--sword2/maketext.cpp1
-rw-r--r--sword2/save_rest.cpp1
-rw-r--r--sword2/sword2.cpp10
-rw-r--r--sword2/sword2.h8
17 files changed, 36 insertions, 10 deletions
diff --git a/sword2/build_display.cpp b/sword2/build_display.cpp
index eb6b8737e8..b0a6468bb0 100644
--- a/sword2/build_display.cpp
+++ b/sword2/build_display.cpp
@@ -22,6 +22,7 @@
// ---------------------------------------------------------------------------
#include "common/stdafx.h"
+#include "common/system.h"
#include "sword2/sword2.h"
#include "sword2/console.h"
#include "sword2/defs.h"
@@ -103,10 +104,10 @@ void Sword2Engine::buildDisplay(void) {
_graphics->updateDisplay();
_frameCount++;
- if (_system->getMillis() > _cycleTime) {
+ if (getMillis() > _cycleTime) {
_fps = _frameCount;
_frameCount = 0;
- _cycleTime = _system->getMillis() + 1000;
+ _cycleTime = getMillis() + 1000;
}
} while (!_graphics->endRenderCycle());
@@ -174,7 +175,7 @@ void Sword2Engine::displayMsg(byte *text, int time) {
_graphics->waitForFade();
if (time > 0) {
- uint32 targetTime = _system->getMillis() + (time * 1000);
+ uint32 targetTime = getMillis() + (time * 1000);
sleepUntil(targetTime);
} else {
while (!_quit) {
diff --git a/sword2/controls.cpp b/sword2/controls.cpp
index b3d3af4a8e..459f413846 100644
--- a/sword2/controls.cpp
+++ b/sword2/controls.cpp
@@ -20,6 +20,7 @@
#include "common/stdafx.h"
#include "common/rect.h"
#include "common/config-manager.h"
+#include "common/system.h"
#include "sword2/sword2.h"
#include "sword2/controls.h"
#include "sword2/defs.h"
diff --git a/sword2/debug.cpp b/sword2/debug.cpp
index cf28e26f3a..b62eeee0d8 100644
--- a/sword2/debug.cpp
+++ b/sword2/debug.cpp
@@ -116,7 +116,7 @@ void Debugger::buildDebugText(void) {
// debug info at top of screen - enabled/disabled as one complete unit
if (_displayTime) {
- int32 time = _vm->_system->getMillis();
+ int32 time = _vm->getMillis();
if ((time - _startTime) / 1000 >= 10000)
_startTime = time;
diff --git a/sword2/driver/_mouse.cpp b/sword2/driver/_mouse.cpp
index bde0896df2..dd9c42c88f 100644
--- a/sword2/driver/_mouse.cpp
+++ b/sword2/driver/_mouse.cpp
@@ -18,6 +18,7 @@
*/
#include "common/stdafx.h"
+#include "common/system.h"
#include "sword2/sword2.h"
#include "sword2/driver/d_draw.h"
diff --git a/sword2/driver/animation.cpp b/sword2/driver/animation.cpp
index ff5dac2375..3a1a30f630 100644
--- a/sword2/driver/animation.cpp
+++ b/sword2/driver/animation.cpp
@@ -22,6 +22,7 @@
#include "common/stdafx.h"
#include "common/file.h"
#include "common/config-manager.h"
+#include "common/system.h"
#include "sound/vorbis.h"
#include "sound/mp3.h"
diff --git a/sword2/driver/d_draw.cpp b/sword2/driver/d_draw.cpp
index 293a2da838..822d858e35 100644
--- a/sword2/driver/d_draw.cpp
+++ b/sword2/driver/d_draw.cpp
@@ -18,6 +18,7 @@
*/
#include "common/stdafx.h"
+#include "common/system.h"
#include "sword2/sword2.h"
#include "sword2/driver/d_draw.h"
#include "sword2/driver/menu.h"
diff --git a/sword2/driver/d_sound.cpp b/sword2/driver/d_sound.cpp
index 495fcf24b0..c61a349d28 100644
--- a/sword2/driver/d_sound.cpp
+++ b/sword2/driver/d_sound.cpp
@@ -25,6 +25,7 @@
#include "common/stdafx.h"
#include "common/file.h"
+#include "common/system.h"
#include "sound/mp3.h"
#include "sound/vorbis.h"
#include "sound/flac.h"
diff --git a/sword2/driver/d_sound.h b/sword2/driver/d_sound.h
index 96a6689ff6..77d8f753d0 100644
--- a/sword2/driver/d_sound.h
+++ b/sword2/driver/d_sound.h
@@ -59,7 +59,7 @@ class Sound : public AudioStream {
private:
Sword2Engine *_vm;
- OSystem::MutexRef _mutex;
+ Common::MutexRef _mutex;
int32 _panTable[33];
bool _soundOn;
diff --git a/sword2/driver/menu.cpp b/sword2/driver/menu.cpp
index e8b39d0d37..98a430e11c 100644
--- a/sword2/driver/menu.cpp
+++ b/sword2/driver/menu.cpp
@@ -55,10 +55,10 @@ void Graphics::processMenu(void) {
static int32 lastTime = 0;
if (lastTime == 0) {
- lastTime = _vm->_system->getMillis();
+ lastTime = _vm->getMillis();
frameCount = 1;
} else {
- int32 delta = _vm->_system->getMillis() - lastTime;
+ int32 delta = _vm->getMillis() - lastTime;
if (delta > 250) {
lastTime += delta;
diff --git a/sword2/driver/palette.cpp b/sword2/driver/palette.cpp
index 285c463e14..2423d38ae3 100644
--- a/sword2/driver/palette.cpp
+++ b/sword2/driver/palette.cpp
@@ -18,6 +18,7 @@
*/
#include "common/stdafx.h"
+#include "common/system.h"
#include "sword2/sword2.h"
#include "sword2/driver/d_draw.h"
diff --git a/sword2/driver/rdwin.cpp b/sword2/driver/rdwin.cpp
index 45405b47d0..51ae28569b 100644
--- a/sword2/driver/rdwin.cpp
+++ b/sword2/driver/rdwin.cpp
@@ -18,6 +18,7 @@
*/
#include "common/stdafx.h"
+#include "common/system.h"
#include "sword2/sword2.h"
#include "sword2/driver/d_draw.h"
#include "sword2/driver/menu.h"
diff --git a/sword2/driver/render.cpp b/sword2/driver/render.cpp
index 4f7f8947cf..9a07cb0431 100644
--- a/sword2/driver/render.cpp
+++ b/sword2/driver/render.cpp
@@ -18,6 +18,7 @@
*/
#include "common/stdafx.h"
+#include "common/system.h"
#include "sword2/sword2.h"
#include "sword2/driver/animation.h"
#include "sword2/driver/d_draw.h"
diff --git a/sword2/function.cpp b/sword2/function.cpp
index 102f328281..99f52a8b5e 100644
--- a/sword2/function.cpp
+++ b/sword2/function.cpp
@@ -19,6 +19,7 @@
#include "common/stdafx.h"
#include "common/file.h"
+#include "common/system.h"
#include "sword2/sword2.h"
#include "sword2/defs.h"
#include "sword2/interpreter.h"
@@ -588,7 +589,7 @@ int32 Logic::fnPlayCredits(int32 *params) {
bool abortCredits = false;
int scrollSteps = lineTop + CREDITS_FONT_HEIGHT;
- uint32 musicStart = _vm->_system->getMillis();
+ uint32 musicStart = _vm->getMillis();
// Ideally the music should last just a tiny bit longer than the
// credits. Note that musicTimeRemaining() will return 0 if the music
diff --git a/sword2/maketext.cpp b/sword2/maketext.cpp
index 8bad8e6ce7..b8ab6a6ca9 100644
--- a/sword2/maketext.cpp
+++ b/sword2/maketext.cpp
@@ -36,6 +36,7 @@
// as a resource) on 5dec96.
#include "common/stdafx.h"
+#include "common/system.h"
#include "sword2/sword2.h"
#include "sword2/defs.h"
#include "sword2/logic.h"
diff --git a/sword2/save_rest.cpp b/sword2/save_rest.cpp
index 365c2baadc..680ce944ce 100644
--- a/sword2/save_rest.cpp
+++ b/sword2/save_rest.cpp
@@ -27,6 +27,7 @@
// ---------------------------------------------------------------------------
#include "common/stdafx.h"
+#include "common/savefile.h"
#include "sword2/sword2.h"
#include "sword2/defs.h"
#include "sword2/interpreter.h"
diff --git a/sword2/sword2.cpp b/sword2/sword2.cpp
index 8894c289ec..dc3c96ad26 100644
--- a/sword2/sword2.cpp
+++ b/sword2/sword2.cpp
@@ -18,11 +18,15 @@
*/
#include "common/stdafx.h"
+
#include "backends/fs/fs.h"
+
#include "base/gameDetector.h"
#include "base/plugins.h"
+
#include "common/config-manager.h"
#include "common/file.h"
+#include "common/system.h"
#include "sword2/sword2.h"
#include "sword2/console.h"
@@ -545,7 +549,7 @@ void Sword2Engine::startGame() {
// FIXME: Move this to some better place?
void Sword2Engine::sleepUntil(uint32 time) {
- while (_system->getMillis() < time) {
+ while (getMillis() < time) {
// Make sure menu animations and fades don't suffer, but don't
// redraw the entire scene.
_graphics->processMenu();
@@ -612,4 +616,8 @@ void Sword2Engine::unpauseGame() {
setMouse(NORMAL_MOUSE_ID);
}
+uint32 Sword2Engine::getMillis() {
+ return _system->getMillis();
+}
+
} // End of namespace Sword2
diff --git a/sword2/sword2.h b/sword2/sword2.h
index e230995d3b..0d0a832800 100644
--- a/sword2/sword2.h
+++ b/sword2/sword2.h
@@ -29,7 +29,7 @@
#include "base/engine.h"
-#include "common/system.h"
+#include "common/util.h"
#include "sword2/driver/driver96.h"
#include "sword2/build_display.h"
@@ -41,6 +41,7 @@
#include "sword2/save_rest.h"
class GameDetector;
+class OSystem;
namespace Sword2 {
@@ -407,6 +408,11 @@ public:
void errorString(const char *buf_input, char *buf_output);
void initialiseFontResourceFlags();
void initialiseFontResourceFlags(uint8 language);
+
+
+ // Convenience alias for OSystem::getMillis().
+ // This is a bit hackish, of course :-).
+ uint32 getMillis();
};
} // End of namespace Sword2