aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xengines/pegasus/gamestate.cpp6
-rwxr-xr-xengines/pegasus/gamestate.h5
2 files changed, 7 insertions, 4 deletions
diff --git a/engines/pegasus/gamestate.cpp b/engines/pegasus/gamestate.cpp
index bc88c5ed22..5c889bdd20 100755
--- a/engines/pegasus/gamestate.cpp
+++ b/engines/pegasus/gamestate.cpp
@@ -45,6 +45,7 @@ Common::Error GameStateManager::writeGameState(Common::WriteStream *stream) {
stream->writeByte(_nextDirection);
stream->writeUint16BE(_lastNeighborhood);
stream->writeUint16BE(_lastRoom);
+ stream->writeByte(_lastDirection);
stream->writeUint16BE(_openDoorRoom);
stream->writeByte(_openDoorDirection);
@@ -74,6 +75,7 @@ Common::Error GameStateManager::readGameState(Common::ReadStream *stream) {
_nextDirection = stream->readByte();
_lastNeighborhood = stream->readUint16BE();
_lastRoom = stream->readUint16BE();
+ _lastDirection = stream->readByte();
_openDoorRoom = stream->readUint16BE();
_openDoorDirection = stream->readByte();
@@ -599,13 +601,13 @@ void GameStateManager::resetPrehistoricState() {
void GameStateManager::writeNoradState(Common::WriteStream *stream) {
_noradFlags.writeToStream(stream);
stream->writeUint16BE(_noradSubRoomPressure);
- stream->writeUint32BE(_noradSubPrepState); // FIXME: sizeof(enum)!
+ stream->writeByte(_noradSubPrepState);
}
void GameStateManager::readNoradState(Common::ReadStream *stream) {
_noradFlags.readFromStream(stream);
_noradSubRoomPressure = stream->readUint16BE();
- _noradSubPrepState = (tNoradSubPrepState)stream->readUint32BE(); // FIXME: sizeof(enum)!
+ _noradSubPrepState = (tNoradSubPrepState)stream->readByte();
}
void GameStateManager::resetNoradState() {
diff --git a/engines/pegasus/gamestate.h b/engines/pegasus/gamestate.h
index 4118b5d519..f3568295d6 100755
--- a/engines/pegasus/gamestate.h
+++ b/engines/pegasus/gamestate.h
@@ -27,6 +27,7 @@
#define PEGASUS_GAMESTATE_H
#include "common/singleton.h"
+#include "common/util.h"
#include "pegasus/types.h"
#include "pegasus/items/item.h"
@@ -879,7 +880,7 @@ private:
return;
}
- for (uint32 i = 0; i < sizeof(_flags); i++) {
+ for (uint32 i = 0; i < ARRAYSIZE(_flags); i++) {
if (sizeof(Unit) == 2)
_flags[i] = stream->readUint16BE();
else /* if (sizeof(Unit) == 4) */
@@ -894,7 +895,7 @@ private:
return;
}
- for (uint32 i = 0; i < sizeof(_flags); i++) {
+ for (uint32 i = 0; i < ARRAYSIZE(_flags); i++) {
if (sizeof(Unit) == 2)
stream->writeUint16BE(_flags[i]);
else /* if (sizeof(Unit) == 4) */