diff options
Diffstat (limited to 'backends/platform')
-rw-r--r-- | backends/platform/android/android.cpp | 8 | ||||
-rw-r--r-- | backends/platform/dc/dc.h | 7 | ||||
-rw-r--r-- | backends/platform/ds/arm9/source/osystem_ds.h | 10 | ||||
-rw-r--r-- | backends/platform/iphone/osys_main.h | 8 | ||||
-rw-r--r-- | backends/platform/n64/osys_n64.h | 8 | ||||
-rw-r--r-- | backends/platform/ps2/systemps2.h | 10 | ||||
-rw-r--r-- | backends/platform/psp/default_display_client.h | 2 | ||||
-rw-r--r-- | backends/platform/psp/osys_psp.cpp | 4 | ||||
-rw-r--r-- | backends/platform/psp/osys_psp.h | 6 | ||||
-rw-r--r-- | backends/platform/wii/osystem.h | 6 |
10 files changed, 56 insertions, 13 deletions
diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp index 7a4ae24e6b..b790dab036 100644 --- a/backends/platform/android/android.cpp +++ b/backends/platform/android/android.cpp @@ -153,7 +153,7 @@ static void checkGlError(const char* file, int line) { #define CHECK_GL_ERROR() do {} while (false) #endif -class OSystem_Android : public BaseBackend { +class OSystem_Android : public BaseBackend, public PaletteManager { private: jobject _back_ptr; // back pointer to (java) peer instance jmethodID MID_displayMessageOnOSD; @@ -238,8 +238,14 @@ public: virtual int getScreenChangeID() const { return _screen_changeid; } virtual int16 getHeight(); virtual int16 getWidth(); + + virtual PaletteManager *getPaletteManager() { return this; } +protected: + // PaletteManager API virtual void setPalette(const byte *colors, uint start, uint num); virtual void grabPalette(byte *colors, uint start, uint num); + +public: virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h); virtual void updateScreen(); virtual Graphics::Surface *lockScreen(); diff --git a/backends/platform/dc/dc.h b/backends/platform/dc/dc.h index b78e5f13df..f1d7454007 100644 --- a/backends/platform/dc/dc.h +++ b/backends/platform/dc/dc.h @@ -69,7 +69,7 @@ class DCCDManager : public DefaultAudioCDManager { void updateCD(); }; -class OSystem_Dreamcast : private DCHardware, public BaseBackend, public FilesystemFactory { +class OSystem_Dreamcast : private DCHardware, public BaseBackend, public PaletteManager, public FilesystemFactory { public: OSystem_Dreamcast(); @@ -98,9 +98,14 @@ class OSystem_Dreamcast : private DCHardware, public BaseBackend, public Filesys int getGraphicsMode() const; // Set colors of the palette + PaletteManager *getPaletteManager() { return this; } +protected: + // PaletteManager API void setPalette(const byte *colors, uint start, uint num); void grabPalette(byte *colors, uint start, uint num); +public: + // Determine the pixel format currently in use for screen rendering. Graphics::PixelFormat getScreenFormat() const; diff --git a/backends/platform/ds/arm9/source/osystem_ds.h b/backends/platform/ds/arm9/source/osystem_ds.h index 50a4353e18..27d75e5124 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.h +++ b/backends/platform/ds/arm9/source/osystem_ds.h @@ -37,7 +37,7 @@ #include "graphics/surface.h" #include "graphics/colormasks.h" -class OSystem_DS : public BaseBackend { +class OSystem_DS : public BaseBackend, public PaletteManager { protected: int eventNum; @@ -92,8 +92,14 @@ public: virtual void initSize(uint width, uint height, const Graphics::PixelFormat *format); virtual int16 getHeight(); virtual int16 getWidth(); + + virtual PaletteManager *getPaletteManager() { return this; } +protected: + // PaletteManager API virtual void setPalette(const byte *colors, uint start, uint num); - virtual void grabPalette(unsigned char *colors, uint start, uint num); + virtual void grabPalette(byte *colors, uint start, uint num); + +public: void restoreHardwarePalette(); virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h); diff --git a/backends/platform/iphone/osys_main.h b/backends/platform/iphone/osys_main.h index c925078b46..df01af798a 100644 --- a/backends/platform/iphone/osys_main.h +++ b/backends/platform/iphone/osys_main.h @@ -51,7 +51,7 @@ typedef struct AQCallbackStruct { AudioStreamBasicDescription dataFormat; } AQCallbackStruct; -class OSystem_IPHONE : public BaseBackend { +class OSystem_IPHONE : public BaseBackend, public PaletteManager { protected: static const OSystem::GraphicsMode s_supportedGraphicsModes[]; @@ -132,8 +132,14 @@ public: virtual void initSize(uint width, uint height, const Graphics::PixelFormat *format); virtual int16 getHeight(); virtual int16 getWidth(); + + virtual PaletteManager *getPaletteManager() { return this; } +protected: + // PaletteManager API virtual void setPalette(const byte *colors, uint start, uint num); virtual void grabPalette(byte *colors, uint start, uint num); + +public: virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h); virtual void updateScreen(); virtual Graphics::Surface *lockScreen(); diff --git a/backends/platform/n64/osys_n64.h b/backends/platform/n64/osys_n64.h index f0dc6959c1..4b2164cc9f 100644 --- a/backends/platform/n64/osys_n64.h +++ b/backends/platform/n64/osys_n64.h @@ -75,7 +75,7 @@ enum GraphicModeID { OVERS_MPAL_340X240 }; -class OSystem_N64 : public BaseBackend { +class OSystem_N64 : public BaseBackend, public PaletteManager { protected: Common::SaveFileManager *_savefile; Audio::MixerImpl *_mixer; @@ -158,8 +158,14 @@ public: virtual void initSize(uint width, uint height, const Graphics::PixelFormat *format); virtual int16 getHeight(); virtual int16 getWidth(); + + virtual PaletteManager *getPaletteManager() { return this; } +protected: + // PaletteManager API virtual void setPalette(const byte *colors, uint start, uint num); virtual void grabPalette(byte *colors, uint start, uint num); + +public: virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h); virtual void updateScreen(); virtual Graphics::Surface *lockScreen(); diff --git a/backends/platform/ps2/systemps2.h b/backends/platform/ps2/systemps2.h index 78973ed3f0..37575f399f 100644 --- a/backends/platform/ps2/systemps2.h +++ b/backends/platform/ps2/systemps2.h @@ -54,7 +54,7 @@ namespace Audio { class MixerImpl; }; -class OSystem_PS2 : public BaseBackend { +class OSystem_PS2 : public BaseBackend, public PaletteManager { public: OSystem_PS2(const char *elfPath); virtual ~OSystem_PS2(void); @@ -64,10 +64,16 @@ public: virtual int16 getHeight(void); virtual int16 getWidth(void); + + virtual PaletteManager *getPaletteManager() { return this; } +protected: + // PaletteManager API virtual void setPalette(const byte *colors, uint start, uint num); + virtual void grabPalette(byte *colors, uint start, uint num); +public: + virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h); virtual void setShakePos(int shakeOffset); - virtual void grabPalette(byte *colors, uint start, uint num); virtual bool grabRawScreen(Graphics::Surface *surf); virtual Graphics::Surface *lockScreen(); virtual void unlockScreen(); diff --git a/backends/platform/psp/default_display_client.h b/backends/platform/psp/default_display_client.h index 2e33632eb1..c7189b0168 100644 --- a/backends/platform/psp/default_display_client.h +++ b/backends/platform/psp/default_display_client.h @@ -69,7 +69,7 @@ protected: class Overlay : public DefaultDisplayClient { public: Overlay() {} - ~Overlay() { } + ~Overlay() {} void init(); bool allocate(); diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp index 025edeb684..73a030f5d1 100644 --- a/backends/platform/psp/osys_psp.cpp +++ b/backends/platform/psp/osys_psp.cpp @@ -273,11 +273,11 @@ void OSystem_PSP::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, i } int16 OSystem_PSP::getOverlayWidth() { - return (int16) _overlay.getWidth(); + return (int16)_overlay.getWidth(); } int16 OSystem_PSP::getOverlayHeight() { - return (int16) _overlay.getHeight(); + return (int16)_overlay.getHeight(); } void OSystem_PSP::grabPalette(byte *colors, uint start, uint num) { diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h index d21c7e78ef..8d274bb5bd 100644 --- a/backends/platform/psp/osys_psp.h +++ b/backends/platform/psp/osys_psp.h @@ -44,7 +44,7 @@ #include "backends/timer/psp/timer.h" #include "backends/platform/psp/thread.h" -class OSystem_PSP : public BaseBackend { +class OSystem_PSP : public BaseBackend, public PaletteManager { private: Common::SaveFileManager *_savefile; @@ -94,8 +94,12 @@ public: int16 getHeight(); // Palette related + PaletteManager *getPaletteManager() { return this; } +protected: + // PaletteManager API void setPalette(const byte *colors, uint start, uint num); void grabPalette(byte *colors, uint start, uint num); +public: void setCursorPalette(const byte *colors, uint start, uint num); void disableCursorPalette(bool disable); diff --git a/backends/platform/wii/osystem.h b/backends/platform/wii/osystem.h index ddfa905a77..9ed4b16d79 100644 --- a/backends/platform/wii/osystem.h +++ b/backends/platform/wii/osystem.h @@ -54,7 +54,7 @@ extern void wii_memstats(void); } #endif -class OSystem_Wii : public BaseBackend { +class OSystem_Wii : public BaseBackend, public PaletteManager { private: s64 _startup_time; @@ -164,8 +164,12 @@ public: const Graphics::PixelFormat *format); virtual int16 getWidth(); virtual int16 getHeight(); + + virtual PaletteManager *getPaletteManager() { return this; } +protected: virtual void setPalette(const byte *colors, uint start, uint num); virtual void grabPalette(byte *colors, uint start, uint num); +public: virtual void setCursorPalette(const byte *colors, uint start, uint num); virtual void disableCursorPalette(bool disable); virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, |