aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorMax Horn2009-02-15 22:01:09 +0000
committerMax Horn2009-02-15 22:01:09 +0000
commit4eff1002f99c15c213144c2aef1bf49c1bbb65e6 (patch)
treeadbd8d3dd57f02f95e4cdd1a3716cf99a0b2d761 /engines/sci/engine
parent7a72318a12bec184885beeef9b58b5f968c7b3bc (diff)
downloadscummvm-rg350-4eff1002f99c15c213144c2aef1bf49c1bbb65e6.tar.gz
scummvm-rg350-4eff1002f99c15c213144c2aef1bf49c1bbb65e6.tar.bz2
scummvm-rg350-4eff1002f99c15c213144c2aef1bf49c1bbb65e6.zip
SCI: Got rid of a nasty hack where class, delete, new were re#defined because FreeSCI used these C++ keywords for variable names
svn-id: r38312
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/game.cpp6
-rw-r--r--engines/sci/engine/kernel.cpp4
-rw-r--r--engines/sci/engine/kgraphics.cpp2
-rw-r--r--engines/sci/engine/vm.cpp24
4 files changed, 18 insertions, 18 deletions
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp
index fc24727c55..ccf720f927 100644
--- a/engines/sci/engine/game.cpp
+++ b/engines/sci/engine/game.cpp
@@ -305,13 +305,13 @@ game_init_sound(state_t *s, int sound_flags)
/* Maps a class ID to the script the corresponding class is contained in */
/* Returns the script number suggested by vocab.996, or -1 if there's none */
static int
-suggested_script(resource_t *res, unsigned int class)
+suggested_script(resource_t *res, unsigned int classId)
{
int offset;
- if (!res || class >= res->size >> 2)
+ if (!res || classId >= res->size >> 2)
return -1;
- offset = 2 + (class << 2);
+ offset = 2 + (classId << 2);
return getInt16(res->data + offset);
}
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 538bdcd60c..1c403f0a40 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -499,7 +499,7 @@ k_Unknown(state_t *s, int funct_nr, int argc, reg_t *argv)
} else switch(kfunct_mappers[funct_nr].type) {
case KF_NEW:
- return kfunct_mappers[funct_nr].new.fun(s, funct_nr, argc, argv);
+ return kfunct_mappers[funct_nr].sig_pair.fun(s, funct_nr, argc, argv);
case KF_NONE:
default:
@@ -907,7 +907,7 @@ script_map_kernel(state_t *s)
break;
case KF_NEW:
- s->kfunct_table[functnr] = kfunct_mappers[found].new;
+ s->kfunct_table[functnr] = kfunct_mappers[found].sig_pair;
kernel_compile_signature(&(s->kfunct_table[functnr].signature));
++mapped;
break;
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index e011fdbcf7..0d12e40d6f 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -1997,7 +1997,7 @@ _k_view_list_dispose_loop(state_t *s, list_t *list, gfxw_dyn_view_t *widget,
}
if (is_object(s, obj)) {
- if (invoke_selector(INV_SEL(obj, delete, 1), 0))
+ if (invoke_selector(INV_SEL(obj, delete_, 1), 0))
SCIkwarn(SCIkWARNING, "Object at "PREG" requested deletion, but does not have"
" a delete funcselector\n", PRINT_REG(obj));
if (_k_animate_ran) {
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index c9c4560d67..b19d07a7d1 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -230,7 +230,7 @@ script_error(state_t *s, const char *file, int line, const char *reason)
reg_t
get_class_address(state_t *s, int classnr, int lock, reg_t caller)
{
- class_t *class = s->classtable + classnr;
+ class_t *the_class = s->classtable + classnr;
if (NULL == s) {
sciprintf("vm.c: get_class_address(): NULL passed for \"s\"\n");
@@ -239,26 +239,26 @@ get_class_address(state_t *s, int classnr, int lock, reg_t caller)
if (classnr < 0
|| s->classtable_size <= classnr
- || class->script < 0) {
+ || the_class->script < 0) {
sciprintf("[VM] Attempt to dereference class %x, which doesn't exist (max %x)\n",
classnr, s->classtable_size);
script_error_flag = script_debug_flag = 1;
return NULL_REG;
} else {
- if (!class->reg.segment) {
- script_get_segment(s, class->script, lock);
+ if (!the_class->reg.segment) {
+ script_get_segment(s, the_class->script, lock);
- if (!class->reg.segment) {
+ if (!the_class->reg.segment) {
sciprintf("[VM] Trying to instantiate class %x by instantiating script 0x%x (%03d) failed;"
- " Entering debugger.\n", classnr, class->script);
+ " Entering debugger.\n", classnr, the_class->script);
script_error_flag = script_debug_flag = 1;
return NULL_REG;
}
} else
- if (caller.segment != class->reg.segment)
- sm_increment_lockers(&s->seg_manager, class->reg.segment, SEG_ID);
+ if (caller.segment != the_class->reg.segment)
+ sm_increment_lockers(&s->seg_manager, the_class->reg.segment, SEG_ID);
- return class->reg;
+ return the_class->reg;
}
}
@@ -458,11 +458,11 @@ send_selector(state_t *s, reg_t send_obj, reg_t work_obj,
{ /* Argument is supplied -> Selector should be set */
if (print_send_action) {
- reg_t val = *varp;
- reg_t new = argp[1];
+ reg_t oldReg = *varp;
+ reg_t newReg = argp[1];
sciprintf("[write to selector: change "PREG" to "PREG"]\n",
- PRINT_REG(val), PRINT_REG(new));
+ PRINT_REG(oldReg), PRINT_REG(newReg));
print_send_action = 0;
}
send_calls[send_calls_nr].address.var = varp; /* register the call */