[Scummvm-cvs-logs] scummvm master -> 428105b2d393b17e750893556040d665b3fb1c9a

djwillis John.Willis at Distant-earth.com
Mon Oct 3 13:57:16 CEST 2011


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:
69683b8ee0 SURFACESDL: Stop forceful resetting of _videoMode.hardware* when calling  SurfaceSdlGraphicsManager::loadGFXMode() for t
fc551cf1ad GPH: Cleanup loadGFXMode().
428105b2d3 GPH: Minor cleanup (and rename header from gph-sdl.h to gph.h).


Commit: 69683b8ee028c008bac6cde04a6e2e811501a3d0
    https://github.com/scummvm/scummvm/commit/69683b8ee028c008bac6cde04a6e2e811501a3d0
Author: David-John Willis (John.Willis at Distant-earth.com)
Date: 2011-10-03T04:24:25-07:00

Commit Message:
SURFACESDL: Stop forceful resetting of _videoMode.hardware* when calling  SurfaceSdlGraphicsManager::loadGFXMode() for the GPH backend.

* Note: This really should be cleaned up and all backends that have a custom loadGFXMode() really should setup their own _videoMode.hardware* settings. Assuming the overlay will always match the hardware is flawed logic on devices with fixed hardware screens.
* Just done for the GPH backend for now to cut down on the regresion risk to other backends near the 1.4.0 release cycle.

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




Commit: fc551cf1add92bfa5ce703e28f669bb4feee5658
    https://github.com/scummvm/scummvm/commit/fc551cf1add92bfa5ce703e28f669bb4feee5658
Author: David-John Willis (John.Willis at Distant-earth.com)
Date: 2011-10-03T04:37:46-07:00

Commit Message:
GPH: Cleanup loadGFXMode().

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 96b0619..fe5f514 100644
--- a/backends/graphics/gph/gph-graphics.cpp
+++ b/backends/graphics/gph/gph-graphics.cpp
@@ -326,6 +326,9 @@ void GPHGraphicsManager::internUpdateScreen() {
 		_dirtyRectList[0].y = 0;
 		_dirtyRectList[0].w = width;
 		_dirtyRectList[0].h = height;
+
+		// HACK: Make sure the full hardware screen is wiped clean.
+		SDL_FillRect(_hwscreen, NULL, 0);
 	}
 
 	// Only draw anything if necessary
@@ -454,82 +457,34 @@ void GPHGraphicsManager::hideOverlay() {
 	SurfaceSdlGraphicsManager::hideOverlay();
 }
 
+bool GPHGraphicsManager::loadGFXMode() {
 
-//bool GPHGraphicsManager::loadGFXMode() {
-
-
-//	_videoMode.overlayWidth = 320;
-//	_videoMode.overlayHeight = 240;
-//	_videoMode.fullscreen = true;
-//
-//	/* Forcefully disable aspect ratio correction for games
-//	   that start with a native 240px height resolution
-//	   This corrects games with non-standard resolutions
-//	   such as MM Nes (256x240).
-//	*/
-//	if(_videoMode.screenHeight == 240) {
-//		_videoMode.aspectRatioCorrection = false;
-//	}
-
-//	debug("Game ScreenMode = %d*%d", _videoMode.screenWidth, _videoMode.screenHeight);
-//	if (_videoMode.screenWidth > 320 || _videoMode.screenHeight > 240) {
-//		_videoMode.aspectRatioCorrection = false;
-//		setGraphicsMode(GFX_HALF);
-//		debug("GraphicsMode set to HALF");
-//	} else {
-//		setGraphicsMode(GFX_NORMAL);
-//		debug("GraphicsMode set to NORMAL");
-//	}
-
-
-//	if ((_videoMode.mode == GFX_HALF) && !_overlayVisible) {
-//		//_videoMode.overlayWidth = _videoMode.screenWidth / 2;
-//		//_videoMode.overlayHeight = _videoMode.screenHeight / 2;
-//		_videoMode.overlayWidth = 320;
-//		_videoMode.overlayHeight = 240;
-//		_videoMode.fullscreen = true;
-//	} else {
-//
-//		_videoMode.overlayWidth = _videoMode.screenWidth * _videoMode.scaleFactor;
-//		_videoMode.overlayHeight = _videoMode.screenHeight * _videoMode.scaleFactor;
-//
-//		if (_videoMode.aspectRatioCorrection)
-//			_videoMode.overlayHeight = real2Aspect(_videoMode.overlayHeight);
-//
-//		//_videoMode.hardwareWidth = _videoMode.screenWidth * _videoMode.scaleFactor;
-//		//_videoMode.hardwareHeight = effectiveScreenHeight();
-//		_videoMode.hardwareWidth = 320;
-//		_videoMode.hardwareHeight = 240;
-//
-//	}
-
-//	return SurfaceSdlGraphicsManager::loadGFXMode();
-//}
+	// We don't offer anything other than fullscreen on GPH devices so let’s not even pretend.
+	_videoMode.fullscreen = true;
+
+	// Set the hardware stats to match the LCD.
+	_videoMode.hardwareWidth = 320;
+	_videoMode.hardwareHeight = 240;
+
+	if (_videoMode.screenHeight != 200)
+		_videoMode.aspectRatioCorrection = false;
 
-bool GPHGraphicsManager::loadGFXMode() {
 	if (_videoMode.screenWidth > 320 || _videoMode.screenHeight > 240) {
 		_videoMode.aspectRatioCorrection = false;
 		setGraphicsMode(GFX_HALF);
-//		printf("GFX_HALF\n");
 	} else {
 		setGraphicsMode(GFX_NORMAL);
-//		printf("GFX_NORMAL\n");
 	}
 
 	if ((_videoMode.mode == GFX_HALF) && !_overlayVisible) {
 		_videoMode.overlayWidth = _videoMode.screenWidth / 2;
 		_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);
-
-		_videoMode.hardwareWidth = _videoMode.screenWidth * _videoMode.scaleFactor;
-		_videoMode.hardwareHeight = effectiveScreenHeight();
 	}
 	return SurfaceSdlGraphicsManager::loadGFXMode();
 }
@@ -545,6 +500,10 @@ void GPHGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) {
 		case OSystem::kFeatureAspectRatioCorrection:
 		setAspectRatioCorrection(enable);
 		break;
+		case OSystem::kFeatureCursorPalette:
+		_cursorPaletteDisabled = !enable;
+		blitCursor();
+		break;
 	default:
 		break;
 	}
@@ -556,6 +515,8 @@ bool GPHGraphicsManager::getFeatureState(OSystem::Feature f) {
 	switch (f) {
 		case OSystem::kFeatureAspectRatioCorrection:
 		return _videoMode.aspectRatioCorrection;
+		case OSystem::kFeatureCursorPalette:
+		return !_cursorPaletteDisabled;
 	default:
 		return false;
 	}


Commit: 428105b2d393b17e750893556040d665b3fb1c9a
    https://github.com/scummvm/scummvm/commit/428105b2d393b17e750893556040d665b3fb1c9a
Author: David-John Willis (John.Willis at Distant-earth.com)
Date: 2011-10-03T04:38:42-07:00

Commit Message:
GPH: Minor cleanup (and rename header from gph-sdl.h to gph.h).

Changed paths:
  A backends/platform/gph/gph.h
  R backends/platform/gph/gph-sdl.h
    backends/platform/gph/build/gp2xwiz-bundle.sh
    backends/platform/gph/gph-backend.cpp
    backends/platform/gph/gph-main.cpp



diff --git a/backends/platform/gph/build/gp2xwiz-bundle.sh b/backends/platform/gph/build/gp2xwiz-bundle.sh
index 579e2dc..2182f20 100644
--- a/backends/platform/gph/build/gp2xwiz-bundle.sh
+++ b/backends/platform/gph/build/gp2xwiz-bundle.sh
@@ -2,6 +2,16 @@
 
 echo Quick script to make building a distribution of the GP2X Wiz backend more consistent.
 
+# Set the paths up here to support the build.
+
+export PATH=/opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/bin:$PATH
+export PATH=/opt/open2x/gcc-4.1.1-glibc-2.3.6/bin:$PATH
+export CXX=arm-open2x-linux-g++
+export CC=arm-open2x-linux-gcc
+export CXXFLAGS=-march=armv4t
+export LDFLAGS=-static
+export ASFLAGS=-mfloat-abi=soft
+
 cd ../../../..
 
 echo Building ScummVM for GP2X Wiz.
diff --git a/backends/platform/gph/gph-backend.cpp b/backends/platform/gph/gph-backend.cpp
index ae3466b..8ee84ed 100644
--- a/backends/platform/gph/gph-backend.cpp
+++ b/backends/platform/gph/gph-backend.cpp
@@ -25,10 +25,9 @@
 
 #include "backends/platform/sdl/sdl-sys.h"
 
-// #include "backends/platform/gph/gph-options.h"
 #include "backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h"
 #include "backends/platform/gph/gph-hw.h"
-#include "backends/platform/gph/gph-sdl.h"
+#include "backends/platform/gph/gph.h"
 #include "backends/plugins/posix/posix-provider.h"
 #include "backends/saves/default/default-saves.h"
 #include "backends/timer/default/default-timer.h"
@@ -105,8 +104,9 @@ void OSystem_GPH::initBackend() {
 	_savefileManager = new DefaultSaveFileManager(savePath);
 
 	#ifdef DUMP_STDOUT
-		// The GP2X Wiz has a serial console on the breakout board but most users do not use this so we
-		// output all our STDOUT and STDERR to files for debug purposes.
+		// The GPH devices have a serial console on the breakout board
+		// but most users do not use this so we output all our STDOUT
+		// and STDERR to files for debug purposes.
 		char STDOUT_FILE[PATH_MAX+1];
 		char STDERR_FILE[PATH_MAX+1];
 
@@ -169,9 +169,6 @@ void OSystem_GPH::initBackend() {
 	/* Make sure SDL knows that we have a joystick we want to use. */
 	ConfMan.setInt("joystick_num", 0);
 
-	/* Now setup any device specific user options (Left handed mode, that sort of thing). */
-	// GPH::setOptions();
-
 	/* Pass to POSIX method to do the heavy lifting */
 	OSystem_POSIX::initBackend();
 
diff --git a/backends/platform/gph/gph-main.cpp b/backends/platform/gph/gph-main.cpp
index 1a8c668..4f290f7 100644
--- a/backends/platform/gph/gph-main.cpp
+++ b/backends/platform/gph/gph-main.cpp
@@ -20,7 +20,7 @@
  *
  */
 
-#include "backends/platform/gph/gph-sdl.h"
+#include "backends/platform/gph/gph.h"
 #include "backends/plugins/posix/posix-provider.h"
 #include "base/main.h"
 
diff --git a/backends/platform/gph/gph-sdl.h b/backends/platform/gph/gph-sdl.h
deleted file mode 100644
index 8b943f9..0000000
--- a/backends/platform/gph/gph-sdl.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef GPH_H
-#define GPH_H
-
-#if defined(GPH_DEVICE)
-
-#include "backends/base-backend.h"
-#include "backends/platform/sdl/sdl.h"
-#include "backends/platform/sdl/posix/posix.h"
-#include "backends/events/gph/gph-events.h"
-#include "backends/graphics/gph/gph-graphics.h"
-
-#define __GP2XWIZ__
-
-#ifndef PATH_MAX
-	#define PATH_MAX 255
-#endif
-
-class OSystem_GPH : public OSystem_POSIX {
-public:
-	OSystem_GPH();
-
-	/* Platform Setup Stuff */
-	void addSysArchivesToSearchSet(Common::SearchSet &s, int priority);
-	void initBackend();
-	void quit();
-};
-
-#endif
-#endif //GPH_H
diff --git a/backends/platform/gph/gph.h b/backends/platform/gph/gph.h
new file mode 100644
index 0000000..8b943f9
--- /dev/null
+++ b/backends/platform/gph/gph.h
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef GPH_H
+#define GPH_H
+
+#if defined(GPH_DEVICE)
+
+#include "backends/base-backend.h"
+#include "backends/platform/sdl/sdl.h"
+#include "backends/platform/sdl/posix/posix.h"
+#include "backends/events/gph/gph-events.h"
+#include "backends/graphics/gph/gph-graphics.h"
+
+#define __GP2XWIZ__
+
+#ifndef PATH_MAX
+	#define PATH_MAX 255
+#endif
+
+class OSystem_GPH : public OSystem_POSIX {
+public:
+	OSystem_GPH();
+
+	/* Platform Setup Stuff */
+	void addSysArchivesToSearchSet(Common::SearchSet &s, int priority);
+	void initBackend();
+	void quit();
+};
+
+#endif
+#endif //GPH_H






More information about the Scummvm-git-logs mailing list