aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/PalmOS/Src
diff options
context:
space:
mode:
authorChris Apers2007-01-21 09:55:44 +0000
committerChris Apers2007-01-21 09:55:44 +0000
commitd9e866398d125692444b7812bd3cbb95d3ab9977 (patch)
treec156c2a1e5126fc3bc3f72363dec6bb425890661 /backends/platform/PalmOS/Src
parent0e5871b0ae868cb9401ce307c425935c4ed5220d (diff)
downloadscummvm-rg350-d9e866398d125692444b7812bd3cbb95d3ab9977.tar.gz
scummvm-rg350-d9e866398d125692444b7812bd3cbb95d3ab9977.tar.bz2
scummvm-rg350-d9e866398d125692444b7812bd3cbb95d3ab9977.zip
Clenaup
svn-id: r25143
Diffstat (limited to 'backends/platform/PalmOS/Src')
-rw-r--r--backends/platform/PalmOS/Src/be_os5.cpp4
-rw-r--r--backends/platform/PalmOS/Src/be_os5.h7
-rw-r--r--backends/platform/PalmOS/Src/be_zodiac.cpp24
-rw-r--r--backends/platform/PalmOS/Src/be_zodiac.h1
-rw-r--r--backends/platform/PalmOS/Src/os5_event.cpp20
5 files changed, 11 insertions, 45 deletions
diff --git a/backends/platform/PalmOS/Src/be_os5.cpp b/backends/platform/PalmOS/Src/be_os5.cpp
index cddea55568..d8abf979e3 100644
--- a/backends/platform/PalmOS/Src/be_os5.cpp
+++ b/backends/platform/PalmOS/Src/be_os5.cpp
@@ -67,10 +67,10 @@ void OSystem_PalmOS5::calc_rect(Boolean fullscreen) {
} else {
w = gVars->screenWidth;
- h = gVars->screenHeight - MIN_OFFSET * 2;
+ h = gVars->screenHeight * _screenHeight / _screenWidth;
_screenOffset.x = 0;
- _screenOffset.y = MIN_OFFSET;
+ _screenOffset.y = (gVars->screenHeight - h) / 2;
}
_screenDest.w = w;
diff --git a/backends/platform/PalmOS/Src/be_os5.h b/backends/platform/PalmOS/Src/be_os5.h
index b585ad3fba..fdcd70f254 100644
--- a/backends/platform/PalmOS/Src/be_os5.h
+++ b/backends/platform/PalmOS/Src/be_os5.h
@@ -27,8 +27,6 @@
#include "be_base.h"
-#define MIN_OFFSET 20
-
#if !defined(SYSTEM_CALLBACK) || defined(PALMOS_68K)
# define SYSTEM_CALLBACK
# ifdef PALMOS_ARM
@@ -125,10 +123,8 @@ private:
void draw_mouse();
void undraw_mouse();
- virtual void get_coordinates(EventPtr ev, Coord &x, Coord &y);
virtual bool check_event(Event &event, EventPtr ev);
virtual void extras_palette(uint8 index, uint8 r, uint8 g, uint8 b);
- void calc_rect(Boolean fullscreen);
void calc_scale();
void render_landscapeAny(RectangleType &r, PointType &p);
@@ -158,6 +154,9 @@ protected:
Coord height; // (480 x height)
} _ratio;
+ void calc_rect(Boolean fullscreen);
+ void get_coordinates(EventPtr ev, Coord &x, Coord &y);
+
public:
OSystem_PalmOS5();
static OSystem *create();
diff --git a/backends/platform/PalmOS/Src/be_zodiac.cpp b/backends/platform/PalmOS/Src/be_zodiac.cpp
index 6fd8c5cc06..61b28bccae 100644
--- a/backends/platform/PalmOS/Src/be_zodiac.cpp
+++ b/backends/platform/PalmOS/Src/be_zodiac.cpp
@@ -42,30 +42,12 @@ void OSystem_PalmZodiac::int_initBackend() {
}
void OSystem_PalmZodiac::calc_rect(Boolean fullscreen) {
- Int32 w, h;
-
- if (fullscreen) {
- w = (_ratio.adjustAspect == kRatioWidth) ? _ratio.width : gVars->screenFullWidth;
- h = (_ratio.adjustAspect == kRatioHeight) ? _ratio.height : gVars->screenFullHeight;
-
- _screenOffset.x = (_ratio.adjustAspect == kRatioWidth) ? (gVars->screenFullWidth - _ratio.width) / 2 : 0;
- _screenOffset.y = (_ratio.adjustAspect == kRatioHeight) ? (gVars->screenFullHeight - _ratio.height) / 2 : 0;
-
- } else {
- w = gVars->screenWidth;
- h = gVars->screenHeight - MIN_OFFSET * 2;
-
- _screenOffset.x = 0;
- _screenOffset.y = MIN_OFFSET;
- }
+ OSystem_PalmOS5::calc_rect(fullscreen);
_dstRect.x = _screenOffset.x;
_dstRect.y = _screenOffset.y;
- _dstRect.w = w;
- _dstRect.h = h;
-
- _screenDest.w = _dstRect.w;
- _screenDest.h = _dstRect.h;
+ _dstRect.w = _screenDest.w;
+ _dstRect.h = _screenDest.h;
}
void OSystem_PalmZodiac::setFeatureState(Feature f, bool enable) {
diff --git a/backends/platform/PalmOS/Src/be_zodiac.h b/backends/platform/PalmOS/Src/be_zodiac.h
index 54b5cd55a7..d641a51ef1 100644
--- a/backends/platform/PalmOS/Src/be_zodiac.h
+++ b/backends/platform/PalmOS/Src/be_zodiac.h
@@ -55,7 +55,6 @@ private:
void extras_palette(uint8 index, uint8 r, uint8 g, uint8 b);
void calc_rect(Boolean fullscreen);
- void get_coordinates(EventPtr ev, Coord &x, Coord &y);
bool check_event(Event &event, EventPtr ev);
void draw_osd(UInt16 id, Int32 x, Int32 y, Boolean show, UInt8 color = 0);
diff --git a/backends/platform/PalmOS/Src/os5_event.cpp b/backends/platform/PalmOS/Src/os5_event.cpp
index 915da4ba4f..a1b07a0460 100644
--- a/backends/platform/PalmOS/Src/os5_event.cpp
+++ b/backends/platform/PalmOS/Src/os5_event.cpp
@@ -27,27 +27,13 @@
void OSystem_PalmOS5::get_coordinates(EventPtr ev, Coord &x, Coord &y) {
Boolean dummy;
EvtGetPenNative(WinGetDisplayWindow(), &ev->screenX, &ev->screenY, &dummy);
-
+
x = (ev->screenX - _screenOffset.x);
y = (ev->screenY - _screenOffset.y);
if (_stretched) {
- Int32 w, h;
-
- if (_mode == GFX_NORMAL) {
-
- h = gVars->screenHeight - MIN_OFFSET * 2;
- w = gVars->screenWidth;
- x = (_screenWidth * x) / w;
- y = (_screenHeight * y) / h;
-
- } else {
-
- h = (_ratio.adjustAspect == kRatioHeight ? _ratio.height : gVars->screenFullHeight);
- w = (_ratio.adjustAspect == kRatioWidth ? _ratio.width : gVars->screenFullWidth);
- x = (_screenWidth * x) / w;
- y = (_screenHeight * y) / h;
- }
+ x = (x * _screenWidth) / _screenDest.w;
+ y = (y * _screenHeight) / _screenDest.h;
}
}