[Scummvm-git-logs] scummvm master -> 8ae0be4ae3ca4093ac4140abcb16d5b03dd59810

ccawley2011 ccawley2011 at gmail.com
Sat Nov 23 18:42:42 UTC 2019


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

Summary:
a2110d36f9 BACKENDS: Unify formatting between the GPH, Dingux and LinuxMoto backends
8ae0be4ae3 GPH: Remove unused variable


Commit: a2110d36f91fcc9713fccd7a8ef95dc5ae5e907c
    https://github.com/scummvm/scummvm/commit/a2110d36f91fcc9713fccd7a8ef95dc5ae5e907c
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2019-11-23T18:40:43Z

Commit Message:
BACKENDS: Unify formatting between the GPH, Dingux and LinuxMoto backends

Changed paths:
    backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
    backends/graphics/gph/gph-graphics.cpp
    backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp
    backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h


diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
index 427053f..fc9ed4d 100644
--- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
+++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
@@ -39,8 +39,8 @@ static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
 #define DownscaleAllByHalf 0
 #endif
 
-DINGUXSdlGraphicsManager::DINGUXSdlGraphicsManager(SdlEventSource *boss, SdlWindow *window)
-	: SurfaceSdlGraphicsManager(boss, window) {
+DINGUXSdlGraphicsManager::DINGUXSdlGraphicsManager(SdlEventSource *sdlEventSource, SdlWindow *window)
+	: SurfaceSdlGraphicsManager(sdlEventSource, window) {
 }
 
 const OSystem::GraphicsMode *DINGUXSdlGraphicsManager::getSupportedGraphicsModes() const {
@@ -189,7 +189,6 @@ void DINGUXSdlGraphicsManager::drawMouse() {
 
 	// 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);
 }
 
@@ -204,7 +203,7 @@ void DINGUXSdlGraphicsManager::undrawMouse() {
 
 	if (_mouseBackup.w != 0 && _mouseBackup.h != 0) {
 		if (_videoMode.mode == GFX_HALF && !_overlayVisible) {
-			addDirtyRect(x*2, y*2, _mouseBackup.w*2, _mouseBackup.h*2);
+			addDirtyRect(x * 2, y * 2, _mouseBackup.w * 2, _mouseBackup.h * 2);
 		} else {
 			addDirtyRect(x, y, _mouseBackup.w, _mouseBackup.h);
 		}
@@ -305,8 +304,8 @@ void DINGUXSdlGraphicsManager::internUpdateScreen() {
 
 		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.
+			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());
@@ -345,7 +344,7 @@ void DINGUXSdlGraphicsManager::internUpdateScreen() {
 
 				assert(scalerProc != NULL);
 
-				if ((_videoMode.mode == GFX_HALF) && (scalerProc == DownscaleAllByHalf)) {
+				if (_videoMode.mode == GFX_HALF && scalerProc == DownscaleAllByHalf) {
 					if (dst_x % 2 == 1) {
 						dst_x--;
 						dst_w++;
@@ -361,7 +360,6 @@ void DINGUXSdlGraphicsManager::internUpdateScreen() {
 
 					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);
-
 				} else {
 					scalerProc((byte *)srcSurf->pixels + (r->x * 2 + 2) + (r->y + 1) * srcPitch, srcPitch,
 					           (byte *)_hwScreen->pixels + dst_x * 2 + dst_y * dstPitch, dstPitch, dst_w, dst_h);
@@ -379,7 +377,6 @@ void DINGUXSdlGraphicsManager::internUpdateScreen() {
 			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, _videoMode.filtering);
@@ -402,6 +399,7 @@ void DINGUXSdlGraphicsManager::internUpdateScreen() {
 #ifdef USE_OSD
 		drawOSD();
 #endif
+
 		// Finally, blit all our changes to the screen
 		SDL_UpdateRects(_hwScreen, _numDirtyRects, _dirtyRectList);
 	}
@@ -413,16 +411,16 @@ void DINGUXSdlGraphicsManager::internUpdateScreen() {
 
 void DINGUXSdlGraphicsManager::showOverlay() {
 	if (_videoMode.mode == GFX_HALF) {
-		_cursorX = _cursorX / 2;
-		_cursorY = _cursorY / 2;
+		_cursorX /= 2;
+		_cursorY /= 2;
 	}
 	SurfaceSdlGraphicsManager::showOverlay();
 }
 
 void DINGUXSdlGraphicsManager::hideOverlay() {
 	if (_videoMode.mode == GFX_HALF) {
-		_cursorX = _cursorX * 2;
-		_cursorY = _cursorY * 2;
+		_cursorX *= 2;
+		_cursorY *= 2;
 	}
 	SurfaceSdlGraphicsManager::hideOverlay();
 }
@@ -497,7 +495,7 @@ bool DINGUXSdlGraphicsManager::getFeatureState(OSystem::Feature f) const {
 
 	switch (f) {
 	case OSystem::kFeatureAspectRatioCorrection:
-			return _videoMode.aspectRatioCorrection;
+		return _videoMode.aspectRatioCorrection;
 	case OSystem::kFeatureCursorPalette:
 		return !_cursorPaletteDisabled;
 	default:
@@ -508,8 +506,8 @@ bool DINGUXSdlGraphicsManager::getFeatureState(OSystem::Feature f) const {
 void DINGUXSdlGraphicsManager::warpMouse(int x, int 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);
diff --git a/backends/graphics/gph/gph-graphics.cpp b/backends/graphics/gph/gph-graphics.cpp
index cc8ef38..c54c6f2 100644
--- a/backends/graphics/gph/gph-graphics.cpp
+++ b/backends/graphics/gph/gph-graphics.cpp
@@ -272,7 +272,6 @@ void GPHGraphicsManager::internUpdateScreen() {
 		width = _videoMode.overlayWidth;
 		height = _videoMode.overlayHeight;
 		scalerProc = Normal1x;
-
 		scale1 = 1;
 	}
 
@@ -346,7 +345,7 @@ void GPHGraphicsManager::internUpdateScreen() {
 
 				assert(scalerProc != NULL);
 
-				if ((_videoMode.mode == GFX_HALF) && (scalerProc == DownscaleAllByHalf)) {
+				if (_videoMode.mode == GFX_HALF && scalerProc == DownscaleAllByHalf) {
 					if (dst_x % 2 == 1) {
 						dst_x--;
 						dst_w++;
@@ -379,7 +378,6 @@ void GPHGraphicsManager::internUpdateScreen() {
 			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, _videoMode.filtering);
@@ -414,16 +412,16 @@ void GPHGraphicsManager::internUpdateScreen() {
 
 void GPHGraphicsManager::showOverlay() {
 	if (_videoMode.mode == GFX_HALF) {
-		_cursorX = _cursorX / 2;
-		_cursorY = _cursorY / 2;
+		_cursorX /= 2;
+		_cursorY /= 2;
 	}
 	SurfaceSdlGraphicsManager::showOverlay();
 }
 
 void GPHGraphicsManager::hideOverlay() {
 	if (_videoMode.mode == GFX_HALF) {
-		_cursorX = _cursorX * 2;
-		_cursorY = _cursorY * 2;
+		_cursorX *= 2;
+		_cursorY *= 2;
 	}
 	SurfaceSdlGraphicsManager::hideOverlay();
 }
@@ -502,8 +500,8 @@ bool GPHGraphicsManager::getFeatureState(OSystem::Feature f) const {
 void GPHGraphicsManager::warpMouse(int x, int 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);
diff --git a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp
index 3fa1465..4e64060 100644
--- a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp
+++ b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp
@@ -35,10 +35,6 @@
 #include "graphics/scaler/downscaler.h"
 #include "graphics/surface.h"
 
-enum {
-	GFX_HALF = 12
-};
-
 static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
 	{"1x", "Fullscreen", GFX_NORMAL},
 	{"½x", "Downscale", GFX_HALF},
@@ -46,7 +42,7 @@ static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
 };
 
 LinuxmotoSdlGraphicsManager::LinuxmotoSdlGraphicsManager(SdlEventSource *sdlEventSource, SdlWindow *window)
- : SurfaceSdlGraphicsManager(sdlEventSource, window) {
+	: SurfaceSdlGraphicsManager(sdlEventSource, window) {
 }
 
 const OSystem::GraphicsMode *LinuxmotoSdlGraphicsManager::getSupportedGraphicsModes() const {
@@ -116,7 +112,7 @@ void LinuxmotoSdlGraphicsManager::initSize(uint w, uint h, const Graphics::Pixel
 	_videoMode.screenWidth = w;
 	_videoMode.screenHeight = h;
 
-	if	(w > 320 || h > 240) {
+	if (w > 320 || h > 240) {
 		setGraphicsMode(GFX_HALF);
 		setGraphicsModeIntern();
 		_window->toggleMouseGrab();
@@ -127,6 +123,7 @@ void LinuxmotoSdlGraphicsManager::initSize(uint w, uint h, const Graphics::Pixel
 
 bool LinuxmotoSdlGraphicsManager::loadGFXMode() {
 	debug("Game ScreenMode = %d*%d",_videoMode.screenWidth, _videoMode.screenHeight);
+
 	if (_videoMode.screenWidth > 320 || _videoMode.screenHeight > 240) {
 		_videoMode.aspectRatioCorrection = false;
 		setGraphicsMode(GFX_HALF);
@@ -135,6 +132,7 @@ bool LinuxmotoSdlGraphicsManager::loadGFXMode() {
 		setGraphicsMode(GFX_NORMAL);
 		debug("GraphicsMode set to NORMAL");
 	}
+
 	if (_videoMode.mode == GFX_HALF && !_overlayVisible) {
 		_videoMode.overlayWidth = 320;
 		_videoMode.overlayHeight = 240;
@@ -231,7 +229,7 @@ void LinuxmotoSdlGraphicsManager::undrawMouse() {
 
 	if (_mouseBackup.w != 0 && _mouseBackup.h != 0) {
 		if (_videoMode.mode == GFX_HALF && !_overlayVisible) {
-			addDirtyRect(x*2, y*2, _mouseBackup.w*2, _mouseBackup.h*2);
+			addDirtyRect(x * 2, y * 2, _mouseBackup.w * 2, _mouseBackup.h * 2);
 		} else {
 			addDirtyRect(x, y, _mouseBackup.w, _mouseBackup.h);
 		}
@@ -244,7 +242,7 @@ void LinuxmotoSdlGraphicsManager::internUpdateScreen() {
 	ScalerProc *scalerProc;
 	int scale1;
 
-#if defined(DEBUG) // definitions not available for non-DEBUG here. (needed this to compile in SYMBIAN32 & linux?)
+#if defined(DEBUG)
 	assert(_hwScreen != NULL);
 	assert(_hwScreen->map->sw_data != NULL);
 #endif
@@ -268,8 +266,8 @@ void LinuxmotoSdlGraphicsManager::internUpdateScreen() {
 	// screen surface accordingly.
 	if (_screen && _paletteDirtyEnd != 0) {
 		SDL_SetColors(_screen, _currentPalette + _paletteDirtyStart,
-			_paletteDirtyStart,
-			_paletteDirtyEnd - _paletteDirtyStart);
+		              _paletteDirtyStart,
+		              _paletteDirtyEnd - _paletteDirtyStart);
 
 		_paletteDirtyEnd = 0;
 
@@ -319,8 +317,8 @@ void LinuxmotoSdlGraphicsManager::internUpdateScreen() {
 
 		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.
+			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());
@@ -356,12 +354,11 @@ void LinuxmotoSdlGraphicsManager::internUpdateScreen() {
 				assert(scalerProc != NULL);
 
 				if (_videoMode.mode == GFX_HALF && scalerProc == DownscaleAllByHalf) {
-
-					if (dst_x%2==1) {
+					if (dst_x % 2 == 1) {
 						dst_x--;
 						dst_w++;
 					}
-					if (dst_y%2==1) {
+					if (dst_y % 2 == 1) {
 						dst_y--;
 						dst_h++;
 					}
diff --git a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h
index ec5ebff..0a538be 100644
--- a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h
+++ b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h
@@ -25,6 +25,10 @@
 
 #include "backends/graphics/surfacesdl/surfacesdl-graphics.h"
 
+enum {
+	GFX_HALF = 12
+};
+
 class LinuxmotoSdlGraphicsManager : public SurfaceSdlGraphicsManager {
 public:
 	LinuxmotoSdlGraphicsManager(SdlEventSource *sdlEventSource, SdlWindow *window);


Commit: 8ae0be4ae3ca4093ac4140abcb16d5b03dd59810
    https://github.com/scummvm/scummvm/commit/8ae0be4ae3ca4093ac4140abcb16d5b03dd59810
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2019-11-23T18:42:04Z

Commit Message:
GPH: Remove unused variable

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


diff --git a/backends/graphics/gph/gph-graphics.cpp b/backends/graphics/gph/gph-graphics.cpp
index c54c6f2..434b779 100644
--- a/backends/graphics/gph/gph-graphics.cpp
+++ b/backends/graphics/gph/gph-graphics.cpp
@@ -126,7 +126,6 @@ void GPHGraphicsManager::drawMouse() {
 
 	SDL_Rect dst;
 	int scale;
-	int width, height;
 	int hotX, hotY;
 
 	if (_videoMode.mode == GFX_HALF && !_overlayVisible) {
@@ -139,16 +138,12 @@ void GPHGraphicsManager::drawMouse() {
 
 	if (!_overlayVisible) {
 		scale = _videoMode.scaleFactor;
-		width = _videoMode.screenWidth;
-		height = _videoMode.screenHeight;
 		dst.w = _mouseCurState.vW;
 		dst.h = _mouseCurState.vH;
 		hotX = _mouseCurState.vHotX;
 		hotY = _mouseCurState.vHotY;
 	} else {
 		scale = 1;
-		width = _videoMode.overlayWidth;
-		height = _videoMode.overlayHeight;
 		dst.w = _mouseCurState.rW;
 		dst.h = _mouseCurState.rH;
 		hotX = _mouseCurState.rHotX;




More information about the Scummvm-git-logs mailing list