diff options
Diffstat (limited to 'backends/platform')
23 files changed, 104 insertions, 281 deletions
| diff --git a/backends/platform/android/texture.cpp b/backends/platform/android/texture.cpp index 95c96e0d25..b174e93191 100644 --- a/backends/platform/android/texture.cpp +++ b/backends/platform/android/texture.cpp @@ -52,9 +52,6 @@  // Supported GL extensions  static bool npot_supported = false; -#ifdef GL_OES_draw_texture -static bool draw_tex_supported = false; -#endif  static inline GLfixed xdiv(int numerator, int denominator) {  	assert(numerator < (1 << 16)); @@ -85,11 +82,6 @@ void GLESBaseTexture::initGLExtensions() {  		if (token == "GL_ARB_texture_non_power_of_two")  			npot_supported = true; - -#ifdef GL_OES_draw_texture -		if (token == "GL_OES_draw_texture") -			draw_tex_supported = true; -#endif  	}  } @@ -180,45 +172,28 @@ void GLESBaseTexture::allocBuffer(GLuint w, GLuint h) {  void GLESBaseTexture::drawTexture(GLshort x, GLshort y, GLshort w, GLshort h) {  	GLCALL(glBindTexture(GL_TEXTURE_2D, _texture_name)); -#ifdef GL_OES_draw_texture -	// Great extension, but only works under specific conditions. -	// Still a work-in-progress - disabled for now. -	if (false && draw_tex_supported && !hasPalette()) { -		//GLCALL(glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE)); -		const GLint crop[4] = { 0, _surface.h, _surface.w, -_surface.h }; +	const GLfixed tex_width = xdiv(_surface.w, _texture_width); +	const GLfixed tex_height = xdiv(_surface.h, _texture_height); +	const GLfixed texcoords[] = { +		0, 0, +		tex_width, 0, +		0, tex_height, +		tex_width, tex_height, +	}; -		GLCALL(glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop)); +	GLCALL(glTexCoordPointer(2, GL_FIXED, 0, texcoords)); -		// Android GLES bug? -		GLCALL(glColor4ub(0xff, 0xff, 0xff, 0xff)); +	const GLshort vertices[] = { +		x, y, +		x + w, y, +		x, y + h, +		x + w, y + h, +	}; -		GLCALL(glDrawTexiOES(x, y, 0, w, h)); -	} else -#endif -	{ -		const GLfixed tex_width = xdiv(_surface.w, _texture_width); -		const GLfixed tex_height = xdiv(_surface.h, _texture_height); -		const GLfixed texcoords[] = { -			0, 0, -			tex_width, 0, -			0, tex_height, -			tex_width, tex_height, -		}; - -		GLCALL(glTexCoordPointer(2, GL_FIXED, 0, texcoords)); - -		const GLshort vertices[] = { -			x, y, -			x + w, y, -			x, y + h, -			x + w, y + h, -		}; - -		GLCALL(glVertexPointer(2, GL_SHORT, 0, vertices)); - -		assert(ARRAYSIZE(vertices) == ARRAYSIZE(texcoords)); -		GLCALL(glDrawArrays(GL_TRIANGLE_STRIP, 0, ARRAYSIZE(vertices) / 2)); -	} +	GLCALL(glVertexPointer(2, GL_SHORT, 0, vertices)); + +	assert(ARRAYSIZE(vertices) == ARRAYSIZE(texcoords)); +	GLCALL(glDrawArrays(GL_TRIANGLE_STRIP, 0, ARRAYSIZE(vertices) / 2));  	clearDirty();  } diff --git a/backends/platform/bada/application.cpp b/backends/platform/bada/application.cpp index ba8e544983..e761649245 100644 --- a/backends/platform/bada/application.cpp +++ b/backends/platform/bada/application.cpp @@ -103,7 +103,7 @@ void BadaScummVM::pauseGame(bool pause) {  		if (pause && g_engine && !g_engine->isPaused()) {  			_appForm->pushKey(Common::KEYCODE_SPACE);  		} -		 +  		if (g_system) {  			((BadaSystem *)g_system)->setMute(pause);  		} diff --git a/backends/platform/bada/sscanf.cpp b/backends/platform/bada/sscanf.cpp index b5e5b88cb5..aa846698f6 100644 --- a/backends/platform/bada/sscanf.cpp +++ b/backends/platform/bada/sscanf.cpp @@ -56,7 +56,7 @@ bool scanInt(const char **in, va_list *ap, int max) {  	bool err = false;  	if (end == *in || (max > 0 && (end - *in) > max)) { -		err = true;  +		err = true;  	} else {  		*arg = (int)n;  		*in = end; diff --git a/backends/platform/gph/gph-backend.cpp b/backends/platform/gph/gph-backend.cpp index 49a1edf411..485780b472 100644 --- a/backends/platform/gph/gph-backend.cpp +++ b/backends/platform/gph/gph-backend.cpp @@ -20,6 +20,8 @@   *   */ +#if defined(GPH_DEVICE) +  // Disable symbol overrides so that we can use system headers.  #define FORBIDDEN_SYMBOL_ALLOW_ALL @@ -32,8 +34,6 @@  #include "backends/saves/default/default-saves.h"  #include "backends/timer/default/default-timer.h" -#include "base/main.h" -  #include "common/archive.h"  #include "common/config-manager.h"  #include "common/debug.h" @@ -64,23 +64,6 @@ void OSystem_GPH::initBackend() {  	assert(!_inited); -	// Create the events manager -	if (_eventSource == 0) -		_eventSource = new GPHEventSource(); - -	// Create the graphics manager -	if (_graphicsManager == 0) { -		_graphicsManager = new GPHGraphicsManager(_eventSource); -	} - -	// Create the mixer manager -	if (_mixer == 0) { -		_mixerManager = new DoubleBufferSDLMixerManager(); - -		// Setup and start mixer -		_mixerManager->init(); -	} -  	/* Setup default save path to be workingdir/saves */  	char savePath[PATH_MAX+1]; @@ -165,16 +148,42 @@ void OSystem_GPH::initBackend() {  	/* Make sure that aspect ratio correction is enabled on the 1st run to stop  	   users asking me what the 'wasted space' at the bottom is ;-). */  	ConfMan.registerDefault("aspect_ratio", true); +	ConfMan.registerDefault("fullscreen", true);  	/* Make sure SDL knows that we have a joystick we want to use. */  	ConfMan.setInt("joystick_num", 0); +	// Create the events manager +	if (_eventSource == 0) +		_eventSource = new GPHEventSource(); + +	// Create the graphics manager +	if (_graphicsManager == 0) { +		_graphicsManager = new GPHGraphicsManager(_eventSource); +	} +  	/* Pass to POSIX method to do the heavy lifting */  	OSystem_POSIX::initBackend();  	_inited = true;  } +void OSystem_GPH::initSDL() { +	// Check if SDL has not been initialized +	if (!_initedSDL) { + +		uint32 sdlFlags = SDL_INIT_EVENTTHREAD; +		if (ConfMan.hasKey("disable_sdl_parachute")) +			sdlFlags |= SDL_INIT_NOPARACHUTE; + +		// Initialize SDL (SDL Subsystems are initiliazed in the corresponding sdl managers) +		if (SDL_Init(sdlFlags) == -1) +			error("Could not initialize SDL: %s", SDL_GetError()); + +		_initedSDL = true; +	} +} +  void OSystem_GPH::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) {  	/* Setup default extra data paths for engine data files and plugins */ @@ -222,3 +231,5 @@ void OSystem_GPH::quit() {  	OSystem_POSIX::quit();  } + +#endif diff --git a/backends/platform/gph/gph-main.cpp b/backends/platform/gph/gph-main.cpp index 2c43af151f..876de0f358 100644 --- a/backends/platform/gph/gph-main.cpp +++ b/backends/platform/gph/gph-main.cpp @@ -21,7 +21,7 @@   */  #include "backends/platform/gph/gph.h" -#include "backends/plugins/posix/posix-provider.h" +#include "backends/plugins/sdl/sdl-provider.h"  #include "base/main.h"  #if defined(GPH_DEVICE) @@ -36,7 +36,7 @@ int main(int argc, char *argv[]) {  	((OSystem_GPH *)g_system)->init();  #ifdef DYNAMIC_MODULES -	PluginManager::instance().addPluginProvider(new POSIXPluginProvider()); +	PluginManager::instance().addPluginProvider(new SDLPluginProvider());  #endif  	// Invoke the actual ScummVM main entry point: diff --git a/backends/platform/gph/gph.h b/backends/platform/gph/gph.h index 80f43f0bab..90a798154f 100644 --- a/backends/platform/gph/gph.h +++ b/backends/platform/gph/gph.h @@ -26,13 +26,11 @@  #if defined(GPH_DEVICE)  #include "backends/base-backend.h" -#include "backends/platform/sdl/sdl.h" +#include "backends/platform/sdl/sdl-sys.h"  #include "backends/platform/sdl/posix/posix.h"  #include "backends/events/gph/gph-events.h"  #include "backends/graphics/gph/gph-graphics.h" -#define __GP2XWIZ__ -  #ifndef PATH_MAX  #define PATH_MAX 255  #endif @@ -45,6 +43,11 @@ public:  	void addSysArchivesToSearchSet(Common::SearchSet &s, int priority);  	void initBackend();  	void quit(); + +protected: +	bool _inited; +	bool _initedSDL; +	virtual void initSDL();  };  #endif diff --git a/backends/platform/iphone/iphone_video.mm b/backends/platform/iphone/iphone_video.mm index 7877bc6430..0bfae30fc7 100644 --- a/backends/platform/iphone/iphone_video.mm +++ b/backends/platform/iphone/iphone_video.mm @@ -161,9 +161,9 @@ const char *iPhone_getDocumentsDir() {  - (id)initWithFrame:(struct CGRect)frame {  	self = [super initWithFrame: frame]; -	if ([[UIScreen mainScreen] respondsToSelector: NSSelectorFromString(@"scale")]) { -		if ([self respondsToSelector: NSSelectorFromString(@"contentScaleFactor")]) { -			//self.contentScaleFactor = [[UIScreen mainScreen] scale]; +	if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) { +		if ([self respondsToSelector:@selector(setContentScaleFactor:)]) { +			[self setContentScaleFactor:[[UIScreen mainScreen] scale]];  		}  	} @@ -268,6 +268,11 @@ const char *iPhone_getDocumentsDir() {  	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter); printOpenGLError();  	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter); printOpenGLError(); +	// We use GL_CLAMP_TO_EDGE here to avoid artifacts when linear filtering +	// is used. If we would not use this for example the cursor in Loom would +	// have a line/border artifact on the right side of the covered rect. +	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); printOpenGLError(); +	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); printOpenGLError();  }  - (void)setGraphicsMode { @@ -476,7 +481,7 @@ const char *iPhone_getDocumentsDir() {  		else if (_videoContext.screenWidth == 640 && _videoContext.screenHeight == 400)  			adjustedHeight = 480;  	} -	 +  	float overlayPortraitRatio;  	if (_orientation == UIDeviceOrientationLandscapeLeft || _orientation ==  UIDeviceOrientationLandscapeRight) { diff --git a/backends/platform/iphone/osys_video.mm b/backends/platform/iphone/osys_video.mm index aa1856490f..ebe435cb25 100644 --- a/backends/platform/iphone/osys_video.mm +++ b/backends/platform/iphone/osys_video.mm @@ -353,7 +353,7 @@ void OSystem_IPHONE::copyRectToOverlay(const void *buf, int pitch, int x, int y,  	}  	byte *dst = (byte *)_videoContext->overlayTexture.getBasePtr(x, y); -	do {  +	do {  		memcpy(dst, src, w * sizeof(uint16));  		src += pitch;  		dst += _videoContext->overlayTexture.pitch; @@ -435,7 +435,7 @@ void OSystem_IPHONE::setCursorPalette(const byte *colors, uint start, uint num)  	for (uint i = start; i < start + num; ++i, colors += 3)  		_mouseCursorPalette[i] = Graphics::RGBToColor<Graphics::ColorMasks<5551> >(colors[0], colors[1], colors[2]); -	 +  	// FIXME: This is just stupid, our client code seems to assume that this  	// automatically enables the cursor palette.  	_mouseCursorPaletteEnabled = true; diff --git a/backends/platform/maemo/debian/changelog b/backends/platform/maemo/debian/changelog index f3e4c4eadb..ea44574e96 100644 --- a/backends/platform/maemo/debian/changelog +++ b/backends/platform/maemo/debian/changelog @@ -8,7 +8,7 @@ scummvm (1.5.0) unstable; urgency=low    * 1.5.0 release - -- Tarek Soliman <tsoliman@scummvm.org>  Tue, 10 Jul 2012 22:57:32 -0500 + -- Tarek Soliman <tsoliman@scummvm.org>  Fri, 20 Jul 2012 14:48:44 -0500  scummvm (1.4.1) unstable; urgency=low diff --git a/backends/platform/maemo/debian/control b/backends/platform/maemo/debian/control index 6e1dfe2fd4..bdaccd2359 100644 --- a/backends/platform/maemo/debian/control +++ b/backends/platform/maemo/debian/control @@ -2,7 +2,7 @@ Source: scummvm  Section: user/games  Priority: optional  Maintainer: Tarek Soliman <tsoliman@scummvm.org> -Build-Depends: debhelper (>> 4.0.0), libsdl1.2-dev, libmad0-dev, libasound2-dev, libvorbisidec-dev, libmpeg2-4-dev, libflac-dev (>= 1.1.2), libz-dev, quilt +Build-Depends: debhelper (>> 4.0.0), libsdl1.2-dev, libmad0-dev, libasound2-dev, libvorbisidec-dev, libmpeg2-4-dev, libflac-dev (>= 1.1.2), libfreetype6-dev, libz-dev, quilt  Standards-Version: 3.6.1.1  Package: scummvm diff --git a/backends/platform/maemo/debian/rules b/backends/platform/maemo/debian/rules index 64add08de8..c713403876 100755 --- a/backends/platform/maemo/debian/rules +++ b/backends/platform/maemo/debian/rules @@ -47,10 +47,10 @@ install: build  	install -m0644 gui/themes/scummclassic.zip  gui/themes/scummmodern.zip debian/scummvm/opt/scummvm/share  	install -m0644 backends/vkeybd/packs/vkeybd_default.zip debian/scummvm/opt/scummvm/share  # for optified version we can also add engine datafiles -	install -m0644 dists/engine-data/drascula.dat dists/engine-data/hugo.dat dists/engine-data/kyra.dat dists/engine-data/lure.dat dists/engine-data/queen.tbl dists/engine-data/sky.cpt dists/engine-data/teenagent.dat dists/engine-data/toon.dat debian/scummvm/opt/scummvm/share +	install -m0644 dists/engine-data/drascula.dat dists/engine-data/hugo.dat dists/engine-data/kyra.dat dists/engine-data/lure.dat dists/engine-data/queen.tbl dists/engine-data/sky.cpt dists/engine-data/teenagent.dat dists/engine-data/tony.dat dists/engine-data/toon.dat debian/scummvm/opt/scummvm/share  	install -m0644 -d debian/scummvm/usr/share/doc/scummvm -	install -m0644 NEWS README COPYRIGHT debian/scummvm/usr/share/doc/scummvm +	install -m0644 AUTHORS COPYING COPYING.BSD COPYING.FREEFONT COPYING.LGPL COPYRIGHT NEWS README debian/scummvm/usr/share/doc/scummvm  binary: binary-arch  binary-arch: build install diff --git a/backends/platform/openpandora/op-backend.cpp b/backends/platform/openpandora/op-backend.cpp index dcec387f97..354aa24b24 100644 --- a/backends/platform/openpandora/op-backend.cpp +++ b/backends/platform/openpandora/op-backend.cpp @@ -54,53 +54,15 @@  /* Dump console info to files. */  #define DUMP_STDOUT -static SDL_Cursor *hiddenCursor; -  OSystem_OP::OSystem_OP()  	:  	OSystem_POSIX() {  } -//static Uint32 timer_handler(Uint32 interval, void *param) { -//	((DefaultTimerManager *)param)->handler(); -//	return interval; -//} -  void OSystem_OP::initBackend() {  	assert(!_inited); -	// Create the events manager -	if (_eventSource == 0) -		_eventSource = new OPEventSource(); - -	// Create the graphics manager -	if (_graphicsManager == 0) { -		_graphicsManager = new OPGraphicsManager(_eventSource); -	} - -//	int joystick_num = ConfMan.getInt("joystick_num"); -//	uint32 sdlFlags = SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER; -// -//	if (ConfMan.hasKey("disable_sdl_parachute")) -//		sdlFlags |= SDL_INIT_NOPARACHUTE; -// -//	if (joystick_num > -1) -//		sdlFlags |= SDL_INIT_JOYSTICK; -// -//	if (SDL_Init(sdlFlags) == -1) { -//		error("Could not initialize SDL: %s", SDL_GetError()); -//	} -// - -	// Create the mixer manager -//	if (_mixer == 0) { -//		_mixerManager = new DoubleBufferSDLMixerManager(); - -	// Setup and start mixer -//		_mixerManager->init(); -//	} -  	/* Setup default save path to be workingdir/saves */  	char savePath[PATH_MAX+1]; @@ -179,7 +141,14 @@ void OSystem_OP::initBackend() {  	/* Make sure SDL knows that we have a joystick we want to use. */  	ConfMan.setInt("joystick_num", 0); -//	_graphicsMutex = createMutex(); +	// Create the events manager +	if (_eventSource == 0) +		_eventSource = new OPEventSource(); + +	// Create the graphics manager +	if (_graphicsManager == 0) { +		_graphicsManager = new OPGraphicsManager(_eventSource); +	}  	/* Pass to POSIX method to do the heavy lifting */  	OSystem_POSIX::initBackend(); @@ -187,24 +156,6 @@ void OSystem_OP::initBackend() {  	_inited = true;  } -// enable joystick -//	if (joystick_num > -1 && SDL_NumJoysticks() > 0) { -//		printf("Using joystick: %s\n", SDL_JoystickName(0)); -//		_joystick = SDL_JoystickOpen(joystick_num); -//	} -// -//	setupMixer(); - -// Note: We could implement a custom SDLTimerManager by using -// SDL_AddTimer. That might yield better timer resolution, but it would -// also change the semantics of a timer: Right now, ScummVM timers -// *never* run in parallel, due to the way they are implemented. If we -// switched to SDL_AddTimer, each timer might run in a separate thread. -// However, not all our code is prepared for that, so we can't just -// switch. Still, it's a potential future change to keep in mind. -//	_timer = new DefaultTimerManager(); -//	_timerID = SDL_AddTimer(10, &timer_handler, _timer); -  void OSystem_OP::initSDL() {  	// Check if SDL has not been initialized  	if (!_initedSDL) { @@ -217,38 +168,7 @@ void OSystem_OP::initSDL() {  		if (SDL_Init(sdlFlags) == -1)  			error("Could not initialize SDL: %s", SDL_GetError()); -		uint8_t hiddenCursorData = 0; - -		hiddenCursor = SDL_CreateCursor(&hiddenCursorData, &hiddenCursorData, 8, 1, 0, 0); - -		/* On the OpenPandora we need to work around an SDL assumption that -		   returns relative mouse coordinates when you get to the screen -		   edges using the touchscreen. The workaround is to set a blank -		   SDL cursor and not disable it (Hackish I know). - -		   The root issues likes in the Windows Manager GRAB code in SDL. -		   That is why the issue is not seen on framebuffer devices like the -		   GP2X (there is no X window manager ;)). -		*/ -		SDL_ShowCursor(SDL_ENABLE); -		SDL_SetCursor(hiddenCursor); -		SDL_EnableUNICODE(1); - -//		memset(&_oldVideoMode, 0, sizeof(_oldVideoMode)); -//		memset(&_videoMode, 0, sizeof(_videoMode)); -//		memset(&_transactionDetails, 0, sizeof(_transactionDetails)); - -//		_videoMode.mode = GFX_DOUBLESIZE; -//		_videoMode.scaleFactor = 2; -//		_videoMode.aspectRatioCorrection = ConfMan.getBool("aspect_ratio"); -//		_scalerProc = Normal2x; -//		_scalerType = 0; - -//		_videoMode.fullscreen = true; -  		_initedSDL = true; - -//	OSystem_POSIX::initSDL();  	}  } @@ -275,8 +195,6 @@ void OSystem_OP::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) {  void OSystem_OP::quit() { -	SDL_FreeCursor(hiddenCursor); -  #ifdef DUMP_STDOUT  	printf("%s\n", "Debug: STDOUT and STDERR text files closed.");  	fclose(stdout); diff --git a/backends/platform/openpandora/op-options.cpp b/backends/platform/openpandora/op-options.cpp index 58f0fb7188..005a76b76c 100644 --- a/backends/platform/openpandora/op-options.cpp +++ b/backends/platform/openpandora/op-options.cpp @@ -33,7 +33,8 @@ enum {  	/* Touchscreen TapMode */  	TAPMODE_LEFT        = 0,  	TAPMODE_RIGHT       = 1, -	TAPMODE_HOVER       = 2 +	TAPMODE_HOVER       = 2, +	TAPMODE_HOVER_DPAD  = 3  };  int tapmodeLevel = TAPMODE_LEFT; @@ -44,6 +45,8 @@ void ToggleTapMode() {  	} else if (tapmodeLevel == TAPMODE_RIGHT) {  		tapmodeLevel = TAPMODE_HOVER;  	} else if (tapmodeLevel == TAPMODE_HOVER) { +		tapmodeLevel = TAPMODE_HOVER_DPAD; +	} else if (tapmodeLevel == TAPMODE_HOVER_DPAD) {  		tapmodeLevel = TAPMODE_LEFT;  	} else {  		tapmodeLevel = TAPMODE_LEFT; diff --git a/backends/platform/openpandora/op-sdl.h b/backends/platform/openpandora/op-sdl.h index 8cccbb5f86..1eddad5c4a 100644 --- a/backends/platform/openpandora/op-sdl.h +++ b/backends/platform/openpandora/op-sdl.h @@ -31,8 +31,6 @@  #include "backends/events/openpandora/op-events.h"  #include "backends/graphics/openpandora/op-graphics.h" -//#define MIXER_DOUBLE_BUFFERING 1 -  #ifndef PATH_MAX  #define PATH_MAX 255  #endif diff --git a/backends/platform/sdl/macosx/macosx.cpp b/backends/platform/sdl/macosx/macosx.cpp index 639bd980f6..fb76c111f2 100644 --- a/backends/platform/sdl/macosx/macosx.cpp +++ b/backends/platform/sdl/macosx/macosx.cpp @@ -156,7 +156,7 @@ Common::String OSystem_MacOSX::getSystemLanguage() const {  			}  			CFRelease(preferredLocalizations);  		} -		 +  	}  	// Falback to POSIX implementation  	return OSystem_POSIX::getSystemLanguage(); diff --git a/backends/platform/sdl/macosx/macosx.h b/backends/platform/sdl/macosx/macosx.h index 4837e643b3..d9cb28b973 100644 --- a/backends/platform/sdl/macosx/macosx.h +++ b/backends/platform/sdl/macosx/macosx.h @@ -32,7 +32,7 @@ public:  	virtual bool hasFeature(Feature f);  	virtual bool displayLogFile(); -	 +  	virtual Common::String getSystemLanguage() const;  	virtual void initBackend(); diff --git a/backends/platform/sdl/main.cpp b/backends/platform/sdl/main.cpp deleted file mode 100644 index 040028079d..0000000000 --- a/backends/platform/sdl/main.cpp +++ /dev/null @@ -1,66 +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. - * - */ - -#include "common/scummsys.h" - -// Several SDL based ports use a custom main, and hence do not want to compile -// of this file. The following "#if" ensures that. -#if !defined(POSIX) && \ -    !defined(WIN32) && \ -    !defined(MAEMO) && \ -    !defined(__SYMBIAN32__) && \ -    !defined(_WIN32_WCE) && \ -    !defined(__amigaos4__) && \ -    !defined(DINGUX) && \ -    !defined(CAANOO) && \ -    !defined(LINUXMOTO) && \ -    !defined(SAMSUNGTV) && \ -    !defined(PLAYSTATION3) && \ -    !defined(OPENPANDORA) - -#include "backends/platform/sdl/sdl.h" -#include "backends/plugins/sdl/sdl-provider.h" -#include "base/main.h" - -int main(int argc, char *argv[]) { - -	// Create our OSystem instance -	g_system = new OSystem_SDL(); -	assert(g_system); - -	// Pre initialize the backend -	((OSystem_SDL *)g_system)->init(); - -#ifdef DYNAMIC_MODULES -	PluginManager::instance().addPluginProvider(new SDLPluginProvider()); -#endif - -	// Invoke the actual ScummVM main entry point: -	int res = scummvm_main(argc, argv); - -	// Free OSystem -	delete (OSystem_SDL *)g_system; - -	return res; -} - -#endif diff --git a/backends/platform/sdl/module.mk b/backends/platform/sdl/module.mk index 98a8265301..a17a326889 100644 --- a/backends/platform/sdl/module.mk +++ b/backends/platform/sdl/module.mk @@ -1,7 +1,6 @@  MODULE := backends/platform/sdl  MODULE_OBJS := \ -	main.o \  	sdl.o  ifdef POSIX diff --git a/backends/platform/webos/webos.cpp b/backends/platform/webos/webos.cpp index 4ec153a7e9..fc18628235 100644 --- a/backends/platform/webos/webos.cpp +++ b/backends/platform/webos/webos.cpp @@ -45,24 +45,4 @@ void OSystem_SDL_WebOS::initBackend() {  	OSystem_SDL::initBackend();  } -/** - * Gets the original SDL hardware key set, adds WebOS specific keys and - * returns the new key set. - * - * @return The hardware key set with added webOS specific keys. - */ -#ifdef ENABLE_KEYMAPPER -HardwareInputSet *OSystem_SDL_WebOS::getHardwareInputSet() { -	// Get the original SDL hardware key set -	HardwareInputSet *inputSet = OSystem_SDL::getHardwareInputSet(); - -	// Add WebOS specific keys -	inputSet->addHardwareInput(new HardwareInput("FORWARD", -		KeyState((KeyCode) 229, 229, 0), "Forward")); - -	// Return the modified hardware key set -	return inputSet; -} -#endif -  #endif diff --git a/backends/platform/webos/webos.h b/backends/platform/webos/webos.h index 8dfa43239c..dda56a70da 100644 --- a/backends/platform/webos/webos.h +++ b/backends/platform/webos/webos.h @@ -31,9 +31,6 @@ public:  	OSystem_SDL_WebOS();  	virtual void initBackend(); -#ifdef ENABLE_KEYMAPPER -	virtual Common::HardwareInputSet *getHardwareInputSet(); -#endif  };  #endif diff --git a/backends/platform/wii/osystem.cpp b/backends/platform/wii/osystem.cpp index 681675529a..22a6495f8f 100644 --- a/backends/platform/wii/osystem.cpp +++ b/backends/platform/wii/osystem.cpp @@ -39,7 +39,7 @@  OSystem_Wii::OSystem_Wii() :  	_startup_time(0), -	_cursorScale(1), +	_cursorDontScale(true),  	_cursorPaletteDisabled(true),  	_cursorPalette(NULL),  	_cursorPaletteDirty(false), diff --git a/backends/platform/wii/osystem.h b/backends/platform/wii/osystem.h index abafa7f642..5d6998d0b6 100644 --- a/backends/platform/wii/osystem.h +++ b/backends/platform/wii/osystem.h @@ -56,7 +56,7 @@ class OSystem_Wii : public EventsBaseBackend, public PaletteManager {  private:  	s64 _startup_time; -	int _cursorScale; +	bool _cursorDontScale;  	bool _cursorPaletteDisabled;  	u16 *_cursorPalette;  	bool _cursorPaletteDirty; diff --git a/backends/platform/wii/osystem_gfx.cpp b/backends/platform/wii/osystem_gfx.cpp index 90e4d98c6b..fc0802dd4c 100644 --- a/backends/platform/wii/osystem_gfx.cpp +++ b/backends/platform/wii/osystem_gfx.cpp @@ -451,7 +451,7 @@ bool OSystem_Wii::needsScreenUpdate() {  void OSystem_Wii::updateScreen() {  	static f32 ar;  	static gfx_screen_coords_t cc; -	static int cs; +	static f32 csx, csy;  	u32 now = getMillis();  	if (now - _lastScreenUpdate < 1000 / MAX_FPS) @@ -466,7 +466,6 @@ void OSystem_Wii::updateScreen() {  	wii_memstats();  #endif -	cs = _cursorScale;  	_lastScreenUpdate = now;  	if (_overlayVisible || _consoleVisible) @@ -488,12 +487,6 @@ void OSystem_Wii::updateScreen() {  		if (_gameRunning)  			ar = gfx_set_ar(4.0 / 3.0); -		// ugly, but the modern theme sets a factor of 3, only god knows why -		if (cs > 2) -			cs = 1; -		else -			cs *= 2; -  		if (_overlayDirty) {  			gfx_tex_convert(&_texOverlay, _overlayPixels);  			_overlayDirty = false; @@ -503,10 +496,18 @@ void OSystem_Wii::updateScreen() {  	}  	if (_mouseVisible) { -		cc.x = f32(_mouseX - cs * _mouseHotspotX) * _currentXScale; -		cc.y = f32(_mouseY - cs * _mouseHotspotY) * _currentYScale; -		cc.w = f32(_texMouse.width) * _currentXScale * cs; -		cc.h = f32(_texMouse.height) * _currentYScale * cs; +		if (_cursorDontScale) { +			csx = 1.0f / _currentXScale; +			csy = 1.0f / _currentYScale; +		} else { +			csx = 1.0f; +			csy = 1.0f; +		} + +		cc.x = f32(_mouseX - csx * _mouseHotspotX) * _currentXScale; +		cc.y = f32(_mouseY - csy * _mouseHotspotY) * _currentYScale; +		cc.w = f32(_texMouse.width) * _currentXScale * csx; +		cc.h = f32(_texMouse.height) * _currentYScale * csy;  		if (_texMouse.palette && _cursorPaletteDirty) {  			_texMouse.palette[_mouseKeyColor] = 0; @@ -745,8 +746,7 @@ void OSystem_Wii::setMouseCursor(const void *buf, uint w, uint h, int hotspotX,  	_mouseHotspotX = hotspotX;  	_mouseHotspotY = hotspotY; -	// TODO: Adapt to new dontScale logic! -	_cursorScale = 1; +	_cursorDontScale = dontScale;  	if ((_texMouse.palette) && (oldKeycolor != _mouseKeyColor))  		_cursorPaletteDirty = true; | 
