aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2011-06-07 10:57:24 +0200
committerMax Horn2011-06-07 14:57:57 +0200
commit8ac63a37a8a0e995b9228c90b24d4fbdffcf940d (patch)
tree576ed97d34e1f1c4bd95aa2beaac12e8c35157dd
parent9e1ed9ee6a3a6d3bd788fe16b93b5a9392330f2e (diff)
downloadscummvm-rg350-8ac63a37a8a0e995b9228c90b24d4fbdffcf940d.tar.gz
scummvm-rg350-8ac63a37a8a0e995b9228c90b24d4fbdffcf940d.tar.bz2
scummvm-rg350-8ac63a37a8a0e995b9228c90b24d4fbdffcf940d.zip
PS2: Use OSystem's 'slots' for timer/savefile manager
-rw-r--r--backends/platform/ps2/systemps2.cpp19
-rw-r--r--backends/platform/ps2/systemps2.h14
2 files changed, 5 insertions, 28 deletions
diff --git a/backends/platform/ps2/systemps2.cpp b/backends/platform/ps2/systemps2.cpp
index 728a67fbad..d3acd06089 100644
--- a/backends/platform/ps2/systemps2.cpp
+++ b/backends/platform/ps2/systemps2.cpp
@@ -60,7 +60,6 @@
#include "backends/fs/ps2/ps2-fs-factory.h"
#include "backends/plugins/ps2/ps2-provider.h"
-#include "backends/saves/default/default-saves.h"
#include "backends/timer/default/default-timer.h"
#include "audio/mixer_intern.h"
@@ -348,14 +347,14 @@ OSystem_PS2::OSystem_PS2(const char *elfPath) {
void OSystem_PS2::init(void) {
sioprintf("Timer...\n");
- _scummTimerManager = new DefaultTimerManager();
+ _timerManager = new DefaultTimerManager();
_scummMixer = new Audio::MixerImpl(this, 48000);
_scummMixer->setReady(true);
initTimer();
sioprintf("Starting SavefileManager\n");
- _saveManager = new Ps2SaveFileManager(this, _screen);
+ _savefileManager = new Ps2SaveFileManager(this, _screen);
sioprintf("Initializing ps2Input\n");
_input = new Ps2Input(this, _useMouse, _useKbd);
@@ -430,7 +429,7 @@ void OSystem_PS2::initTimer(void) {
void OSystem_PS2::timerThreadCallback(void) {
while (!_systemQuit) {
WaitSema(g_TimerThreadSema);
- _scummTimerManager->handler();
+ ((DefaultTimerManager *)_timerManager)->handler();
}
ExitThread();
}
@@ -600,18 +599,10 @@ void OSystem_PS2::delayMillis(uint msecs) {
}
}
-Common::TimerManager *OSystem_PS2::getTimerManager() {
- return _scummTimerManager;
-}
-
Audio::Mixer *OSystem_PS2::getMixer() {
return _scummMixer;
}
-Common::SaveFileManager *OSystem_PS2::getSavefileManager(void) {
- return _saveManager;
-}
-
FilesystemFactory *OSystem_PS2::getFilesystemFactory() {
return &Ps2FilesystemFactory::instance();
}
@@ -770,7 +761,7 @@ void OSystem_PS2::msgPrintf(int millis, const char *format, ...) {
void OSystem_PS2::powerOffCallback(void) {
sioprintf("powerOffCallback\n");
- // _saveManager->quit(); // romeo
+ // _savefileManager->quit(); // romeo
if (_useHdd) {
sioprintf("umount\n");
fio.umount("pfs0:");
@@ -810,7 +801,7 @@ void OSystem_PS2::quit(void) {
DisableIntc(INT_TIMER0);
RemoveIntcHandler(INT_TIMER0, _intrId);
- // _saveManager->quit(); // romeo
+ // _savefileManager->quit(); // romeo
_screen->quit();
padEnd(); // stop pad library
diff --git a/backends/platform/ps2/systemps2.h b/backends/platform/ps2/systemps2.h
index cc9c489827..d12d02b104 100644
--- a/backends/platform/ps2/systemps2.h
+++ b/backends/platform/ps2/systemps2.h
@@ -27,12 +27,8 @@
#include "backends/base-backend.h"
#include "graphics/palette.h"
-class DefaultTimerManager;
-class DefaultSaveFileManager;
-
class Gs2dScreen;
class Ps2Input;
-class Ps2SaveFileManager;
// class Ps2FilesystemFactory;
struct IrxReference;
@@ -44,10 +40,6 @@ struct Ps2Mutex {
int count;
};
-namespace Common {
-class TimerManager;
-};
-
namespace Audio {
class MixerImpl;
};
@@ -93,7 +85,6 @@ public:
virtual uint32 getMillis();
virtual void delayMillis(uint msecs);
- virtual Common::TimerManager *getTimerManager();
virtual bool pollEvent(Common::Event &event);
virtual Audio::Mixer *getMixer();
@@ -116,7 +107,6 @@ public:
virtual void logMessage(LogMessageType::Type type, const char *message);
virtual Graphics::PixelFormat getOverlayFormat() const;
- virtual Common::SaveFileManager *getSavefileManager();
virtual FilesystemFactory *getFilesystemFactory();
virtual void getTimeAndDate(TimeDate &t) const;
@@ -144,15 +134,11 @@ private:
void initTimer(void);
void readRtcTime(void);
- DefaultTimerManager *_scummTimerManager;
Audio::MixerImpl *_scummMixer;
bool _mouseVisible;
bool _useMouse, _useKbd, _useHdd, _usbMassLoaded, _useNet;
- Ps2SaveFileManager *_saveManager;
- // DefaultSaveFileManager *_saveManager;
-
Gs2dScreen *_screen;
Ps2Input *_input;
uint16 _oldMouseX, _oldMouseY;