diff options
author | Joost Peters | 2007-02-11 11:24:37 +0000 |
---|---|---|
committer | Joost Peters | 2007-02-11 11:24:37 +0000 |
commit | fb76c7d2e58a04e44016b056277026af2060308d (patch) | |
tree | e89dcf8875cea053e3213df0de0d6dc4f06c4a7f /backends/platform/psp | |
parent | b14bb6206a0247511335848f4b24b5e3c132264d (diff) | |
download | scummvm-rg350-fb76c7d2e58a04e44016b056277026af2060308d.tar.gz scummvm-rg350-fb76c7d2e58a04e44016b056277026af2060308d.tar.bz2 scummvm-rg350-fb76c7d2e58a04e44016b056277026af2060308d.zip |
fix compilation / modularization update
svn-id: r25487
Diffstat (limited to 'backends/platform/psp')
-rw-r--r-- | backends/platform/psp/osys_psp.cpp | 22 | ||||
-rw-r--r-- | backends/platform/psp/osys_psp.h | 20 |
2 files changed, 40 insertions, 2 deletions
diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp index ebda445019..42e066b543 100644 --- a/backends/platform/psp/osys_psp.cpp +++ b/backends/platform/psp/osys_psp.cpp @@ -30,6 +30,10 @@ #include "common/rect.h" #include "osys_psp.h" +#include "backends/saves/default/default-saves.h" +#include "backends/timer/default/default-timer.h" +#include "sound/mixer.h" + #include "common/config-manager.h" #include <pspgu.h> @@ -51,6 +55,12 @@ void putPixel(uint16 x, uint16 y, unsigned long colour) { *(unsigned short *)(DrawBuffer + (y << 9) + x ) = colour; } +static int timer_handler(int t) { + DefaultTimerManager *tm = (DefaultTimerManager *)g_system->getTimerManager(); + tm->handler(); + return t; +} + const OSystem::GraphicsMode OSystem_PSP::s_supportedGraphicsModes[] = { { "320x200 (centered)", "320x200 16-bit centered", CENTERED_320X200 }, { "353x272 (best-fit, centered)", "353x272 16-bit centered", CENTERED_435X272 }, @@ -81,6 +91,18 @@ OSystem_PSP::~OSystem_PSP() { if (_mouseBuf) free(_mouseBuf); } + +void OSystem_PSP::initBackend() { + _savefile = new DefaultSaveFileManager(); + _mixer = new Audio::Mixer(); + _timer = new DefaultTimerManager(); + setSoundCallback(Audio::Mixer::mixCallback, _mixer); + setTimerCallback(&timer_handler, 10); + + OSystem::initBackend(); +} + + bool OSystem_PSP::hasFeature(Feature f) { return false; } diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h index df5c69d232..d8c92da431 100644 --- a/backends/platform/psp/osys_psp.h +++ b/backends/platform/psp/osys_psp.h @@ -41,6 +41,10 @@ namespace Graphics { struct Surface; } +namespace Common { + class SaveFileManager; + class TimerManager; +} class OSystem_PSP : public OSystem { public: @@ -72,12 +76,18 @@ protected: uint32 _samplesPerSec; SceCtrlData pad; - + + Common::SaveFileManager *_savefile; + Audio::Mixer *_mixer; + Common::TimerManager *_timer; + public: OSystem_PSP(); virtual ~OSystem_PSP(); + virtual void initBackend(); + virtual bool hasFeature(Feature f); virtual void setFeatureState(Feature f, bool enable); virtual bool getFeatureState(Feature f); @@ -107,7 +117,7 @@ public: virtual OverlayColor ARGBToColor(uint8 a, uint8 r, uint8 g, uint8 b); virtual void colorToARGB(OverlayColor color, uint8 &a, uint8 &r, uint8 &g, uint8 &b); virtual void grabPalette(byte *colors, uint start, uint num); - + virtual bool showMouse(bool visible); virtual void warpMouse(int x, int y); @@ -117,6 +127,7 @@ public: virtual uint32 getMillis(); virtual void delayMillis(uint msecs); + typedef int (*TimerProc)(int interval); virtual void setTimerCallback(TimerProc callback, int interval); virtual MutexRef createMutex(void); @@ -124,10 +135,15 @@ public: virtual void unlockMutex(MutexRef mutex); virtual void deleteMutex(MutexRef mutex); + typedef void (*SoundProc)(void *param, byte *buf, int len); virtual bool setSoundCallback(SoundProc proc, void *param); virtual void clearSoundCallback(); virtual int getOutputSampleRate() const; + Common::SaveFileManager *getSavefileManager() { return _savefile; } + Audio::Mixer *getMixer() { return _mixer; } + Common::TimerManager *getTimerManager() { return _timer; } + virtual void quit(); virtual void setWindowCaption(const char *caption); |