aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2011-06-21 16:57:42 +0200
committerJohannes Schickel2011-06-21 16:59:50 +0200
commit3b7c91f2a77b49a36074f666e3801d28e7ccb999 (patch)
tree2d761f11a5113e78120fd08af1235199df8bff4b
parent36526ef954bfd105c8a3dd143a0e68e3fb9cb6b9 (diff)
downloadscummvm-rg350-3b7c91f2a77b49a36074f666e3801d28e7ccb999.tar.gz
scummvm-rg350-3b7c91f2a77b49a36074f666e3801d28e7ccb999.tar.bz2
scummvm-rg350-3b7c91f2a77b49a36074f666e3801d28e7ccb999.zip
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.
-rw-r--r--common/util.h5
-rw-r--r--engines/scumm/gfx.cpp10
-rw-r--r--engines/scumm/gfx.h5
-rw-r--r--engines/scumm/input.cpp2
-rw-r--r--engines/scumm/scumm.cpp4
5 files changed, 13 insertions, 13 deletions
diff --git a/common/util.h b/common/util.h
index 5837c8beab..cd890c970f 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 2b0ded1c0a..f22547f193 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 af75a98731..4b44ddc376 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 07c52578c3..5eea7acc6b 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 ed5537f409..7b136dc36d 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;