[Scummvm-cvs-logs] SF.net SVN: scummvm: [27455] scummvm/trunk/backends/platform/PalmOS/Src

chrilith at users.sourceforge.net chrilith at users.sourceforge.net
Sat Jun 16 12:38:00 CEST 2007


Revision: 27455
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27455&view=rev
Author:   chrilith
Date:     2007-06-16 03:37:59 -0700 (Sat, 16 Jun 2007)

Log Message:
-----------
Use the old and faster 1.5x scaler when available

Modified Paths:
--------------
    scummvm/trunk/backends/platform/PalmOS/Src/be_os5.h
    scummvm/trunk/backends/platform/PalmOS/Src/os5_gfx.cpp
    scummvm/trunk/backends/platform/PalmOS/Src/os5_renderer.cpp

Modified: scummvm/trunk/backends/platform/PalmOS/Src/be_os5.h
===================================================================
--- scummvm/trunk/backends/platform/PalmOS/Src/be_os5.h	2007-06-16 10:34:48 UTC (rev 27454)
+++ scummvm/trunk/backends/platform/PalmOS/Src/be_os5.h	2007-06-16 10:37:59 UTC (rev 27455)
@@ -131,8 +131,7 @@
 	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);

Modified: scummvm/trunk/backends/platform/PalmOS/Src/os5_gfx.cpp
===================================================================
--- scummvm/trunk/backends/platform/PalmOS/Src/os5_gfx.cpp	2007-06-16 10:34:48 UTC (rev 27454)
+++ scummvm/trunk/backends/platform/PalmOS/Src/os5_gfx.cpp	2007-06-16 10:37:59 UTC (rev 27455)
@@ -137,9 +137,13 @@
 	}
 
 	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;

Modified: scummvm/trunk/backends/platform/PalmOS/Src/os5_renderer.cpp
===================================================================
--- scummvm/trunk/backends/platform/PalmOS/Src/os5_renderer.cpp	2007-06-16 10:34:48 UTC (rev 27454)
+++ scummvm/trunk/backends/platform/PalmOS/Src/os5_renderer.cpp	2007-06-16 10:37:59 UTC (rev 27455)
@@ -76,3 +76,43 @@
 	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);
+}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list