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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Tue Nov 10 01:01:43 CET 2009


Revision: 45797
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45797&view=rev
Author:   fingolfin
Date:     2009-11-10 00:01:43 +0000 (Tue, 10 Nov 2009)

Log Message:
-----------
SDL: Remove const from new handle*() method for now, to allow using remapKey (ultimately, the goal is to get back the const by changing how remapping works)

Modified Paths:
--------------
    scummvm/trunk/backends/platform/sdl/events.cpp
    scummvm/trunk/backends/platform/sdl/sdl.h

Modified: scummvm/trunk/backends/platform/sdl/events.cpp
===================================================================
--- scummvm/trunk/backends/platform/sdl/events.cpp	2009-11-09 23:58:12 UTC (rev 45796)
+++ scummvm/trunk/backends/platform/sdl/events.cpp	2009-11-10 00:01:43 UTC (rev 45797)
@@ -191,7 +191,7 @@
 	return false;
 }
 
-bool OSystem_SDL::dispatchSDLEvent(const SDL_Event &ev, Common::Event &event) {
+bool OSystem_SDL::dispatchSDLEvent(SDL_Event &ev, Common::Event &event) {
 	switch (ev.type) {
 	case SDL_KEYDOWN:
 		return handleKeyDown(ev, event);
@@ -224,7 +224,7 @@
 }
 
 
-bool OSystem_SDL::handleKeyDown(const SDL_Event &ev, Common::Event &event) {
+bool OSystem_SDL::handleKeyDown(SDL_Event &ev, Common::Event &event) {
 	byte b = 0;
 	b = event.kbd.flags = SDLModToOSystemKeyFlags(SDL_GetModState());
 
@@ -313,7 +313,7 @@
 	return true;
 }
 
-bool OSystem_SDL::handleKeyUp(const SDL_Event &ev, Common::Event &event) {
+bool OSystem_SDL::handleKeyUp(SDL_Event &ev, Common::Event &event) {
 	byte b = 0;
 	const bool event_complete = remapKey(ev, event);
 
@@ -334,7 +334,7 @@
 	return true;
 }
 
-bool OSystem_SDL::handleMouseMotion(const SDL_Event &ev, Common::Event &event) {
+bool OSystem_SDL::handleMouseMotion(SDL_Event &ev, Common::Event &event) {
 	event.type = Common::EVENT_MOUSEMOVE;
 	fillMouseEvent(event, ev.motion.x, ev.motion.y);
 
@@ -342,7 +342,7 @@
 	return true;
 }
 
-bool OSystem_SDL::handleMouseButtonDown(const SDL_Event &ev, Common::Event &event) {
+bool OSystem_SDL::handleMouseButtonDown(SDL_Event &ev, Common::Event &event) {
 	if (ev.button.button == SDL_BUTTON_LEFT)
 		event.type = Common::EVENT_LBUTTONDOWN;
 	else if (ev.button.button == SDL_BUTTON_RIGHT)
@@ -365,7 +365,7 @@
 	return true;
 }
 
-bool OSystem_SDL::handleMouseButtonUp(const SDL_Event &ev, Common::Event &event) {
+bool OSystem_SDL::handleMouseButtonUp(SDL_Event &ev, Common::Event &event) {
 	if (ev.button.button == SDL_BUTTON_LEFT)
 		event.type = Common::EVENT_LBUTTONUP;
 	else if (ev.button.button == SDL_BUTTON_RIGHT)
@@ -381,7 +381,7 @@
 	return true;
 }
 
-bool OSystem_SDL::handleJoyButtonDown(const SDL_Event &ev, Common::Event &event) {
+bool OSystem_SDL::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) {
 	if (ev.jbutton.button == JOY_BUT_LMOUSE) {
 		event.type = Common::EVENT_LBUTTONDOWN;
 		fillMouseEvent(event, _km.x, _km.y);
@@ -412,7 +412,7 @@
 	return true;
 }
 
-bool OSystem_SDL::handleJoyButtonUp(const SDL_Event &ev, Common::Event &event) {
+bool OSystem_SDL::handleJoyButtonUp(SDL_Event &ev, Common::Event &event) {
 	if (ev.jbutton.button == JOY_BUT_LMOUSE) {
 		event.type = Common::EVENT_LBUTTONUP;
 		fillMouseEvent(event, _km.x, _km.y);
@@ -443,7 +443,7 @@
 	return true;
 }
 
-bool OSystem_SDL::handleJoyAxisMotion(const SDL_Event &ev, Common::Event &event) {
+bool OSystem_SDL::handleJoyAxisMotion(SDL_Event &ev, Common::Event &event) {
 	int axis = ev.jaxis.value;
 	if ( axis > JOY_DEADZONE) {
 		axis -= JOY_DEADZONE;

Modified: scummvm/trunk/backends/platform/sdl/sdl.h
===================================================================
--- scummvm/trunk/backends/platform/sdl/sdl.h	2009-11-09 23:58:12 UTC (rev 45796)
+++ scummvm/trunk/backends/platform/sdl/sdl.h	2009-11-10 00:01:43 UTC (rev 45797)
@@ -157,20 +157,20 @@
 	virtual bool pollEvent(Common::Event &event); // overloaded by CE backend
 
 protected:
-	virtual bool dispatchSDLEvent(const SDL_Event &ev, Common::Event &event);
+	virtual bool dispatchSDLEvent(SDL_Event &ev, Common::Event &event);
 
 	// Handlers for specific SDL events, called by pollEvent.
 	// This way, if a backend inherits fromt the SDL backend, it can
 	// change the behavior of only a single event, without having to override all
 	// of pollEvent.
-	virtual bool handleKeyDown(const SDL_Event &ev, Common::Event &event);
-	virtual bool handleKeyUp(const SDL_Event &ev, Common::Event &event);
-	virtual bool handleMouseMotion(const SDL_Event &ev, Common::Event &event);
-	virtual bool handleMouseButtonDown(const SDL_Event &ev, Common::Event &event);
-	virtual bool handleMouseButtonUp(const SDL_Event &ev, Common::Event &event);
-	virtual bool handleJoyButtonDown(const SDL_Event &ev, Common::Event &event);
-	virtual bool handleJoyButtonUp(const SDL_Event &ev, Common::Event &event);
-	virtual bool handleJoyAxisMotion(const SDL_Event &ev, Common::Event &event);
+	virtual bool handleKeyDown(SDL_Event &ev, Common::Event &event);
+	virtual bool handleKeyUp(SDL_Event &ev, Common::Event &event);
+	virtual bool handleMouseMotion(SDL_Event &ev, Common::Event &event);
+	virtual bool handleMouseButtonDown(SDL_Event &ev, Common::Event &event);
+	virtual bool handleMouseButtonUp(SDL_Event &ev, Common::Event &event);
+	virtual bool handleJoyButtonDown(SDL_Event &ev, Common::Event &event);
+	virtual bool handleJoyButtonUp(SDL_Event &ev, Common::Event &event);
+	virtual bool handleJoyAxisMotion(SDL_Event &ev, Common::Event &event);
 
 public:
 


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