aboutsummaryrefslogtreecommitdiff
path: root/engines/simon/items.cpp
diff options
context:
space:
mode:
authorTravis Howell2006-04-21 06:37:28 +0000
committerTravis Howell2006-04-21 06:37:28 +0000
commit061063189ffc7ed0055cd88f3086dc0e236e2e68 (patch)
tree36b1f09a09bfb8d1e308e5d75a90f798d0e22107 /engines/simon/items.cpp
parent6b7a37d71cd368cafd0821450639ec0cc0544f83 (diff)
downloadscummvm-rg350-061063189ffc7ed0055cd88f3086dc0e236e2e68.tar.gz
scummvm-rg350-061063189ffc7ed0055cd88f3086dc0e236e2e68.tar.bz2
scummvm-rg350-061063189ffc7ed0055cd88f3086dc0e236e2e68.zip
Split bitArrays into three separate arrays, like original. Also fixing load/save issue with bitArrayThree been off by one
svn-id: r22067
Diffstat (limited to 'engines/simon/items.cpp')
-rw-r--r--engines/simon/items.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/engines/simon/items.cpp b/engines/simon/items.cpp
index d973bb86b6..03a7f90527 100644
--- a/engines/simon/items.cpp
+++ b/engines/simon/items.cpp
@@ -1365,22 +1365,26 @@ void SimonEngine::o_isAdjNoun() {
void SimonEngine::o_b2Set() {
// 166: set bit2
- setBitFlag(256 + getVarOrByte(), true);
+ uint bit = getVarOrByte();
+ _bitArrayTwo[bit / 16] |= (1 << (bit & 15));
}
void SimonEngine::o_b2Clear() {
// 167: clear bit2
- setBitFlag(256 + getVarOrByte(), false);
+ uint bit = getVarOrByte();
+ _bitArrayTwo[bit / 16] &= ~(1 << (bit & 15));
}
void SimonEngine::o_b2Zero() {
// 168: is bit2 clear
- setScriptCondition(!getBitFlag(256 + getVarOrByte()));
+ uint bit = getVarOrByte();
+ setScriptCondition((_bitArrayTwo[bit / 16] & (1 << (bit & 15))) == 0);
}
void SimonEngine::o_b2NotZero() {
// 169: is bit2 set
- setScriptCondition(getBitFlag(256 + getVarOrByte()));
+ uint bit = getVarOrByte();
+ setScriptCondition((_bitArrayTwo[bit / 16] & (1 << (bit & 15))) != 0);
}
void SimonEngine::o_lockZones() {
@@ -2090,22 +2094,26 @@ void SimonEngine::o3_setColour() {
void SimonEngine::o3_b3Set() {
// 196: set bit3
- setBitFlag(512 + getVarOrByte(), true);
+ uint bit = getVarOrByte();
+ _bitArrayThree[bit / 16] |= (1 << (bit & 15));
}
void SimonEngine::o3_b3Clear() {
// 197: clear bit3
- setBitFlag(512 + getVarOrByte(), false);
+ uint bit = getVarOrByte();
+ _bitArrayThree[bit / 16] &= ~(1 << (bit & 15));
}
void SimonEngine::o3_b3Zero() {
// 198: is bit3 clear
- setScriptCondition(!getBitFlag(512 + getVarOrByte()));
+ uint bit = getVarOrByte();
+ setScriptCondition((_bitArrayThree[bit / 16] & (1 << (bit & 15))) == 0);
}
void SimonEngine::o3_b3NotZero() {
// 199: is bit3 set
- setScriptCondition(getBitFlag(512 + getVarOrByte()));
+ uint bit = getVarOrByte();
+ setScriptCondition((_bitArrayThree[bit / 16] & (1 << (bit & 15))) != 0);
}
// -----------------------------------------------------------------------