aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorMax Horn2008-12-09 19:54:01 +0000
committerMax Horn2008-12-09 19:54:01 +0000
commitcabfbb49031b142a726ae0c966861f1f7f74f43f (patch)
tree97c151aac284716e0336d5e6dea2736cc4dd0050 /engines/scumm
parentc96b4f692a9cfaa5e5f374813045b97c9f33fa7d (diff)
downloadscummvm-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/scumm')
-rw-r--r--engines/scumm/cursor.cpp17
-rw-r--r--engines/scumm/scumm.cpp2
-rw-r--r--engines/scumm/string.cpp33
3 files changed, 9 insertions, 43 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;
- }
}
}