From 3b7c91f2a77b49a36074f666e3801d28e7ccb999 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 21 Jun 2011 16:57:42 +0200 Subject: 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. --- common/util.h | 5 ----- engines/scumm/gfx.cpp | 10 +++++----- engines/scumm/gfx.h | 5 +++++ engines/scumm/input.cpp | 2 +- engines/scumm/scumm.cpp | 4 ++-- 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; -- cgit v1.2.3