Pushing down some header deps (on common/system.h, mostly)

svn-id: r35542
This commit is contained in:
Max Horn 2008-12-25 20:40:00 +00:00
parent f4fc0a9176
commit df20d264fd
17 changed files with 64 additions and 44 deletions

View file

@ -28,6 +28,9 @@
#include "common/events.h" #include "common/events.h"
#include "common/savefile.h" #include "common/savefile.h"
#include "common/mutex.h"
class OSystem;
/* /*
At some point we will remove pollEvent from OSystem and change At some point we will remove pollEvent from OSystem and change

View file

@ -29,7 +29,6 @@
#include "common/keyboard.h" #include "common/keyboard.h"
#include "common/queue.h" #include "common/queue.h"
#include "common/rect.h" #include "common/rect.h"
#include "common/system.h"
#include "common/noncopyable.h" #include "common/noncopyable.h"
namespace Common { namespace Common {

View file

@ -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/xmlparser.h"
#include "common/util.h"
#include "common/archive.h"
namespace Common { 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, ...) { bool XMLParser::parserError(const char *errorString, ...) {
_state = kParserError; _state = kParserError;

View file

@ -27,11 +27,7 @@
#define XML_PARSER_H #define XML_PARSER_H
#include "common/scummsys.h" #include "common/scummsys.h"
#include "common/archive.h"
#include "common/system.h"
#include "common/stream.h" #include "common/stream.h"
#include "common/file.h"
#include "common/fs.h"
#include "common/hashmap.h" #include "common/hashmap.h"
#include "common/hash-str.h" #include "common/hash-str.h"
@ -40,6 +36,8 @@
namespace Common { namespace Common {
class FSNode;
/* /*
XMLParser.cpp/h -- Generic XML Parser XMLParser.cpp/h -- Generic XML Parser
===================================== =====================================
@ -184,23 +182,9 @@ public:
* *
* @param filename Name of the file to load. * @param filename Name of the file to load.
*/ */
bool loadFile(const Common::String &filename) { bool loadFile(const Common::String &filename);
_stream = SearchMan.openFile(filename);
if (!_stream)
return false;
_fileName = filename; bool loadFile(const FSNode &node);
return true;
}
bool loadFile(const FSNode &node) {
_stream = node.openForReading();
if (!_stream)
return false;
_fileName = node.getName();
return true;
}
/** /**
* Loads a memory buffer into the parser. * Loads a memory buffer into the parser.
@ -213,22 +197,11 @@ public:
* i.e. if it can be freed safely after it's * i.e. if it can be freed safely after it's
* no longer needed by the parser. * no longer needed by the parser.
*/ */
bool loadBuffer(const byte *buffer, uint32 size, bool disposable = false) { bool loadBuffer(const byte *buffer, uint32 size, bool disposable = false);
_stream = new MemoryReadStream(buffer, size, disposable);
_fileName = "Memory Stream";
return true;
}
bool loadStream(Common::SeekableReadStream *stream) { bool loadStream(Common::SeekableReadStream *stream);
_stream = stream;
_fileName = "File Stream";
return true;
}
void close() { void close();
delete _stream;
_stream = 0;
}
/** /**
* The actual parsing function. * The actual parsing function.

View file

@ -26,11 +26,12 @@
#include "common/endian.h" #include "common/endian.h"
#include "common/events.h" #include "common/events.h"
#include "common/config-manager.h"
#include "common/system.h" // for g_system->getEventManager()
#include "cine/cine.h" #include "cine/cine.h"
#include "cine/various.h" #include "cine/various.h"
#include "common/config-manager.h"
namespace Cine { namespace Cine {

View file

@ -23,9 +23,9 @@
* *
*/ */
#include "common/endian.h" #include "common/endian.h"
#include "common/events.h" #include "common/events.h"
#include "common/system.h" // for g_system->getEventManager()
#include "cruise/cruise_main.h" #include "cruise/cruise_main.h"
#include "cruise/cell.h" #include "cruise/cell.h"

View file

@ -250,6 +250,11 @@ public:
*/ */
void openMainMenuDialog(); void openMainMenuDialog();
Common::TimerManager *getTimerManager() { return _timer; }
Common::EventManager *getEventManager() { return _eventMan; }
Common::SaveFileManager *getSaveFileManager() { return _saveFileMan; }
public: public:
/** On some systems, check if the game appears to be run from CD. */ /** On some systems, check if the game appears to be run from CD. */

View file

@ -30,6 +30,7 @@
#include "common/array.h" #include "common/array.h"
#include "common/events.h" #include "common/events.h"
#include "common/system.h"
#include "kyra/script.h" #include "kyra/script.h"

View file

@ -24,6 +24,7 @@
*/ */
#include "common/events.h" #include "common/events.h"
#include "common/system.h"
#include "parallaction/input.h" #include "parallaction/input.h"
#include "parallaction/parallaction.h" #include "parallaction/parallaction.h"

View file

@ -27,6 +27,7 @@
#include "common/events.h" #include "common/events.h"
#include "common/file.h" #include "common/file.h"
#include "common/util.h" #include "common/util.h"
#include "common/system.h"
#include "sound/mididrv.h" #include "sound/mididrv.h"
#include "sound/mixer.h" #include "sound/mixer.h"

View file

@ -84,7 +84,7 @@ MidiMusic::MidiMusic(QueenEngine *vm)
_parser->setMidiDriver(this); _parser->setMidiDriver(this);
_parser->setTimerRate(_driver->getBaseTempo()); _parser->setTimerRate(_driver->getBaseTempo());
vm->_system->getEventManager()->registerRandomSource(_rnd, "queenMusic"); vm->getEventManager()->registerRandomSource(_rnd, "queenMusic");
} }
MidiMusic::~MidiMusic() { MidiMusic::~MidiMusic() {

View file

@ -39,6 +39,7 @@
#include "saga/scene.h" #include "saga/scene.h"
#include "common/events.h" #include "common/events.h"
#include "common/system.h"
namespace Saga { namespace Saga {

View file

@ -27,6 +27,7 @@
#include "common/endian.h" #include "common/endian.h"
#include "common/rect.h" #include "common/rect.h"
#include "common/events.h" #include "common/events.h"
#include "common/system.h"
#include "sky/autoroute.h" #include "sky/autoroute.h"
#include "sky/compact.h" #include "sky/compact.h"

View file

@ -24,6 +24,7 @@
*/ */
#include "common/config-manager.h" #include "common/config-manager.h"
#include "common/system.h"
#include "sky/control.h" #include "sky/control.h"
#include "sky/debug.h" #include "sky/debug.h"

View file

@ -31,6 +31,7 @@
#include "common/file.h" #include "common/file.h"
#include "common/fs.h" #include "common/fs.h"
#include "common/savefile.h" #include "common/savefile.h"
#include "common/system.h"
#include "graphics/thumbnail.h" #include "graphics/thumbnail.h"
#include "engines/metaengine.h" #include "engines/metaengine.h"

View file

@ -28,6 +28,7 @@
#include "common/util.h" #include "common/util.h"
#include "common/events.h" #include "common/events.h"
#include "common/system.h"
#include "sword1/sound.h" #include "sword1/sound.h"
#include "sword1/resman.h" #include "sword1/resman.h"

View file

@ -25,6 +25,7 @@
#include "tucker/tucker.h" #include "tucker/tucker.h"
#include "tucker/graphics.h" #include "tucker/graphics.h"
#include "common/system.h"
namespace Tucker { namespace Tucker {