diff options
author | Max Horn | 2009-04-22 17:54:30 +0000 |
---|---|---|
committer | Max Horn | 2009-04-22 17:54:30 +0000 |
commit | 3774b9cd0c6e45bc77a6f4c55a4c3aa25bcdd4b1 (patch) | |
tree | aaf02c04c83444ab40cf08e21a7c114a526c253a /engines | |
parent | 3af8918e1a0888d46df13eff088104dce4c88974 (diff) | |
download | scummvm-rg350-3774b9cd0c6e45bc77a6f4c55a4c3aa25bcdd4b1.tar.gz scummvm-rg350-3774b9cd0c6e45bc77a6f4c55a4c3aa25bcdd4b1.tar.bz2 scummvm-rg350-3774b9cd0c6e45bc77a6f4c55a4c3aa25bcdd4b1.zip |
SCI: Slim down struct SciKernelFunction
svn-id: r40081
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/kernel.cpp | 14 | ||||
-rw-r--r-- | engines/sci/engine/kernel.h | 3 |
2 files changed, 10 insertions, 7 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp index c5fca9deac..23bba40960 100644 --- a/engines/sci/engine/kernel.cpp +++ b/engines/sci/engine/kernel.cpp @@ -55,8 +55,8 @@ static int sci_max_allowed_unknown_kernel_functions[] = { #endif }; -#define DEFUN(nm, cname, sig) {KF_NEW, nm, {cname, sig, NULL}} -#define NOFUN(nm) {KF_NONE, nm, {NULL, NULL, NULL}} +#define DEFUN(nm, cname, sig) {KF_NEW, nm, cname, sig} +#define NOFUN(nm) {KF_NONE, nm, NULL, NULL} SciKernelFunction kfunct_mappers[] = { /*00*/ DEFUN("Load", kLoad, "iii*"), @@ -208,9 +208,9 @@ SciKernelFunction kfunct_mappers[] = { // Special and NOP stuff - {KF_NEW, NULL, {k_Unknown, NULL, NULL}}, + {KF_NEW, NULL, k_Unknown, NULL}, - {KF_TERMINATOR, NULL, {NULL, NULL, NULL}} // Terminator + {KF_TERMINATOR, NULL, NULL, NULL} // Terminator }; static const char *argtype_description[] = { "Undetermined (WTF?)", "List", "Node", "Object", "Reference", "Arithmetic" }; @@ -321,7 +321,7 @@ reg_t k_Unknown(EngineState *s, int funct_nr, int argc, reg_t *argv) { } else { switch (kfunct_mappers[funct_nr].type) { case KF_NEW: - return kfunct_mappers[funct_nr].sig_pair.fun(s, funct_nr, argc, argv); + return kfunct_mappers[funct_nr].fun(s, funct_nr, argc, argv); case KF_NONE: default: warning("Unhandled Unknown function %04x", funct_nr); @@ -642,7 +642,9 @@ int script_map_kernel(EngineState *s) { break; case KF_NEW: - s->_kfuncTable[functnr] = kfunct_mappers[found].sig_pair; + s->_kfuncTable[functnr].fun = kfunct_mappers[found].fun; + s->_kfuncTable[functnr].signature = kfunct_mappers[found].signature; + s->_kfuncTable[functnr].orig_name.clear(); kernel_compile_signature(&(s->_kfuncTable[functnr].signature)); ++mapped; break; diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h index 3a3b1f87db..077191199e 100644 --- a/engines/sci/engine/kernel.h +++ b/engines/sci/engine/kernel.h @@ -318,7 +318,8 @@ struct kfunct_sig_pair_t { struct SciKernelFunction { int type; /* KF_* */ const char *name; - kfunct_sig_pair_t sig_pair; + kfunct *fun; /* The actual function */ + const char *signature; /* kfunct signature */ }; extern SciKernelFunction kfunct_mappers[]; |