[Scummvm-git-logs] scummvm master -> e515998da0e3d50535bd0a0d5cf5c0289cc1b651

digitall 547637+digitall at users.noreply.github.com
Sat Nov 23 16:40:59 UTC 2019


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
e515998da0 LINUXMOTO: Replace usage of old SurfaceSdlGraphicsManager APIs


Commit: e515998da0e3d50535bd0a0d5cf5c0289cc1b651
    https://github.com/scummvm/scummvm/commit/e515998da0e3d50535bd0a0d5cf5c0289cc1b651
Author: D G Turner (digitall at scummvm.org)
Date: 2019-11-23T16:37:51Z

Commit Message:
LINUXMOTO: Replace usage of old SurfaceSdlGraphicsManager APIs

Changed paths:
    backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp


diff --git a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp
index a087c95..c6ac3fa 100644
--- a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp
+++ b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp
@@ -155,7 +155,7 @@ bool LinuxmotoSdlGraphicsManager::loadGFXMode() {
 }
 
 void LinuxmotoSdlGraphicsManager::drawMouse() {
-	if (!_mouseVisible || !_mouseSurface) {
+	if (!_cursorVisible || !_mouseSurface) {
 		_mouseBackup.x = _mouseBackup.y = _mouseBackup.w = _mouseBackup.h = 0;
 		return;
 	}
@@ -165,11 +165,11 @@ void LinuxmotoSdlGraphicsManager::drawMouse() {
 	int hotX, hotY;
 
 	if (_videoMode.mode == GFX_HALF && !_overlayVisible) {
-		dst.x = _mouseCurState.x/2;
-		dst.y = _mouseCurState.y/2;
+		dst.x = _cursorX / 2;
+		dst.y = _cursorY / 2;
 	} else {
-		dst.x = _mouseCurState.x;
-		dst.y = _mouseCurState.y;
+		dst.x = _cursorX;
+		dst.y = _cursorY;
 	}
 
 	if (!_overlayVisible) {
@@ -212,7 +212,7 @@ void LinuxmotoSdlGraphicsManager::drawMouse() {
 	// Note that SDL_BlitSurface() and addDirtyRect() will both perform any
 	// clipping necessary
 
-	if (SDL_BlitSurface(_mouseSurface, NULL, _hwscreen, &dst) != 0)
+	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.
@@ -245,8 +245,8 @@ void LinuxmotoSdlGraphicsManager::internUpdateScreen() {
 	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);
+	assert(_hwScreen != NULL);
+	assert(_hwScreen->map->sw_data != NULL);
 #endif
 
 	// If the shake position changed, fill the dirty area with blackness
@@ -257,11 +257,11 @@ void LinuxmotoSdlGraphicsManager::internUpdateScreen() {
 		if (_videoMode.aspectRatioCorrection && !_overlayVisible)
 			blackrect.h = real2Aspect(blackrect.h - 1) + 1;
 
-		SDL_FillRect(_hwscreen, &blackrect, 0);
+		SDL_FillRect(_hwScreen, &blackrect, 0);
 
 		_currentShakeYOffset = _gameScreenShakeYOffset;
 
-		_forceFull = true;
+		_forceRedraw = true;
 	}
 
 	// Check whether the palette was changed in the meantime and update the
@@ -273,7 +273,7 @@ void LinuxmotoSdlGraphicsManager::internUpdateScreen() {
 
 		_paletteDirtyEnd = 0;
 
-		_forceFull = true;
+		_forceRedraw = true;
 	}
 
 	if (!_overlayVisible) {
@@ -302,7 +302,7 @@ void LinuxmotoSdlGraphicsManager::internUpdateScreen() {
 #endif
 
 	// Force a full redraw if requested
-	if (_forceFull) {
+	if (_forceRedraw) {
 		_numDirtyRects = 1;
 		_dirtyRectList[0].x = 0;
 		_dirtyRectList[0].y = 0;
@@ -327,10 +327,10 @@ void LinuxmotoSdlGraphicsManager::internUpdateScreen() {
 		}
 
 		SDL_LockSurface(srcSurf);
-		SDL_LockSurface(_hwscreen);
+		SDL_LockSurface(_hwScreen);
 
 		srcPitch = srcSurf->pitch;
-		dstPitch = _hwscreen->pitch;
+		dstPitch = _hwScreen->pitch;
 
 		for (r = _dirtyRectList; r != lastRect; ++r) {
 			int dst_y = r->y + _currentShakeYOffset;
@@ -377,7 +377,7 @@ void LinuxmotoSdlGraphicsManager::internUpdateScreen() {
 					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);
+						   (byte *)_hwScreen->pixels + dst_x * 2 + dst_y * dstPitch, dstPitch, dst_w, dst_h);
 			}
 
 			if (_videoMode.mode == GFX_HALF && scalerProc == DownscaleAllByHalf) {
@@ -393,15 +393,15 @@ void LinuxmotoSdlGraphicsManager::internUpdateScreen() {
 
 #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, _videoMode.filtering);
+				r->h = stretch200To240((uint8 *) _hwScreen->pixels, dstPitch, r->w, r->h, r->x, r->y, orig_dst_y * scale1, _videoMode.filtering);
 #endif
 		}
 		SDL_UnlockSurface(srcSurf);
-		SDL_UnlockSurface(_hwscreen);
+		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) {
+		if (_forceRedraw) {
 			_dirtyRectList[0].y = 0;
 			_dirtyRectList[0].h = (_videoMode.mode == GFX_HALF) ? effectiveScreenHeight()/2 : effectiveScreenHeight();
 		}
@@ -413,35 +413,35 @@ void LinuxmotoSdlGraphicsManager::internUpdateScreen() {
 #endif
 
 		// Finally, blit all our changes to the screen
-		SDL_UpdateRects(_hwscreen, _numDirtyRects, _dirtyRectList);
+		SDL_UpdateRects(_hwScreen, _numDirtyRects, _dirtyRectList);
 	}
 
 	_numDirtyRects = 0;
-	_forceFull = false;
+	_forceRedraw = false;
 	_mouseNeedsRedraw = false;
 }
 
 void LinuxmotoSdlGraphicsManager::showOverlay() {
 	if (_videoMode.mode == GFX_HALF) {
-		_mouseCurState.x = _mouseCurState.x / 2;
-		_mouseCurState.y = _mouseCurState.y / 2;
+		_cursorX /= 2;
+		_cursorY /= 2;
 	}
 	SurfaceSdlGraphicsManager::showOverlay();
 }
 
 void LinuxmotoSdlGraphicsManager::hideOverlay() {
 	if (_videoMode.mode == GFX_HALF) {
-		_mouseCurState.x = _mouseCurState.x * 2;
-		_mouseCurState.y = _mouseCurState.y * 2;
+		_cursorX *= 2;
+		_cursorY *= 2;
 	}
 	SurfaceSdlGraphicsManager::hideOverlay();
 }
 
 void LinuxmotoSdlGraphicsManager::warpMouse(int x, int y) {
-	if (_mouseCurState.x != x || _mouseCurState.y != y) {
+	if (_cursorX != x || _cursorY != y) {
 		if (_videoMode.mode == GFX_HALF && !_overlayVisible) {
-			x = x / 2;
-			y = y / 2;
+			x /= 2;
+			y /= 2;
 		}
 	}
 	SurfaceSdlGraphicsManager::warpMouse(x, y);




More information about the Scummvm-git-logs mailing list