aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sci/console.cpp2
-rw-r--r--engines/sci/detection.cpp12
-rw-r--r--engines/sci/engine/gc.cpp6
-rw-r--r--engines/sci/engine/kernel.cpp36
-rw-r--r--engines/sci/engine/kernel.h16
-rw-r--r--engines/sci/engine/kernel_types.h6
-rw-r--r--engines/sci/engine/kevent.cpp8
-rw-r--r--engines/sci/engine/kgraphics.cpp42
-rw-r--r--engines/sci/engine/klists.cpp2
-rw-r--r--engines/sci/engine/kmenu.cpp2
-rw-r--r--engines/sci/engine/kmovement.cpp10
-rw-r--r--engines/sci/engine/kpathing.cpp14
-rw-r--r--engines/sci/engine/kscripts.cpp30
-rw-r--r--engines/sci/engine/ksound.cpp12
-rw-r--r--engines/sci/engine/kstring.cpp6
-rw-r--r--engines/sci/engine/memobj.cpp20
-rw-r--r--engines/sci/engine/memobj.h20
-rw-r--r--engines/sci/engine/scriptdebug.cpp10
-rw-r--r--engines/sci/engine/state.cpp8
-rw-r--r--engines/sci/engine/vm.cpp138
-rw-r--r--engines/sci/engine/vm.h36
-rw-r--r--engines/sci/gfx/gfx_resmgr.cpp6
-rw-r--r--engines/sci/gfx/gfx_resmgr.h2
-rw-r--r--engines/sci/gfx/operations.cpp4
-rw-r--r--engines/sci/gfx/operations.h4
25 files changed, 224 insertions, 228 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index e568540683..03cc1c8a07 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -2741,7 +2741,7 @@ bool Console::cmdStopSfx(int argc, const char **argv) {
}
int handle = id.segment << 16 | id.offset; // frobnicate handle
- SegManager *segManager = _vm->_gamestate->segMan; // for PUT_SEL32V
+ SegManager *segMan = _vm->_gamestate->segMan; // for PUT_SEL32V
if (id.segment) {
_vm->_gamestate->_sound.sfx_song_set_status(handle, SOUND_STATUS_STOPPED);
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index a24a34b346..967134ccfb 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -301,19 +301,19 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl
s_fallbackDesc.desc.platform = Common::kPlatformAmiga;
// Determine the game id
- SegManager *segManager = new SegManager(resMan);
- if (!script_instantiate(resMan, segManager, 0)) {
+ SegManager *segMan = new SegManager(resMan);
+ if (!script_instantiate(resMan, segMan, 0)) {
warning("fallbackDetect(): Could not instantiate script 0");
SearchMan.remove("SCI_detection");
- delete segManager;
+ delete segMan;
delete resMan;
return 0;
}
- reg_t game_obj = script_lookup_export(segManager, 0, 0);
- const char *gameName = obj_get_name(segManager, game_obj);
+ reg_t game_obj = script_lookup_export(segMan, 0, 0);
+ const char *gameName = obj_get_name(segMan, 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);
- delete segManager;
+ delete segMan;
// Try to determine the game language
// Load up text 0 and start looking for "#" characters
diff --git a/engines/sci/engine/gc.cpp b/engines/sci/engine/gc.cpp
index 5041416989..94413a3c50 100644
--- a/engines/sci/engine/gc.cpp
+++ b/engines/sci/engine/gc.cpp
@@ -145,7 +145,7 @@ reg_t_hash_map *find_all_used_references(EngineState *s) {
}
struct deallocator_t {
- SegManager *segManager;
+ SegManager *segMan;
MemObject *mobj;
#ifdef DEBUG_GC
char *segnames[MEM_OBJ_MAX + 1];
@@ -160,7 +160,7 @@ void free_unless_used(void *refcon, reg_t addr) {
if (!use_map->contains(addr)) {
// Not found -> we can free it
- deallocator->mobj->freeAtAddress(deallocator->segManager, addr);
+ deallocator->mobj->freeAtAddress(deallocator->segMan, addr);
#ifdef DEBUG_GC
debugC(2, kDebugLevelGC, "[GC] Deallocating %04x:%04x\n", PRINT_REG(addr));
deallocator->segcount[deallocator->mobj->getType()]++;
@@ -179,7 +179,7 @@ void run_gc(EngineState *s) {
memset(&(deallocator.segcount), 0, sizeof(int) * (MEM_OBJ_MAX + 1));
#endif
- deallocator.segManager = sm;
+ deallocator.segMan = sm;
deallocator.use_map = find_all_used_references(s);
for (seg_nr = 1; seg_nr < sm->_heap.size(); seg_nr++) {
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 401cc92203..41622dbfbb 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -456,18 +456,18 @@ void Kernel::loadSelectorNames() {
}
// Allocates a set amount of memory for a specified use and returns a handle to it.
-reg_t kalloc(SegManager *segManager, const char *type, int space) {
+reg_t kalloc(SegManager *segMan, const char *type, int space) {
reg_t reg;
- segManager->alloc_hunk_entry(type, space, &reg);
+ segMan->alloc_hunk_entry(type, space, &reg);
debugC(2, kDebugLevelMemory, "Allocated %d at hunk %04x:%04x (%s)\n", space, PRINT_REG(reg), type);
return reg;
}
// Returns a pointer to the memory indicated by the specified handle
-byte *kmem(SegManager *segManager, reg_t handle) {
- HunkTable *ht = (HunkTable *)GET_SEGMENT(*segManager, handle.segment, MEM_OBJ_HUNK);
+byte *kmem(SegManager *segMan, reg_t handle) {
+ HunkTable *ht = (HunkTable *)GET_SEGMENT(*segMan, handle.segment, MEM_OBJ_HUNK);
if (!ht || !ht->isValidEntry(handle.offset)) {
warning("Error: kmem() with invalid handle");
@@ -478,8 +478,8 @@ byte *kmem(SegManager *segManager, reg_t handle) {
}
// Frees the specified handle. Returns 0 on success, 1 otherwise.
-int kfree(SegManager *segManager, reg_t handle) {
- segManager->free_hunk_entry(handle);
+int kfree(SegManager *segMan, reg_t handle) {
+ segMan->free_hunk_entry(handle);
return 0;
}
@@ -620,7 +620,7 @@ void Kernel::mapFunctions() {
return;
}
-int determine_reg_type(SegManager *segManager, reg_t reg, bool allow_invalid) {
+int determine_reg_type(SegManager *segMan, reg_t reg, bool allow_invalid) {
MemObject *mobj;
int type = 0;
@@ -632,12 +632,12 @@ int determine_reg_type(SegManager *segManager, reg_t reg, bool allow_invalid) {
return type;
}
- if ((reg.segment >= segManager->_heap.size()) || !segManager->_heap[reg.segment])
+ if ((reg.segment >= segMan->_heap.size()) || !segMan->_heap[reg.segment])
return 0; // Invalid
- mobj = segManager->_heap[reg.segment];
+ mobj = segMan->_heap[reg.segment];
- SciVersion version = segManager->sciVersion(); // for the offset defines
+ SciVersion version = segMan->sciVersion(); // for the offset defines
switch (mobj->getType()) {
case MEM_OBJ_SCRIPT:
@@ -685,14 +685,14 @@ const char *kernel_argtype_description(int type) {
return argtype_description[sci_ffs(type)];
}
-bool kernel_matches_signature(SegManager *segManager, const char *sig, int argc, const reg_t *argv) {
+bool kernel_matches_signature(SegManager *segMan, const char *sig, int argc, const reg_t *argv) {
// Always "match" if no signature is given
if (!sig)
return true;
while (*sig && argc) {
if ((*sig & KSIG_ANY) != KSIG_ANY) {
- int type = determine_reg_type(segManager, *argv, *sig & KSIG_ALLOW_INV);
+ int type = determine_reg_type(segMan, *argv, *sig & KSIG_ALLOW_INV);
if (!type) {
warning("[KERN] Could not determine type of ref %04x:%04x; failing signature check", PRINT_REG(*argv));
@@ -721,9 +721,9 @@ bool kernel_matches_signature(SegManager *segManager, const char *sig, int argc,
return (*sig == 0 || (*sig & KSIG_ELLIPSIS));
}
-static void *_kernel_dereference_pointer(SegManager *segManager, reg_t pointer, int entries, int align) {
+static void *_kernel_dereference_pointer(SegManager *segMan, reg_t pointer, int entries, int align) {
int maxsize;
- void *retval = segManager->dereference(pointer, &maxsize);
+ void *retval = segMan->dereference(pointer, &maxsize);
if (!retval)
return NULL;
@@ -741,12 +741,12 @@ static void *_kernel_dereference_pointer(SegManager *segManager, reg_t pointer,
}
-byte *kernelDerefBulkPtr(SegManager *segManager, reg_t pointer, int entries) {
- return (byte*)_kernel_dereference_pointer(segManager, pointer, entries, 1);
+byte *kernelDerefBulkPtr(SegManager *segMan, reg_t pointer, int entries) {
+ return (byte*)_kernel_dereference_pointer(segMan, pointer, entries, 1);
}
-reg_t *kernelDerefRegPtr(SegManager *segManager, reg_t pointer, int entries) {
- return (reg_t*)_kernel_dereference_pointer(segManager, pointer, entries, sizeof(reg_t));
+reg_t *kernelDerefRegPtr(SegManager *segMan, reg_t pointer, int entries) {
+ return (reg_t*)_kernel_dereference_pointer(segMan, pointer, entries, sizeof(reg_t));
}
void Kernel::setDefaultKernelNames() {
diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h
index 4844f01a76..9c0160befd 100644
--- a/engines/sci/engine/kernel.h
+++ b/engines/sci/engine/kernel.h
@@ -172,7 +172,7 @@ enum SelectorInvocation {
kContinueOnInvalidSelector = 1
};
-#define GET_SEL32(_o_, _slc_) read_selector(segManager, _o_, ((SciEngine*)g_engine)->getKernel()->_selectorMap._slc_, __FILE__, __LINE__)
+#define GET_SEL32(_o_, _slc_) read_selector(segMan, _o_, ((SciEngine*)g_engine)->getKernel()->_selectorMap._slc_, __FILE__, __LINE__)
#define GET_SEL32V(_o_, _slc_) (GET_SEL32(_o_, _slc_).offset)
/* Retrieves a selector from an object
** Parameters: (reg_t) object: The address of the object which the selector should be read from
@@ -182,8 +182,8 @@ enum SelectorInvocation {
** selector_map_t and mapped in script.c.
*/
-#define PUT_SEL32(_o_, _slc_, _val_) write_selector(segManager, _o_, ((SciEngine*)g_engine)->getKernel()->_selectorMap._slc_, _val_, __FILE__, __LINE__)
-#define PUT_SEL32V(_o_, _slc_, _val_) write_selector(segManager, _o_, ((SciEngine*)g_engine)->getKernel()->_selectorMap._slc_, make_reg(0, _val_), __FILE__, __LINE__)
+#define PUT_SEL32(_o_, _slc_, _val_) write_selector(segMan, _o_, ((SciEngine*)g_engine)->getKernel()->_selectorMap._slc_, _val_, __FILE__, __LINE__)
+#define PUT_SEL32V(_o_, _slc_, _val_) write_selector(segMan, _o_, ((SciEngine*)g_engine)->getKernel()->_selectorMap._slc_, make_reg(0, _val_), __FILE__, __LINE__)
/* Writes a selector value to an object
** Parameters: (reg_t) object: The address of the object which the selector should be written to
** (selector_name) selector: The selector to read
@@ -203,8 +203,8 @@ enum { WAS_FUNCT_NR = -1 };
*/
-reg_t read_selector(SegManager *segManager, reg_t object, Selector selector_id, const char *fname, int line);
-void write_selector(SegManager *segManager, reg_t object, Selector selector_id, reg_t value, const char *fname, int line);
+reg_t read_selector(SegManager *segMan, reg_t object, Selector selector_id, const char *fname, int line);
+void write_selector(SegManager *segMan, reg_t object, Selector selector_id, reg_t value, const char *fname, int line);
int invoke_selector(EngineState *s, reg_t object, int selector_id, SelectorInvocation noinvalid, int kfunct,
StackPtr k_argp, int k_argc, const char *fname, int line, int argc, ...);
@@ -232,7 +232,7 @@ char *kernel_lookup_text(EngineState *s, reg_t address, int index);
* @parm obj The address to check
* @return True if it is an object, false otherwise
*/
-bool is_object(SegManager *segManager, reg_t obj);
+bool is_object(SegManager *segMan, reg_t obj);
/******************** Kernel function parameter macros ********************/
@@ -246,8 +246,8 @@ bool is_object(SegManager *segManager, reg_t obj);
* if not enugh entries were available.
* reg_t dereferenciation also assures alignedness of data.
*/
-reg_t *kernelDerefRegPtr(SegManager *segManager, reg_t pointer, int entries);
-byte *kernelDerefBulkPtr(SegManager *segManager, reg_t pointer, int entries);
+reg_t *kernelDerefRegPtr(SegManager *segMan, reg_t pointer, int entries);
+byte *kernelDerefBulkPtr(SegManager *segMan, reg_t pointer, int entries);
#define kernelDerefCharPtr(state, pointer, entries) ((char*)kernelDerefBulkPtr(state, pointer, entries))
#define kernelDerefString(state, pointer) ((char*)kernelDerefBulkPtr(state, pointer, 0))
diff --git a/engines/sci/engine/kernel_types.h b/engines/sci/engine/kernel_types.h
index bec57f5174..609ded11ca 100644
--- a/engines/sci/engine/kernel_types.h
+++ b/engines/sci/engine/kernel_types.h
@@ -75,18 +75,18 @@ namespace Sci {
* @param argv argument list
* @return true if the signature was matched, false otherwise
*/
-bool kernel_matches_signature(SegManager *segManager, const char *sig, int argc, const reg_t *argv);
+bool kernel_matches_signature(SegManager *segMan, const char *sig, int argc, const reg_t *argv);
/**
* Determines the type of the object indicated by reg.
- * @param segManager the Segment manager
+ * @param segMan the Segment manager
* @param reg register to check
* @param allow_invalid determines whether invalid pointer (=offset) values are allowed
* @return one of KSIG_* below KSIG_NULL.
* KSIG_INVALID set if the type of reg can be determined, but is invalid.
* 0 on error.
*/
-int determine_reg_type(SegManager *segManager, reg_t reg, bool allow_invalid);
+int determine_reg_type(SegManager *segMan, reg_t reg, bool allow_invalid);
/**
* Returns a textual description of the type of an object.
diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp
index 7bb9fdfa8c..dc8ee6d296 100644
--- a/engines/sci/engine/kevent.cpp
+++ b/engines/sci/engine/kevent.cpp
@@ -41,7 +41,7 @@ reg_t kGetEvent(EngineState *s, int, int argc, reg_t *argv) {
sci_event_t e;
int oldx, oldy;
int modifier_mask = s->resMan->sciVersion() <= SCI_VERSION_01 ? SCI_EVM_ALL : SCI_EVM_NO_FOOLOCK;
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
// If there's a simkey pending, and the game wants a keyboard event, use the
// simkey instead of a normal event
@@ -153,7 +153,7 @@ reg_t kGetEvent(EngineState *s, int, int argc, reg_t *argv) {
reg_t kMapKeyToDir(EngineState *s, int, int argc, reg_t *argv) {
reg_t obj = argv[0];
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
if (GET_SEL32V(obj, type) == SCI_EVT_KEYBOARD) { // Keyboard
int mover = -1;
@@ -203,7 +203,7 @@ reg_t kMapKeyToDir(EngineState *s, int, int argc, reg_t *argv) {
reg_t kGlobalToLocal(EngineState *s, int, int argc, reg_t *argv) {
reg_t obj = argc ? argv[0] : NULL_REG; // Can this really happen? Lars
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
if (obj.segment) {
int x = GET_SEL32V(obj, x);
@@ -219,7 +219,7 @@ reg_t kGlobalToLocal(EngineState *s, int, int argc, reg_t *argv) {
reg_t kLocalToGlobal(EngineState *s, int, int argc, reg_t *argv) {
reg_t obj = argc ? argv[0] : NULL_REG; // Can this really happen? Lars
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
if (obj.segment) {
int x = GET_SEL32V(obj, x);
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 623789f296..1ef2fdf971 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -673,7 +673,7 @@ reg_t kPriCoord(EngineState *s, int, int argc, reg_t *argv) {
}
void _k_dirloop(reg_t obj, uint16 angle, EngineState *s, int argc, reg_t *argv) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
int view = GET_SEL32V(obj, view);
int signal = GET_SEL32V(obj, signal);
int loop;
@@ -728,7 +728,7 @@ reg_t kDirLoop(EngineState *s, int, int argc, reg_t *argv) {
static Common::Rect nsrect_clip(EngineState *s, int y, Common::Rect retval, int priority);
static int collides_with(EngineState *s, Common::Rect area, reg_t other_obj, int use_nsrect, int view_mask, int argc, reg_t *argv) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
int other_signal = GET_SEL32V(other_obj, signal);
int other_priority = GET_SEL32V(other_obj, priority);
int y = (int16)GET_SEL32V(other_obj, y);
@@ -768,7 +768,7 @@ static int collides_with(EngineState *s, Common::Rect area, reg_t other_obj, int
}
reg_t kCanBeHere(EngineState *s, int, int argc, reg_t *argv) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
reg_t obj = argv[0];
reg_t cliplist_ref = (argc > 1) ? argv[1] : NULL_REG;
List *cliplist = NULL;
@@ -917,7 +917,7 @@ reg_t kCelWide(EngineState *s, int, int argc, reg_t *argv) {
}
reg_t kNumLoops(EngineState *s, int, int argc, reg_t *argv) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
reg_t obj = argv[0];
int view = GET_SEL32V(obj, view);
int loops_nr = gfxop_lookup_view_get_loops(s->gfx_state, view);
@@ -933,7 +933,7 @@ reg_t kNumLoops(EngineState *s, int, int argc, reg_t *argv) {
}
reg_t kNumCels(EngineState *s, int, int argc, reg_t *argv) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
reg_t obj = argv[0];
int loop = GET_SEL32V(obj, loop);
int view = GET_SEL32V(obj, view);
@@ -1047,7 +1047,7 @@ reg_t kDrawPic(EngineState *s, int, int argc, reg_t *argv) {
}
Common::Rect set_base(EngineState *s, reg_t object) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
int x, y, original_y, z, ystep, xsize, ysize;
int xbase, ybase, xend, yend;
int view, loop, cel;
@@ -1106,7 +1106,7 @@ Common::Rect set_base(EngineState *s, reg_t object) {
}
void _k_base_setter(EngineState *s, reg_t object) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
Common::Rect absrect = set_base(s, object);
if (lookup_selector(s->segMan, object, ((SciEngine*)g_engine)->getKernel()->_selectorMap.brLeft, NULL, NULL) != kSelectorVariable)
@@ -1179,7 +1179,7 @@ static Common::Rect calculate_nsrect(EngineState *s, int x, int y, int view, int
}
Common::Rect get_nsrect(EngineState *s, reg_t object, byte clip) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
int x, y, z;
int view, loop, cel;
Common::Rect retval;
@@ -1209,7 +1209,7 @@ Common::Rect get_nsrect(EngineState *s, reg_t object, byte clip) {
}
static void _k_set_now_seen(EngineState *s, reg_t object) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
Common::Rect absrect = get_nsrect(s, object, 0);
if (lookup_selector(s->segMan, object, ((SciEngine*)g_engine)->getKernel()->_selectorMap.nsTop, NULL, NULL) != kSelectorVariable) {
@@ -1306,7 +1306,7 @@ reg_t kPalVary(EngineState *s, int, int argc, reg_t *argv) {
static void _k_draw_control(EngineState *s, reg_t obj, int inverse);
static void _k_disable_delete_for_now(EngineState *s, reg_t obj) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
reg_t text_pos = GET_SEL32(obj, text);
char *text = text_pos.isNull() ? NULL : (char *)s->segMan->dereference(text_pos, NULL);
int type = GET_SEL32V(obj, type);
@@ -1377,7 +1377,7 @@ void update_cursor_limits(int *display_offset, int *cursor, int max_displayed) {
}
reg_t kEditControl(EngineState *s, int, int argc, reg_t *argv) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
reg_t obj = argv[0];
reg_t event = argv[1];
@@ -1552,7 +1552,7 @@ reg_t kEditControl(EngineState *s, int, int argc, reg_t *argv) {
}
static void _k_draw_control(EngineState *s, reg_t obj, int inverse) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
int x = (int16)GET_SEL32V(obj, nsLeft);
int y = (int16)GET_SEL32V(obj, nsTop);
int xl = (int16)GET_SEL32V(obj, nsRight) - x;
@@ -1694,7 +1694,7 @@ static void draw_obj_to_control_map(EngineState *s, GfxDynView *view) {
}
static void _k_view_list_do_postdraw(EngineState *s, GfxList *list) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
GfxDynView *widget = (GfxDynView *) list->_contents;
while (widget) {
@@ -1771,7 +1771,7 @@ int _k_view_list_dispose_loop(EngineState *s, List *list, GfxDynView *widget, in
// returns non-zero IFF views were dropped
int signal;
int dropped = 0;
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
_k_animate_ran = false;
@@ -1784,7 +1784,7 @@ int _k_view_list_dispose_loop(EngineState *s, List *list, GfxDynView *widget, in
return -1;
if (GFXW_IS_DYN_VIEW(widget) && (widget->_ID != GFXW_NO_ID)) {
- signal = widget->signalp.getPointer(segManager)->offset;
+ signal = widget->signalp.getPointer(segMan)->offset;
if (signal & _K_VIEW_SIG_FLAG_DISPOSE_ME) {
reg_t obj = make_reg(widget->_ID, widget->_subID);
reg_t under_bits = NULL_REG;
@@ -1793,7 +1793,7 @@ int _k_view_list_dispose_loop(EngineState *s, List *list, GfxDynView *widget, in
error("Non-object %04x:%04x present in view list during delete time", PRINT_REG(obj));
obj = NULL_REG;
} else {
- reg_t *ubp = widget->under_bitsp.getPointer(segManager);
+ reg_t *ubp = widget->under_bitsp.getPointer(segMan);
if (ubp) { // Is there a bg picture left to clean?
reg_t mem_handle = *ubp;
@@ -1807,7 +1807,7 @@ int _k_view_list_dispose_loop(EngineState *s, List *list, GfxDynView *widget, in
}
}
}
- if (is_object(segManager, obj)) {
+ if (is_object(segMan, obj)) {
if (invoke_selector(INV_SEL(obj, delete_, kContinueOnInvalidSelector), 0))
warning("Object at %04x:%04x requested deletion, but does not have a delete funcselector", PRINT_REG(obj));
if (_k_animate_ran) {
@@ -1815,7 +1815,7 @@ int _k_view_list_dispose_loop(EngineState *s, List *list, GfxDynView *widget, in
return dropped;
}
- reg_t *ubp = widget->under_bitsp.getPointer(segManager);
+ reg_t *ubp = widget->under_bitsp.getPointer(segMan);
if (ubp)
under_bits = *ubp;
@@ -1860,7 +1860,7 @@ enum {
};
static GfxDynView *_k_make_dynview_obj(EngineState *s, reg_t obj, int options, int nr, int argc, reg_t *argv) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
short oldloop, oldcel;
int cel, loop, view_nr = (int16)GET_SEL32V(obj, view);
int palette;
@@ -1942,7 +1942,7 @@ static void _k_make_view_list(EngineState *s, GfxList **widget_list, List *list,
** number of list entries in *list_nr. Calls doit for each entry if cycle is set.
** argc, argv should be the same as in the calling kernel function.
*/
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
Node *node;
int sequence_nr = 0;
GfxDynView *widget;
@@ -2004,7 +2004,7 @@ static void _k_make_view_list(EngineState *s, GfxList **widget_list, List *list,
}
static void _k_prepare_view_list(EngineState *s, GfxList *list, int options) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
GfxDynView *view = (GfxDynView *) list->_contents;
while (view) {
reg_t obj = make_reg(view->_ID, view->_subID);
diff --git a/engines/sci/engine/klists.cpp b/engines/sci/engine/klists.cpp
index 810eb3afc2..7f5919c8bc 100644
--- a/engines/sci/engine/klists.cpp
+++ b/engines/sci/engine/klists.cpp
@@ -425,7 +425,7 @@ int sort_temp_cmp(const void *p1, const void *p2) {
}
reg_t kSort(EngineState *s, int, int argc, reg_t *argv) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
reg_t source = argv[0];
reg_t dest = argv[1];
reg_t order_func = argv[2];
diff --git a/engines/sci/engine/kmenu.cpp b/engines/sci/engine/kmenu.cpp
index 99c5ded1da..45265dd74a 100644
--- a/engines/sci/engine/kmenu.cpp
+++ b/engines/sci/engine/kmenu.cpp
@@ -124,7 +124,7 @@ static int _menu_go_down(Menubar *menubar, int menu_nr, int item_nr) {
reg_t kMenuSelect(EngineState *s, int, int argc, reg_t *argv) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
reg_t event = argv[0];
/*int pause_sound = (argc > 1) ? argv[1].toUint16() : 1;*/ /* FIXME: Do this eventually */
bool claimed = false;
diff --git a/engines/sci/engine/kmovement.cpp b/engines/sci/engine/kmovement.cpp
index a2a470b30f..3dbc72fab7 100644
--- a/engines/sci/engine/kmovement.cpp
+++ b/engines/sci/engine/kmovement.cpp
@@ -68,7 +68,7 @@ Still, what we compute in the end is of course not a real velocity anymore, but
used in an iterative stepping algorithm
*/
reg_t kSetJump(EngineState *s, int, int argc, reg_t *argv) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
// Input data
reg_t object = argv[0];
int dx = argv[1].toSint16();
@@ -165,7 +165,7 @@ reg_t kSetJump(EngineState *s, int, int argc, reg_t *argv) {
#define _K_BRESEN_AXIS_X 0
#define _K_BRESEN_AXIS_Y 1
-static void initialize_bresen(SegManager *segManager, int argc, reg_t *argv, reg_t mover, int step_factor, int deltax, int deltay) {
+static void initialize_bresen(SegManager *segMan, int argc, reg_t *argv, reg_t mover, int step_factor, int deltax, int deltay) {
reg_t client = GET_SEL32(mover, client);
int stepx = (int16)GET_SEL32V(client, xStep) * step_factor;
int stepy = (int16)GET_SEL32V(client, yStep) * step_factor;
@@ -219,7 +219,7 @@ static void initialize_bresen(SegManager *segManager, int argc, reg_t *argv, reg
}
reg_t kInitBresen(EngineState *s, int, int argc, reg_t *argv) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
reg_t mover = argv[0];
reg_t client = GET_SEL32(mover, client);
@@ -285,7 +285,7 @@ static void bresenham_autodetect(EngineState *s) {
}
reg_t kDoBresen(EngineState *s, int, int argc, reg_t *argv) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
reg_t mover = argv[0];
reg_t client = GET_SEL32(mover, client);
@@ -395,7 +395,7 @@ int is_heap_object(EngineState *s, reg_t pos);
extern int get_angle(int xrel, int yrel);
reg_t kDoAvoider(EngineState *s, int, int argc, reg_t *argv) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
reg_t avoider = argv[0];
reg_t client, looper, mover;
int angle;
diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp
index 8ec18c2893..6e6ec27eaf 100644
--- a/engines/sci/engine/kpathing.cpp
+++ b/engines/sci/engine/kpathing.cpp
@@ -284,7 +284,7 @@ static Common::Point read_point(const byte *list, int is_reg_t, int offset) {
/**
* Checks whether two polygons are equal
*/
-static bool polygons_equal(SegManager *segManager, reg_t p1, reg_t p2) {
+static bool polygons_equal(SegManager *segMan, reg_t p1, reg_t p2) {
// Check for same type
if (GET_SEL32(p1, type).toUint16() != GET_SEL32(p2, type).toUint16())
return false;
@@ -295,8 +295,8 @@ static bool polygons_equal(SegManager *segManager, reg_t p1, reg_t p2) {
if (size != GET_SEL32(p2, size).toUint16())
return false;
- const byte *p1_points = kernelDerefBulkPtr(segManager, GET_SEL32(p1, points), size * POLY_POINT_SIZE);
- const byte *p2_points = kernelDerefBulkPtr(segManager, GET_SEL32(p2, points), size * POLY_POINT_SIZE);
+ const byte *p1_points = kernelDerefBulkPtr(segMan, GET_SEL32(p1, points), size * POLY_POINT_SIZE);
+ const byte *p2_points = kernelDerefBulkPtr(segMan, GET_SEL32(p2, points), size * POLY_POINT_SIZE);
bool p1_is_reg_t = polygon_is_reg_t(p1_points, size);
bool p2_is_reg_t = polygon_is_reg_t(p2_points, size);
@@ -401,12 +401,12 @@ static void draw_input(EngineState *s, reg_t poly_list, Common::Point start, Com
#endif // DEBUG_AVOIDPATH
-static void print_polygon(SegManager *segManager, reg_t polygon) {
+static void print_polygon(SegManager *segMan, reg_t polygon) {
reg_t points = GET_SEL32(polygon, points);
int size = GET_SEL32(polygon, size).toUint16();
int type = GET_SEL32(polygon, type).toUint16();
int i;
- const byte *point_array = kernelDerefBulkPtr(segManager, points, size * POLY_POINT_SIZE);
+ const byte *point_array = kernelDerefBulkPtr(segMan, points, size * POLY_POINT_SIZE);
int is_reg_t = polygon_is_reg_t(point_array, size);
Common::Point point;
@@ -1226,7 +1226,7 @@ static Polygon *convert_polygon(EngineState *s, reg_t polygon) {
// Parameters: (EngineState *) s: The game state
// (reg_t) polygon: The SCI polygon to convert
// Returns : (Polygon *) The converted polygon
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
int i;
reg_t points = GET_SEL32(polygon, points);
int size = GET_SEL32(polygon, size).toUint16();
@@ -1363,7 +1363,7 @@ static PathfindingState *convert_polygon_set(EngineState *s, reg_t poly_list, Co
// (int) opt: Optimization level (0, 1 or 2)
// Returns : (PathfindingState *) On success a newly allocated pathfinding state,
// NULL otherwise
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
Polygon *polygon;
int err;
int count = 0;
diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp
index 3b0df6874f..551e7cd535 100644
--- a/engines/sci/engine/kscripts.cpp
+++ b/engines/sci/engine/kscripts.cpp
@@ -31,16 +31,16 @@
namespace Sci {
-reg_t read_selector(SegManager *segManager, reg_t object, Selector selector_id, const char *file, int line) {
+reg_t read_selector(SegManager *segMan, reg_t object, Selector selector_id, const char *file, int line) {
ObjVarRef address;
- if (lookup_selector(segManager, object, selector_id, &address, NULL) != kSelectorVariable)
+ if (lookup_selector(segMan, object, selector_id, &address, NULL) != kSelectorVariable)
return NULL_REG;
else
- return *address.getPointer(segManager);
+ return *address.getPointer(segMan);
}
-void write_selector(SegManager *segManager, reg_t object, Selector selector_id, reg_t value, const char *fname, int line) {
+void write_selector(SegManager *segMan, reg_t object, Selector selector_id, reg_t value, const char *fname, int line) {
ObjVarRef address;
if ((selector_id < 0) || (selector_id > (int)((SciEngine*)g_engine)->getKernel()->getSelectorNamesSize())) {
@@ -49,11 +49,11 @@ void write_selector(SegManager *segManager, reg_t object, Selector selector_id,
return;
}
- if (lookup_selector(segManager, object, selector_id, &address, NULL) != kSelectorVariable)
+ if (lookup_selector(segMan, object, selector_id, &address, NULL) != kSelectorVariable)
warning("Selector '%s' of object at %04x:%04x could not be"
" written to (%s L%d)", ((SciEngine*)g_engine)->getKernel()->getSelectorName(selector_id).c_str(), PRINT_REG(object), fname, line);
else
- *address.getPointer(segManager) = value;
+ *address.getPointer(segMan) = value;
}
int invoke_selector(EngineState *s, reg_t object, int selector_id, SelectorInvocation noinvalid, int kfunct,
@@ -107,8 +107,8 @@ int invoke_selector(EngineState *s, reg_t object, int selector_id, SelectorInvoc
return 0;
}
-bool is_object(SegManager *segManager, reg_t object) {
- return obj_get(segManager, object) != NULL;
+bool is_object(SegManager *segMan, reg_t object) {
+ return obj_get(segMan, object) != NULL;
}
// Loads arbitrary resources of type 'restype' with resource numbers 'resnrs'
@@ -221,7 +221,7 @@ reg_t kClone(EngineState *s, int, int argc, reg_t *argv) {
extern void _k_view_list_mark_free(EngineState *s, reg_t off);
reg_t kDisposeClone(EngineState *s, int, int argc, reg_t *argv) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
reg_t victim_addr = argv[0];
Clone *victim_obj = obj_get(s->segMan, victim_addr);
uint16 underBits;
@@ -265,16 +265,16 @@ reg_t kScriptID(EngineState *s, int, int argc, reg_t *argv) {
int script = argv[0].toUint16();
int index = (argc > 1) ? argv[1].toUint16() : 0;
- SegmentId scriptid = s->segMan->getSegment(script, SCRIPT_GET_LOAD);
- Script *scr;
-
if (argv[0].segment)
return argv[0];
- if (!scriptid)
+ SegmentId scriptSeg = s->segMan->getSegment(script, SCRIPT_GET_LOAD);
+ Script *scr;
+
+ if (!scriptSeg)
return NULL_REG;
- scr = s->segMan->getScript(scriptid);
+ scr = s->segMan->getScript(scriptSeg);
if (!scr->exports_nr) {
// FIXME: Is this fatal? This occurs in SQ4CD
@@ -287,7 +287,7 @@ reg_t kScriptID(EngineState *s, int, int argc, reg_t *argv) {
return NULL_REG;
}
- return make_reg(scriptid, s->segMan->validateExportFunc(index, scriptid));
+ return make_reg(scriptSeg, s->segMan->validateExportFunc(index, scriptSeg));
}
reg_t kDisposeScript(EngineState *s, int, int argc, reg_t *argv) {
diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp
index 50aa7c8d7d..d235aea660 100644
--- a/engines/sci/engine/ksound.cpp
+++ b/engines/sci/engine/ksound.cpp
@@ -122,7 +122,7 @@ enum AudioSyncCommands {
static void script_set_priority(EngineState *s, reg_t obj, int priority) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
int song_nr = GET_SEL32V(obj, number);
Resource *song = s->resMan->findResource(ResourceId(kResourceTypeSound, song_nr), 0);
int flags = GET_SEL32V(obj, flags);
@@ -157,7 +157,7 @@ void process_sound_events(EngineState *s) { /* Get all sound events, apply their
int result;
SongHandle handle;
int cue;
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
if (s->resMan->sciVersion() > SCI_VERSION_01)
return;
@@ -207,7 +207,7 @@ void process_sound_events(EngineState *s) { /* Get all sound events, apply their
static reg_t kDoSoundSci0(EngineState *s, int argc, reg_t *argv) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
reg_t obj = (argc > 1) ? argv[1] : NULL_REG;
uint16 command = argv[0].toUint16();
SongHandle handle = FROBNICATE_HANDLE(obj);
@@ -387,7 +387,7 @@ static reg_t kDoSoundSci0(EngineState *s, int argc, reg_t *argv) {
static reg_t kDoSoundSci1Early(EngineState *s, int argc, reg_t *argv) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
uint16 command = argv[0].toUint16();
reg_t obj = (argc > 1) ? argv[1] : NULL_REG;
SongHandle handle = FROBNICATE_HANDLE(obj);
@@ -679,7 +679,7 @@ static reg_t kDoSoundSci1Early(EngineState *s, int argc, reg_t *argv) {
}
static reg_t kDoSoundSci1Late(EngineState *s, int argc, reg_t *argv) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
uint16 command = argv[0].toUint16();
reg_t obj = (argc > 1) ? argv[1] : NULL_REG;
SongHandle handle = FROBNICATE_HANDLE(obj);
@@ -1069,7 +1069,7 @@ reg_t kDoAudio(EngineState *s, int, int argc, reg_t *argv) {
}
reg_t kDoSync(EngineState *s, int, int argc, reg_t *argv) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
switch (argv[0].toUint16()) {
case kSciAudioSyncStart: {
ResourceId id;
diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp
index 3016012e35..3c18a14ea8 100644
--- a/engines/sci/engine/kstring.cpp
+++ b/engines/sci/engine/kstring.cpp
@@ -79,7 +79,7 @@ char *kernel_lookup_text(EngineState *s, reg_t address, int index) {
reg_t kSaid(EngineState *s, int, int argc, reg_t *argv) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
reg_t heap_said_block = argv[0];
byte *said_block;
int new_lastmatch;
@@ -129,7 +129,7 @@ reg_t kSaid(EngineState *s, int, int argc, reg_t *argv) {
reg_t kSetSynonyms(EngineState *s, int, int argc, reg_t *argv) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
reg_t object = argv[0];
List *list;
Node *node;
@@ -187,7 +187,7 @@ reg_t kSetSynonyms(EngineState *s, int, int argc, reg_t *argv) {
reg_t kParse(EngineState *s, int, int argc, reg_t *argv) {
- SegManager *segManager = s->segMan;
+ SegManager *segMan = s->segMan;
reg_t stringpos = argv[0];
char *string = kernelDerefString(s->segMan, stringpos);
char *error;
diff --git a/engines/sci/engine/memobj.cpp b/engines/sci/engine/memobj.cpp
index 7b28bde663..5f31546b91 100644
--- a/engines/sci/engine/memobj.cpp
+++ b/engines/sci/engine/memobj.cpp
@@ -224,12 +224,12 @@ byte *SystemStrings::dereference(reg_t pointer, int *size) {
//-------------------- script --------------------
-reg_t Script::findCanonicAddress(SegManager *segManager, reg_t addr) {
+reg_t Script::findCanonicAddress(SegManager *segMan, reg_t addr) {
addr.offset = 0;
return addr;
}
-void Script::freeAtAddress(SegManager *segManager, reg_t addr) {
+void Script::freeAtAddress(SegManager *segMan, reg_t addr) {
/*
debugC(2, kDebugLevelGC, "[GC] Freeing script %04x:%04x\n", PRINT_REG(addr));
if (locals_segment)
@@ -237,7 +237,7 @@ void Script::freeAtAddress(SegManager *segManager, reg_t addr) {
*/
if (_markedAsDeleted)
- segManager->deallocateScript(nr);
+ segMan->deallocateScript(nr);
}
void Script::listAllDeallocatable(SegmentId segId, void *param, NoteCallback note) {
@@ -292,7 +292,7 @@ void CloneTable::listAllOutgoingReferences(reg_t addr, void *param, NoteCallback
//debugC(2, kDebugLevelGC, "[GC] Reporting clone-pos %04x:%04x\n", PRINT_REG(clone->pos));
}
-void CloneTable::freeAtAddress(SegManager *segManager, reg_t addr) {
+void CloneTable::freeAtAddress(SegManager *segMan, reg_t addr) {
CloneTable *clone_table = this;
Object *victim_obj;
@@ -317,9 +317,9 @@ void CloneTable::freeAtAddress(SegManager *segManager, reg_t addr) {
//-------------------- locals --------------------
-reg_t LocalVariables::findCanonicAddress(SegManager *segManager, reg_t addr) {
+reg_t LocalVariables::findCanonicAddress(SegManager *segMan, reg_t addr) {
// Reference the owning script
- SegmentId owner_seg = segManager->segGet(script_id);
+ SegmentId owner_seg = segMan->segGet(script_id);
assert(owner_seg >= 0);
@@ -335,7 +335,7 @@ void LocalVariables::listAllOutgoingReferences(reg_t addr, void *param, NoteCall
//-------------------- stack --------------------
-reg_t DataStack::findCanonicAddress(SegManager *segManager, reg_t addr) {
+reg_t DataStack::findCanonicAddress(SegManager *segMan, reg_t addr) {
addr.offset = 0;
return addr;
}
@@ -349,7 +349,7 @@ void DataStack::listAllOutgoingReferences(reg_t addr, void *param, NoteCallback
//-------------------- lists --------------------
-void ListTable::freeAtAddress(SegManager *segManager, reg_t sub_addr) {
+void ListTable::freeAtAddress(SegManager *segMan, reg_t sub_addr) {
freeEntry(sub_addr.offset);
}
@@ -369,7 +369,7 @@ void ListTable::listAllOutgoingReferences(reg_t addr, void *param, NoteCallback
//-------------------- nodes --------------------
-void NodeTable::freeAtAddress(SegManager *segManager, reg_t sub_addr) {
+void NodeTable::freeAtAddress(SegManager *segMan, reg_t sub_addr) {
freeEntry(sub_addr.offset);
}
@@ -393,7 +393,7 @@ void NodeTable::listAllOutgoingReferences(reg_t addr, void *param, NoteCallback
//-------------------- dynamic memory --------------------
-reg_t DynMem::findCanonicAddress(SegManager *segManager, reg_t addr) {
+reg_t DynMem::findCanonicAddress(SegManager *segMan, reg_t addr) {
addr.offset = 0;
return addr;
}
diff --git a/engines/sci/engine/memobj.h b/engines/sci/engine/memobj.h
index 7f03a648ac..1301fff308 100644
--- a/engines/sci/engine/memobj.h
+++ b/engines/sci/engine/memobj.h
@@ -87,13 +87,13 @@ public:
*
* @param sub_addr base address whose canonic address is to be found
*/
- virtual reg_t findCanonicAddress(SegManager *segManager, reg_t sub_addr) { return sub_addr; }
+ virtual reg_t findCanonicAddress(SegManager *segMan, reg_t sub_addr) { return sub_addr; }
/**
* Deallocates all memory associated with the specified address.
* @param sub_addr address (within the given segment) to deallocate
*/
- virtual void freeAtAddress(SegManager *segManager, reg_t sub_addr) {}
+ virtual void freeAtAddress(SegManager *segMan, reg_t sub_addr) {}
/**
* Iterates over and reports all addresses within the current segment.
@@ -191,7 +191,7 @@ public:
virtual bool isValidOffset(uint16 offset) const;
virtual byte *dereference(reg_t pointer, int *size);
- virtual reg_t findCanonicAddress(SegManager *segManager, reg_t sub_addr);
+ virtual reg_t findCanonicAddress(SegManager *segMan, reg_t sub_addr);
virtual void listAllOutgoingReferences(reg_t object, void *param, NoteCallback note, SciVersion version);
virtual void saveLoadWithSerializer(Common::Serializer &ser);
@@ -301,8 +301,8 @@ public:
virtual bool isValidOffset(uint16 offset) const;
virtual byte *dereference(reg_t pointer, int *size);
- virtual reg_t findCanonicAddress(SegManager *segManager, reg_t sub_addr);
- virtual void freeAtAddress(SegManager *segManager, reg_t sub_addr);
+ virtual reg_t findCanonicAddress(SegManager *segMan, reg_t sub_addr);
+ virtual void freeAtAddress(SegManager *segMan, reg_t sub_addr);
virtual void listAllDeallocatable(SegmentId segId, void *param, NoteCallback note);
virtual void listAllOutgoingReferences(reg_t object, void *param, NoteCallback note, SciVersion version);
@@ -416,7 +416,7 @@ public:
virtual bool isValidOffset(uint16 offset) const;
virtual byte *dereference(reg_t pointer, int *size);
- virtual reg_t findCanonicAddress(SegManager *segManager, reg_t sub_addr);
+ virtual reg_t findCanonicAddress(SegManager *segMan, reg_t sub_addr);
virtual void listAllOutgoingReferences(reg_t object, void *param, NoteCallback note, SciVersion version);
virtual void saveLoadWithSerializer(Common::Serializer &ser);
@@ -513,7 +513,7 @@ public:
/* CloneTable */
struct CloneTable : public Table<Clone> {
- virtual void freeAtAddress(SegManager *segManager, reg_t sub_addr);
+ virtual void freeAtAddress(SegManager *segMan, reg_t sub_addr);
virtual void listAllOutgoingReferences(reg_t object, void *param, NoteCallback note, SciVersion version);
virtual void saveLoadWithSerializer(Common::Serializer &ser);
@@ -522,7 +522,7 @@ struct CloneTable : public Table<Clone> {
/* NodeTable */
struct NodeTable : public Table<Node> {
- virtual void freeAtAddress(SegManager *segManager, reg_t sub_addr);
+ virtual void freeAtAddress(SegManager *segMan, reg_t sub_addr);
virtual void listAllOutgoingReferences(reg_t object, void *param, NoteCallback note, SciVersion version);
virtual void saveLoadWithSerializer(Common::Serializer &ser);
@@ -531,7 +531,7 @@ struct NodeTable : public Table<Node> {
/* ListTable */
struct ListTable : public Table<List> {
- virtual void freeAtAddress(SegManager *segManager, reg_t sub_addr);
+ virtual void freeAtAddress(SegManager *segMan, reg_t sub_addr);
virtual void listAllOutgoingReferences(reg_t object, void *param, NoteCallback note, SciVersion version);
virtual void saveLoadWithSerializer(Common::Serializer &ser);
@@ -567,7 +567,7 @@ public:
virtual bool isValidOffset(uint16 offset) const;
virtual byte *dereference(reg_t pointer, int *size);
- virtual reg_t findCanonicAddress(SegManager *segManager, reg_t sub_addr);
+ virtual reg_t findCanonicAddress(SegManager *segMan, reg_t sub_addr);
virtual void listAllDeallocatable(SegmentId segId, void *param, NoteCallback note);
virtual void saveLoadWithSerializer(Common::Serializer &ser);
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp
index 43c07f3419..ffad720c86 100644
--- a/engines/sci/engine/scriptdebug.cpp
+++ b/engines/sci/engine/scriptdebug.cpp
@@ -65,11 +65,11 @@ extern const char *selector_name(EngineState *s, int selector);
ScriptState scriptState;
-int propertyOffsetToId(SegManager *segManager, int prop_ofs, reg_t objp) {
- Object *obj = obj_get(segManager, objp);
+int propertyOffsetToId(SegManager *segMan, int prop_ofs, reg_t objp) {
+ Object *obj = obj_get(segMan, objp);
byte *selectoroffset;
int selectors;
- SciVersion version = segManager->sciVersion(); // for the selector defines
+ SciVersion version = segMan->sciVersion(); // for the selector defines
if (!obj) {
warning("Applied propertyOffsetToId on non-object at %04x:%04x", PRINT_REG(objp));
@@ -78,11 +78,11 @@ int propertyOffsetToId(SegManager *segManager, int prop_ofs, reg_t objp) {
selectors = obj->_variables.size();
- if (segManager->sciVersion() < SCI_VERSION_1_1)
+ if (segMan->sciVersion() < SCI_VERSION_1_1)
selectoroffset = ((byte *)(obj->base_obj)) + SCRIPT_SELECTOR_OFFSET + selectors * 2;
else {
if (!(obj->_variables[SCRIPT_INFO_SELECTOR].offset & SCRIPT_INFO_CLASS)) {
- obj = obj_get(segManager, obj->_variables[SCRIPT_SUPERCLASS_SELECTOR]);
+ obj = obj_get(segMan, obj->_variables[SCRIPT_SUPERCLASS_SELECTOR]);
selectoroffset = (byte *)obj->base_vars;
} else
selectoroffset = (byte *)obj->base_vars;
diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp
index 78ace4e6e7..4c513e9ee5 100644
--- a/engines/sci/engine/state.cpp
+++ b/engines/sci/engine/state.cpp
@@ -184,11 +184,9 @@ kLanguage EngineState::getLanguage() {
kLanguage lang = K_LANG_ENGLISH;
if (((SciEngine*)g_engine)->getKernel()->_selectorMap.printLang != -1) {
- SegManager *segManager = this->segMan;
-
lang = (kLanguage)GET_SEL32V(this->game_obj, printLang);
- if ((segManager->sciVersion() == SCI_VERSION_1_1) || (lang == K_LANG_NONE)) {
+ if ((segMan->sciVersion() == SCI_VERSION_1_1) || (lang == K_LANG_NONE)) {
// If language is set to none, we use the language from the game detector.
// SSCI reads this from resource.cfg (early games do not have a language
// setting in resource.cfg, but instead have the secondary language number
@@ -229,8 +227,6 @@ kLanguage EngineState::getLanguage() {
}
Common::String EngineState::strSplit(const char *str, const char *sep) {
- SegManager *segManager = this->segMan;
-
kLanguage lang = getLanguage();
kLanguage subLang = K_LANG_NONE;
@@ -251,7 +247,7 @@ int EngineState::methodChecksum(reg_t objAddress, Selector sel, int offset, uint
reg_t fptr;
Object *obj = obj_get(segMan, objAddress);
- SelectorType selType = lookup_selector(this->segMan, objAddress, sel, NULL, &fptr);
+ SelectorType selType = lookup_selector(segMan, objAddress, sel, NULL, &fptr);
if (!obj || (selType != kSelectorMethod))
return -1;
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index 0e9890473f..505fc52d77 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -1398,10 +1398,10 @@ void run_vm(EngineState *s, int restoring) {
}
}
-static int _obj_locate_varselector(SegManager *segManager, Object *obj, Selector slc) {
+static int _obj_locate_varselector(SegManager *segMan, Object *obj, Selector slc) {
// Determines if obj explicitly defines slc as a varselector
// Returns -1 if not found
- SciVersion version = segManager->sciVersion(); // for the selector defines
+ SciVersion version = segMan->sciVersion(); // for the selector defines
byte *buf;
uint varnum;
@@ -1411,7 +1411,7 @@ static int _obj_locate_varselector(SegManager *segManager, Object *obj, Selector
buf = obj->base_obj + selector_name_offset;
} else {
if (!(obj->_variables[SCRIPT_INFO_SELECTOR].offset & SCRIPT_INFO_CLASS))
- obj = obj_get(segManager, obj->_variables[SCRIPT_SUPERCLASS_SELECTOR]);
+ obj = obj_get(segMan, obj->_variables[SCRIPT_SUPERCLASS_SELECTOR]);
buf = (byte *)obj->base_vars;
varnum = obj->_variables[1].toUint16();
@@ -1438,9 +1438,9 @@ static int _class_locate_funcselector(Object *obj, Selector slc, SciVersion vers
return -1; // Failed
}
-static SelectorType _lookup_selector_function(SegManager *segManager, int seg_id, Object *obj, Selector selector_id, reg_t *fptr) {
+static SelectorType _lookup_selector_function(SegManager *segMan, int seg_id, Object *obj, Selector selector_id, reg_t *fptr) {
int index;
- SciVersion version = segManager->sciVersion(); // for the selector defines
+ SciVersion version = segMan->sciVersion(); // for the selector defines
// "recursive" lookup
@@ -1455,18 +1455,18 @@ static SelectorType _lookup_selector_function(SegManager *segManager, int seg_id
return kSelectorMethod;
} else {
seg_id = obj->_variables[SCRIPT_SUPERCLASS_SELECTOR].segment;
- obj = obj_get(segManager, obj->_variables[SCRIPT_SUPERCLASS_SELECTOR]);
+ obj = obj_get(segMan, obj->_variables[SCRIPT_SUPERCLASS_SELECTOR]);
}
}
return kSelectorNone;
}
-SelectorType lookup_selector(SegManager *segManager, reg_t obj_location, Selector selector_id, ObjVarRef *varp, reg_t *fptr) {
- Object *obj = obj_get(segManager, obj_location);
+SelectorType lookup_selector(SegManager *segMan, reg_t obj_location, Selector selector_id, ObjVarRef *varp, reg_t *fptr) {
+ Object *obj = obj_get(segMan, obj_location);
Object *species;
int index;
- SciVersion version = segManager->sciVersion(); // for the selector defines
+ SciVersion version = segMan->sciVersion(); // for the selector defines
bool oldScriptHeader = (version == SCI_VERSION_0_EARLY);
// Early SCI versions used the LSB in the selector ID as a read/write
@@ -1482,7 +1482,7 @@ SelectorType lookup_selector(SegManager *segManager, reg_t obj_location, Selecto
if (IS_CLASS(obj))
species = obj;
else
- species = obj_get(segManager, obj->_variables[SCRIPT_SPECIES_SELECTOR]);
+ species = obj_get(segMan, obj->_variables[SCRIPT_SPECIES_SELECTOR]);
if (!obj) {
@@ -1491,7 +1491,7 @@ SelectorType lookup_selector(SegManager *segManager, reg_t obj_location, Selecto
return kSelectorNone;
}
- index = _obj_locate_varselector(segManager, obj, selector_id);
+ index = _obj_locate_varselector(segMan, obj, selector_id);
if (index >= 0) {
// Found it as a variable
@@ -1502,17 +1502,17 @@ SelectorType lookup_selector(SegManager *segManager, reg_t obj_location, Selecto
return kSelectorVariable;
}
- return _lookup_selector_function(segManager, obj_location.segment, obj, selector_id, fptr);
+ return _lookup_selector_function(segMan, obj_location.segment, obj, selector_id, fptr);
}
-reg_t script_lookup_export(SegManager *segManager, int script_nr, int export_index) {
- SegmentId seg = segManager->getSegment(script_nr, SCRIPT_GET_DONT_LOAD);
- return make_reg(seg, segManager->validateExportFunc(export_index, seg));
+reg_t script_lookup_export(SegManager *segMan, int script_nr, int export_index) {
+ SegmentId seg = segMan->getSegment(script_nr, SCRIPT_GET_DONT_LOAD);
+ return make_reg(seg, segMan->validateExportFunc(export_index, seg));
}
-#define INST_LOOKUP_CLASS(id) ((id == 0xffff)? NULL_REG : segManager->get_class_address(id, SCRIPT_GET_LOCK, reg))
+#define INST_LOOKUP_CLASS(id) ((id == 0xffff)? NULL_REG : segMan->get_class_address(id, SCRIPT_GET_LOCK, reg))
-int script_instantiate_common(ResourceManager *resMan, SegManager *segManager, int script_nr, Resource **script, Resource **heap, int *was_new) {
+int script_instantiate_common(ResourceManager *resMan, SegManager *segMan, int script_nr, Resource **script, Resource **heap, int *was_new) {
int seg_id;
reg_t reg;
@@ -1533,8 +1533,8 @@ int script_instantiate_common(ResourceManager *resMan, SegManager *segManager, i
return 0;
}
- seg_id = segManager->segGet(script_nr);
- Script *scr = segManager->getScriptIfLoaded(seg_id);
+ seg_id = segMan->segGet(script_nr);
+ Script *scr = segMan->getScriptIfLoaded(seg_id);
if (scr) {
if (!scr->isMarkedAsDeleted()) {
scr->incrementLockers();
@@ -1543,14 +1543,14 @@ int script_instantiate_common(ResourceManager *resMan, SegManager *segManager, i
scr->freeScript();
}
} else {
- scr = segManager->allocateScript(script_nr, &seg_id);
+ scr = segMan->allocateScript(script_nr, &seg_id);
if (!scr) { // ALL YOUR SCRIPT BASE ARE BELONG TO US
error("Not enough heap space for script size 0x%x of script 0x%x (Should this happen?)", (*script)->size, script_nr);
return 0;
}
}
- segManager->initialiseScript(*scr, script_nr);
+ segMan->initialiseScript(*scr, script_nr);
reg.segment = seg_id;
reg.offset = 0;
@@ -1566,7 +1566,7 @@ int script_instantiate_common(ResourceManager *resMan, SegManager *segManager, i
return seg_id;
}
-int script_instantiate_sci0(ResourceManager *resMan, SegManager *segManager, int script_nr) {
+int script_instantiate_sci0(ResourceManager *resMan, SegManager *segMan, int script_nr) {
int objtype;
unsigned int objlength;
reg_t reg;
@@ -1578,7 +1578,7 @@ int script_instantiate_sci0(ResourceManager *resMan, SegManager *segManager, int
SciVersion version = resMan->sciVersion();
bool oldScriptHeader = (version == SCI_VERSION_0_EARLY);
- seg_id = script_instantiate_common(resMan, segManager, script_nr, &script, NULL, &was_new);
+ seg_id = script_instantiate_common(resMan, segMan, script_nr, &script, NULL, &was_new);
if (was_new)
return seg_id;
@@ -1586,7 +1586,7 @@ int script_instantiate_sci0(ResourceManager *resMan, SegManager *segManager, int
reg.segment = seg_id;
reg.offset = 0;
- Script *scr = segManager->getScript(seg_id);
+ Script *scr = segMan->getScript(seg_id);
if (oldScriptHeader) {
//
@@ -1601,7 +1601,7 @@ int script_instantiate_sci0(ResourceManager *resMan, SegManager *segManager, int
magic_pos_adder = 2; // Step over the funny prefix
if (locals_nr)
- segManager->scriptInitialiseLocalsZero(reg.segment, locals_nr);
+ segMan->scriptInitialiseLocalsZero(reg.segment, locals_nr);
} else {
scr->mcpyInOut(0, script->data, script->size);
@@ -1649,23 +1649,23 @@ int script_instantiate_sci0(ResourceManager *resMan, SegManager *segManager, int
break;
case SCI_OBJ_LOCALVARS:
- segManager->scriptInitialiseLocals(data_base);
+ segMan->scriptInitialiseLocals(data_base);
break;
case SCI_OBJ_CLASS: {
int classpos = addr.offset - SCRIPT_OBJECT_MAGIC_OFFSET;
int species;
species = scr->getHeap(addr.offset - SCRIPT_OBJECT_MAGIC_OFFSET + SCRIPT_SPECIES_OFFSET);
- if (species < 0 || species >= (int)segManager->_classtable.size()) {
+ if (species < 0 || species >= (int)segMan->_classtable.size()) {
warning("Invalid species %d(0x%x) not in interval "
"[0,%d) while instantiating script %d\n",
- species, species, segManager->_classtable.size(),
+ species, species, segMan->_classtable.size(),
script_nr);
return 0;
}
- segManager->_classtable[species].reg = addr;
- segManager->_classtable[species].reg.offset = classpos;
+ segMan->_classtable[species].reg = addr;
+ segMan->_classtable[species].reg.offset = classpos;
// Set technical class position-- into the block allocated for it
}
break;
@@ -1694,17 +1694,17 @@ int script_instantiate_sci0(ResourceManager *resMan, SegManager *segManager, int
switch (objtype) {
case SCI_OBJ_CODE:
- segManager->scriptAddCodeBlock(addr);
+ segMan->scriptAddCodeBlock(addr);
break;
case SCI_OBJ_OBJECT:
case SCI_OBJ_CLASS: { // object or class?
- Object *obj = segManager->scriptObjInit(addr);
+ Object *obj = segMan->scriptObjInit(addr);
Object *base_obj;
// Instantiate the superclass, if neccessary
obj->_variables[SCRIPT_SPECIES_SELECTOR] = INST_LOOKUP_CLASS(obj->_variables[SCRIPT_SPECIES_SELECTOR].offset);
- base_obj = obj_get(segManager, obj->_variables[SCRIPT_SPECIES_SELECTOR]);
+ base_obj = obj_get(segMan, obj->_variables[SCRIPT_SPECIES_SELECTOR]);
obj->variable_names_nr = base_obj->_variables.size();
obj->base_obj = base_obj->base_obj;
// Copy base from species class, as we need its selector IDs
@@ -1725,24 +1725,24 @@ int script_instantiate_sci0(ResourceManager *resMan, SegManager *segManager, int
} while (objtype != 0 && reg.offset < script->size - 2);
if (relocation >= 0)
- segManager->scriptRelocate(make_reg(reg.segment, relocation));
+ segMan->scriptRelocate(make_reg(reg.segment, relocation));
return reg.segment; // instantiation successful
}
-int script_instantiate_sci11(ResourceManager *resMan, SegManager *segManager, int script_nr) {
+int script_instantiate_sci11(ResourceManager *resMan, SegManager *segMan, int script_nr) {
Resource *script, *heap;
int seg_id;
int heap_start;
reg_t reg;
int was_new;
- seg_id = script_instantiate_common(resMan, segManager, script_nr, &script, &heap, &was_new);
+ seg_id = script_instantiate_common(resMan, segMan, script_nr, &script, &heap, &was_new);
if (was_new)
return seg_id;
- Script *scr = segManager->getScript(seg_id);
+ Script *scr = segMan->getScript(seg_id);
heap_start = script->size;
if (script->size & 2)
@@ -1756,30 +1756,30 @@ int script_instantiate_sci11(ResourceManager *resMan, SegManager *segManager, in
reg.segment = seg_id;
reg.offset = heap_start + 4;
- segManager->scriptInitialiseLocals(reg);
+ segMan->scriptInitialiseLocals(reg);
- segManager->scriptRelocateExportsSci11(seg_id);
- segManager->scriptInitialiseObjectsSci11(seg_id);
+ segMan->scriptRelocateExportsSci11(seg_id);
+ segMan->scriptInitialiseObjectsSci11(seg_id);
reg.offset = READ_LE_UINT16(heap->data);
- segManager->heapRelocate(reg);
+ segMan->heapRelocate(reg);
return seg_id;
}
-int script_instantiate(ResourceManager *resMan, SegManager *segManager, int script_nr) {
+int script_instantiate(ResourceManager *resMan, SegManager *segMan, int script_nr) {
if (resMan->sciVersion() >= SCI_VERSION_1_1)
- return script_instantiate_sci11(resMan, segManager, script_nr);
+ return script_instantiate_sci11(resMan, segMan, script_nr);
else
- return script_instantiate_sci0(resMan, segManager, script_nr);
+ return script_instantiate_sci0(resMan, segMan, script_nr);
}
-void script_uninstantiate_sci0(SegManager *segManager, int script_nr, SegmentId seg) {
- bool oldScriptHeader = (segManager->sciVersion() == SCI_VERSION_0_EARLY);
+void script_uninstantiate_sci0(SegManager *segMan, int script_nr, SegmentId seg) {
+ bool oldScriptHeader = (segMan->sciVersion() == SCI_VERSION_0_EARLY);
reg_t reg = make_reg(seg, oldScriptHeader ? 2 : 0);
int objtype, objlength;
- Script *scr = segManager->getScript(seg);
- SciVersion version = segManager->sciVersion();
+ Script *scr = segMan->getScript(seg);
+ SciVersion version = segMan->sciVersion();
// Make a pass over the object in order uninstantiate all superclasses
objlength = 0;
@@ -1802,13 +1802,13 @@ void script_uninstantiate_sci0(SegManager *segManager, int script_nr, SegmentId
superclass = scr->getHeap(reg.offset + SCRIPT_SUPERCLASS_OFFSET); // Get superclass...
if (superclass >= 0) {
- int superclass_script = segManager->_classtable[superclass].script;
+ int superclass_script = segMan->_classtable[superclass].script;
if (superclass_script == script_nr) {
if (scr->getLockers())
scr->decrementLockers(); // Decrease lockers if this is us ourselves
} else
- script_uninstantiate(segManager, superclass_script);
+ script_uninstantiate(segMan, superclass_script);
// Recurse to assure that the superclass lockers number gets decreased
}
@@ -1820,9 +1820,9 @@ void script_uninstantiate_sci0(SegManager *segManager, int script_nr, SegmentId
} while (objtype != 0);
}
-void script_uninstantiate(SegManager *segManager, int script_nr) {
- SegmentId segment = segManager->segGet(script_nr);
- Script *scr = segManager->getScriptIfLoaded(segment);
+void script_uninstantiate(SegManager *segMan, int script_nr) {
+ SegmentId segment = segMan->segGet(script_nr);
+ Script *scr = segMan->getScriptIfLoaded(segment);
if (!scr) { // Is it already loaded?
//warning("unloading script 0x%x requested although not loaded", script_nr);
@@ -1836,12 +1836,12 @@ void script_uninstantiate(SegManager *segManager, int script_nr) {
return;
// Free all classtable references to this script
- for (uint i = 0; i < segManager->_classtable.size(); i++)
- if (segManager->_classtable[i].reg.segment == segment)
- segManager->_classtable[i].reg = NULL_REG;
+ for (uint i = 0; i < segMan->_classtable.size(); i++)
+ if (segMan->_classtable[i].reg.segment == segment)
+ segMan->_classtable[i].reg = NULL_REG;
- if (segManager->sciVersion() < SCI_VERSION_1_1)
- script_uninstantiate_sci0(segManager, script_nr, segment);
+ if (segMan->sciVersion() < SCI_VERSION_1_1)
+ script_uninstantiate_sci0(segMan, script_nr, segment);
else
warning("FIXME: Add proper script uninstantiation for SCI 1.1");
@@ -1933,9 +1933,9 @@ int game_run(EngineState **_s) {
return 0;
}
-Object *obj_get(SegManager *segManager, reg_t offset) {
- MemObject *mobj = GET_OBJECT_SEGMENT(*segManager, offset.segment);
- SciVersion version = segManager->sciVersion();
+Object *obj_get(SegManager *segMan, reg_t offset) {
+ MemObject *mobj = GET_OBJECT_SEGMENT(*segMan, offset.segment);
+ SciVersion version = segMan->sciVersion();
Object *obj = NULL;
int idx;
@@ -1958,9 +1958,9 @@ Object *obj_get(SegManager *segManager, reg_t offset) {
return obj;
}
-const char *obj_get_name(SegManager *segManager, reg_t pos) {
- Object *obj = obj_get(segManager, pos);
- SciVersion version = segManager->sciVersion();
+const char *obj_get_name(SegManager *segMan, reg_t pos) {
+ Object *obj = obj_get(segMan, pos);
+ SciVersion version = segMan->sciVersion();
if (!obj)
return "<no such object>";
@@ -1968,7 +1968,7 @@ const char *obj_get_name(SegManager *segManager, reg_t pos) {
if (nameReg.isNull())
return "<no name>";
- const char *name = (const char*)segManager->dereference(obj->_variables[SCRIPT_NAME_SELECTOR], NULL);
+ const char *name = (const char*)segMan->dereference(obj->_variables[SCRIPT_NAME_SELECTOR], NULL);
if (!name)
return "<invalid name>";
@@ -1991,15 +1991,15 @@ void shrink_execution_stack(EngineState *s, uint size) {
s->_executionStack.erase(iter, s->_executionStack.end());
}
-reg_t* ObjVarRef::getPointer(SegManager *segManager) const {
- Object *o = obj_get(segManager, obj);
+reg_t* ObjVarRef::getPointer(SegManager *segMan) const {
+ Object *o = obj_get(segMan, obj);
if (!o) return 0;
return &(o->_variables[varindex]);
}
-reg_t* ExecStack::getVarPointer(SegManager *segManager) const {
+reg_t* ExecStack::getVarPointer(SegManager *segMan) const {
assert(type == EXEC_STACK_TYPE_VARSELECTOR);
- return addr.varp.getPointer(segManager);
+ return addr.varp.getPointer(segMan);
}
} // End of namespace Sci
diff --git a/engines/sci/engine/vm.h b/engines/sci/engine/vm.h
index a459d7e083..99b0b4d9b7 100644
--- a/engines/sci/engine/vm.h
+++ b/engines/sci/engine/vm.h
@@ -209,7 +209,7 @@ struct ObjVarRef {
reg_t obj;
int varindex;
- reg_t* getPointer(SegManager *segManager) const;
+ reg_t* getPointer(SegManager *segMan) const;
};
@@ -260,7 +260,7 @@ struct ExecStack {
int origin; // The stack frame position the call was made from, or -1 if it was the initial call
ExecStackType type;
- reg_t* getVarPointer(SegManager *segManager) const;
+ reg_t* getVarPointer(SegManager *segMan) const;
};
@@ -444,7 +444,7 @@ void script_free_vm_memory(EngineState *s);
/**
* Looks up a selector and returns its type and value
* varindex is written to iff it is non-NULL and the selector indicates a property of the object.
- * @param[in] segManager The Segment Manager
+ * @param[in] segMan The Segment Manager
* @param[in] obj Address of the object to look the selector up in
* @param[in] selectorid The selector to look up
* @param[out] varp A reference to the selector, if it is a
@@ -461,17 +461,17 @@ void script_free_vm_memory(EngineState *s);
* kSelectorMethod if the selector represents a
* method
*/
-SelectorType lookup_selector(SegManager *segManager, reg_t obj, Selector selectorid,
+SelectorType lookup_selector(SegManager *segMan, reg_t obj, Selector selectorid,
ObjVarRef *varp, reg_t *fptr);
/**
* Looks up an entry of the exports table of a script
- * @param[in] segManager The segment manager
+ * @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 *segManager, int script_nr, int export_index);
+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.
@@ -480,22 +480,22 @@ reg_t script_lookup_export(SegManager *segManager, int script_nr, int export_ind
* recursively as well, unless 'recursive' is set to zero. The
* complementary function is "script_uninstantiate()" below.
* @param[in] resMan The resource manager
- * @param[in] segManager The segment manager
+ * @param[in] segMan The segment manager
* @param[in] script_nr The script number to load
* @return The script's segment ID or 0 if out of heap
*/
-int script_instantiate(ResourceManager *resMan, SegManager *segManager, int script_nr);
+int script_instantiate(ResourceManager *resMan, SegManager *segMan, int script_nr);
/**
* Decreases the numer of lockers of a script and unloads it if that number
* reaches zero.
* This function will recursively unload scripts containing its
* superclasses, if those aren't locked by other scripts as well.
- * @param[in] segManager The segment manager
+ * @param[in] segMan The segment manager
* @param[in] version The SCI version to use
* @param[in] script_nr The script number that is requestet to be unloaded
*/
-void script_uninstantiate(SegManager *segManager, int script_nr);
+void script_uninstantiate(SegManager *segMan, int script_nr);
/**
* Converts the builtin Sierra game IDs to the ones we use in ScummVM
@@ -571,28 +571,28 @@ void quit_vm();
/**
* Allocates "kernel" memory and returns a handle suitable to be passed on
* to SCI scripts
- * @param[in] segManager The Segment Manager
+ * @param[in] segMan The Segment Manager
* @param[in] type A free-form type description string (static)
* @param[in] space The space to allocate
* @return The handle
*/
-reg_t kalloc(SegManager *segManager, const char *type, int space);
+reg_t kalloc(SegManager *segMan, const char *type, int space);
/**
* Returns a pointer to "kernel" memory based on the handle
- * @param[in] segManager The Segment Manager
+ * @param[in] segMan The Segment Manager
* @param[in] handle The handle to use
* @return A pointer to the allocated memory
*/
-byte *kmem(SegManager *segManager, reg_t handle);
+byte *kmem(SegManager *segMan, reg_t handle);
/**
* Frees all "kernel" memory associated with a handle
- * @param[in] segManager The Segment Manager
+ * @param[in] segMan The Segment Manager
* @param[in] handle The handle to free
* @return 0 on success, 1 otherwise
*/
-int kfree(SegManager *segManager, reg_t handle);
+int kfree(SegManager *segMan, reg_t handle);
/**
* Determines the name of an object
@@ -603,7 +603,7 @@ int kfree(SegManager *segManager, reg_t handle);
* in a static buffer and need not be freed (neither may
* it be modified).
*/
-const char *obj_get_name(SegManager *segManager, reg_t pos);
+const char *obj_get_name(SegManager *segMan, reg_t pos);
/**
* Retrieves an object from the specified location
@@ -611,7 +611,7 @@ const char *obj_get_name(SegManager *segManager, reg_t pos);
* @param[in] offset The object's offset
* @return The object in question, or NULL if there is none
*/
-Object *obj_get(SegManager *segManager, reg_t offset);
+Object *obj_get(SegManager *segMan, reg_t offset);
/**
* Shrink execution stack to size.
diff --git a/engines/sci/gfx/gfx_resmgr.cpp b/engines/sci/gfx/gfx_resmgr.cpp
index 940fed21d6..258764ca2b 100644
--- a/engines/sci/gfx/gfx_resmgr.cpp
+++ b/engines/sci/gfx/gfx_resmgr.cpp
@@ -49,8 +49,8 @@ struct param_struct {
GfxDriver *driver;
};
-GfxResManager::GfxResManager(gfx_options_t *options, GfxDriver *driver, ResourceManager *resManager) :
- _options(options), _driver(driver), _resMan(resManager),
+GfxResManager::GfxResManager(gfx_options_t *options, GfxDriver *driver, ResourceManager *resMan) :
+ _options(options), _driver(driver), _resMan(resMan),
_lockCounter(0), _tagLockCounter(0), _staticPalette(0) {
gfxr_init_static_palette();
@@ -65,7 +65,7 @@ GfxResManager::GfxResManager(gfx_options_t *options, GfxDriver *driver, Resource
debugC(2, kDebugLevelGraphics, "Palettes are not yet supported in this SCI version\n");
#endif
} else {
- Resource *res = resManager->findResource(ResourceId(kResourceTypePalette, 999), 0);
+ Resource *res = resMan->findResource(ResourceId(kResourceTypePalette, 999), 0);
if (res && res->data)
_staticPalette = gfxr_read_pal1(res->id.number, res->data, res->size);
}
diff --git a/engines/sci/gfx/gfx_resmgr.h b/engines/sci/gfx/gfx_resmgr.h
index 98cc06c5d7..9372d69902 100644
--- a/engines/sci/gfx/gfx_resmgr.h
+++ b/engines/sci/gfx/gfx_resmgr.h
@@ -90,7 +90,7 @@ typedef Common::HashMap<int, gfx_resource_t *> IntResMap;
/** Graphics resource manager */
class GfxResManager {
public:
- GfxResManager(gfx_options_t *options, GfxDriver *driver, ResourceManager *resManager);
+ GfxResManager(gfx_options_t *options, GfxDriver *driver, ResourceManager *resMan);
~GfxResManager();
/**
diff --git a/engines/sci/gfx/operations.cpp b/engines/sci/gfx/operations.cpp
index 4407ae8179..992a33177e 100644
--- a/engines/sci/gfx/operations.cpp
+++ b/engines/sci/gfx/operations.cpp
@@ -384,7 +384,7 @@ static void init_aux_pixmap(gfx_pixmap_t **pixmap) {
}
void gfxop_init(int version, GfxState *state,
- gfx_options_t *options, ResourceManager *resManager,
+ gfx_options_t *options, ResourceManager *resMan,
Graphics::PixelFormat mode, int xfact, int yfact) {
//int color_depth = bpp ? bpp : 1;
//int initialized = 0;
@@ -403,7 +403,7 @@ void gfxop_init(int version, GfxState *state,
state->driver = new GfxDriver(xfact, yfact, mode);
- state->gfxResMan = new GfxResManager(state->options, state->driver, resManager);
+ state->gfxResMan = new GfxResManager(state->options, state->driver, resMan);
gfxop_set_clip_zone(state, gfx_rect(0, 0, 320, 200));
state->pointerZone = Common::Rect(0, 0, 320, 200);
diff --git a/engines/sci/gfx/operations.h b/engines/sci/gfx/operations.h
index 7ca714aaed..b38d70f47f 100644
--- a/engines/sci/gfx/operations.h
+++ b/engines/sci/gfx/operations.h
@@ -141,10 +141,10 @@ struct GfxState {
* @param[in] yfact Vertical scale factors
* @param[in] mode Graphics mode to use
* @param[in] options Rendering options
- * @param[in] resManager Resource manager to use
+ * @param[in] resMan Resource manager to use
*/
void gfxop_init(int version, GfxState *state,
- gfx_options_t *options, ResourceManager *resManager,
+ gfx_options_t *options, ResourceManager *resMan,
Graphics::PixelFormat mode, int xfact = 1, int yfact = 1);
/**