[Scummvm-cvs-logs] SF.net SVN: scummvm:[53918] scummvm/trunk/backends/platform/psp

bluddy at users.sourceforge.net bluddy at users.sourceforge.net
Fri Oct 29 09:55:18 CEST 2010


Revision: 53918
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53918&view=rev
Author:   bluddy
Date:     2010-10-29 07:55:18 +0000 (Fri, 29 Oct 2010)

Log Message:
-----------
PSP: Improved image viewer movement

Before the limit was arbitrary. Now we check the proper location on screen and move in increments relative to the size on screen.

Modified Paths:
--------------
    scummvm/trunk/backends/platform/psp/image_viewer.cpp
    scummvm/trunk/backends/platform/psp/image_viewer.h

Modified: scummvm/trunk/backends/platform/psp/image_viewer.cpp
===================================================================
--- scummvm/trunk/backends/platform/psp/image_viewer.cpp	2010-10-29 07:08:24 UTC (rev 53917)
+++ scummvm/trunk/backends/platform/psp/image_viewer.cpp	2010-10-29 07:55:18 UTC (rev 53918)
@@ -218,16 +218,16 @@
 		// move the image slightly. Note that we count on the renderer's timing
 		switch (_movement) {
 		case EVENT_MOVE_LEFT:
-			moveImageX(-2);
+			moveImageX(-_visibleWidth / 100.0f);
 			break;
 		case EVENT_MOVE_UP:
-			moveImageY(-2);
+			moveImageY(-_visibleHeight / 100.0f);
 			break;
 		case EVENT_MOVE_RIGHT:
-			moveImageX(2);
+			moveImageX(_visibleWidth / 100.0f);
 			break;
 		case EVENT_MOVE_DOWN:
-			moveImageY(2);
+			moveImageY(_visibleHeight / 100.0f);
 			break;
 		default:
 			break;
@@ -255,19 +255,19 @@
 	setOffsetParams();
 }
 
-void ImageViewer::moveImageX(int val) {
+void ImageViewer::moveImageX(float val) {
 	float newVal = _centerX + val;
 	
-	if (newVal < 0 || newVal > PSP_SCREEN_WIDTH)
+	if (newVal - (_visibleWidth / 2) > PSP_SCREEN_WIDTH - 4 || newVal + (_visibleWidth / 2) < 4)  
 		return;
 	_centerX = newVal;
 	setOffsetParams();
 }
 
-void ImageViewer::moveImageY(int val) {
+void ImageViewer::moveImageY(float val) {
 	float newVal = _centerY + val;
 	
-	if (newVal < 0 || newVal > PSP_SCREEN_HEIGHT)
+	if (newVal - (_visibleHeight / 2) > PSP_SCREEN_HEIGHT - 4 || newVal + (_visibleHeight / 2) < 4)  
 		return;
 	_centerY = newVal;
 	setOffsetParams();

Modified: scummvm/trunk/backends/platform/psp/image_viewer.h
===================================================================
--- scummvm/trunk/backends/platform/psp/image_viewer.h	2010-10-29 07:08:24 UTC (rev 53917)
+++ scummvm/trunk/backends/platform/psp/image_viewer.h	2010-10-29 07:55:18 UTC (rev 53918)
@@ -66,8 +66,8 @@
 	void loadLastImage();
 	void setViewerButtons(bool active);
 	void setConstantRendererOptions();
-	void moveImageX(int val);
-	void moveImageY(int val);
+	void moveImageX(float val);
+	void moveImageY(float val);
 	bool load(int imageNum);
 	void unload();	
 	void runLoop(); // to get total pausing we have to do our own loop


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