aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorMax Horn2009-06-04 20:51:24 +0000
committerMax Horn2009-06-04 20:51:24 +0000
commitf08f5c3bbf882b817ed6fc04530044e406ddd04f (patch)
tree3d37bc42daba8a958e27faf8650dc9ae119b03a2 /engines/sci/engine
parentae3c6c30531aa1def49939baf5a15c2e227365ae (diff)
downloadscummvm-rg350-f08f5c3bbf882b817ed6fc04530044e406ddd04f.tar.gz
scummvm-rg350-f08f5c3bbf882b817ed6fc04530044e406ddd04f.tar.bz2
scummvm-rg350-f08f5c3bbf882b817ed6fc04530044e406ddd04f.zip
SCI: Slightly modified kAddAfter so that it does not modify its arguments needlessly
svn-id: r41174
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/kgraphics.cpp2
-rw-r--r--engines/sci/engine/klists.cpp9
2 files changed, 5 insertions, 6 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 4ccc125eb4..8413a7887b 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -769,7 +769,7 @@ static int collides_with(EngineState *s, Common::Rect area, reg_t other_obj, int
return 0;
}
-reg_t kCanBeHere(EngineState *s, int funct_nr, int argc, reg_t * argv) {
+reg_t kCanBeHere(EngineState *s, int funct_nr, int argc, reg_t *argv) {
reg_t obj = argv[0];
reg_t cliplist_ref = KP_ALT(1, NULL_REG);
List *cliplist = NULL;
diff --git a/engines/sci/engine/klists.cpp b/engines/sci/engine/klists.cpp
index 029954d00f..43d1f25e01 100644
--- a/engines/sci/engine/klists.cpp
+++ b/engines/sci/engine/klists.cpp
@@ -310,7 +310,7 @@ reg_t kAddToFront(EngineState *s, int funct_nr, int argc, reg_t *argv) {
}
reg_t kAddAfter(EngineState *s, int funct_nr, int argc, reg_t *argv) {
- List *l =lookup_list(s, argv[0]);
+ List *l = lookup_list(s, argv[0]);
Node *firstnode = argv[1].isNull() ? NULL : lookup_node(s, argv[1]);
Node *newnode = lookup_node(s, argv[2]);
@@ -341,12 +341,11 @@ reg_t kAddAfter(EngineState *s, int funct_nr, int argc, reg_t *argv) {
else
lookup_node(s, oldnext)->pred = argv[2];
- return s->r_acc;
} else { // !firstnode
- // Prepare call to AddToFront...
- argv[1] = argv[0];
- return kAddToFront(s, funct_nr, 2, argv + 1); // Set as initial list node
+ _k_add_to_front(s, argv[0], argv[2]); // Set as initial list node
}
+
+ return s->r_acc;
}
reg_t kAddToEnd(EngineState *s, int funct_nr, int argc, reg_t *argv) {