[Scummvm-cvs-logs] scummvm master -> 5636c1fee05d1b718597017e003fa046c9791902

dhewg dhewg at wiibrew.org
Sat Jul 21 16:31:13 CEST 2012


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:
5636c1fee0 WII: Adapt to mouse cursor dontScale API change


Commit: 5636c1fee05d1b718597017e003fa046c9791902
    https://github.com/scummvm/scummvm/commit/5636c1fee05d1b718597017e003fa046c9791902
Author: dhewg (dhewg at wiibrew.org)
Date: 2012-07-21T07:22:05-07:00

Commit Message:
WII: Adapt to mouse cursor dontScale API change

Changed paths:
    backends/platform/wii/osystem.cpp
    backends/platform/wii/osystem.h
    backends/platform/wii/osystem_gfx.cpp



diff --git a/backends/platform/wii/osystem.cpp b/backends/platform/wii/osystem.cpp
index 6816755..22a6495 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 abafa7f..5d6998d 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 90e4d98..fc0802d 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;






More information about the Scummvm-git-logs mailing list