[Scummvm-cvs-logs] SF.net SVN: scummvm: [20770] residual/trunk

marcus_c at users.sourceforge.net marcus_c at users.sourceforge.net
Sun Feb 19 05:17:05 CET 2006


Revision: 20770
Author:   marcus_c
Date:     2006-02-19 05:16:34 -0800 (Sun, 19 Feb 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm?rev=20770&view=rev

Log Message:
-----------
The LUA code expects a value in the range -1..1 for the state of an axis control, so getControlAxis() ought to return a float, not an int.

Modified Paths:
--------------
    residual/trunk/driver.h
    residual/trunk/driver_sdl.cpp
    residual/trunk/driver_sdl.h
Modified: residual/trunk/driver.h
===================================================================
--- residual/trunk/driver.h	2006-02-19 04:29:26 UTC (rev 20769)
+++ residual/trunk/driver.h	2006-02-19 13:16:34 UTC (rev 20770)
@@ -190,9 +190,9 @@
 	virtual bool controlIsAxis(int num) = 0;
 
 	/**
-	 * Read the current value of an axis control
+	 * Read the current value of an axis control (-1.0 .. 1.0)
 	 */
-	virtual int getControlAxis(int num) = 0;
+	virtual float getControlAxis(int num) = 0;
 
 	/**
 	 * Read the current state of a non-axis control

Modified: residual/trunk/driver_sdl.cpp
===================================================================
--- residual/trunk/driver_sdl.cpp	2006-02-19 04:29:26 UTC (rev 20769)
+++ residual/trunk/driver_sdl.cpp	2006-02-19 13:16:34 UTC (rev 20770)
@@ -281,7 +281,7 @@
 	return num >= SDLK_AXIS_JOY1_X && num <= SDLK_AXIS_MOUSE_Z;
 }
 
-int DriverSDL::getControlAxis(int num) {
+float DriverSDL::getControlAxis(int num) {
 	return 0;
 }
 

Modified: residual/trunk/driver_sdl.h
===================================================================
--- residual/trunk/driver_sdl.h	2006-02-19 04:29:26 UTC (rev 20769)
+++ residual/trunk/driver_sdl.h	2006-02-19 13:16:34 UTC (rev 20770)
@@ -41,7 +41,7 @@
 	const ControlDescriptor *listControls();
 	int getNumControls();
 	bool controlIsAxis(int num);
-	int getControlAxis(int num);
+	float getControlAxis(int num);
 	bool getControlState(int num);
 	bool pollEvent(Event &event);
 	uint32 getMillis();







More information about the Scummvm-git-logs mailing list