diff options
-rw-r--r-- | engines/sci/engine/kernel.h | 52 | ||||
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 8 | ||||
-rw-r--r-- | engines/sci/engine/klists.cpp | 2 | ||||
-rw-r--r-- | engines/sci/engine/ksound.cpp | 8 |
4 files changed, 38 insertions, 32 deletions
diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h index 68e8807e56..0010e3cd64 100644 --- a/engines/sci/engine/kernel.h +++ b/engines/sci/engine/kernel.h @@ -187,10 +187,13 @@ enum SelectorInvocation { */ -enum { WAS_FUNCT_NR = -1 }; +enum { + // FIXME: FAKE_FUNCT_NR is a hack used to substitute for an opcode number in certain places + FAKE_FUNCT_NR = -1 +}; #define INV_SEL(_object_, _selector_, _noinvalid_) \ - s, _object_, ((SciEngine*)g_engine)->getKernel()->_selectorCache._selector_, _noinvalid_, WAS_FUNCT_NR, argv, argc, __FILE__, __LINE__ + s, _object_, ((SciEngine*)g_engine)->getKernel()->_selectorCache._selector_, _noinvalid_, FAKE_FUNCT_NR, argv, argc, __FILE__, __LINE__ /* Kludge for use with invoke_selector(). Used for compatibility with compilers that can't ** handle vararg macros. */ @@ -298,31 +301,26 @@ List *lookup_list(EngineState *s, reg_t addr); #define SCI_MAX_SAVENAME_LENGTH 0x24 /* Flags for the signal selector */ -#define _K_VIEW_SIG_FLAG_STOP_UPDATE 0x0001 -#define _K_VIEW_SIG_FLAG_UPDATED 0x0002 -#define _K_VIEW_SIG_FLAG_NO_UPDATE 0x0004 -#define _K_VIEW_SIG_FLAG_HIDDEN 0x0008 -#define _K_VIEW_SIG_FLAG_FIX_PRI_ON 0x0010 -#define _K_VIEW_SIG_FLAG_ALWAYS_UPDATE 0x0020 -#define _K_VIEW_SIG_FLAG_FORCE_UPDATE 0x0040 -#define _K_VIEW_SIG_FLAG_REMOVE 0x0080 -#define _K_VIEW_SIG_FLAG_FROZEN 0x0100 -#define _K_VIEW_SIG_FLAG_IS_EXTRA 0x0200 -#define _K_VIEW_SIG_FLAG_HIT_OBSTACLE 0x0400 -#define _K_VIEW_SIG_FLAG_DOESNT_TURN 0x0800 -#define _K_VIEW_SIG_FLAG_NO_CYCLER 0x1000 -#define _K_VIEW_SIG_FLAG_IGNORE_HORIZON 0x2000 -#define _K_VIEW_SIG_FLAG_IGNORE_ACTOR 0x4000 -#define _K_VIEW_SIG_FLAG_DISPOSE_ME 0x8000 - -#define _K_VIEW_SIG_FLAG_STOPUPD 0x20000000 /* View has been stop-updated */ - - -/* Sound status */ -#define _K_SOUND_STATUS_STOPPED 0 -#define _K_SOUND_STATUS_INITIALIZED 1 -#define _K_SOUND_STATUS_PAUSED 2 -#define _K_SOUND_STATUS_PLAYING 3 +enum { + _K_VIEW_SIG_FLAG_STOP_UPDATE = 0x0001, + _K_VIEW_SIG_FLAG_UPDATED = 0x0002, + _K_VIEW_SIG_FLAG_NO_UPDATE = 0x0004, + _K_VIEW_SIG_FLAG_HIDDEN = 0x0008, + _K_VIEW_SIG_FLAG_FIX_PRI_ON = 0x0010, + _K_VIEW_SIG_FLAG_ALWAYS_UPDATE = 0x0020, + _K_VIEW_SIG_FLAG_FORCE_UPDATE = 0x0040, + _K_VIEW_SIG_FLAG_REMOVE = 0x0080, + _K_VIEW_SIG_FLAG_FROZEN = 0x0100, + _K_VIEW_SIG_FLAG_IS_EXTRA = 0x0200, + _K_VIEW_SIG_FLAG_HIT_OBSTACLE = 0x0400, + _K_VIEW_SIG_FLAG_DOESNT_TURN = 0x0800, + _K_VIEW_SIG_FLAG_NO_CYCLER = 0x1000, + _K_VIEW_SIG_FLAG_IGNORE_HORIZON = 0x2000, + _K_VIEW_SIG_FLAG_IGNORE_ACTOR = 0x4000, + _K_VIEW_SIG_FLAG_DISPOSE_ME = 0x8000, + + _K_VIEW_SIG_FLAG_STOPUPD = 0x20000000 /* View has been stop-updated */ +}; /******************** Kernel functions ********************/ diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 025a6f4aac..01942cda90 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -343,9 +343,9 @@ static reg_t kSetCursorSci11(EngineState *s, int, int argc, reg_t *argv) { reg_t kSetCursor(EngineState *s, int, int argc, reg_t *argv) { switch (s->detectSetCursorType()) { case SCI_VERSION_0_EARLY: - return kSetCursorSci0(s, WAS_FUNCT_NR, argc, argv); + return kSetCursorSci0(s, FAKE_FUNCT_NR, argc, argv); case SCI_VERSION_1_1: - return kSetCursorSci11(s, WAS_FUNCT_NR, argc, argv); + return kSetCursorSci11(s, FAKE_FUNCT_NR, argc, argv); default: warning("Unknown SetCursor type"); return NULL_REG; @@ -855,7 +855,7 @@ reg_t kCanBeHere(EngineState *s, int, int argc, reg_t *argv) { reg_t kCantBeHere(EngineState *s, int, int argc, reg_t *argv) { // kCantBeHere does the same thing as kCanBeHere, except that // it returns the opposite result. - reg_t result = kCanBeHere(s, 0, argc, argv); + reg_t result = kCanBeHere(s, FAKE_FUNCT_NR, argc, argv); result.offset = !result.offset; return result; } @@ -2992,7 +2992,7 @@ reg_t kAnimate(EngineState *s, int, int argc, reg_t *argv) { // End of doit() recovery code if (s->pic_is_new) { // Happens if DrawPic() is executed by a dynview (yes, that happens) - kAnimate(s, WAS_FUNCT_NR, argc, argv); /* Tail-recurse */ + kAnimate(s, FAKE_FUNCT_NR, argc, argv); /* Tail-recurse */ return s->r_acc; } diff --git a/engines/sci/engine/klists.cpp b/engines/sci/engine/klists.cpp index 91842ffad2..4e0f64a543 100644 --- a/engines/sci/engine/klists.cpp +++ b/engines/sci/engine/klists.cpp @@ -383,7 +383,7 @@ reg_t kFindKey(EngineState *s, int, int argc, reg_t *argv) { } reg_t kDeleteKey(EngineState *s, int, int argc, reg_t *argv) { - reg_t node_pos = kFindKey(s, WAS_FUNCT_NR, 2, argv); + reg_t node_pos = kFindKey(s, FAKE_FUNCT_NR, 2, argv); Node *n; List *l = lookup_list(s, argv[0]); diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp index 4399de1443..5bccc43f93 100644 --- a/engines/sci/engine/ksound.cpp +++ b/engines/sci/engine/ksound.cpp @@ -36,6 +36,14 @@ namespace Sci { +/* Sound status */ +enum { + _K_SOUND_STATUS_STOPPED = 0, + _K_SOUND_STATUS_INITIALIZED = 1, + _K_SOUND_STATUS_PAUSED = 2, + _K_SOUND_STATUS_PLAYING = 3 +}; + enum { _K_SCI0_SOUND_INIT_HANDLE = 0, _K_SCI0_SOUND_PLAY_HANDLE = 1, |