[Scummvm-cvs-logs] SF.net SVN: scummvm: [23193] scummvm/branches/branch-0-9-0/backends/wince/wince-sdl.cpp

knakos at users.sourceforge.net knakos at users.sourceforge.net
Tue Jun 20 20:03:49 CEST 2006


Revision: 23193
Author:   knakos
Date:     2006-06-20 11:03:43 -0700 (Tue, 20 Jun 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=23193&view=rev

Log Message:
-----------
fix vga device overlays and invalid mouse cursor calls

Modified Paths:
--------------
    scummvm/branches/branch-0-9-0/backends/wince/wince-sdl.cpp
Modified: scummvm/branches/branch-0-9-0/backends/wince/wince-sdl.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/backends/wince/wince-sdl.cpp	2006-06-20 18:03:02 UTC (rev 23192)
+++ scummvm/branches/branch-0-9-0/backends/wince/wince-sdl.cpp	2006-06-20 18:03:43 UTC (rev 23193)
@@ -1185,15 +1185,22 @@
 
 
 	// Overlay
-	_overlayscreen = SDL_CreateRGBSurface(SDL_SWSURFACE, _overlayWidth, _overlayHeight, 16, 0, 0, 0, 0);
-	if (_overlayscreen == NULL)
-		error("_overlayscreen failed");
-	_tmpscreen2 = SDL_CreateRGBSurface(SDL_SWSURFACE, _overlayWidth + 3, _overlayHeight + 3, 16, 0, 0, 0, 0);
-	if (_tmpscreen2 == NULL)
-		error("_tmpscreen2 failed");
+	if (CEDevice::hasDesktopResolution()) {
+		_overlayscreen = SDL_CreateRGBSurface(SDL_SWSURFACE, _overlayWidth * _scaleFactorXm / _scaleFactorXd, _overlayHeight * _scaleFactorYm / _scaleFactorYd, 16, 0, 0, 0, 0);
+		if (_overlayscreen == NULL)
+			error("_overlayscreen failed");
+		_tmpscreen2 = SDL_CreateRGBSurface(SDL_SWSURFACE, _overlayWidth * _scaleFactorXm / _scaleFactorXd + 3, _overlayHeight * _scaleFactorYm / _scaleFactorYd + 3, 16, 0, 0, 0, 0);
+		if (_tmpscreen2 == NULL)
+			error("_tmpscreen2 failed");
+	} else {
+		_overlayscreen = SDL_CreateRGBSurface(SDL_SWSURFACE, _overlayWidth, _overlayHeight, 16, 0, 0, 0, 0);
+		if (_overlayscreen == NULL)
+			error("_overlayscreen failed");
+		_tmpscreen2 = SDL_CreateRGBSurface(SDL_SWSURFACE, _overlayWidth + 3, _overlayHeight + 3, 16, 0, 0, 0, 0);
+		if (_tmpscreen2 == NULL)
+			error("_tmpscreen2 failed");
+	}
 
-
-
 	// Toolbar
 	uint16 *toolbar_screen = (uint16 *)calloc(320 * 40, sizeof(uint16));
 	_toolbarLow = SDL_CreateRGBSurfaceFrom(toolbar_screen,
@@ -1445,8 +1452,8 @@
 					}
 
 					// clip inside platform screen (landscape,bottom only)
-					if (_orientationLandscape && !_zoomDown && dst_y+dst_h > _platformScreenWidth)
-						dst_h = _platformScreenWidth - dst_y;
+					if (_orientationLandscape && !_zoomDown && dst_y+dst_h > _screenHeight)
+						dst_h = _screenHeight - dst_y;
 
 					if (!_zoomDown)
 						_scalerProc((byte *)srcSurf->pixels + (r->x * 2 + 2) + (r->y + 1) * srcPitch, srcPitch,
@@ -1698,6 +1705,8 @@
 void OSystem_WINCE3::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale) {
 
 	undrawMouse();
+	if (w == 0 || h == 0)
+		return;
 
 	assert(w <= MAX_MOUSE_W);
 	assert(h <= MAX_MOUSE_H);


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