[Scummvm-cvs-logs] scummvm master -> 3b7c91f2a77b49a36074f666e3801d28e7ccb999

lordhoto lordhoto at gmail.com
Tue Jun 21 17:01:47 CEST 2011


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:
3b7c91f2a7 COMMON: Move HerculesDimensions enum to SCUMM.


Commit: 3b7c91f2a77b49a36074f666e3801d28e7ccb999
    https://github.com/scummvm/scummvm/commit/3b7c91f2a77b49a36074f666e3801d28e7ccb999
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2011-06-21T07:59:50-07:00

Commit Message:
COMMON: Move HerculesDimensions enum to SCUMM.

The enum is only used inside the SCUMM engine so it is rather pointless to
keep it in common/util.h right now. Also if we really want it in some common
place it should probably be better in graphics/ too.

Changed paths:
    common/util.h
    engines/scumm/gfx.cpp
    engines/scumm/gfx.h
    engines/scumm/input.cpp
    engines/scumm/scumm.cpp



diff --git a/common/util.h b/common/util.h
index 5837c8b..cd890c9 100644
--- a/common/util.h
+++ b/common/util.h
@@ -208,11 +208,6 @@ enum RenderMode {
 	kRenderAmiga = 5
 };
 
-enum HerculesDimensions {
-	kHercW = 720,
-	kHercH = 350
-};
-
 struct RenderModeDescription {
 	const char *code;
 	const char *description;
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 2b0ded1..f22547f 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -722,11 +722,11 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
 		if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG) {
 			ditherHerc(_compositeBuf, _herculesBuf, width, &x, &y, &width, &height);
 
-			src = _herculesBuf + x + y * Common::kHercW;
-			pitch = Common::kHercW;
+			src = _herculesBuf + x + y * kHercWidth;
+			pitch = kHercWidth;
 
 			// center image on the screen
-			x += (Common::kHercW - _screenWidth * 2) / 2;	// (720 - 320*2)/2 = 40
+			x += (kHercWidth - _screenWidth * 2) / 2;	// (720 - 320*2)/2 = 40
 		} else if (_useCJKMode && m == 2) {
 			pitch *= m;
 			x *= m;
@@ -819,10 +819,10 @@ void ditherHerc(byte *src, byte *hercbuf, int srcPitch, int *x, int *y, int *wid
 	int dsty = yo*2 - yo/4;
 
 	for (int y1 = 0; y1 < heighto;) {
-		assert(dsty < Common::kHercH);
+		assert(dsty < kHercHeight);
 
 		srcptr = src + y1 * srcPitch;
-		dstptr = hercbuf + dsty * Common::kHercW + xo * 2;
+		dstptr = hercbuf + dsty * kHercWidth + xo * 2;
 
 		const int idx1 = (dsty % 7) % 2;
 		for (int x1 = 0; x1 < widtho; x1++) {
diff --git a/engines/scumm/gfx.h b/engines/scumm/gfx.h
index af75a98..4b44ddc 100644
--- a/engines/scumm/gfx.h
+++ b/engines/scumm/gfx.h
@@ -32,6 +32,11 @@ namespace Scumm {
 
 class ScummEngine;
 
+enum HerculesDimensions {
+	kHercWidth = 720,
+	kHercHeight = 350
+};
+
 /** Camera modes */
 enum {
 	kNormalCameraMode = 1,
diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp
index 07c5257..5eea7ac 100644
--- a/engines/scumm/input.cpp
+++ b/engines/scumm/input.cpp
@@ -181,7 +181,7 @@ void ScummEngine::parseEvent(Common::Event event) {
 		_mouse.y = event.mouse.y;
 
 		if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG) {
-			_mouse.x -= (Common::kHercW - _screenWidth * 2) / 2;
+			_mouse.x -= (kHercWidth - _screenWidth * 2) / 2;
 			_mouse.x >>= 1;
 			_mouse.y = _mouse.y * 4 / 7;
 		} else if (_useCJKMode && _textSurfaceMultiplier == 2) {
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index ed5537f..7b136dc 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -564,7 +564,7 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
 
 	_herculesBuf = 0;
 	if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG) {
-		_herculesBuf = (byte *)malloc(Common::kHercW * Common::kHercH);
+		_herculesBuf = (byte *)malloc(kHercWidth * kHercHeight);
 	}
 
 	// Add debug levels
@@ -1140,7 +1140,7 @@ Common::Error ScummEngine::init() {
 
 	// Initialize backend
 	if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG) {
-		initGraphics(Common::kHercW, Common::kHercH, true);
+		initGraphics(kHercWidth, kHercHeight, true);
 	} else {
 		int screenWidth = _screenWidth;
 		int screenHeight = _screenHeight;






More information about the Scummvm-git-logs mailing list