aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/PalmOS/Src
diff options
context:
space:
mode:
authorChris Apers2007-06-16 10:37:59 +0000
committerChris Apers2007-06-16 10:37:59 +0000
commit7a5b89309e22f0ff71e6c13f04fef8c85c243afd (patch)
tree2f840ae51df44c46c264e70a2d8559f27a8f2157 /backends/platform/PalmOS/Src
parent6e9200f73944ac5ad56efa40201375dc508b0bcc (diff)
downloadscummvm-rg350-7a5b89309e22f0ff71e6c13f04fef8c85c243afd.tar.gz
scummvm-rg350-7a5b89309e22f0ff71e6c13f04fef8c85c243afd.tar.bz2
scummvm-rg350-7a5b89309e22f0ff71e6c13f04fef8c85c243afd.zip
Use the old and faster 1.5x scaler when available
svn-id: r27455
Diffstat (limited to 'backends/platform/PalmOS/Src')
-rw-r--r--backends/platform/PalmOS/Src/be_os5.h3
-rw-r--r--backends/platform/PalmOS/Src/os5_gfx.cpp8
-rw-r--r--backends/platform/PalmOS/Src/os5_renderer.cpp40
3 files changed, 47 insertions, 4 deletions
diff --git a/backends/platform/PalmOS/Src/be_os5.h b/backends/platform/PalmOS/Src/be_os5.h
index fc5f9e667f..13e8b4ff20 100644
--- a/backends/platform/PalmOS/Src/be_os5.h
+++ b/backends/platform/PalmOS/Src/be_os5.h
@@ -131,8 +131,7 @@ private:
void calc_scale();
void render_landscapeAny(RectangleType &r, PointType &p);
- void render_landscape(RectangleType &r, PointType &p);
- void render_portrait(RectangleType &r, PointType &p);
+ void render_landscape15x(RectangleType &r, PointType &p);
void render_1x(RectangleType &r, PointType &p);
WinHandle alloc_screen(Coord w, Coord h);
virtual void draw_osd(UInt16 id, Int32 x, Int32 y, Boolean show, UInt8 color = 0);
diff --git a/backends/platform/PalmOS/Src/os5_gfx.cpp b/backends/platform/PalmOS/Src/os5_gfx.cpp
index 247acf6f46..cff9e79abe 100644
--- a/backends/platform/PalmOS/Src/os5_gfx.cpp
+++ b/backends/platform/PalmOS/Src/os5_gfx.cpp
@@ -137,9 +137,13 @@ void OSystem_PalmOS5::hotswap_gfx_mode(int mode) {
}
if (_stretched) {
- calc_scale();
OPTIONS_SET(kOptDisableOnScrDisp);
- _render = &OSystem_PalmOS5::render_landscapeAny;
+ if (_screenHeight == 200 && _screenDest.h == 300) {
+ _render = &OSystem_PalmOS5::render_landscape15x;
+ } else {
+ _render = &OSystem_PalmOS5::render_landscapeAny;
+ calc_scale();
+ }
} else {
OPTIONS_RST(kOptDisableOnScrDisp);
_render = &OSystem_PalmOS5::render_1x;
diff --git a/backends/platform/PalmOS/Src/os5_renderer.cpp b/backends/platform/PalmOS/Src/os5_renderer.cpp
index fdae35acd5..4580db4d53 100644
--- a/backends/platform/PalmOS/Src/os5_renderer.cpp
+++ b/backends/platform/PalmOS/Src/os5_renderer.cpp
@@ -76,3 +76,43 @@ void OSystem_PalmOS5::render_landscapeAny(RectangleType &r, PointType &p) {
p.y = _screenOffset.y + o;
RctSetRectangle(&r, 0, 0, _screenDest.w, _screenDest.h - o);
}
+
+void OSystem_PalmOS5::render_landscape15x(RectangleType &r, PointType &p) {
+ Coord x, y, o = 0;
+ int16 *dst = _workScreenP;
+
+ if (_overlayVisible) {
+ int16 *src = _overlayP;
+
+ for (y = 0; y < 100; y++) {
+ // draw 2 lines
+ for (x = 0; x < 320; x++) {
+ *dst++ = *src++;
+ *dst++ = *src;
+ *dst++ = *src++;
+ }
+ // copy the second to the next line
+ MemMove(dst, dst - 480, 480 * 2);
+ dst += 480;
+ }
+ } else {
+ byte *src = _offScreenP;
+ o = _current_shake_pos;
+
+ for (y = 0; y < 100; y++) {
+ // draw 2 lines
+ for (x = 0; x < 320; x++) {
+ *dst++ = _nativePal[*src++];
+ *dst++ = _nativePal[*src];
+ *dst++ = _nativePal[*src++];
+ }
+ // copy the second to the next line
+ MemMove(dst, dst - 480, 480 * 2);
+ dst += 480;
+ }
+ }
+
+ p.x = _screenOffset.x;
+ p.y = _screenOffset.y + o;
+ RctSetRectangle(&r, 0, 0, 480, 300 - o);
+}