aboutsummaryrefslogtreecommitdiff
path: root/sky
diff options
context:
space:
mode:
authorOliver Kiehl2003-05-23 14:27:53 +0000
committerOliver Kiehl2003-05-23 14:27:53 +0000
commit4c0f8eda9ac1256920fec5794230c447402af11c (patch)
treeac198a679af8c36028fc6c88bf22109462dfcd0a /sky
parent4c531d373b4db5f84932da3a9958fd101874579c (diff)
downloadscummvm-rg350-4c0f8eda9ac1256920fec5794230c447402af11c.tar.gz
scummvm-rg350-4c0f8eda9ac1256920fec5794230c447402af11c.tar.bz2
scummvm-rg350-4c0f8eda9ac1256920fec5794230c447402af11c.zip
I must have been drunk when I coded this....
svn-id: r7862
Diffstat (limited to 'sky')
-rw-r--r--sky/logic.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/sky/logic.cpp b/sky/logic.cpp
index 40b7951983..6e41ba2dbc 100644
--- a/sky/logic.cpp
+++ b/sky/logic.cpp
@@ -66,17 +66,17 @@ SkyLogic::SkyLogic(SkyDisk *skyDisk, SkyGrid *skyGrid, SkyText *skyText, SkyMusi
}
void SkyLogic::engine() {
- Compact *compact2 = SkyState::fetchCompact(_scriptVariables[LOGIC_LIST_NO]);
+ uint16 *logicList = (uint16 *)SkyState::fetchCompact(_scriptVariables[LOGIC_LIST_NO]);
- while (compact2->logic) { // 0 means end of list
- if (compact2->logic == 0xffff) {
+ while (uint16 id = *logicList++) { // 0 means end of list
+ if (id == 0xffff) {
// Change logic data address
- compact2 = SkyState::fetchCompact(compact2->status);
+ logicList = (uint16 *)SkyState::fetchCompact(id);
continue;
}
- _scriptVariables[CUR_ID] = compact2->logic;
- _compact = SkyState::fetchCompact(compact2->logic);
+ _scriptVariables[CUR_ID] = id;
+ _compact = SkyState::fetchCompact(id);
// check the id actually wishes to be processed
if (!(_compact->status & (1 << 6)))
@@ -1260,7 +1260,7 @@ uint32 SkyLogic::fnChooser(uint32 a, uint32 b, uint32 c) {
uint16 width = ((dataFileHeader *)data)->s_width;
width >>= 1;
- for (uint16 i = height; i > 0; i++) {
+ for (uint16 i = height; i > 0; i--) {
for (uint16 j = width; j > 0; j--) {
if (!*data) // only change 0's
*data = 1;