aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction/exec_br.cpp
diff options
context:
space:
mode:
authorNicola Mettifogo2008-08-15 02:52:42 +0000
committerNicola Mettifogo2008-08-15 02:52:42 +0000
commitea2a2cbb7c3a0d8721f1968414bd421a43b13596 (patch)
treeb72d683f779dc03c3e102ecf73d6447ceccbcf01 /engines/parallaction/exec_br.cpp
parentd6ac646d0bebb1a67a3578b3462a65f4c44c4813 (diff)
downloadscummvm-rg350-ea2a2cbb7c3a0d8721f1968414bd421a43b13596.tar.gz
scummvm-rg350-ea2a2cbb7c3a0d8721f1968414bd421a43b13596.tar.bz2
scummvm-rg350-ea2a2cbb7c3a0d8721f1968414bd421a43b13596.zip
Simplified handling of script variables (especially locals).
svn-id: r33889
Diffstat (limited to 'engines/parallaction/exec_br.cpp')
-rw-r--r--engines/parallaction/exec_br.cpp29
1 files changed, 9 insertions, 20 deletions
diff --git a/engines/parallaction/exec_br.cpp b/engines/parallaction/exec_br.cpp
index 5c718bf61a..e58ec13d98 100644
--- a/engines/parallaction/exec_br.cpp
+++ b/engines/parallaction/exec_br.cpp
@@ -321,12 +321,7 @@ DECLARE_INSTRUCTION_OPCODE(off) {
DECLARE_INSTRUCTION_OPCODE(set) {
InstructionPtr inst = *_ctxt.inst;
-
- int16 rvalue = inst->_opB.getRValue();
- int16* lvalue = inst->_opA.getLValue();
-
- *lvalue = rvalue;
-
+ inst->_opA.setValue(inst->_opB.getValue());
}
@@ -334,7 +329,7 @@ DECLARE_INSTRUCTION_OPCODE(set) {
DECLARE_INSTRUCTION_OPCODE(inc) {
InstructionPtr inst = *_ctxt.inst;
- int16 rvalue = inst->_opB.getRValue();
+ int16 rvalue = inst->_opB.getValue();
if (inst->_flags & kInstMod) { // mod
int16 _bx = (rvalue > 0 ? rvalue : -rvalue);
@@ -343,32 +338,30 @@ DECLARE_INSTRUCTION_OPCODE(inc) {
rvalue = (rvalue > 0 ? 1 : -1);
}
- int16 *lvalue = inst->_opA.getLValue();
+ int16 lvalue = inst->_opA.getValue();
switch (inst->_index) {
case INST_INC:
- *lvalue += rvalue;
+ lvalue += rvalue;
break;
case INST_DEC:
- *lvalue -= rvalue;
+ lvalue -= rvalue;
break;
case INST_MUL:
- *lvalue *= rvalue;
+ lvalue *= rvalue;
break;
case INST_DIV:
- *lvalue /= rvalue;
+ lvalue /= rvalue;
break;
default:
error("This should never happen. Report immediately");
}
- if (inst->_opA._flags & kParaLocal) {
- inst->_opA._local->wrap();
- }
+ inst->_opA.setValue(lvalue);
}
@@ -401,11 +394,7 @@ DECLARE_INSTRUCTION_OPCODE(move) {
DECLARE_INSTRUCTION_OPCODE(color) {
InstructionPtr inst = *_ctxt.inst;
-
- int16 entry = inst->_opB.getRValue();
-
- _vm->_gfx->_palette.setEntry(entry, inst->_colors[0], inst->_colors[1], inst->_colors[2]);
-
+ _vm->_gfx->_palette.setEntry(inst->_opB.getValue(), inst->_colors[0], inst->_colors[1], inst->_colors[2]);
}