diff options
author | Max Horn | 2008-12-09 19:54:01 +0000 |
---|---|---|
committer | Max Horn | 2008-12-09 19:54:01 +0000 |
commit | cabfbb49031b142a726ae0c966861f1f7f74f43f (patch) | |
tree | 97c151aac284716e0336d5e6dea2736cc4dd0050 /engines | |
parent | c96b4f692a9cfaa5e5f374813045b97c9f33fa7d (diff) | |
download | scummvm-rg350-cabfbb49031b142a726ae0c966861f1f7f74f43f.tar.gz scummvm-rg350-cabfbb49031b142a726ae0c966861f1f7f74f43f.tar.bz2 scummvm-rg350-cabfbb49031b142a726ae0c966861f1f7f74f43f.zip |
Removed some dead code, clarified comments, cleanup
svn-id: r35293
Diffstat (limited to 'engines')
-rw-r--r-- | engines/scumm/cursor.cpp | 17 | ||||
-rw-r--r-- | engines/scumm/scumm.cpp | 2 | ||||
-rw-r--r-- | engines/scumm/string.cpp | 33 | ||||
-rw-r--r-- | engines/tinsel/polygons.cpp | 8 |
4 files changed, 13 insertions, 47 deletions
diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp index 367247544b..1dcb96d1e8 100644 --- a/engines/scumm/cursor.cpp +++ b/engines/scumm/cursor.cpp @@ -22,7 +22,6 @@ * */ - #include "common/system.h" #include "common/util.h" #include "graphics/cursorman.h" @@ -322,12 +321,9 @@ void ScummEngine_v6::useBompCursor(const byte *im, int width, int height) { } void ScummEngine_v5::redefineBuiltinCursorFromChar(int index, int chr) { - // Cursor image in both Looms are based on images from charset. - if (_game.id != GID_LOOM) { - // FIXME: Actually: is this opcode ever called by a non-Loom game? - // Which V3-V5 game besides Loom makes use of custom cursors, ever? - error("V3--V5 SO_CURSOR_IMAGE(%d,%d) called - tell Fingolfin where you saw this!", index, chr); - } + // Cursor image in both Loom versions are based on images from charset. + // This function is *only* supported for Loom! + assert(_game.id == GID_LOOM); assert(index >= 0 && index < 4); @@ -367,11 +363,8 @@ void ScummEngine_v5::redefineBuiltinCursorFromChar(int index, int chr) { void ScummEngine_v5::redefineBuiltinCursorHotspot(int index, int x, int y) { // Cursor image in both Looms are based on images from charset. - if (_game.id != GID_LOOM) { - // FIXME: Actually: is this opcode ever called by a non-Loom game? - // Which V3-V5 game besides Loom makes use of custom cursors, ever? - error("V3--V5 SO_CURSOR_HOTSPOT(%d,%d,%d) called - tell Fingolfin where you saw this!", index, x, y); - } + // This function is *only* supported for Loom! + assert(_game.id == GID_LOOM); assert(index >= 0 && index < 4); diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index ddae3141c4..d3ece7a5ad 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -2157,7 +2157,7 @@ void ScummEngine::restart() { // TODO: Check this function - we should probably be reinitting a lot more stuff, and I suspect // this leaks memory like a sieve -// Fingolfing seez: An alternate way to implement restarting would be to create +// Fingolfin seez: An alternate way to implement restarting would be to create // a save state right after startup ... to this end we could introduce a SaveFile // subclass which is implemented using a memory buffer (i.e. no actual file is // created). Then to restart we just have to load that pseudo save state. diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp index 700632e4b3..00521048a1 100644 --- a/engines/scumm/string.cpp +++ b/engines/scumm/string.cpp @@ -837,29 +837,11 @@ void ScummEngine::drawString(int a, const byte *msg) { uint color; int code = (_game.heversion >= 80) ? 127 : 64; - bool cmi_pos_hack = false; + // drawString is not used in SCUMM v7 and v8 + assert(_game.version < 7); convertMessageToString(msg, buf, sizeof(buf)); - if (_game.version >= 7) { - // I recently disabled charset mask related code for V7+ games, thinking - // that it should never be needed there. Well, I missed on case: In this - // method, it could potentially still be used. Now the question is: - // Does this actually ever happen? Basically, drawString is called from - // two spots: First off, from drawVerb, which I *think* is not used for - // V7+ games (but I am not 100% sure), and secondly from printString(). - // The latter is much harder to predict. Maybe in some obscure place it - // is used after all? - // - // Hence I am adding this error message, hoping that either somebody - // triggers it (at which point I can investigate), or, if nobody ever - // triggers it, we can assume that it's safe to keep this error even - // after the release. - // - // TODO/FIXME: Remove or update this hack before the next release! - error("drawString(%d, '%s') -- please inform Fingolfin about this crash!", a, buf); - } - _charset->_top = _string[a].ypos + _screenTop; _charset->_startLeft = _charset->_left = _string[a].xpos; _charset->_right = _string[a].right; @@ -999,19 +981,10 @@ void ScummEngine::drawString(int a, const byte *msg) { c = 0x20; //not in S-JIS } else { c += buf[i++] * 256; - if (_game.id == GID_CMI) { - cmi_pos_hack = true; - _charset->_top += 6; - } } } - _charset->printChar(c, (_game.version < 7)); + _charset->printChar(c, true); _charset->_blitAlso = false; - - if (cmi_pos_hack) { - cmi_pos_hack = false; - _charset->_top -= 6; - } } } diff --git a/engines/tinsel/polygons.cpp b/engines/tinsel/polygons.cpp index 30d3565c00..f1ba989444 100644 --- a/engines/tinsel/polygons.cpp +++ b/engines/tinsel/polygons.cpp @@ -769,8 +769,10 @@ static HPOLYGON PathOnTheWay(HPOLYGON from, HPOLYGON to) { } /** - * Indirect method of calling PathOnTheWay(), to put the burden of - * recursion onto the main stack. + * Indirect method of calling PathOnTheWay(). + * Used to be implemented using coroutines, to put the burden of + * recursion onto the main stack. Since our "fake" coroutines use the + * same stack for everything anyway, we can do without the coroutines. */ HPOLYGON GetPathOnTheWay(HPOLYGON hFrom, HPOLYGON hTo) { CHECK_HP(hFrom, "Out of range polygon handle (6)"); @@ -794,7 +796,6 @@ HPOLYGON GetPathOnTheWay(HPOLYGON hFrom, HPOLYGON hTo) { /** * Given a node path, work out which end node is nearest the given point. */ - int NearestEndNode(HPOLYGON hPath, int x, int y) { const POLYGON *pp; @@ -825,7 +826,6 @@ int NearestEndNode(HPOLYGON hPath, int x, int y) { * nodes is nearest together. * Return which node in the start path is part of the closest pair. */ - int NearEndNode(HPOLYGON hSpath, HPOLYGON hDpath) { const POLYGON *pSpath, *pDpath; |