aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/agi/agi.h6
-rw-r--r--engines/agi/cycle.cpp3
-rw-r--r--engines/agi/global.cpp12
3 files changed, 11 insertions, 10 deletions
diff --git a/engines/agi/agi.h b/engines/agi/agi.h
index 5119ccd046..4c7580dadb 100644
--- a/engines/agi/agi.h
+++ b/engines/agi/agi.h
@@ -685,7 +685,7 @@ public:
int _soundemu;
- int getFlag(int16 flagNr);
+ bool getFlag(int16 flagNr);
void setFlag(int16 flagNr, bool newState);
void flipFlag(int16 flagNr);
@@ -822,8 +822,8 @@ public:
void newInputMode(InputMode mode);
void oldInputMode();
- int getVar(int16 varNr);
- void setVar(int16 varNr, int);
+ byte getVar(int16 varNr);
+ void setVar(int16 varNr, byte newValue);
void decrypt(uint8 *mem, int len);
void releaseSprites();
int mainCycle(bool onlyCheckForEvents = false);
diff --git a/engines/agi/cycle.cpp b/engines/agi/cycle.cpp
index e58d018b1b..85a465cb02 100644
--- a/engines/agi/cycle.cpp
+++ b/engines/agi/cycle.cpp
@@ -128,7 +128,8 @@ void AgiEngine::resetControllers() {
void AgiEngine::interpretCycle() {
ScreenObjEntry *screenObjEgo = &_game.screenObjTable[SCREENOBJECTS_EGO_ENTRY];
- int oldSound, oldScore;
+ bool oldSound;
+ byte oldScore;
if (!_game.playerControl)
setVar(VM_VAR_EGO_DIRECTION, screenObjEgo->direction);
diff --git a/engines/agi/global.cpp b/engines/agi/global.cpp
index 4cf6c3d12b..9f3fb451c2 100644
--- a/engines/agi/global.cpp
+++ b/engines/agi/global.cpp
@@ -24,7 +24,7 @@
namespace Agi {
-int AgiBase::getFlag(int16 flagNr) {
+bool AgiBase::getFlag(int16 flagNr) {
uint8 *flagPtr = _game.flags;
flagPtr += flagNr >> 3;
@@ -48,16 +48,16 @@ void AgiBase::flipFlag(int16 flagNr) {
*flagPtr ^= 1 << (flagNr & 0x07); // flip bit
}
-void AgiEngine::setVar(int16 varNr, int val) {
- _game.vars[varNr] = val;
+void AgiEngine::setVar(int16 varNr, byte newValue) {
+ _game.vars[varNr] = newValue;
if (varNr == VM_VAR_VOLUME) {
- _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, val * 17);
- _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, val * 17);
+ _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, newValue * 17);
+ _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, newValue * 17);
}
}
-int AgiEngine::getVar(int16 varNr) {
+byte AgiEngine::getVar(int16 varNr) {
return _game.vars[varNr];
}