diff options
-rw-r--r-- | backends/events/default/default-events.h | 3 | ||||
-rw-r--r-- | common/events.h | 1 | ||||
-rw-r--r-- | common/xmlparser.cpp | 42 | ||||
-rw-r--r-- | common/xmlparser.h | 41 | ||||
-rw-r--r-- | engines/cine/prc.cpp | 3 | ||||
-rw-r--r-- | engines/cruise/cruise_main.cpp | 2 | ||||
-rw-r--r-- | engines/engine.h | 5 | ||||
-rw-r--r-- | engines/kyra/kyra_v1.h | 1 | ||||
-rw-r--r-- | engines/parallaction/input.cpp | 1 | ||||
-rw-r--r-- | engines/parallaction/parallaction.cpp | 1 | ||||
-rw-r--r-- | engines/queen/music.cpp | 2 | ||||
-rw-r--r-- | engines/saga/introproc_ihnm.cpp | 1 | ||||
-rw-r--r-- | engines/sky/logic.cpp | 1 | ||||
-rw-r--r-- | engines/sky/sky.cpp | 1 | ||||
-rw-r--r-- | engines/sword1/detection.cpp | 1 | ||||
-rw-r--r-- | engines/sword1/sound.cpp | 1 | ||||
-rw-r--r-- | engines/tucker/locations.cpp | 1 |
17 files changed, 64 insertions, 44 deletions
diff --git a/backends/events/default/default-events.h b/backends/events/default/default-events.h index b2cd1354cc..e481accc3e 100644 --- a/backends/events/default/default-events.h +++ b/backends/events/default/default-events.h @@ -28,6 +28,9 @@ #include "common/events.h" #include "common/savefile.h" +#include "common/mutex.h" + +class OSystem; /* At some point we will remove pollEvent from OSystem and change diff --git a/common/events.h b/common/events.h index c1655a17f3..0f0b0cf783 100644 --- a/common/events.h +++ b/common/events.h @@ -29,7 +29,6 @@ #include "common/keyboard.h" #include "common/queue.h" #include "common/rect.h" -#include "common/system.h" #include "common/noncopyable.h" namespace Common { diff --git a/common/xmlparser.cpp b/common/xmlparser.cpp index 516f4bfcdf..3e1a7dd451 100644 --- a/common/xmlparser.cpp +++ b/common/xmlparser.cpp @@ -23,16 +23,46 @@ * */ -#include "common/util.h" -#include "common/system.h" -#include "common/events.h" -#include "common/hashmap.h" -#include "common/hash-str.h" #include "common/xmlparser.h" +#include "common/util.h" +#include "common/archive.h" namespace Common { -using namespace Graphics; +bool XMLParser::loadFile(const Common::String &filename) { + _stream = SearchMan.openFile(filename); + if (!_stream) + return false; + + _fileName = filename; + return true; +} + +bool XMLParser::loadFile(const FSNode &node) { + _stream = node.openForReading(); + if (!_stream) + return false; + + _fileName = node.getName(); + return true; +} + +bool XMLParser::loadBuffer(const byte *buffer, uint32 size, bool disposable) { + _stream = new MemoryReadStream(buffer, size, disposable); + _fileName = "Memory Stream"; + return true; +} + +bool XMLParser::loadStream(Common::SeekableReadStream *stream) { + _stream = stream; + _fileName = "File Stream"; + return true; +} + +void XMLParser::close() { + delete _stream; + _stream = 0; +} bool XMLParser::parserError(const char *errorString, ...) { _state = kParserError; diff --git a/common/xmlparser.h b/common/xmlparser.h index 435e7c7e0c..08f4565b11 100644 --- a/common/xmlparser.h +++ b/common/xmlparser.h @@ -27,11 +27,7 @@ #define XML_PARSER_H #include "common/scummsys.h" -#include "common/archive.h" -#include "common/system.h" #include "common/stream.h" -#include "common/file.h" -#include "common/fs.h" #include "common/hashmap.h" #include "common/hash-str.h" @@ -40,6 +36,8 @@ namespace Common { +class FSNode; + /* XMLParser.cpp/h -- Generic XML Parser ===================================== @@ -184,23 +182,9 @@ public: * * @param filename Name of the file to load. */ - bool loadFile(const Common::String &filename) { - _stream = SearchMan.openFile(filename); - if (!_stream) - return false; - - _fileName = filename; - return true; - } + bool loadFile(const Common::String &filename); - bool loadFile(const FSNode &node) { - _stream = node.openForReading(); - if (!_stream) - return false; - - _fileName = node.getName(); - return true; - } + bool loadFile(const FSNode &node); /** * Loads a memory buffer into the parser. @@ -213,22 +197,11 @@ public: * i.e. if it can be freed safely after it's * no longer needed by the parser. */ - bool loadBuffer(const byte *buffer, uint32 size, bool disposable = false) { - _stream = new MemoryReadStream(buffer, size, disposable); - _fileName = "Memory Stream"; - return true; - } + bool loadBuffer(const byte *buffer, uint32 size, bool disposable = false); - bool loadStream(Common::SeekableReadStream *stream) { - _stream = stream; - _fileName = "File Stream"; - return true; - } + bool loadStream(Common::SeekableReadStream *stream); - void close() { - delete _stream; - _stream = 0; - } + void close(); /** * The actual parsing function. diff --git a/engines/cine/prc.cpp b/engines/cine/prc.cpp index 797a354c4f..487b8b60a4 100644 --- a/engines/cine/prc.cpp +++ b/engines/cine/prc.cpp @@ -26,11 +26,12 @@ #include "common/endian.h" #include "common/events.h" +#include "common/config-manager.h" +#include "common/system.h" // for g_system->getEventManager() #include "cine/cine.h" #include "cine/various.h" -#include "common/config-manager.h" namespace Cine { diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp index 7064f81a90..44f4f155aa 100644 --- a/engines/cruise/cruise_main.cpp +++ b/engines/cruise/cruise_main.cpp @@ -23,9 +23,9 @@ * */ - #include "common/endian.h" #include "common/events.h" +#include "common/system.h" // for g_system->getEventManager() #include "cruise/cruise_main.h" #include "cruise/cell.h" diff --git a/engines/engine.h b/engines/engine.h index de8523a1b0..e859cf090b 100644 --- a/engines/engine.h +++ b/engines/engine.h @@ -250,6 +250,11 @@ public: */ void openMainMenuDialog(); + + Common::TimerManager *getTimerManager() { return _timer; } + Common::EventManager *getEventManager() { return _eventMan; } + Common::SaveFileManager *getSaveFileManager() { return _saveFileMan; } + public: /** On some systems, check if the game appears to be run from CD. */ diff --git a/engines/kyra/kyra_v1.h b/engines/kyra/kyra_v1.h index 13b6397e44..e38f0b0633 100644 --- a/engines/kyra/kyra_v1.h +++ b/engines/kyra/kyra_v1.h @@ -30,6 +30,7 @@ #include "common/array.h" #include "common/events.h" +#include "common/system.h" #include "kyra/script.h" diff --git a/engines/parallaction/input.cpp b/engines/parallaction/input.cpp index 08df4f9fe3..4904e63df6 100644 --- a/engines/parallaction/input.cpp +++ b/engines/parallaction/input.cpp @@ -24,6 +24,7 @@ */ #include "common/events.h" +#include "common/system.h" #include "parallaction/input.h" #include "parallaction/parallaction.h" diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 5628c3c8c6..f61947f29c 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -27,6 +27,7 @@ #include "common/events.h" #include "common/file.h" #include "common/util.h" +#include "common/system.h" #include "sound/mididrv.h" #include "sound/mixer.h" diff --git a/engines/queen/music.cpp b/engines/queen/music.cpp index a668d38b40..8a50ae6b40 100644 --- a/engines/queen/music.cpp +++ b/engines/queen/music.cpp @@ -84,7 +84,7 @@ MidiMusic::MidiMusic(QueenEngine *vm) _parser->setMidiDriver(this); _parser->setTimerRate(_driver->getBaseTempo()); - vm->_system->getEventManager()->registerRandomSource(_rnd, "queenMusic"); + vm->getEventManager()->registerRandomSource(_rnd, "queenMusic"); } MidiMusic::~MidiMusic() { diff --git a/engines/saga/introproc_ihnm.cpp b/engines/saga/introproc_ihnm.cpp index 1cd1079d83..0b4ef6eb6a 100644 --- a/engines/saga/introproc_ihnm.cpp +++ b/engines/saga/introproc_ihnm.cpp @@ -39,6 +39,7 @@ #include "saga/scene.h" #include "common/events.h" +#include "common/system.h" namespace Saga { diff --git a/engines/sky/logic.cpp b/engines/sky/logic.cpp index 9f13bf9bee..fc8ecdca3a 100644 --- a/engines/sky/logic.cpp +++ b/engines/sky/logic.cpp @@ -27,6 +27,7 @@ #include "common/endian.h" #include "common/rect.h" #include "common/events.h" +#include "common/system.h" #include "sky/autoroute.h" #include "sky/compact.h" diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp index 4adce2ebaf..da63e432c2 100644 --- a/engines/sky/sky.cpp +++ b/engines/sky/sky.cpp @@ -24,6 +24,7 @@ */ #include "common/config-manager.h" +#include "common/system.h" #include "sky/control.h" #include "sky/debug.h" diff --git a/engines/sword1/detection.cpp b/engines/sword1/detection.cpp index 30f0ebcb2b..657364cc11 100644 --- a/engines/sword1/detection.cpp +++ b/engines/sword1/detection.cpp @@ -31,6 +31,7 @@ #include "common/file.h" #include "common/fs.h" #include "common/savefile.h" +#include "common/system.h" #include "graphics/thumbnail.h" #include "engines/metaengine.h" diff --git a/engines/sword1/sound.cpp b/engines/sword1/sound.cpp index d994ebf69b..caf6d48613 100644 --- a/engines/sword1/sound.cpp +++ b/engines/sword1/sound.cpp @@ -28,6 +28,7 @@ #include "common/util.h" #include "common/events.h" +#include "common/system.h" #include "sword1/sound.h" #include "sword1/resman.h" diff --git a/engines/tucker/locations.cpp b/engines/tucker/locations.cpp index b0bd3f1f48..d0e380eea4 100644 --- a/engines/tucker/locations.cpp +++ b/engines/tucker/locations.cpp @@ -25,6 +25,7 @@ #include "tucker/tucker.h" #include "tucker/graphics.h" +#include "common/system.h" namespace Tucker { |