[Scummvm-cvs-logs] SF.net SVN: scummvm:[50474] scummvm/branches/gsoc2010-opengl/backends

vgvgf at users.sourceforge.net vgvgf at users.sourceforge.net
Tue Jun 29 03:08:36 CEST 2010


Revision: 50474
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50474&view=rev
Author:   vgvgf
Date:     2010-06-29 01:08:36 +0000 (Tue, 29 Jun 2010)

Log Message:
-----------
Modularized Linuxmoto port.

Modified Paths:
--------------
    scummvm/branches/gsoc2010-opengl/backends/events/sdl/sdl-events.h
    scummvm/branches/gsoc2010-opengl/backends/mixer/sdl/sdl-mixer.cpp
    scummvm/branches/gsoc2010-opengl/backends/mixer/sdl/sdl-mixer.h
    scummvm/branches/gsoc2010-opengl/backends/platform/linuxmoto/linuxmoto-main.cpp
    scummvm/branches/gsoc2010-opengl/backends/platform/linuxmoto/linuxmoto-sdl.cpp
    scummvm/branches/gsoc2010-opengl/backends/platform/linuxmoto/linuxmoto-sdl.h
    scummvm/branches/gsoc2010-opengl/backends/platform/linuxmoto/module.mk
    scummvm/branches/gsoc2010-opengl/backends/platform/sdl/sdl.cpp
    scummvm/branches/gsoc2010-opengl/backends/platform/sdl/sdl.h

Added Paths:
-----------
    scummvm/branches/gsoc2010-opengl/backends/events/linuxmotosdl/
    scummvm/branches/gsoc2010-opengl/backends/events/linuxmotosdl/linuxmotosdl-events.cpp
    scummvm/branches/gsoc2010-opengl/backends/events/linuxmotosdl/linuxmotosdl-events.h
    scummvm/branches/gsoc2010-opengl/backends/graphics/linuxmotosdl/
    scummvm/branches/gsoc2010-opengl/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp
    scummvm/branches/gsoc2010-opengl/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h

Removed Paths:
-------------
    scummvm/branches/gsoc2010-opengl/backends/platform/linuxmoto/linuxmoto-events.cpp
    scummvm/branches/gsoc2010-opengl/backends/platform/linuxmoto/linuxmoto-graphics.cpp


Property changes on: scummvm/branches/gsoc2010-opengl/backends/events/linuxmotosdl
___________________________________________________________________
Added: svn:ignore
   + .deps
*.o
lib*.a


Added: scummvm/branches/gsoc2010-opengl/backends/events/linuxmotosdl/linuxmotosdl-events.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/events/linuxmotosdl/linuxmotosdl-events.cpp	                        (rev 0)
+++ scummvm/branches/gsoc2010-opengl/backends/events/linuxmotosdl/linuxmotosdl-events.cpp	2010-06-29 01:08:36 UTC (rev 50474)
@@ -0,0 +1,248 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#if defined(LINUXMOTO)
+
+#include "backends/events/linuxmotosdl/linuxmotosdl-events.h"
+#include "backends/platform/linuxmoto/linuxmoto-sdl.h"
+
+enum {
+	GFX_HALF = 12
+};
+
+LinuxmotoSdlEventManager::LinuxmotoSdlEventManager(Common::EventSource *boss)
+	:
+	SdlEventManager(boss) {
+
+}
+
+LinuxmotoSdlEventManager::~LinuxmotoSdlEventManager() {
+
+}
+
+void LinuxmotoSdlEventManager::preprocessEvents(SDL_Event *event) {
+	if (event->type == SDL_ACTIVEEVENT) {
+		if (event->active.state == SDL_APPINPUTFOCUS && !event->active.gain) {
+			((OSystem_SDL* )g_system)->getMixerManager()->suspendAudio();
+			for (;;) {
+				if (!SDL_WaitEvent(event)) {
+					SDL_Delay(10);
+					continue;
+				}
+				if (event->type == SDL_QUIT)
+					return;
+				if (event->type != SDL_ACTIVEEVENT)
+					continue;
+				if (event->active.state == SDL_APPINPUTFOCUS && event->active.gain) {
+					((OSystem_SDL* )g_system)->getMixerManager()->resumeAudio();
+					return;
+				}
+			}
+		}
+	}
+}
+
+static int mapKey(SDLKey key, SDLMod mod, Uint16 unicode) {
+	if (key >= SDLK_F1 && key <= SDLK_F9) {
+		return key - SDLK_F1 + Common::ASCII_F1;
+	} else if (key >= SDLK_KP0 && key <= SDLK_KP9) {
+		return key - SDLK_KP0 + '0';
+	} else if (key >= SDLK_UP && key <= SDLK_PAGEDOWN) {
+		return key;
+	} else if (unicode) {
+		return unicode;
+	} else if (key >= 'a' && key <= 'z' && (mod & KMOD_SHIFT)) {
+		return key & ~0x20;
+	} else if (key >= SDLK_NUMLOCK && key <= SDLK_EURO) {
+		return 0;
+	}
+	return key;
+}
+
+bool LinuxmotoSdlEventManager::remapKey(SDL_Event &ev, Common::Event &event) {
+	if (false) {}
+
+	//  Motorol A1200/E6/A1600 remapkey by Lubomyr
+#ifdef MOTOEZX
+	// Quit on MOD+Camera Key on A1200
+	if (ev.key.keysym.sym == SDLK_e) {
+		event.type = Common::EVENT_QUIT;
+		return true;
+	}
+	// '1' Bypass security protection - MOD+Call key
+	if (ev.key.keysym.sym == SDLK_f) {
+		ev.key.keysym.sym = SDLK_1;
+	}
+	// F5 Game Menu - Call key
+	else if (ev.key.keysym.sym == SDLK_SPACE) {
+		ev.key.keysym.sym = SDLK_F5;
+	}
+	// VirtualKeyboard - Camera key
+	else if (ev.key.keysym.sym == SDLK_PAUSE) {
+		ev.key.keysym.sym = SDLK_F7;
+	}
+	// Enter - mod+fire key
+	else if (ev.key.keysym.sym == SDLK_b) {
+		ev.key.keysym.sym = SDLK_RETURN;
+	}
+	// '3' - mod+up key
+	else if (ev.key.keysym.sym == SDLK_j) {
+		ev.key.keysym.sym = SDLK_3;
+	}
+	// '6' - mod+up key
+	else if (ev.key.keysym.sym == SDLK_i) {
+		ev.key.keysym.sym = SDLK_6;
+	}
+	// 'y' - mod+right key
+	else if (ev.key.keysym.sym == SDLK_g) {
+		ev.key.keysym.sym = SDLK_y;
+	}
+	// 'n' - mod+right key
+	else if (ev.key.keysym.sym == SDLK_h) {
+		ev.key.keysym.sym = SDLK_n;
+	}
+	//  mod+vol'+' -> volume'+'
+	else if (ev.key.keysym.sym == SDLK_c) {
+		ev.key.keysym.sym = SDLK_RIGHTBRACKET;
+	}
+	//  mod+vol'-' -> volume'-'
+	else if (ev.key.keysym.sym == SDLK_d) {
+		ev.key.keysym.sym = SDLK_LEFTBRACKET;
+	}
+#endif
+
+#ifdef MOTOMAGX
+	// Quit on Clr
+	if (ev.key.keysym.sym == SDLK_BACKSPACE) {
+		event.type = Common::EVENT_QUIT;
+		return true;
+	}
+	// Game Menu - Left Soft key
+	else if (ev.key.keysym.sym == SDLK_F9) {
+		ev.key.keysym.sym = SDLK_F5;
+	}
+	// VirtualKeyboard - Right Soft key
+	else if (ev.key.keysym.sym == SDLK_F11) {
+		ev.key.keysym.sym = SDLK_F7;
+	}      
+#endif
+
+// Joystick to Mouse
+	else if (ev.key.keysym.sym == SDLK_LEFT) {
+		if (ev.type == SDL_KEYDOWN) {
+			_km.x_vel = -1;
+			_km.x_down_count = 1;
+		} else {
+			_km.x_vel = 0;
+			_km.x_down_count = 0;
+		}
+
+		event.type = Common::EVENT_MOUSEMOVE;
+		fillMouseEvent(event, _km.x, _km.y);
+		return true;
+	} else if (ev.key.keysym.sym == SDLK_RIGHT) {
+		if (ev.type == SDL_KEYDOWN) {
+			_km.x_vel = 1;
+			_km.x_down_count = 1;
+		} else {
+			_km.x_vel = 0;
+			_km.x_down_count = 0;
+		}
+
+		event.type = Common::EVENT_MOUSEMOVE;
+		fillMouseEvent(event, _km.x, _km.y);
+
+		return true;
+	} else if (ev.key.keysym.sym == SDLK_DOWN) {
+		if (ev.type == SDL_KEYDOWN) {
+			_km.y_vel = 1;
+			_km.y_down_count = 1;
+		} else {
+			_km.y_vel = 0;
+			_km.y_down_count = 0;
+		}
+
+		event.type = Common::EVENT_MOUSEMOVE;
+		fillMouseEvent(event, _km.x, _km.y);
+
+		return true;
+	} else if (ev.key.keysym.sym == SDLK_UP) {
+		if (ev.type == SDL_KEYDOWN) {
+			_km.y_vel = -1;
+			_km.y_down_count = 1;
+		} else {
+			_km.y_vel = 0;
+			_km.y_down_count = 0;
+		}
+
+		event.type = Common::EVENT_MOUSEMOVE;
+		fillMouseEvent(event, _km.x, _km.y);
+
+		return true;
+	} else if (ev.key.keysym.sym == SDLK_RETURN) {
+		// Joystick center to pressing Left Mouse
+		if (ev.key.type == SDL_KEYDOWN) {
+			event.type = Common::EVENT_LBUTTONDOWN;
+		} else {
+			event.type = Common::EVENT_LBUTTONUP;
+		}
+
+		fillMouseEvent(event, _km.x, _km.y);
+
+		return true;
+	} else if (ev.key.keysym.sym == SDLK_PLUS) {
+		// Volume Up to pressing Right Mouse
+		if (ev.key.type == SDL_KEYDOWN ) {
+			event.type = Common::EVENT_RBUTTONDOWN;
+		} else {
+			event.type = Common::EVENT_RBUTTONUP;
+		}
+		fillMouseEvent(event, _km.x, _km.y);
+
+		return true;
+	} else if (ev.key.keysym.sym == SDLK_MINUS) {
+		// Volume Down to pressing Left Mouse
+		if (ev.key.type == SDL_KEYDOWN) {
+			event.type = Common::EVENT_LBUTTONDOWN;
+		} else {
+			event.type = Common::EVENT_LBUTTONUP;
+		}
+
+		fillMouseEvent(event, _km.x, _km.y);
+
+		return true;
+	} else {
+		// Let the events fall through if we didn't change them, this may not be the best way to
+		// set it up, but i'm not sure how sdl would like it if we let if fall through then redid it though.
+		// and yes i have an huge terminal size so i dont wrap soon enough.
+		event.type = Common::EVENT_KEYDOWN;
+		event.kbd.keycode = (Common::KeyCode)ev.key.keysym.sym;
+		event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode);
+	}
+
+	return false;
+}
+
+#endif


Property changes on: scummvm/branches/gsoc2010-opengl/backends/events/linuxmotosdl/linuxmotosdl-events.cpp
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Added: scummvm/branches/gsoc2010-opengl/backends/events/linuxmotosdl/linuxmotosdl-events.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/events/linuxmotosdl/linuxmotosdl-events.h	                        (rev 0)
+++ scummvm/branches/gsoc2010-opengl/backends/events/linuxmotosdl/linuxmotosdl-events.h	2010-06-29 01:08:36 UTC (rev 50474)
@@ -0,0 +1,41 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#if !defined(BACKEND_EVENTS_SDL_LINUXMOTO_H) && !defined(DISABLE_DEFAULT_EVENTMANAGER)
+#define BACKEND_EVENTS_SDL_LINUXMOTO_H
+
+#include "backends/events/sdl/sdl-events.h"
+
+class LinuxmotoSdlEventManager : public SdlEventManager {
+public:
+	LinuxmotoSdlEventManager(Common::EventSource *boss);
+	virtual ~LinuxmotoSdlEventManager();
+
+protected:
+	virtual void preprocessEvents(SDL_Event *event);
+	virtual bool remapKey(SDL_Event &ev, Common::Event &event);
+};
+
+#endif


Property changes on: scummvm/branches/gsoc2010-opengl/backends/events/linuxmotosdl/linuxmotosdl-events.h
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Modified: scummvm/branches/gsoc2010-opengl/backends/events/sdl/sdl-events.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/events/sdl/sdl-events.h	2010-06-29 00:38:06 UTC (rev 50473)
+++ scummvm/branches/gsoc2010-opengl/backends/events/sdl/sdl-events.h	2010-06-29 01:08:36 UTC (rev 50474)
@@ -43,6 +43,8 @@
 
 	virtual void resetKeyboadEmulation(int16 x_max, int16 y_max);
 
+	virtual void toggleMouseGrab();
+
 protected:
 	virtual void preprocessEvents(SDL_Event *event) {}
 
@@ -77,8 +79,7 @@
 	virtual bool handleJoyButtonUp(SDL_Event &ev, Common::Event &event);
 	virtual bool handleJoyAxisMotion(SDL_Event &ev, Common::Event &event);
 
-	virtual void fillMouseEvent(Common::Event &event, int x, int y); // overloaded by CE backend
-	virtual void toggleMouseGrab();
+	virtual void fillMouseEvent(Common::Event &event, int x, int y);
 
 	virtual void handleKbdMouse();
 	virtual bool remapKey(SDL_Event &ev, Common::Event &event);


Property changes on: scummvm/branches/gsoc2010-opengl/backends/graphics/linuxmotosdl
___________________________________________________________________
Added: svn:ignore
   + .deps
*.o
lib*.a


Added: scummvm/branches/gsoc2010-opengl/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp	                        (rev 0)
+++ scummvm/branches/gsoc2010-opengl/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp	2010-06-29 01:08:36 UTC (rev 50474)
@@ -0,0 +1,498 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifdef LINUXMOTO 
+
+#include "backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h"
+#include "backends/events/linuxmotosdl/linuxmotosdl-events.h"
+#include "common/mutex.h"
+#include "graphics/font.h"
+#include "graphics/fontman.h"
+#include "graphics/scaler.h"
+#include "graphics/scaler/aspect.h"
+#include "graphics/scaler/downscaler.h"
+#include "graphics/surface.h"
+
+enum {
+	GFX_HALF = 12
+};
+
+static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
+	{"1x", "Fullscreen", GFX_NORMAL},
+	{"\xBDx", "Downscale", GFX_HALF},
+	{0, 0, 0}
+};
+
+LinuxmotoSdlGraphicsManager::LinuxmotoSdlGraphicsManager() {
+
+}
+
+LinuxmotoSdlGraphicsManager::~LinuxmotoSdlGraphicsManager() {
+
+}
+
+const OSystem::GraphicsMode *LinuxmotoSdlGraphicsManager::getSupportedGraphicsModes() const {
+	return s_supportedGraphicsModes;
+}
+
+int LinuxmotoSdlGraphicsManager::getDefaultGraphicsMode() const {
+	return GFX_NORMAL;
+}
+
+bool LinuxmotoSdlGraphicsManager::setGraphicsMode(int mode) {
+	Common::StackLock lock(_graphicsMutex);
+
+	assert(_transactionMode == kTransactionActive);
+
+	if (_oldVideoMode.setup && _oldVideoMode.mode == mode)
+		return true;
+
+	int newScaleFactor = 1;
+
+	switch (mode) {
+	case GFX_NORMAL:
+		newScaleFactor = 1;
+		break;
+	case GFX_HALF:
+		newScaleFactor = 1;
+		break;
+	default:
+		warning("unknown gfx mode %d", mode);
+		return false;
+	}
+
+	_transactionDetails.normal1xScaler = (mode == GFX_NORMAL);
+	if (_oldVideoMode.setup && _oldVideoMode.scaleFactor != newScaleFactor)
+		_transactionDetails.needHotswap = true;
+
+	_transactionDetails.needUpdatescreen = true;
+
+	_videoMode.mode = mode;
+	_videoMode.scaleFactor = newScaleFactor;
+
+	return true;
+}
+
+void LinuxmotoSdlGraphicsManager::setGraphicsModeIntern() {
+	Common::StackLock lock(_graphicsMutex);
+	ScalerProc *newScalerProc = 0;
+
+	switch (_videoMode.mode) {
+	case GFX_NORMAL:
+		newScalerProc = Normal1x;
+		break;
+	case GFX_HALF:
+		newScalerProc = DownscaleAllByHalf;
+		break;
+
+	default:
+		error("Unknown gfx mode %d", _videoMode.mode);
+	}
+
+	_scalerProc = newScalerProc;
+
+	if (!_screen || !_hwscreen)
+		return;
+
+	// Blit everything to the screen
+	_forceFull = true;
+
+	// Even if the old and new scale factors are the same, we may have a
+	// different scaler for the cursor now.
+	blitCursor();
+}
+
+
+void LinuxmotoSdlGraphicsManager::initSize(uint w, uint h) {
+	assert(_transactionMode == kTransactionActive);
+
+	// Avoid redundant res changes
+	if ((int)w == _videoMode.screenWidth && (int)h == _videoMode.screenHeight)
+		return;
+
+	_videoMode.screenWidth = w;
+	_videoMode.screenHeight = h;
+
+	if	(w > 320 || h > 240) {
+		setGraphicsMode(GFX_HALF);
+		setGraphicsModeIntern();
+		((LinuxmotoSdlEventManager *)g_system->getEventManager())->toggleMouseGrab();
+	}
+
+	_transactionDetails.sizeChanged = true;
+}
+
+bool LinuxmotoSdlGraphicsManager::loadGFXMode() {
+	printf("Game ScreenMode = %d*%d\n",_videoMode.screenWidth, _videoMode.screenHeight);
+	if (_videoMode.screenWidth > 320 || _videoMode.screenHeight > 240) {
+		_videoMode.aspectRatioCorrection = false;
+		setGraphicsMode(GFX_HALF);
+		printf("GraphicsMode set to HALF\n");
+	} else {
+		setGraphicsMode(GFX_NORMAL);
+		printf("GraphicsMode set to NORMAL\n");
+	}
+	if (_videoMode.mode == GFX_HALF && !_overlayVisible) {
+		_videoMode.overlayWidth = 320;
+		_videoMode.overlayHeight = 240;
+		_videoMode.fullscreen = true;
+	} else {
+
+		_videoMode.overlayWidth = _videoMode.screenWidth * _videoMode.scaleFactor;
+		_videoMode.overlayHeight = _videoMode.screenHeight * _videoMode.scaleFactor;
+
+		if (_videoMode.aspectRatioCorrection)
+			_videoMode.overlayHeight = real2Aspect(_videoMode.overlayHeight);
+
+		_videoMode.hardwareWidth = _videoMode.screenWidth * _videoMode.scaleFactor;
+		_videoMode.hardwareHeight = effectiveScreenHeight();
+	}
+
+	return SdlGraphicsManager::loadGFXMode();
+}
+
+void LinuxmotoSdlGraphicsManager::drawMouse() {
+	if (!_mouseVisible || !_mouseSurface) {
+		_mouseBackup.x = _mouseBackup.y = _mouseBackup.w = _mouseBackup.h = 0;
+		return;
+	}
+
+	SDL_Rect dst;
+	int scale;
+	int hotX, hotY;
+
+	if (_videoMode.mode == GFX_HALF && !_overlayVisible) {
+		dst.x = _mouseCurState.x/2;
+		dst.y = _mouseCurState.y/2;
+	} else {
+		dst.x = _mouseCurState.x;
+		dst.y = _mouseCurState.y;
+	}
+
+	if (!_overlayVisible) {
+		scale = _videoMode.scaleFactor;
+		dst.w = _mouseCurState.vW;
+		dst.h = _mouseCurState.vH;
+		hotX = _mouseCurState.vHotX;
+		hotY = _mouseCurState.vHotY;
+	} else {
+		scale = 1;
+		dst.w = _mouseCurState.rW;
+		dst.h = _mouseCurState.rH;
+		hotX = _mouseCurState.rHotX;
+		hotY = _mouseCurState.rHotY;
+	}
+
+	// The mouse is undrawn using virtual coordinates, i.e. they may be
+	// scaled and aspect-ratio corrected.
+
+	_mouseBackup.x = dst.x - hotX;
+	_mouseBackup.y = dst.y - hotY;
+	_mouseBackup.w = dst.w;
+	_mouseBackup.h = dst.h;
+
+	// We draw the pre-scaled cursor image, so now we need to adjust for
+	// scaling, shake position and aspect ratio correction manually.
+
+	if (!_overlayVisible) {
+		dst.y += _currentShakePos;
+	}
+
+	if (_videoMode.aspectRatioCorrection && !_overlayVisible)
+		dst.y = real2Aspect(dst.y);
+
+	dst.x = scale * dst.x - _mouseCurState.rHotX;
+	dst.y = scale * dst.y - _mouseCurState.rHotY;
+	dst.w = _mouseCurState.rW;
+	dst.h = _mouseCurState.rH;
+
+	// Note that SDL_BlitSurface() and addDirtyRect() will both perform any
+	// clipping necessary
+
+	if (SDL_BlitSurface(_mouseSurface, NULL, _hwscreen, &dst) != 0)
+		error("SDL_BlitSurface failed: %s", SDL_GetError());
+
+	// The screen will be updated using real surface coordinates, i.e.
+	// they will not be scaled or aspect-ratio corrected.
+	addDirtyRect(dst.x, dst.y, dst.w, dst.h, true);
+}
+
+void LinuxmotoSdlGraphicsManager::undrawMouse() {
+	const int x = _mouseBackup.x;
+	const int y = _mouseBackup.y;
+
+	// When we switch bigger overlay off mouse jumps. Argh!
+	// This is intended to prevent undrawing offscreen mouse
+	if (!_overlayVisible && (x >= _videoMode.screenWidth || y >= _videoMode.screenHeight))
+		return;
+
+	if (_mouseBackup.w != 0 && _mouseBackup.h != 0) {
+		if (_videoMode.mode == GFX_HALF && !_overlayVisible) {
+			addDirtyRect(x*2, y*2, _mouseBackup.w*2, _mouseBackup.h*2);
+		} else {
+			addDirtyRect(x, y, _mouseBackup.w, _mouseBackup.h);
+		}
+	}
+}
+
+void LinuxmotoSdlGraphicsManager::internUpdateScreen() {
+	SDL_Surface *srcSurf, *origSurf;
+	int height, width;
+	ScalerProc *scalerProc;
+	int scale1;
+
+#if defined (DEBUG) // definitions not available for non-DEBUG here. (needed this to compile in SYMBIAN32 & linux?)
+	assert(_hwscreen != NULL);
+	assert(_hwscreen->map->sw_data != NULL);
+#endif
+
+	// If the shake position changed, fill the dirty area with blackness
+	if (_currentShakePos != _newShakePos) {
+		SDL_Rect blackrect = {0, 0, _videoMode.screenWidth * _videoMode.scaleFactor, _newShakePos * _videoMode.scaleFactor};
+
+		if (_videoMode.aspectRatioCorrection && !_overlayVisible)
+			blackrect.h = real2Aspect(blackrect.h - 1) + 1;
+
+		SDL_FillRect(_hwscreen, &blackrect, 0);
+
+		_currentShakePos = _newShakePos;
+
+		_forceFull = true;
+	}
+
+	// Check whether the palette was changed in the meantime and update the
+	// screen surface accordingly.
+	if (_screen && _paletteDirtyEnd != 0) {
+		SDL_SetColors(_screen, _currentPalette + _paletteDirtyStart,
+			_paletteDirtyStart,
+			_paletteDirtyEnd - _paletteDirtyStart);
+
+		_paletteDirtyEnd = 0;
+
+		_forceFull = true;
+	}
+
+#ifdef USE_OSD
+	// OSD visible (i.e. non-transparent)?
+	if (_osdAlpha != SDL_ALPHA_TRANSPARENT) {
+		// Updated alpha value
+		const int diff = SDL_GetTicks() - _osdFadeStartTime;
+		if (diff > 0) {
+			if (diff >= kOSDFadeOutDuration) {
+				// Back to full transparency
+				_osdAlpha = SDL_ALPHA_TRANSPARENT;
+			} else {
+				// Do a linear fade out...
+				const int startAlpha = SDL_ALPHA_TRANSPARENT + kOSDInitialAlpha * (SDL_ALPHA_OPAQUE - SDL_ALPHA_TRANSPARENT) / 100;
+				_osdAlpha = startAlpha + diff * (SDL_ALPHA_TRANSPARENT - startAlpha) / kOSDFadeOutDuration;
+			}
+			SDL_SetAlpha(_osdSurface, SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA, _osdAlpha);
+			_forceFull = true;
+		}
+	}
+#endif
+
+	if (!_overlayVisible) {
+		origSurf = _screen;
+		srcSurf = _tmpscreen;
+		width = _videoMode.screenWidth;
+		height = _videoMode.screenHeight;
+		scalerProc = _scalerProc;
+		scale1 = _videoMode.scaleFactor;
+	} else {
+		origSurf = _overlayscreen;
+		srcSurf = _tmpscreen2;
+		width = _videoMode.overlayWidth;
+		height = _videoMode.overlayHeight;
+		scalerProc = Normal1x;
+		scale1 = 1;
+	}
+
+	// Add the area covered by the mouse cursor to the list of dirty rects if
+	// we have to redraw the mouse.
+	if (_mouseNeedsRedraw)
+		undrawMouse();
+
+	// Force a full redraw if requested
+	if (_forceFull) {
+		_numDirtyRects = 1;
+		_dirtyRectList[0].x = 0;
+		_dirtyRectList[0].y = 0;
+		_dirtyRectList[0].w = width;
+		_dirtyRectList[0].h = height;
+	}
+
+	// Only draw anything if necessary
+	if (_numDirtyRects > 0 || _mouseNeedsRedraw) {
+		SDL_Rect *r;
+		SDL_Rect dst;
+		uint32 srcPitch, dstPitch;
+		SDL_Rect *lastRect = _dirtyRectList + _numDirtyRects;
+
+		for (r = _dirtyRectList; r != lastRect; ++r) {
+			dst = *r;
+			dst.x++;	// Shift rect by one since 2xSai needs to access the data around
+			dst.y++;	// any pixel to scale it, and we want to avoid mem access crashes.
+
+			if (SDL_BlitSurface(origSurf, r, srcSurf, &dst) != 0)
+				error("SDL_BlitSurface failed: %s", SDL_GetError());
+		}
+
+		SDL_LockSurface(srcSurf);
+		SDL_LockSurface(_hwscreen);
+
+		srcPitch = srcSurf->pitch;
+		dstPitch = _hwscreen->pitch;
+
+		for (r = _dirtyRectList; r != lastRect; ++r) {
+			register int dst_y = r->y + _currentShakePos;
+			register int dst_h = 0;
+			register int dst_w = r->w;
+			register int orig_dst_y = 0;
+			register int dst_x = r->x;
+			register int src_y;
+			register int src_x;
+
+			if (dst_y < height) {
+				dst_h = r->h;
+				if (dst_h > height - dst_y)
+					dst_h = height - dst_y;
+
+				orig_dst_y = dst_y;
+				src_x = dst_x;
+				src_y = dst_y;
+
+				if (_videoMode.aspectRatioCorrection && !_overlayVisible)
+					dst_y = real2Aspect(dst_y);
+
+				assert(scalerProc != NULL);
+
+				if (_videoMode.mode == GFX_HALF && scalerProc == DownscaleAllByHalf) {
+
+					if (dst_x%2==1) {
+						dst_x--;
+						dst_w++;
+					}
+					if (dst_y%2==1) {
+						dst_y--;
+						dst_h++;
+					}
+
+					if (dst_w&1)
+						dst_w++;
+					if (dst_h&1)
+						dst_h++;
+
+					src_x = dst_x;
+					src_y = dst_y;
+					dst_x = dst_x / 2;
+					dst_y = dst_y / 2;
+				}
+				scalerProc((byte *)srcSurf->pixels + (src_x * 2 + 2) + (src_y + 1) * srcPitch, srcPitch,
+						   (byte *)_hwscreen->pixels + dst_x * 2 + dst_y * dstPitch, dstPitch, dst_w, dst_h);
+			}
+
+			if (_videoMode.mode == GFX_HALF && scalerProc == DownscaleAllByHalf) {
+				r->w = r->w / 2;
+				r->h = dst_h / 2;
+			} else {
+				r->w = r->w;
+				r->h = dst_h;
+			}
+
+			r->x = dst_x;
+			r->y = dst_y;
+
+#ifdef USE_SCALERS
+			if (_videoMode.aspectRatioCorrection && orig_dst_y < height && !_overlayVisible)
+				r->h = stretch200To240((uint8 *) _hwscreen->pixels, dstPitch, r->w, r->h, r->x, r->y, orig_dst_y * scale1);
+#endif
+		}
+		SDL_UnlockSurface(srcSurf);
+		SDL_UnlockSurface(_hwscreen);
+
+		// Readjust the dirty rect list in case we are doing a full update.
+		// This is necessary if shaking is active.
+		if (_forceFull) {
+			_dirtyRectList[0].y = 0;
+			_dirtyRectList[0].h = (_videoMode.mode == GFX_HALF) ? effectiveScreenHeight()/2 : effectiveScreenHeight();
+		}
+
+		drawMouse();
+
+#ifdef USE_OSD
+		if (_osdAlpha != SDL_ALPHA_TRANSPARENT) {
+			SDL_BlitSurface(_osdSurface, 0, _hwscreen, 0);
+		}
+#endif
+		// Finally, blit all our changes to the screen
+		SDL_UpdateRects(_hwscreen, _numDirtyRects, _dirtyRectList);
+	}
+
+	_numDirtyRects = 0;
+	_forceFull = false;
+	_mouseNeedsRedraw = false;
+}
+
+void LinuxmotoSdlGraphicsManager::showOverlay() {
+	if (_videoMode.mode == GFX_HALF) {
+		_mouseCurState.x = _mouseCurState.x / 2;
+		_mouseCurState.y = _mouseCurState.y / 2;
+	}
+	SdlGraphicsManager::showOverlay();
+}
+
+void LinuxmotoSdlGraphicsManager::hideOverlay() {
+	if (_videoMode.mode == GFX_HALF) {
+		_mouseCurState.x = _mouseCurState.x * 2;
+		_mouseCurState.y = _mouseCurState.y * 2;
+	}
+	SdlGraphicsManager::hideOverlay();
+}
+
+void LinuxmotoSdlGraphicsManager::warpMouse(int x, int y) {
+	if (_mouseCurState.x != x || _mouseCurState.y != y) {
+		if (_videoMode.mode == GFX_HALF && !_overlayVisible) {
+			x = x / 2;
+			y = y / 2;
+		}
+	}
+	SdlGraphicsManager::warpMouse(x, y);
+}
+
+void LinuxmotoSdlGraphicsManager::adjustMouseEvent(Common::Event &event) {
+	if (!_overlayVisible) {
+		if (_videoMode.mode == GFX_HALF) {
+			event.mouse.x *= 2;
+			event.mouse.y *= 2;
+		}
+		event.mouse.x /= _videoMode.scaleFactor;
+		event.mouse.y /= _videoMode.scaleFactor;
+		if (_videoMode.aspectRatioCorrection)
+			event.mouse.y = aspect2Real(event.mouse.y);
+	}
+}
+
+#endif


Property changes on: scummvm/branches/gsoc2010-opengl/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Added: scummvm/branches/gsoc2010-opengl/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h	                        (rev 0)
+++ scummvm/branches/gsoc2010-opengl/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h	2010-06-29 01:08:36 UTC (rev 50474)
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef BACKENDS_GRAPHICS_SDL_LINUXMOTO_H
+#define BACKENDS_GRAPHICS_SDL_LINUXMOTO_H
+
+#include "backends/graphics/sdl/sdl-graphics.h"
+
+class LinuxmotoSdlGraphicsManager : public SdlGraphicsManager {
+public:
+	LinuxmotoSdlGraphicsManager();
+	virtual ~LinuxmotoSdlGraphicsManager();
+
+	virtual void initSize(uint w, uint h);
+	virtual void setGraphicsModeIntern();
+	virtual bool setGraphicsMode(int mode);
+	virtual void internUpdateScreen();
+	virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const;
+	virtual int getDefaultGraphicsMode() const;
+	virtual bool loadGFXMode();
+	virtual void drawMouse();
+	virtual void undrawMouse();
+	virtual void showOverlay();
+	virtual void hideOverlay();
+	virtual void warpMouse(int x, int y);
+	virtual void adjustMouseEvent(Common::Event &event);
+};
+
+#endif


Property changes on: scummvm/branches/gsoc2010-opengl/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Modified: scummvm/branches/gsoc2010-opengl/backends/mixer/sdl/sdl-mixer.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/mixer/sdl/sdl-mixer.cpp	2010-06-29 00:38:06 UTC (rev 50473)
+++ scummvm/branches/gsoc2010-opengl/backends/mixer/sdl/sdl-mixer.cpp	2010-06-29 01:08:36 UTC (rev 50474)
@@ -35,7 +35,8 @@
 
 SdlMixerManager::SdlMixerManager()
 	:
-	_mixer(0) {
+	_mixer(0),
+	_audioSuspended(false) {
 
 }
 
@@ -120,4 +121,20 @@
 	manager->callbackHandler(samples, len);
 }
 
+void SdlMixerManager::suspendAudio() {
+	SDL_CloseAudio();
+	_audioSuspended = true;
+}
+
+int SdlMixerManager::resumeAudio() {
+	if (!_audioSuspended)
+		return -2;
+	if (SDL_OpenAudio(&_obtainedRate, NULL) < 0){
+		return -1;
+	}
+	SDL_PauseAudio(0);
+	_audioSuspended = false;
+	return 0;
+}
+
 #endif

Modified: scummvm/branches/gsoc2010-opengl/backends/mixer/sdl/sdl-mixer.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/mixer/sdl/sdl-mixer.h	2010-06-29 00:38:06 UTC (rev 50473)
+++ scummvm/branches/gsoc2010-opengl/backends/mixer/sdl/sdl-mixer.h	2010-06-29 01:08:36 UTC (rev 50474)
@@ -43,9 +43,14 @@
 
 	Audio::Mixer *getMixer() { return (Audio::Mixer *)_mixer; }
 
+	// Used by LinuxMoto Port
+	virtual void suspendAudio();
+	virtual int resumeAudio();
+
 protected:
 	Audio::MixerImpl *_mixer;
 	SDL_AudioSpec _obtainedRate;
+	bool _audioSuspended;
 
 	virtual SDL_AudioSpec getAudioSpec();
 	virtual void startAudio();

Deleted: scummvm/branches/gsoc2010-opengl/backends/platform/linuxmoto/linuxmoto-events.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/platform/linuxmoto/linuxmoto-events.cpp	2010-06-29 00:38:06 UTC (rev 50473)
+++ scummvm/branches/gsoc2010-opengl/backends/platform/linuxmoto/linuxmoto-events.cpp	2010-06-29 01:08:36 UTC (rev 50474)
@@ -1,228 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#include "backends/platform/linuxmoto/linuxmoto-sdl.h"
-#include "graphics/scaler/aspect.h"	// for aspect2Real
-
-static int mapKey(SDLKey key, SDLMod mod, Uint16 unicode) {
-	if (key >= SDLK_F1 && key <= SDLK_F9) {
-		return key - SDLK_F1 + Common::ASCII_F1;
-	} else if (key >= SDLK_KP0 && key <= SDLK_KP9) {
-		return key - SDLK_KP0 + '0';
-	} else if (key >= SDLK_UP && key <= SDLK_PAGEDOWN) {
-		return key;
-	} else if (unicode) {
-		return unicode;
-	} else if (key >= 'a' && key <= 'z' && (mod & KMOD_SHIFT)) {
-		return key & ~0x20;
-	} else if (key >= SDLK_NUMLOCK && key <= SDLK_EURO) {
-		return 0;
-	}
-	return key;
-}
-
-void OSystem_LINUXMOTO::fillMouseEvent(Common::Event &event, int x, int y) {
-	if (_videoMode.mode == GFX_HALF && !_overlayVisible) {
-		event.mouse.x = x*2;
-		event.mouse.y = y*2;
-	} else {
-		event.mouse.x = x;
-		event.mouse.y = y;
-	}
-
-	// Update the "keyboard mouse" coords
-	_km.x = x;
-	_km.y = y;
-
-	// Adjust for the screen scaling
-	if (!_overlayVisible) {
-		event.mouse.x /= _videoMode.scaleFactor;
-		event.mouse.y /= _videoMode.scaleFactor;
-		if (_videoMode.aspectRatioCorrection)
-			event.mouse.y = aspect2Real(event.mouse.y);
-	}
-}
-
-bool OSystem_LINUXMOTO::remapKey(SDL_Event &ev, Common::Event &event) {
-	//  Motorol A1200/E6/A1600 remapkey by Lubomyr
-#ifdef MOTOEZX
-	// Quit on MOD+Camera Key on A1200
-	if (ev.key.keysym.sym == SDLK_e) {
-		event.type = Common::EVENT_QUIT;
-		return true;
-	}
-	// '1' Bypass security protection - MOD+Call key
-	if (ev.key.keysym.sym == SDLK_f) {
-		ev.key.keysym.sym = SDLK_1;
-	}
-	// F5 Game Menu - Call key
-	else if (ev.key.keysym.sym == SDLK_SPACE) {
-		ev.key.keysym.sym = SDLK_F5;
-	}
-	// VirtualKeyboard - Camera key
-	else if (ev.key.keysym.sym == SDLK_PAUSE) {
-		ev.key.keysym.sym = SDLK_F7;
-	}
-	// Enter - mod+fire key
-	else if (ev.key.keysym.sym == SDLK_b) {
-		ev.key.keysym.sym = SDLK_RETURN;
-	}
-	// '3' - mod+up key
-	else if (ev.key.keysym.sym == SDLK_j) {
-		ev.key.keysym.sym = SDLK_3;
-	}
-	// '6' - mod+up key
-	else if (ev.key.keysym.sym == SDLK_i) {
-		ev.key.keysym.sym = SDLK_6;
-	}
-	// 'y' - mod+right key
-	else if (ev.key.keysym.sym == SDLK_g) {
-		ev.key.keysym.sym = SDLK_y;
-	}
-	// 'n' - mod+right key
-	else if (ev.key.keysym.sym == SDLK_h) {
-		ev.key.keysym.sym = SDLK_n;
-	}
-	//  mod+vol'+' -> volume'+'
-	else if (ev.key.keysym.sym == SDLK_c) {
-		ev.key.keysym.sym = SDLK_RIGHTBRACKET;
-	}
-	//  mod+vol'-' -> volume'-'
-	else if (ev.key.keysym.sym == SDLK_d) {
-		ev.key.keysym.sym = SDLK_LEFTBRACKET;
-	}
-#endif
-
-#ifdef MOTOMAGX
-	// Quit on Clr
-	if (ev.key.keysym.sym == SDLK_BACKSPACE) {
-		event.type = Common::EVENT_QUIT;
-		return true;
-	}
-	// Game Menu - Left Soft key
-	else if (ev.key.keysym.sym == SDLK_F9) {
-		ev.key.keysym.sym = SDLK_F5;
-	}
-	// VirtualKeyboard - Right Soft key
-	else if (ev.key.keysym.sym == SDLK_F11) {
-		ev.key.keysym.sym = SDLK_F7;
-	}      
-#endif
-
-// Joystick to Mouse
-	else if (ev.key.keysym.sym == SDLK_LEFT) {
-		if (ev.type == SDL_KEYDOWN) {
-			_km.x_vel = -1;
-			_km.x_down_count = 1;
-		} else {
-			_km.x_vel = 0;
-			_km.x_down_count = 0;
-		}
-
-		event.type = Common::EVENT_MOUSEMOVE;
-		fillMouseEvent(event, _km.x, _km.y);
-		return true;
-	} else if (ev.key.keysym.sym == SDLK_RIGHT) {
-		if (ev.type == SDL_KEYDOWN) {
-			_km.x_vel = 1;
-			_km.x_down_count = 1;
-		} else {
-			_km.x_vel = 0;
-			_km.x_down_count = 0;
-		}
-
-		event.type = Common::EVENT_MOUSEMOVE;
-		fillMouseEvent(event, _km.x, _km.y);
-
-		return true;
-	} else if (ev.key.keysym.sym == SDLK_DOWN) {
-		if (ev.type == SDL_KEYDOWN) {
-			_km.y_vel = 1;
-			_km.y_down_count = 1;
-		} else {
-			_km.y_vel = 0;
-			_km.y_down_count = 0;
-		}
-
-		event.type = Common::EVENT_MOUSEMOVE;
-		fillMouseEvent(event, _km.x, _km.y);
-
-		return true;
-	} else if (ev.key.keysym.sym == SDLK_UP) {
-		if (ev.type == SDL_KEYDOWN) {
-			_km.y_vel = -1;
-			_km.y_down_count = 1;
-		} else {
-			_km.y_vel = 0;
-			_km.y_down_count = 0;
-		}
-
-		event.type = Common::EVENT_MOUSEMOVE;
-		fillMouseEvent(event, _km.x, _km.y);
-
-		return true;
-	} else if (ev.key.keysym.sym == SDLK_RETURN) {
-		// Joystick center to pressing Left Mouse
-		if (ev.key.type == SDL_KEYDOWN) {
-			event.type = Common::EVENT_LBUTTONDOWN;
-		} else {
-			event.type = Common::EVENT_LBUTTONUP;
-		}
-
-		fillMouseEvent(event, _km.x, _km.y);
-
-		return true;
-	} else if (ev.key.keysym.sym == SDLK_PLUS) {
-		// Volume Up to pressing Right Mouse
-		if (ev.key.type == SDL_KEYDOWN ) {
-			event.type = Common::EVENT_RBUTTONDOWN;
-		} else {
-			event.type = Common::EVENT_RBUTTONUP;
-		}
-		fillMouseEvent(event, _km.x, _km.y);
-
-		return true;
-	} else if (ev.key.keysym.sym == SDLK_MINUS) {
-		// Volume Down to pressing Left Mouse
-		if (ev.key.type == SDL_KEYDOWN) {
-			event.type = Common::EVENT_LBUTTONDOWN;
-		} else {
-			event.type = Common::EVENT_LBUTTONUP;
-		}
-
-		fillMouseEvent(event, _km.x, _km.y);
-
-		return true;
-	} else {
-		// Let the events fall through if we didn't change them, this may not be the best way to
-		// set it up, but i'm not sure how sdl would like it if we let if fall through then redid it though.
-		// and yes i have an huge terminal size so i dont wrap soon enough.
-		event.type = Common::EVENT_KEYDOWN;
-		event.kbd.keycode = (Common::KeyCode)ev.key.keysym.sym;
-		event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode);
-	}
-
-	return false;
-}

Deleted: scummvm/branches/gsoc2010-opengl/backends/platform/linuxmoto/linuxmoto-graphics.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/platform/linuxmoto/linuxmoto-graphics.cpp	2010-06-29 00:38:06 UTC (rev 50473)
+++ scummvm/branches/gsoc2010-opengl/backends/platform/linuxmoto/linuxmoto-graphics.cpp	2010-06-29 01:08:36 UTC (rev 50474)
@@ -1,470 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#include "backends/platform/linuxmoto/linuxmoto-sdl.h"
-
-#include "common/mutex.h"
-#include "graphics/font.h"
-#include "graphics/fontman.h"
-#include "graphics/scaler.h"
-#include "graphics/scaler/aspect.h"
-#include "graphics/scaler/downscaler.h"
-#include "graphics/surface.h"
-
-static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
-	{"1x", "Fullscreen", GFX_NORMAL},
-	{"\xBDx", "Downscale", GFX_HALF},
-	{0, 0, 0}
-};
-
-
-const OSystem::GraphicsMode *OSystem_LINUXMOTO::getSupportedGraphicsModes() const {
-	return s_supportedGraphicsModes;
-}
-
-int OSystem_LINUXMOTO::getDefaultGraphicsMode() const {
-	return GFX_NORMAL;
-}
-
-bool OSystem_LINUXMOTO::setGraphicsMode(int mode) {
-	Common::StackLock lock(_graphicsMutex);
-
-	assert(_transactionMode == kTransactionActive);
-
-	if (_oldVideoMode.setup && _oldVideoMode.mode == mode)
-		return true;
-
-	int newScaleFactor = 1;
-
-	switch (mode) {
-	case GFX_NORMAL:
-		newScaleFactor = 1;
-		break;
-	case GFX_HALF:
-		newScaleFactor = 1;
-		break;
-	default:
-		warning("unknown gfx mode %d", mode);
-		return false;
-	}
-
-	_transactionDetails.normal1xScaler = (mode == GFX_NORMAL);
-	if (_oldVideoMode.setup && _oldVideoMode.scaleFactor != newScaleFactor)
-		_transactionDetails.needHotswap = true;
-
-	_transactionDetails.needUpdatescreen = true;
-
-	_videoMode.mode = mode;
-	_videoMode.scaleFactor = newScaleFactor;
-
-	return true;
-}
-
-void OSystem_LINUXMOTO::setGraphicsModeIntern() {
-	Common::StackLock lock(_graphicsMutex);
-	ScalerProc *newScalerProc = 0;
-
-	switch (_videoMode.mode) {
-	case GFX_NORMAL:
-		newScalerProc = Normal1x;
-		break;
-	case GFX_HALF:
-		newScalerProc = DownscaleAllByHalf;
-		break;
-
-	default:
-		error("Unknown gfx mode %d", _videoMode.mode);
-	}
-
-	_scalerProc = newScalerProc;
-
-	if (!_screen || !_hwscreen)
-		return;
-
-	// Blit everything to the screen
-	_forceFull = true;
-
-	// Even if the old and new scale factors are the same, we may have a
-	// different scaler for the cursor now.
-	blitCursor();
-}
-
-
-void OSystem_LINUXMOTO::initSize(uint w, uint h) {
-	assert(_transactionMode == kTransactionActive);
-
-	// Avoid redundant res changes
-	if ((int)w == _videoMode.screenWidth && (int)h == _videoMode.screenHeight)
-		return;
-
-	_videoMode.screenWidth = w;
-	_videoMode.screenHeight = h;
-
-	if	(w > 320 || h > 240) {
-		setGraphicsMode(GFX_HALF);
-		setGraphicsModeIntern();
-		toggleMouseGrab();
-	}
-
-	_transactionDetails.sizeChanged = true;
-}
-
-bool OSystem_LINUXMOTO::loadGFXMode() {
-	printf("Game ScreenMode = %d*%d\n",_videoMode.screenWidth, _videoMode.screenHeight);
-	if (_videoMode.screenWidth > 320 || _videoMode.screenHeight > 240) {
-		_videoMode.aspectRatioCorrection = false;
-		setGraphicsMode(GFX_HALF);
-		printf("GraphicsMode set to HALF\n");
-	} else {
-		setGraphicsMode(GFX_NORMAL);
-		printf("GraphicsMode set to NORMAL\n");
-	}
-	if (_videoMode.mode == GFX_HALF && !_overlayVisible) {
-		_videoMode.overlayWidth = 320;
-		_videoMode.overlayHeight = 240;
-		_videoMode.fullscreen = true;
-	} else {
-
-		_videoMode.overlayWidth = _videoMode.screenWidth * _videoMode.scaleFactor;
-		_videoMode.overlayHeight = _videoMode.screenHeight * _videoMode.scaleFactor;
-
-		if (_videoMode.aspectRatioCorrection)
-			_videoMode.overlayHeight = real2Aspect(_videoMode.overlayHeight);
-
-		_videoMode.hardwareWidth = _videoMode.screenWidth * _videoMode.scaleFactor;
-		_videoMode.hardwareHeight = effectiveScreenHeight();
-	}
-
-	return OSystem_SDL::loadGFXMode();
-}
-
-void OSystem_LINUXMOTO::drawMouse() {
-	if (!_mouseVisible || !_mouseSurface) {
-		_mouseBackup.x = _mouseBackup.y = _mouseBackup.w = _mouseBackup.h = 0;
-		return;
-	}
-
-	SDL_Rect dst;
-	int scale;
-	int hotX, hotY;
-
-	if (_videoMode.mode == GFX_HALF && !_overlayVisible) {
-		dst.x = _mouseCurState.x/2;
-		dst.y = _mouseCurState.y/2;
-	} else {
-		dst.x = _mouseCurState.x;
-		dst.y = _mouseCurState.y;
-	}
-
-	if (!_overlayVisible) {
-		scale = _videoMode.scaleFactor;
-		dst.w = _mouseCurState.vW;
-		dst.h = _mouseCurState.vH;
-		hotX = _mouseCurState.vHotX;
-		hotY = _mouseCurState.vHotY;
-	} else {
-		scale = 1;
-		dst.w = _mouseCurState.rW;
-		dst.h = _mouseCurState.rH;
-		hotX = _mouseCurState.rHotX;
-		hotY = _mouseCurState.rHotY;
-	}
-
-	// The mouse is undrawn using virtual coordinates, i.e. they may be
-	// scaled and aspect-ratio corrected.
-
-	_mouseBackup.x = dst.x - hotX;
-	_mouseBackup.y = dst.y - hotY;
-	_mouseBackup.w = dst.w;
-	_mouseBackup.h = dst.h;
-
-	// We draw the pre-scaled cursor image, so now we need to adjust for
-	// scaling, shake position and aspect ratio correction manually.
-
-	if (!_overlayVisible) {
-		dst.y += _currentShakePos;
-	}
-
-	if (_videoMode.aspectRatioCorrection && !_overlayVisible)
-		dst.y = real2Aspect(dst.y);
-
-	dst.x = scale * dst.x - _mouseCurState.rHotX;
-	dst.y = scale * dst.y - _mouseCurState.rHotY;
-	dst.w = _mouseCurState.rW;
-	dst.h = _mouseCurState.rH;
-
-	// Note that SDL_BlitSurface() and addDirtyRect() will both perform any
-	// clipping necessary
-
-	if (SDL_BlitSurface(_mouseSurface, NULL, _hwscreen, &dst) != 0)
-		error("SDL_BlitSurface failed: %s", SDL_GetError());
-
-	// The screen will be updated using real surface coordinates, i.e.
-	// they will not be scaled or aspect-ratio corrected.
-	addDirtyRect(dst.x, dst.y, dst.w, dst.h, true);
-}
-
-void OSystem_LINUXMOTO::undrawMouse() {
-	const int x = _mouseBackup.x;
-	const int y = _mouseBackup.y;
-
-	// When we switch bigger overlay off mouse jumps. Argh!
-	// This is intended to prevent undrawing offscreen mouse
-	if (!_overlayVisible && (x >= _videoMode.screenWidth || y >= _videoMode.screenHeight))
-		return;
-
-	if (_mouseBackup.w != 0 && _mouseBackup.h != 0) {
-		if (_videoMode.mode == GFX_HALF && !_overlayVisible) {
-			addDirtyRect(x*2, y*2, _mouseBackup.w*2, _mouseBackup.h*2);
-		} else {
-			addDirtyRect(x, y, _mouseBackup.w, _mouseBackup.h);
-		}
-	}
-}
-
-void OSystem_LINUXMOTO::internUpdateScreen() {
-	SDL_Surface *srcSurf, *origSurf;
-	int height, width;
-	ScalerProc *scalerProc;
-	int scale1;
-
-#if defined (DEBUG) && ! defined(_WIN32_WCE) // definitions not available for non-DEBUG here. (needed this to compile in SYMBIAN32 & linux?)
-	assert(_hwscreen != NULL);
-	assert(_hwscreen->map->sw_data != NULL);
-#endif
-
-	// If the shake position changed, fill the dirty area with blackness
-	if (_currentShakePos != _newShakePos) {
-		SDL_Rect blackrect = {0, 0, _videoMode.screenWidth * _videoMode.scaleFactor, _newShakePos * _videoMode.scaleFactor};
-
-		if (_videoMode.aspectRatioCorrection && !_overlayVisible)
-			blackrect.h = real2Aspect(blackrect.h - 1) + 1;
-
-		SDL_FillRect(_hwscreen, &blackrect, 0);
-
-		_currentShakePos = _newShakePos;
-
-		_forceFull = true;
-	}
-
-	// Check whether the palette was changed in the meantime and update the
-	// screen surface accordingly.
-	if (_screen && _paletteDirtyEnd != 0) {
-		SDL_SetColors(_screen, _currentPalette + _paletteDirtyStart,
-			_paletteDirtyStart,
-			_paletteDirtyEnd - _paletteDirtyStart);
-
-		_paletteDirtyEnd = 0;
-
-		_forceFull = true;
-	}
-
-#ifdef USE_OSD
-	// OSD visible (i.e. non-transparent)?
-	if (_osdAlpha != SDL_ALPHA_TRANSPARENT) {
-		// Updated alpha value
-		const int diff = SDL_GetTicks() - _osdFadeStartTime;
-		if (diff > 0) {
-			if (diff >= kOSDFadeOutDuration) {
-				// Back to full transparency
-				_osdAlpha = SDL_ALPHA_TRANSPARENT;
-			} else {
-				// Do a linear fade out...
-				const int startAlpha = SDL_ALPHA_TRANSPARENT + kOSDInitialAlpha * (SDL_ALPHA_OPAQUE - SDL_ALPHA_TRANSPARENT) / 100;
-				_osdAlpha = startAlpha + diff * (SDL_ALPHA_TRANSPARENT - startAlpha) / kOSDFadeOutDuration;
-			}
-			SDL_SetAlpha(_osdSurface, SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA, _osdAlpha);
-			_forceFull = true;
-		}
-	}
-#endif
-
-	if (!_overlayVisible) {
-		origSurf = _screen;
-		srcSurf = _tmpscreen;
-		width = _videoMode.screenWidth;
-		height = _videoMode.screenHeight;
-		scalerProc = _scalerProc;
-		scale1 = _videoMode.scaleFactor;
-	} else {
-		origSurf = _overlayscreen;
-		srcSurf = _tmpscreen2;
-		width = _videoMode.overlayWidth;
-		height = _videoMode.overlayHeight;
-		scalerProc = Normal1x;
-		scale1 = 1;
-	}
-
-	// Add the area covered by the mouse cursor to the list of dirty rects if
-	// we have to redraw the mouse.
-	if (_mouseNeedsRedraw)
-		undrawMouse();
-
-	// Force a full redraw if requested
-	if (_forceFull) {
-		_numDirtyRects = 1;
-		_dirtyRectList[0].x = 0;
-		_dirtyRectList[0].y = 0;
-		_dirtyRectList[0].w = width;
-		_dirtyRectList[0].h = height;
-	}
-
-	// Only draw anything if necessary
-	if (_numDirtyRects > 0 || _mouseNeedsRedraw) {
-		SDL_Rect *r;
-		SDL_Rect dst;
-		uint32 srcPitch, dstPitch;
-		SDL_Rect *lastRect = _dirtyRectList + _numDirtyRects;
-
-		for (r = _dirtyRectList; r != lastRect; ++r) {
-			dst = *r;
-			dst.x++;	// Shift rect by one since 2xSai needs to access the data around
-			dst.y++;	// any pixel to scale it, and we want to avoid mem access crashes.
-
-			if (SDL_BlitSurface(origSurf, r, srcSurf, &dst) != 0)
-				error("SDL_BlitSurface failed: %s", SDL_GetError());
-		}
-
-		SDL_LockSurface(srcSurf);
-		SDL_LockSurface(_hwscreen);
-
-		srcPitch = srcSurf->pitch;
-		dstPitch = _hwscreen->pitch;
-
-		for (r = _dirtyRectList; r != lastRect; ++r) {
-			register int dst_y = r->y + _currentShakePos;
-			register int dst_h = 0;
-			register int dst_w = r->w;
-			register int orig_dst_y = 0;
-			register int dst_x = r->x;
-			register int src_y;
-			register int src_x;
-
-			if (dst_y < height) {
-				dst_h = r->h;
-				if (dst_h > height - dst_y)
-					dst_h = height - dst_y;
-
-				orig_dst_y = dst_y;
-				src_x = dst_x;
-				src_y = dst_y;
-
-				if (_videoMode.aspectRatioCorrection && !_overlayVisible)
-					dst_y = real2Aspect(dst_y);
-
-				assert(scalerProc != NULL);
-
-				if (_videoMode.mode == GFX_HALF && scalerProc == DownscaleAllByHalf) {
-
-					if (dst_x%2==1) {
-						dst_x--;
-						dst_w++;
-					}
-					if (dst_y%2==1) {
-						dst_y--;
-						dst_h++;
-					}
-
-					if (dst_w&1)
-						dst_w++;
-					if (dst_h&1)
-						dst_h++;
-
-					src_x = dst_x;
-					src_y = dst_y;
-					dst_x = dst_x / 2;
-					dst_y = dst_y / 2;
-				}
-				scalerProc((byte *)srcSurf->pixels + (src_x * 2 + 2) + (src_y + 1) * srcPitch, srcPitch,
-						   (byte *)_hwscreen->pixels + dst_x * 2 + dst_y * dstPitch, dstPitch, dst_w, dst_h);
-			}
-
-			if (_videoMode.mode == GFX_HALF && scalerProc == DownscaleAllByHalf) {
-				r->w = r->w / 2;
-				r->h = dst_h / 2;
-			} else {
-				r->w = r->w;
-				r->h = dst_h;
-			}
-
-			r->x = dst_x;
-			r->y = dst_y;
-
-#ifdef USE_SCALERS
-			if (_videoMode.aspectRatioCorrection && orig_dst_y < height && !_overlayVisible)
-				r->h = stretch200To240((uint8 *) _hwscreen->pixels, dstPitch, r->w, r->h, r->x, r->y, orig_dst_y * scale1);
-#endif
-		}
-		SDL_UnlockSurface(srcSurf);
-		SDL_UnlockSurface(_hwscreen);
-
-		// Readjust the dirty rect list in case we are doing a full update.
-		// This is necessary if shaking is active.
-		if (_forceFull) {
-			_dirtyRectList[0].y = 0;
-			_dirtyRectList[0].h = (_videoMode.mode == GFX_HALF) ? effectiveScreenHeight()/2 : effectiveScreenHeight();
-		}
-
-		drawMouse();
-
-#ifdef USE_OSD
-		if (_osdAlpha != SDL_ALPHA_TRANSPARENT) {
-			SDL_BlitSurface(_osdSurface, 0, _hwscreen, 0);
-		}
-#endif
-		// Finally, blit all our changes to the screen
-		SDL_UpdateRects(_hwscreen, _numDirtyRects, _dirtyRectList);
-	}
-
-	_numDirtyRects = 0;
-	_forceFull = false;
-	_mouseNeedsRedraw = false;
-}
-
-void OSystem_LINUXMOTO::showOverlay() {
-	if (_videoMode.mode == GFX_HALF) {
-		_mouseCurState.x = _mouseCurState.x / 2;
-		_mouseCurState.y = _mouseCurState.y / 2;
-	}
-	OSystem_SDL::showOverlay();
-}
-
-void OSystem_LINUXMOTO::hideOverlay() {
-	if (_videoMode.mode == GFX_HALF) {
-		_mouseCurState.x = _mouseCurState.x * 2;
-		_mouseCurState.y = _mouseCurState.y * 2;
-	}
-	OSystem_SDL::hideOverlay();
-}
-
-void OSystem_LINUXMOTO::warpMouse(int x, int y) {
-	if (_mouseCurState.x != x || _mouseCurState.y != y) {
-		if (_videoMode.mode == GFX_HALF && !_overlayVisible) {
-			x = x / 2;
-			y = y / 2;
-		}
-	}
-	OSystem_SDL::warpMouse(x, y);
-}

Modified: scummvm/branches/gsoc2010-opengl/backends/platform/linuxmoto/linuxmoto-main.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/platform/linuxmoto/linuxmoto-main.cpp	2010-06-29 00:38:06 UTC (rev 50473)
+++ scummvm/branches/gsoc2010-opengl/backends/platform/linuxmoto/linuxmoto-main.cpp	2010-06-29 01:08:36 UTC (rev 50474)
@@ -26,19 +26,20 @@
 #include "common/scummsys.h"
 #include "common/system.h"
 
-#include <SDL/SDL.h>
-#include <SDL/SDL_syswm.h>
-
 #include "backends/platform/linuxmoto/linuxmoto-sdl.h"
 #include "base/main.h"
-#include "base/internal_version.h"
 
 int main(int argc, char *argv[]) {
+
+	// Create our OSystem instance
 	g_system = new OSystem_LINUXMOTO();
 	assert(g_system);
+
 	// Invoke the actual ScummVM main entry point:
 	int res = scummvm_main(argc, argv);
-	g_system->quit();	// TODO: Consider removing / replacing this!
 
+	// Free OSystem
+	delete (OSystem_LINUXMOTO *)g_system;
+
 	return res;
 }

Modified: scummvm/branches/gsoc2010-opengl/backends/platform/linuxmoto/linuxmoto-sdl.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/platform/linuxmoto/linuxmoto-sdl.cpp	2010-06-29 00:38:06 UTC (rev 50473)
+++ scummvm/branches/gsoc2010-opengl/backends/platform/linuxmoto/linuxmoto-sdl.cpp	2010-06-29 01:08:36 UTC (rev 50474)
@@ -25,44 +25,17 @@
 
 #include "backends/platform/linuxmoto/linuxmoto-sdl.h"
 
-void OSystem_LINUXMOTO::preprocessEvents(SDL_Event *event) {
-	if (event->type == SDL_ACTIVEEVENT) {
-		if (event->active.state == SDL_APPINPUTFOCUS && !event->active.gain) {
-			suspendAudio();
-			for (;;) {
-				if (!SDL_WaitEvent(event)) {
-					SDL_Delay(10);
-					continue;
-				}
-				if (event->type == SDL_QUIT)
-					return;
-				if (event->type != SDL_ACTIVEEVENT)
-					continue;
-				if (event->active.state == SDL_APPINPUTFOCUS && event->active.gain) {
-					resumeAudio();
-						return;
-				}
-			}
-		}
-	}
-}
+#include "backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h"
+#include "backends/events/linuxmotosdl/linuxmotosdl-events.h"
 
-void OSystem_LINUXMOTO::suspendAudio() {
-	SDL_CloseAudio();
-	_audioSuspended = true;
-}
+void OSystem_LINUXMOTO::initBackend() {
+	// Create the backend custom managers
+	if (_eventsManager == 0)
+		_eventsManager = new LinuxmotoSdlEventManager();
 
-int OSystem_LINUXMOTO::resumeAudio() {
-	if (!_audioSuspended)
-		return -2;
-	if (SDL_OpenAudio(&_obtainedRate, NULL) < 0){
-		return -1;
-	}
-	SDL_PauseAudio(0);
-	_audioSuspended = false;
-	return 0;
-}
+	if (_graphicsManager == 0)
+		_graphicsManager = new LinuxmotoSdlGraphicsManager();
 
-void OSystem_LINUXMOTO::setupMixer() {
-	OSystem_SDL::setupMixer();
+	// Call parent implementation of this method
+	OSystem_POSIX::initBackend();
 }

Modified: scummvm/branches/gsoc2010-opengl/backends/platform/linuxmoto/linuxmoto-sdl.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/platform/linuxmoto/linuxmoto-sdl.h	2010-06-29 00:38:06 UTC (rev 50473)
+++ scummvm/branches/gsoc2010-opengl/backends/platform/linuxmoto/linuxmoto-sdl.h	2010-06-29 01:08:36 UTC (rev 50474)
@@ -23,43 +23,17 @@
  *
  */
 
-#ifndef LINUXMOTO_SDL
-#define LINUXMOTO_SDL
+#ifndef PLATFORM_SDL_LINUXMOTO_H
+#define PLATFORM_SDL_LINUXMOTO_H
 
-#include "backends/platform/sdl/sdl.h"
+#include "backends/platform/sdl/posix/posix.h"
 
-// FIXME: For now keep hacks in this header to save polluting the SDL backend.
-enum {
-	GFX_HALF = 12
-};
-
-class OSystem_LINUXMOTO : public OSystem_SDL {
-private:
-	bool _audioSuspended;
+class OSystem_LINUXMOTO : public OSystem_POSIX {
 public:
-	/* Graphics */
-	void initSize(uint w, uint h);
-	void setGraphicsModeIntern();
-	bool setGraphicsMode(int mode);
-	void internUpdateScreen();
-	const OSystem::GraphicsMode *getSupportedGraphicsModes() const;
-	bool setGraphicsMode(const char *name);
-	int getDefaultGraphicsMode() const;
-	bool loadGFXMode();
-	void drawMouse();
-	void undrawMouse();
-	void showOverlay();
-	void hideOverlay();
+	virtual void initBackend();
 
-	/* Event Stuff */
-	virtual bool remapKey(SDL_Event &ev, Common::Event &event);
-	virtual void preprocessEvents(SDL_Event *event);
-	virtual void setupMixer();
+	// FIXME: This just calls parent methods, is it needed?
 	virtual Common::HardwareKeySet *getHardwareKeySet();
-	void fillMouseEvent(Common::Event&, int, int);
-	void suspendAudio();
-	int resumeAudio();
-	void warpMouse(int, int);
 };
 
 #endif

Modified: scummvm/branches/gsoc2010-opengl/backends/platform/linuxmoto/module.mk
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/platform/linuxmoto/module.mk	2010-06-29 00:38:06 UTC (rev 50473)
+++ scummvm/branches/gsoc2010-opengl/backends/platform/linuxmoto/module.mk	2010-06-29 01:08:36 UTC (rev 50474)
@@ -1,8 +1,6 @@
 MODULE := backends/platform/linuxmoto
 
 MODULE_OBJS := \
-	linuxmoto-events.o \
-	linuxmoto-graphics.o \
 	linuxmoto-main.o \
 	linuxmoto-sdl.o \
 	hardwarekeys.o

Modified: scummvm/branches/gsoc2010-opengl/backends/platform/sdl/sdl.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/platform/sdl/sdl.cpp	2010-06-29 00:38:06 UTC (rev 50473)
+++ scummvm/branches/gsoc2010-opengl/backends/platform/sdl/sdl.cpp	2010-06-29 01:08:36 UTC (rev 50474)
@@ -269,3 +269,8 @@
 	assert(_mixerManager);
 	return _mixerManager->getMixer();
 }
+
+SdlMixerManager *OSystem_SDL::getMixerManager() {
+	assert(_mixerManager);
+	return _mixerManager;
+}

Modified: scummvm/branches/gsoc2010-opengl/backends/platform/sdl/sdl.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/platform/sdl/sdl.h	2010-06-29 00:38:06 UTC (rev 50473)
+++ scummvm/branches/gsoc2010-opengl/backends/platform/sdl/sdl.h	2010-06-29 01:08:36 UTC (rev 50474)
@@ -71,6 +71,9 @@
 	// Get the Graphics Manager instance, used by other managers
 	virtual SdlGraphicsManager *getGraphicsManager();
 
+	// Get the Sdl Mixer Manager instance (not the Audio::Mixer)
+	virtual SdlMixerManager *getMixerManager();
+
 protected:
 	bool _inited;
 	bool _initedSDL;


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