[Scummvm-git-logs] scummvm master -> 7aef79c421011751311334cd5915d31bdadda3da

csnover csnover at users.noreply.github.com
Sun Oct 15 23:43:46 CEST 2017


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

Summary:
4263a78aa0 GPH: Replace usage of old SurfaceSdlGraphicsManager APIs
1f8eeb5920 DINGUX: Replace usage of old SurfaceSdlGraphicsManager APIs
7aef79c421 DINGUX: Fix missing const on hasFeature/getFeatureState implementation


Commit: 4263a78aa0a1dcb1e5764887f15cc4729ea78dc6
    https://github.com/scummvm/scummvm/commit/4263a78aa0a1dcb1e5764887f15cc4729ea78dc6
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-10-15T16:18:10-05:00

Commit Message:
GPH: Replace usage of old SurfaceSdlGraphicsManager APIs

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 e2c8411..9a97e97 100644
--- a/backends/graphics/gph/gph-graphics.cpp
+++ b/backends/graphics/gph/gph-graphics.cpp
@@ -98,11 +98,11 @@ void GPHGraphicsManager::setGraphicsModeIntern() {
 
 	_scalerProc = newScalerProc;
 
-	if (!_screen || !_hwscreen)
+	if (!_screen || !_hwScreen)
 		return;
 
 	// Blit everything to the screen
-	_forceFull = true;
+	_forceRedraw = true;
 
 	// Even if the old and new scale factors are the same, we may have a
 	// different scaler for the cursor now.
@@ -150,7 +150,7 @@ void GPHGraphicsManager::initSize(uint w, uint h, const Graphics::PixelFormat *f
 }
 
 void GPHGraphicsManager::drawMouse() {
-	if (!_mouseVisible || !_mouseSurface) {
+	if (!_cursorVisible || !_mouseSurface) {
 		_mouseBackup.x = _mouseBackup.y = _mouseBackup.w = _mouseBackup.h = 0;
 		return;
 	}
@@ -161,11 +161,11 @@ void GPHGraphicsManager::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 GPHGraphicsManager::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,23 +245,23 @@ void GPHGraphicsManager::internUpdateScreen() {
 	int scale1;
 
 #if defined(DEBUG)
-	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
 	if (_currentShakePos != _newShakePos ||
-	        (_mouseNeedsRedraw && _mouseBackup.y <= _currentShakePos)) {
+	        (_cursorNeedsRedraw && _mouseBackup.y <= _currentShakePos)) {
 		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);
+		SDL_FillRect(_hwScreen, &blackrect, 0);
 
 		_currentShakePos = _newShakePos;
 
-		_forceFull = true;
+		_forceRedraw = true;
 	}
 
 	// Check whether the palette was changed in the meantime and update the
@@ -273,7 +273,7 @@ void GPHGraphicsManager::internUpdateScreen() {
 
 		_paletteDirtyEnd = 0;
 
-		_forceFull = true;
+		_forceRedraw = true;
 	}
 
 	if (!_overlayVisible) {
@@ -295,7 +295,7 @@ void GPHGraphicsManager::internUpdateScreen() {
 
 	// Add the area covered by the mouse cursor to the list of dirty rects if
 	// we have to redraw the mouse.
-	if (_mouseNeedsRedraw)
+	if (_cursorNeedsRedraw)
 		undrawMouse();
 
 #ifdef USE_OSD
@@ -303,7 +303,7 @@ void GPHGraphicsManager::internUpdateScreen() {
 #endif
 
 	// Force a full redraw if requested
-	if (_forceFull) {
+	if (_forceRedraw) {
 		_numDirtyRects = 1;
 		_dirtyRectList[0].x = 0;
 		_dirtyRectList[0].y = 0;
@@ -311,11 +311,11 @@ void GPHGraphicsManager::internUpdateScreen() {
 		_dirtyRectList[0].h = height;
 
 		// HACK: Make sure the full hardware screen is wiped clean.
-		SDL_FillRect(_hwscreen, NULL, 0);
+		SDL_FillRect(_hwScreen, NULL, 0);
 	}
 
 	// Only draw anything if necessary
-	if (_numDirtyRects > 0 || _mouseNeedsRedraw) {
+	if (_numDirtyRects > 0 || _cursorNeedsRedraw) {
 		SDL_Rect *r;
 		SDL_Rect dst;
 		uint32 srcPitch, dstPitch;
@@ -331,10 +331,10 @@ void GPHGraphicsManager::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) {
 			register int dst_y = r->y + _currentShakePos;
@@ -374,10 +374,10 @@ void GPHGraphicsManager::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);
 				} else {
 					scalerProc((byte *)srcSurf->pixels + (r->x * 2 + 2) + (r->y + 1) * srcPitch, srcPitch,
-					           (byte *)_hwscreen->pixels + r->x * 2 + dst_y * dstPitch, dstPitch, r->w, dst_h);
+					           (byte *)_hwScreen->pixels + r->x * 2 + dst_y * dstPitch, dstPitch, r->w, dst_h);
 				}
 			}
 
@@ -395,17 +395,17 @@ void GPHGraphicsManager::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);
+				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);
+		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();
+			_dirtyRectList[0].h = (_videoMode.mode == GFX_HALF) ? _videoMode.hardwareHeight / 2 : _videoMode.hardwareHeight;
 		}
 
 		drawMouse();
@@ -415,26 +415,26 @@ void GPHGraphicsManager::internUpdateScreen() {
 #endif
 
 		// Finally, blit all our changes to the screen
-		SDL_UpdateRects(_hwscreen, _numDirtyRects, _dirtyRectList);
+		SDL_UpdateRects(_hwScreen, _numDirtyRects, _dirtyRectList);
 	}
 
 	_numDirtyRects = 0;
-	_forceFull = false;
-	_mouseNeedsRedraw = false;
+	_forceRedraw = false;
+	_cursorNeedsRedraw = false;
 }
 
 void GPHGraphicsManager::showOverlay() {
 	if (_videoMode.mode == GFX_HALF) {
-		_mouseCurState.x = _mouseCurState.x / 2;
-		_mouseCurState.y = _mouseCurState.y / 2;
+		_cursorX = _cursorX / 2;
+		_cursorY = _cursorY / 2;
 	}
 	SurfaceSdlGraphicsManager::showOverlay();
 }
 
 void GPHGraphicsManager::hideOverlay() {
 	if (_videoMode.mode == GFX_HALF) {
-		_mouseCurState.x = _mouseCurState.x * 2;
-		_mouseCurState.y = _mouseCurState.y * 2;
+		_cursorX = _cursorX * 2;
+		_cursorY = _cursorY * 2;
 	}
 	SurfaceSdlGraphicsManager::hideOverlay();
 }
@@ -511,7 +511,7 @@ bool GPHGraphicsManager::getFeatureState(OSystem::Feature f) const {
 }
 
 void GPHGraphicsManager::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;


Commit: 1f8eeb5920aeaaa34931f66ea565b9c1e14a1bbd
    https://github.com/scummvm/scummvm/commit/1f8eeb5920aeaaa34931f66ea565b9c1e14a1bbd
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-10-15T16:32:58-05:00

Commit Message:
DINGUX: Replace usage of old SurfaceSdlGraphicsManager APIs

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


diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
index 3de6439..9923b65 100644
--- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
+++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
@@ -106,11 +106,11 @@ void DINGUXSdlGraphicsManager::setGraphicsModeIntern() {
 
 	_scalerProc = newScalerProc;
 
-	if (!_screen || !_hwscreen)
+	if (!_screen || !_hwScreen)
 		return;
 
 	// Blit everything to the screen
-	_forceFull = true;
+	_forceRedraw = true;
 
 	// Even if the old and new scale factors are the same, we may have a
 	// different scaler for the cursor now.
@@ -136,7 +136,7 @@ void DINGUXSdlGraphicsManager::initSize(uint w, uint h) {
 }
 
 void DINGUXSdlGraphicsManager::drawMouse() {
-	if (!_mouseVisible || !_mouseSurface) {
+	if (!_cursorVisible || !_mouseSurface) {
 		_mouseBackup.x = _mouseBackup.y = _mouseBackup.w = _mouseBackup.h = 0;
 		return;
 	}
@@ -146,11 +146,11 @@ void DINGUXSdlGraphicsManager::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) {
@@ -193,7 +193,7 @@ void DINGUXSdlGraphicsManager::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.
@@ -226,8 +226,8 @@ void DINGUXSdlGraphicsManager::internUpdateScreen() {
 	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);
+	assert(_hwScreen != NULL);
+	assert(_hwScreen->map->sw_data != NULL);
 #endif
 
 	// If the shake position changed, fill the dirty area with blackness
@@ -237,11 +237,11 @@ void DINGUXSdlGraphicsManager::internUpdateScreen() {
 		if (_videoMode.aspectRatioCorrection && !_overlayVisible)
 			blackrect.h = real2Aspect(blackrect.h - 1) + 1;
 
-		SDL_FillRect(_hwscreen, &blackrect, 0);
+		SDL_FillRect(_hwScreen, &blackrect, 0);
 
 		_currentShakePos = _newShakePos;
 
-		_forceFull = true;
+		_forceRedraw = true;
 	}
 
 	// Check whether the palette was changed in the meantime and update the
@@ -253,7 +253,7 @@ void DINGUXSdlGraphicsManager::internUpdateScreen() {
 
 		_paletteDirtyEnd = 0;
 
-		_forceFull = true;
+		_forceRedraw = true;
 	}
 
 	if (!_overlayVisible) {
@@ -274,7 +274,7 @@ void DINGUXSdlGraphicsManager::internUpdateScreen() {
 
 	// Add the area covered by the mouse cursor to the list of dirty rects if
 	// we have to redraw the mouse.
-	if (_mouseNeedsRedraw)
+	if (_cursorNeedsRedraw)
 		undrawMouse();
 
 #ifdef USE_OSD
@@ -282,7 +282,7 @@ void DINGUXSdlGraphicsManager::internUpdateScreen() {
 #endif
 
 	// Force a full redraw if requested
-	if (_forceFull) {
+	if (_forceRedraw) {
 		_numDirtyRects = 1;
 		_dirtyRectList[0].x = 0;
 		_dirtyRectList[0].y = 0;
@@ -291,7 +291,7 @@ void DINGUXSdlGraphicsManager::internUpdateScreen() {
 	}
 
 	// Only draw anything if necessary
-	if (_numDirtyRects > 0 || _mouseNeedsRedraw) {
+	if (_numDirtyRects > 0 || _cursorNeedsRedraw) {
 		SDL_Rect *r;
 		SDL_Rect dst;
 		uint32 srcPitch, dstPitch;
@@ -307,10 +307,10 @@ void DINGUXSdlGraphicsManager::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) {
 			register int dst_y = r->y + _currentShakePos;
@@ -350,11 +350,11 @@ void DINGUXSdlGraphicsManager::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);
 
 				} else {
 					scalerProc((byte *)srcSurf->pixels + (r->x * 2 + 2) + (r->y + 1) * srcPitch, srcPitch,
-					           (byte *)_hwscreen->pixels + r->x * 2 + dst_y * dstPitch, dstPitch, r->w, dst_h);
+					           (byte *)_hwScreen->pixels + r->x * 2 + dst_y * dstPitch, dstPitch, r->w, dst_h);
 				}
 			}
 
@@ -372,17 +372,17 @@ void DINGUXSdlGraphicsManager::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);
+				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);
+		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();
+			_dirtyRectList[0].h = (_videoMode.mode == GFX_HALF) ? _videoMode.hardwareHeight / 2 : _videoMode.hardwareHeight;
 		}
 
 		drawMouse();
@@ -391,26 +391,26 @@ void DINGUXSdlGraphicsManager::internUpdateScreen() {
 		drawOSD();
 #endif
 		// Finally, blit all our changes to the screen
-		SDL_UpdateRects(_hwscreen, _numDirtyRects, _dirtyRectList);
+		SDL_UpdateRects(_hwScreen, _numDirtyRects, _dirtyRectList);
 	}
 
 	_numDirtyRects = 0;
-	_forceFull = false;
-	_mouseNeedsRedraw = false;
+	_forceRedraw = false;
+	_cursorNeedsRedraw = false;
 }
 
 void DINGUXSdlGraphicsManager::showOverlay() {
 	if (_videoMode.mode == GFX_HALF) {
-		_mouseCurState.x = _mouseCurState.x / 2;
-		_mouseCurState.y = _mouseCurState.y / 2;
+		_cursorX = _cursorX / 2;
+		_cursorY = _cursorY / 2;
 	}
 	SurfaceSdlGraphicsManager::showOverlay();
 }
 
 void DINGUXSdlGraphicsManager::hideOverlay() {
 	if (_videoMode.mode == GFX_HALF) {
-		_mouseCurState.x = _mouseCurState.x * 2;
-		_mouseCurState.y = _mouseCurState.y * 2;
+		_cursorX = _cursorX * 2;
+		_cursorY = _cursorY * 2;
 	}
 	SurfaceSdlGraphicsManager::hideOverlay();
 }
@@ -439,17 +439,20 @@ bool DINGUXSdlGraphicsManager::loadGFXMode() {
 		_videoMode.overlayHeight = _videoMode.screenHeight / 2;
 		_videoMode.fullscreen = true;
 	} else {
-
 		_videoMode.overlayWidth = _videoMode.screenWidth * _videoMode.scaleFactor;
 		_videoMode.overlayHeight = _videoMode.screenHeight * _videoMode.scaleFactor;
 
-		if (_videoMode.aspectRatioCorrection)
-			_videoMode.overlayHeight = real2Aspect(_videoMode.overlayHeight);
+		if (_videoMode.screenHeight != 200 && _videoMode.screenHeight != 400)
+			_videoMode.aspectRatioCorrection = false;
 
 		_videoMode.hardwareWidth = _videoMode.screenWidth * _videoMode.scaleFactor;
-		_videoMode.hardwareHeight = effectiveScreenHeight();
-	}
+		_videoMode.hardwareHeight = _videoMode.screenHeight * _videoMode.scaleFactor;
 
+		if (_videoMode.aspectRatioCorrection) {
+			_videoMode.overlayHeight = real2Aspect(_videoMode.overlayHeight);
+			_videoMode.hardwareHeight = real2Aspect(_videoMode.hardwareHeight);
+		}
+	}
 
 	return SurfaceSdlGraphicsManager::loadGFXMode();
 }
@@ -488,7 +491,7 @@ bool DINGUXSdlGraphicsManager::getFeatureState(OSystem::Feature f) {
 }
 
 void DINGUXSdlGraphicsManager::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;


Commit: 7aef79c421011751311334cd5915d31bdadda3da
    https://github.com/scummvm/scummvm/commit/7aef79c421011751311334cd5915d31bdadda3da
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-10-15T16:41:04-05:00

Commit Message:
DINGUX: Fix missing const on hasFeature/getFeatureState implementation

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


diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
index 9923b65..7d5f542 100644
--- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
+++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
@@ -457,7 +457,7 @@ bool DINGUXSdlGraphicsManager::loadGFXMode() {
 	return SurfaceSdlGraphicsManager::loadGFXMode();
 }
 
-bool DINGUXSdlGraphicsManager::hasFeature(OSystem::Feature f) {
+bool DINGUXSdlGraphicsManager::hasFeature(OSystem::Feature f) const {
 	return
 	    (f == OSystem::kFeatureAspectRatioCorrection) ||
 	    (f == OSystem::kFeatureCursorPalette);
@@ -477,7 +477,7 @@ void DINGUXSdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable)
 	}
 }
 
-bool DINGUXSdlGraphicsManager::getFeatureState(OSystem::Feature f) {
+bool DINGUXSdlGraphicsManager::getFeatureState(OSystem::Feature f) const {
 	assert(_transactionMode == kTransactionNone);
 
 	switch (f) {





More information about the Scummvm-git-logs mailing list