diff options
author | Filippos Karapetis | 2010-05-30 16:38:08 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-05-30 16:38:08 +0000 |
commit | 5cdb13b3e8a160e7eae14c03644ad3be5a38b415 (patch) | |
tree | 98eda07103196ae8754f9f069e43198cc0df87af /engines/sci/engine/savegame.cpp | |
parent | c32e88fe0bb61e75ca983072ba28102d4efbf123 (diff) | |
download | scummvm-rg350-5cdb13b3e8a160e7eae14c03644ad3be5a38b415.tar.gz scummvm-rg350-5cdb13b3e8a160e7eae14c03644ad3be5a38b415.tar.bz2 scummvm-rg350-5cdb13b3e8a160e7eae14c03644ad3be5a38b415.zip |
Made load_script() a member of the Script class
svn-id: r49328
Diffstat (limited to 'engines/sci/engine/savegame.cpp')
-rw-r--r-- | engines/sci/engine/savegame.cpp | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index 363dc8a44a..2846aa5b9f 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -757,27 +757,6 @@ static void reconstruct_stack(EngineState *retval) { retval->stack_top = stack->_entries + stack->_capacity; } -static void load_script(EngineState *s, Script *scr) { - scr->_buf = (byte *)malloc(scr->getBufSize()); - assert(scr->_buf); - - Resource *script = g_sci->getResMan()->findResource(ResourceId(kResourceTypeScript, scr->_nr), 0); - assert(script != 0); - - assert(scr->getBufSize() >= script->size); - memcpy(scr->_buf, script->data, script->size); - - if (getSciVersion() >= SCI_VERSION_1_1) { - Resource *heap = g_sci->getResMan()->findResource(ResourceId(kResourceTypeHeap, scr->_nr), 0); - assert(heap != 0); - - scr->_heapStart = scr->_buf + scr->getScriptSize(); - - assert(scr->getBufSize() - scr->getScriptSize() <= heap->size); - memcpy(scr->_heapStart, heap->data, heap->size); - } -} - // TODO: Move thie function to a more appropriate place, such as vm.cpp or script.cpp void SegManager::reconstructScripts(EngineState *s) { uint i; @@ -791,7 +770,7 @@ void SegManager::reconstructScripts(EngineState *s) { Script *scr = (Script *)mobj; // FIXME: Unify this code with script_instantiate_* ? - load_script(s, scr); + scr->load(g_sci->getResMan()); scr->_localsBlock = (scr->_localsSegment == 0) ? NULL : (LocalVariables *)(_heap[scr->_localsSegment]); if (getSciVersion() >= SCI_VERSION_1_1) { scr->_exportTable = 0; |