From dc91dcde00db746a934fe3ebf6094bee9145347b Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 30 Jun 2007 21:20:47 +0000 Subject: Adding some missing stuff to the PS2 port (it still will require quite some work to get it working again) svn-id: r27799 --- backends/platform/ps2/systemps2.cpp | 10 ++++++++++ backends/platform/ps2/systemps2.h | 7 +++++++ backends/platform/psp/osys_psp.h | 9 --------- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/backends/platform/ps2/systemps2.cpp b/backends/platform/ps2/systemps2.cpp index 32290bddea..6572166e91 100644 --- a/backends/platform/ps2/systemps2.cpp +++ b/backends/platform/ps2/systemps2.cpp @@ -332,6 +332,16 @@ OSystem_PS2::OSystem_PS2(const char *elfPath) { OSystem_PS2::~OSystem_PS2(void) { } +void OSystem_PS2::initBackend() { + // FIXME: Should probably move lots of stuff from the constructor to here + _mixer = new Audio::Mixer(); + _timer = new DefaultTimerManager(); + setSoundCallback(Audio::Mixer::mixCallback, _mixer); + setTimerCallback(&timer_handler, 10); + + OSystem::initBackend(); +} + void OSystem_PS2::initTimer(void) { // first setup the two threads that get activated by the timer: // the timerthread and the soundthread diff --git a/backends/platform/ps2/systemps2.h b/backends/platform/ps2/systemps2.h index b5c84d3b95..033431a6fd 100644 --- a/backends/platform/ps2/systemps2.h +++ b/backends/platform/ps2/systemps2.h @@ -48,6 +48,9 @@ class OSystem_PS2 : public OSystem { public: OSystem_PS2(const char *elfPath); virtual ~OSystem_PS2(void); + + virtual void initBackend(); + virtual void initSize(uint width, uint height); virtual int16 getHeight(void); @@ -103,6 +106,8 @@ public: virtual void colorToRGB(OverlayColor color, uint8 &r, uint8 &g, uint8 &b); virtual Common::SaveFileManager *getSavefileManager(); + virtual Audio::Mixer *getMixer() { return _mixer; } + virtual Common::TimerManager *getTimerManager() { return _timer; } void timerThread(void); void soundThread(void); @@ -129,6 +134,8 @@ private: bool _useMouse, _useKbd, _useHdd, _usbMassLoaded, _usbMassConnected; Ps2SaveFileManager *_saveManager; + Audio::Mixer *_mixer; + Common::TimerManager *_timer; Gs2dScreen *_screen; Ps2Input *_input; diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h index d5d3669a22..7c0932dc20 100644 --- a/backends/platform/psp/osys_psp.h +++ b/backends/platform/psp/osys_psp.h @@ -38,15 +38,6 @@ enum GraphicModeID { CENTERED_362X272 }; -namespace Graphics { - struct Surface; -} - -namespace Common { - class SaveFileManager; - class TimerManager; -} - class OSystem_PSP : public OSystem { public: static const OSystem::GraphicsMode s_supportedGraphicsModes[]; -- cgit v1.2.3