[Scummvm-cvs-logs] SF.net SVN: scummvm:[44140] scummvm/trunk/engines/sci
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Thu Sep 17 11:36:57 CEST 2009
Revision: 44140
http://scummvm.svn.sourceforge.net/scummvm/?rev=44140&view=rev
Author: thebluegr
Date: 2009-09-17 09:36:52 +0000 (Thu, 17 Sep 2009)
Log Message:
-----------
Made script_lookup_export() a method of SegManager
Modified Paths:
--------------
scummvm/trunk/engines/sci/detection.cpp
scummvm/trunk/engines/sci/engine/game.cpp
scummvm/trunk/engines/sci/engine/seg_manager.h
scummvm/trunk/engines/sci/engine/vm.cpp
scummvm/trunk/engines/sci/engine/vm.h
Modified: scummvm/trunk/engines/sci/detection.cpp
===================================================================
--- scummvm/trunk/engines/sci/detection.cpp 2009-09-17 09:08:54 UTC (rev 44139)
+++ scummvm/trunk/engines/sci/detection.cpp 2009-09-17 09:36:52 UTC (rev 44140)
@@ -309,7 +309,7 @@
delete resMan;
return 0;
}
- reg_t game_obj = script_lookup_export(segMan, 0, 0);
+ reg_t game_obj = segMan->lookupScriptExport(0, 0);
const char *gameName = segMan->getObjectName(game_obj);
debug(2, "Detected ID: \"%s\" at %04x:%04x", gameName, PRINT_REG(game_obj));
s_fallbackDesc.desc.gameid = convertSierraGameId(gameName, &s_fallbackDesc.desc.flags);
Modified: scummvm/trunk/engines/sci/engine/game.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/game.cpp 2009-09-17 09:08:54 UTC (rev 44139)
+++ scummvm/trunk/engines/sci/engine/game.cpp 2009-09-17 09:36:52 UTC (rev 44140)
@@ -454,7 +454,7 @@
// script_dissect(0, s->_selectorNames);
// The first entry in the export table of script 0 points to the game object
- s->game_obj = script_lookup_export(s->segMan, 0, 0);
+ s->game_obj = s->segMan->lookupScriptExport(0, 0);
uint32 gameFlags = 0; // unused
s->_gameName = convertSierraGameId(s->segMan->getObjectName(s->game_obj), &gameFlags);
Modified: scummvm/trunk/engines/sci/engine/seg_manager.h
===================================================================
--- scummvm/trunk/engines/sci/engine/seg_manager.h 2009-09-17 09:08:54 UTC (rev 44139)
+++ scummvm/trunk/engines/sci/engine/seg_manager.h 2009-09-17 09:36:52 UTC (rev 44140)
@@ -106,6 +106,11 @@
*/
SegmentId getScriptSegment(int script_nr, ScriptLoadType load);
+ reg_t lookupScriptExport(int script_nr, int export_index) {
+ SegmentId seg = getScriptSegment(script_nr, SCRIPT_GET_DONT_LOAD);
+ return make_reg(seg, validateExportFunc(export_index, seg));
+ }
+
// TODO: document this
reg_t getClassAddress(int classnr, ScriptLoadType lock, reg_t caller);
Modified: scummvm/trunk/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.cpp 2009-09-17 09:08:54 UTC (rev 44139)
+++ scummvm/trunk/engines/sci/engine/vm.cpp 2009-09-17 09:36:52 UTC (rev 44140)
@@ -1501,11 +1501,6 @@
return _lookup_selector_function(segMan, obj_location.segment, obj, selector_id, fptr);
}
-reg_t script_lookup_export(SegManager *segMan, int script_nr, int export_index) {
- SegmentId seg = segMan->getScriptSegment(script_nr, SCRIPT_GET_DONT_LOAD);
- return make_reg(seg, segMan->validateExportFunc(export_index, seg));
-}
-
#define INST_LOOKUP_CLASS(id) ((id == 0xffff)? NULL_REG : segMan->getClassAddress(id, SCRIPT_GET_LOCK, reg))
int script_instantiate_common(ResourceManager *resMan, SegManager *segMan, int script_nr, Resource **script, Resource **heap, int *was_new) {
Modified: scummvm/trunk/engines/sci/engine/vm.h
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.h 2009-09-17 09:08:54 UTC (rev 44139)
+++ scummvm/trunk/engines/sci/engine/vm.h 2009-09-17 09:36:52 UTC (rev 44140)
@@ -441,15 +441,6 @@
ObjVarRef *varp, reg_t *fptr);
/**
- * Looks up an entry of the exports table of a script
- * @param[in] segMan The segment manager
- * @param[in] script_nr The script to look up in
- * @param[out] export_index The index of the export entry to look up
- * @return The handle
- */
-reg_t script_lookup_export(SegManager *segMan, int script_nr, int export_index);
-
-/**
* Makes sure that a script and its superclasses get loaded to the heap.
* If the script already has been loaded, only the number of lockers is
* increased. All scripts containing superclasses of this script are loaded
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list