diff options
author | Filippos Karapetis | 2009-08-25 08:38:14 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-08-25 08:38:14 +0000 |
commit | ed66cad6777a779f5cabeec037a24613da0134bf (patch) | |
tree | a63032758b32e3ada2ec0287033edfc5a17ee1c3 /engines/sci/engine/kmovement.cpp | |
parent | bc20237ae37cf042a0f7c2c49cd0ca68ef76379b (diff) | |
download | scummvm-rg350-ed66cad6777a779f5cabeec037a24613da0134bf.tar.gz scummvm-rg350-ed66cad6777a779f5cabeec037a24613da0134bf.tar.bz2 scummvm-rg350-ed66cad6777a779f5cabeec037a24613da0134bf.zip |
- Simplified the parameters of some functions
- Replaced some EngineState parameters
- The SCI version is now obtained from the resource manager or the segment manager, thereby simplifying several functions
- Plugged 2 leaks in the fallback detector
- Renamed the segment manager and resource manager to "segmentManager" and "resourceManager" in all places, for consistency
svn-id: r43722
Diffstat (limited to 'engines/sci/engine/kmovement.cpp')
-rw-r--r-- | engines/sci/engine/kmovement.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/engines/sci/engine/kmovement.cpp b/engines/sci/engine/kmovement.cpp index 58dc3b73f1..2c0dd1500b 100644 --- a/engines/sci/engine/kmovement.cpp +++ b/engines/sci/engine/kmovement.cpp @@ -257,7 +257,7 @@ static void bresenham_autodetect(EngineState *s) { reg_t motion_class; if (!parse_reg_t(s, "?Motion", &motion_class)) { - Object *obj = obj_get(s->seg_manager, s->_version, motion_class); + Object *obj = obj_get(s->segmentManager, motion_class); reg_t fptr; byte *buf; @@ -267,14 +267,14 @@ static void bresenham_autodetect(EngineState *s) { return; } - if (lookup_selector(s, motion_class, ((SciEngine*)g_engine)->getKernel()->_selectorMap.doit, NULL, &fptr) != kSelectorMethod) { + if (lookup_selector(s->segmentManager, motion_class, ((SciEngine*)g_engine)->getKernel()->_selectorMap.doit, NULL, &fptr) != kSelectorMethod) { warning("bresenham_autodetect failed"); handle_movecnt = INCREMENT_MOVECNT; // Most games do this, so best guess return; } - buf = s->seg_manager->getScript(fptr.segment)->buf + fptr.offset; - handle_movecnt = (s->_version <= SCI_VERSION_01 || checksum_bytes(buf, 8) == 0x216) ? INCREMENT_MOVECNT : IGNORE_MOVECNT; + buf = s->segmentManager->getScript(fptr.segment)->buf + fptr.offset; + handle_movecnt = (s->segmentManager->sciVersion() <= SCI_VERSION_01 || checksum_bytes(buf, 8) == 0x216) ? INCREMENT_MOVECNT : IGNORE_MOVECNT; printf("b-moveCnt action based on checksum: %s\n", handle_movecnt == IGNORE_MOVECNT ? "ignore" : "increment"); } else { warning("bresenham_autodetect failed"); @@ -293,7 +293,7 @@ reg_t kDoBresen(EngineState *s, int funct_nr, int argc, reg_t *argv) { int completed = 0; int max_movcnt = GET_SEL32V(client, moveSpeed); - if (s->_version > SCI_VERSION_01) + if (s->resourceManager->sciVersion() > SCI_VERSION_01) signal &= ~_K_VIEW_SIG_FLAG_HIT_OBSTACLE; if (handle_movecnt == UNINITIALIZED) @@ -380,7 +380,7 @@ reg_t kDoBresen(EngineState *s, int funct_nr, int argc, reg_t *argv) { completed = 1; } - if (s->_version > SCI_VERSION_01) + if (s->resourceManager->sciVersion() > SCI_VERSION_01) if (completed) invoke_selector(INV_SEL(mover, moveDone, kStopOnInvalidSelector), 0); |