aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/agi/preagi.cpp2
-rw-r--r--engines/agos/script_pn.cpp15
-rw-r--r--engines/agos/vga_pn.cpp18
3 files changed, 18 insertions, 17 deletions
diff --git a/engines/agi/preagi.cpp b/engines/agi/preagi.cpp
index 29abbc6008..99c2e55f4b 100644
--- a/engines/agi/preagi.cpp
+++ b/engines/agi/preagi.cpp
@@ -30,8 +30,6 @@
#include "base/plugins.h"
#include "base/version.h"
-#include "graphics/cursorman.h"
-
#include "sound/mididrv.h"
#include "sound/mixer.h"
diff --git a/engines/agos/script_pn.cpp b/engines/agos/script_pn.cpp
index 7b58e46cd8..d508d10c7a 100644
--- a/engines/agos/script_pn.cpp
+++ b/engines/agos/script_pn.cpp
@@ -711,10 +711,9 @@ int AGOSEngine_PN::inventoryOff() {
// -----------------------------------------------------------------------
-static int bitvalue[8] = {128, 64, 32, 16, 8, 4, 2, 1};
-
int AGOSEngine_PN::bitextract(uint32 ptr, int offs) {
- return ((bitvalue[offs % 8] & _dataBase[ptr + offs / 8]) != 0);
+ const byte mask = 0x80 >> (offs % 8);
+ return ((mask & _dataBase[ptr + offs / 8]) != 0);
}
uint16 AGOSEngine_PN::getptr(uint32 pos) {
@@ -823,9 +822,11 @@ void AGOSEngine_PN::writeval(uint8 *ptr, int val) {
void AGOSEngine_PN::setbitf(uint32 ptr, int offs, int val) {
ptr += offs / 8;
- _dataBase[ptr] &= (255 - bitvalue[offs % 8]);
+ const byte mask = 0x80 >> (offs % 8);
if (val != 0)
- _dataBase[ptr] |= bitvalue[offs % 8];
+ _dataBase[ptr] |= mask;
+ else
+ _dataBase[ptr] &= ~mask;
}
int AGOSEngine_PN::actCallD(int n) {
@@ -970,7 +971,7 @@ int AGOSEngine_PN::gvwrd(uint8 *wptr, int mask) {
int val, code, q = _dataBase[57];
uint8 *vocbase = _dataBase + getlong(15);
while (*vocbase != 255) {
- if (*vocbase < 128) {
+ if (*vocbase < 0x80) {
val = vocbase[q] + 256 * vocbase[q + 1];
code = vocbase[q + 2];
}
@@ -981,6 +982,8 @@ int AGOSEngine_PN::gvwrd(uint8 *wptr, int mask) {
return -1;
}
+
+// FIXME/TODO: Isn't this just scumm_strnicmp ?
int AGOSEngine_PN::samewrd(uint8 *w1, uint8 *w2, int ln) {
int ct = 0;
diff --git a/engines/agos/vga_pn.cpp b/engines/agos/vga_pn.cpp
index eafac6e1a2..61e5bc1e9c 100644
--- a/engines/agos/vga_pn.cpp
+++ b/engines/agos/vga_pn.cpp
@@ -90,23 +90,23 @@ void AGOSEngine_PN::setupVideoOpcodes(VgaOpcodeProc *op) {
bool AGOSEngine_PN::ifObjectHere(uint16 a) {
if (getFeatures() & GF_DEMO)
- return 0;
- else
- return _variableArray[39] == getptr(_quickptr[11] + a * _quickshort[4] + 2);
+ return false;
+
+ return _variableArray[39] == getptr(_quickptr[11] + a * _quickshort[4] + 2);
}
bool AGOSEngine_PN::ifObjectAt(uint16 a, uint16 b) {
if (getFeatures() & GF_DEMO)
- return 0;
- else
- return b == getptr(_quickptr[11] + a * _quickshort[4] + 2);
+ return false;
+
+ return b == getptr(_quickptr[11] + a * _quickshort[4] + 2);
}
bool AGOSEngine_PN::ifObjectState(uint16 a, int16 b) {
if (getFeatures() & GF_DEMO)
- return 0;
- else
- return b == getptr(_quickptr[0] + a * _quickshort[0] + 2);
+ return false;
+
+ return b == getptr(_quickptr[0] + a * _quickshort[0] + 2);
}
void AGOSEngine::vc36_pause() {