aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/global.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/agi/global.cpp')
-rw-r--r--engines/agi/global.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/engines/agi/global.cpp b/engines/agi/global.cpp
index bf6356dbcd..4cf6c3d12b 100644
--- a/engines/agi/global.cpp
+++ b/engines/agi/global.cpp
@@ -24,28 +24,28 @@
namespace Agi {
-int AgiBase::getflag(int n) {
- uint8 *set = (uint8 *)&_game.flags;
+int AgiBase::getFlag(int16 flagNr) {
+ uint8 *flagPtr = _game.flags;
- set += n >> 3;
- return (*set & (1 << (n & 0x07))) != 0;
+ flagPtr += flagNr >> 3;
+ return (*flagPtr & (1 << (flagNr & 0x07))) != 0;
}
-void AgiBase::setflag(int n, int v) {
- uint8 *set = (uint8 *)&_game.flags;
+void AgiBase::setFlag(int16 flagNr, bool newState) {
+ uint8 *flagPtr = _game.flags;
- set += n >> 3;
- if (v)
- *set |= 1 << (n & 0x07); // set bit
+ flagPtr += flagNr >> 3;
+ if (newState)
+ *flagPtr |= 1 << (flagNr & 0x07); // set bit
else
- *set &= ~(1 << (n & 0x07)); // clear bit
+ *flagPtr &= ~(1 << (flagNr & 0x07)); // clear bit
}
-void AgiBase::flipflag(int n) {
- uint8 *set = (uint8 *)&_game.flags;
+void AgiBase::flipFlag(int16 flagNr) {
+ uint8 *flagPtr = _game.flags;
- set += n >> 3;
- *set ^= 1 << (n & 0x07); // flip bit
+ flagPtr += flagNr >> 3;
+ *flagPtr ^= 1 << (flagNr & 0x07); // flip bit
}
void AgiEngine::setVar(int16 varNr, int val) {