aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/PalmOS/Src
diff options
context:
space:
mode:
authorMax Horn2008-11-06 15:02:50 +0000
committerMax Horn2008-11-06 15:02:50 +0000
commitedf9f249260b1fd4364f6727fa622991e81e8cf3 (patch)
tree2b034d5daf7b69212957d8d51ab839974f51f2c5 /backends/platform/PalmOS/Src
parentf238a12b27ebfa9847814b9972fdb5789e484533 (diff)
downloadscummvm-rg350-edf9f249260b1fd4364f6727fa622991e81e8cf3.tar.gz
scummvm-rg350-edf9f249260b1fd4364f6727fa622991e81e8cf3.tar.bz2
scummvm-rg350-edf9f249260b1fd4364f6727fa622991e81e8cf3.zip
Got rid of OSystem::colorToRGB and RGBToColor; added implementations for OSystem::getOverlayFormat to several ports (pending testing by the porters)
svn-id: r34912
Diffstat (limited to 'backends/platform/PalmOS/Src')
-rw-r--r--backends/platform/PalmOS/Src/base_gfx.cpp2
-rw-r--r--backends/platform/PalmOS/Src/be_base.h3
-rw-r--r--backends/platform/PalmOS/Src/be_os5.h2
-rw-r--r--backends/platform/PalmOS/Src/be_zodiac.h2
-rw-r--r--backends/platform/PalmOS/Src/os5_gfx.cpp4
-rw-r--r--backends/platform/PalmOS/Src/os5_overlay.cpp10
-rw-r--r--backends/platform/PalmOS/Src/zodiac_gfx.cpp4
-rw-r--r--backends/platform/PalmOS/Src/zodiac_overlay.cpp10
8 files changed, 6 insertions, 31 deletions
diff --git a/backends/platform/PalmOS/Src/base_gfx.cpp b/backends/platform/PalmOS/Src/base_gfx.cpp
index c96a258d52..cb40bb55e5 100644
--- a/backends/platform/PalmOS/Src/base_gfx.cpp
+++ b/backends/platform/PalmOS/Src/base_gfx.cpp
@@ -152,7 +152,7 @@ void OSystem_PalmBase::updateScreen() {
void OSystem_PalmBase::clearScreen() {
WinSetDrawWindow(WinGetDisplayWindow());
- WinSetBackColor(RGBToColor(0,0,0));
+ WinSetBackColor(Graphics::RGBToColor<ColorMasks<565> >(0,0,0));
WinEraseWindow();
}
diff --git a/backends/platform/PalmOS/Src/be_base.h b/backends/platform/PalmOS/Src/be_base.h
index 03a9d56fb4..009c5a9997 100644
--- a/backends/platform/PalmOS/Src/be_base.h
+++ b/backends/platform/PalmOS/Src/be_base.h
@@ -230,8 +230,7 @@ public:
void setPalette(const byte *colors, uint start, uint num);
void grabPalette(byte *colors, uint start, uint num);
- virtual OverlayColor RGBToColor(uint8 r, uint8 g, uint8 b) = 0;
- virtual void colorToRGB(OverlayColor color, uint8 &r, uint8 &g, uint8 &b) = 0;
+ virtual Graphics::PixelFormat getOverlayFormat() const { return Graphics::createPixelFormat<565>(); }
bool pollEvent(Common::Event &event);
diff --git a/backends/platform/PalmOS/Src/be_os5.h b/backends/platform/PalmOS/Src/be_os5.h
index 99d1dd9dc1..c56688b98f 100644
--- a/backends/platform/PalmOS/Src/be_os5.h
+++ b/backends/platform/PalmOS/Src/be_os5.h
@@ -181,8 +181,6 @@ public:
virtual void clearOverlay();
virtual void grabOverlay(OverlayColor *buf, int pitch);
virtual void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h);
- virtual OverlayColor RGBToColor(uint8 r, uint8 g, uint8 b);
- virtual void colorToRGB(OverlayColor color, uint8 &r, uint8 &g, uint8 &b);
void setWindowCaption(const char *caption);
diff --git a/backends/platform/PalmOS/Src/be_zodiac.h b/backends/platform/PalmOS/Src/be_zodiac.h
index 58e2ca88ac..28fcf29ddd 100644
--- a/backends/platform/PalmOS/Src/be_zodiac.h
+++ b/backends/platform/PalmOS/Src/be_zodiac.h
@@ -71,8 +71,6 @@ public:
void clearOverlay();
void grabOverlay(OverlayColor *buf, int pitch);
void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h);
- OverlayColor RGBToColor(uint8 r, uint8 g, uint8 b);
- void colorToRGB(OverlayColor color, uint8 &r, uint8 &g, uint8 &b);
};
#endif
diff --git a/backends/platform/PalmOS/Src/os5_gfx.cpp b/backends/platform/PalmOS/Src/os5_gfx.cpp
index 2d26419dff..c02e1f7db4 100644
--- a/backends/platform/PalmOS/Src/os5_gfx.cpp
+++ b/backends/platform/PalmOS/Src/os5_gfx.cpp
@@ -77,8 +77,8 @@ void OSystem_PalmOS5::load_gfx_mode() {
__68K(PINSetInputTriggerState(pinInputTriggerDisabled));
}
- gVars->indicator.on = RGBToColor(0,255,0);
- gVars->indicator.off = RGBToColor(0,0,0);
+ gVars->indicator.on = Graphics::RGBToColor<ColorMasks<565> >(0,255,0);
+ gVars->indicator.off = Graphics::RGBToColor<ColorMasks<565> >(0,0,0);
_overlayH = alloc_screen(_screenWidth, _screenHeight);
_overlayP = (OverlayColor *)(BmpGetBits(WinGetBitmap(_overlayH)));
diff --git a/backends/platform/PalmOS/Src/os5_overlay.cpp b/backends/platform/PalmOS/Src/os5_overlay.cpp
index 5555c7ef08..2ffc082547 100644
--- a/backends/platform/PalmOS/Src/os5_overlay.cpp
+++ b/backends/platform/PalmOS/Src/os5_overlay.cpp
@@ -74,13 +74,3 @@ void OSystem_PalmOS5::copyRectToOverlay(const OverlayColor *buf, int pitch, int
buf += pitch;
} while (--h);
}
-
-OverlayColor OSystem_PalmOS5::RGBToColor(uint8 r, uint8 g, uint8 b) {
- return gfxMakeDisplayRGB(r, g, b);
-}
-
-void OSystem_PalmOS5::colorToRGB(OverlayColor color, uint8 &r, uint8 &g, uint8 &b) {
- r = ((color >> 8) & 0xF8);
- g = ((color >> 3) & 0xFC);
- b = ((color << 3) & 0xF8);
-}
diff --git a/backends/platform/PalmOS/Src/zodiac_gfx.cpp b/backends/platform/PalmOS/Src/zodiac_gfx.cpp
index e7f7adb773..866ee086f7 100644
--- a/backends/platform/PalmOS/Src/zodiac_gfx.cpp
+++ b/backends/platform/PalmOS/Src/zodiac_gfx.cpp
@@ -71,8 +71,8 @@ void OSystem_PalmZodiac::load_gfx_mode() {
SysSetOrientationTriggerState(sysOrientationTriggerDisabled);
PINSetInputTriggerState(pinInputTriggerDisabled);
- gVars->indicator.on = RGBToColor(0,255,0);
- gVars->indicator.off = RGBToColor(0,0,0);
+ gVars->indicator.on = Graphics::RGBToColor<ColorMasks<565> >(0,255,0);
+ gVars->indicator.off = Graphics::RGBToColor<ColorMasks<565> >(0,0,0);
_screenH = WinGetDisplayWindow();
_screenP = (byte *)BmpGetBits(WinGetBitmap(_screenH));
diff --git a/backends/platform/PalmOS/Src/zodiac_overlay.cpp b/backends/platform/PalmOS/Src/zodiac_overlay.cpp
index 34390853fc..f8322e8fa5 100644
--- a/backends/platform/PalmOS/Src/zodiac_overlay.cpp
+++ b/backends/platform/PalmOS/Src/zodiac_overlay.cpp
@@ -65,13 +65,3 @@ void OSystem_PalmZodiac::copyRectToOverlay(const OverlayColor *buf, int pitch, i
};
e = TwGfxDrawBitmap(_overlayP, &pos, &bmp);
}
-
-OverlayColor OSystem_PalmZodiac::RGBToColor(uint8 r, uint8 g, uint8 b) {
- return TwGfxMakeDisplayRGB(r, g, b);
-}
-
-void OSystem_PalmZodiac::colorToRGB(OverlayColor color, uint8 &r, uint8 &g, uint8 &b) {
- r = ((color >> 8) & 0xF8);
- g = ((color >> 3) & 0xFC);
- b = ((color << 3) & 0xF8);
-}