BVBS: Use a constant instead of a variable for the snapshot size

This commit is contained in:
Strangerke 2014-03-20 19:31:40 +01:00
parent e324f3e6be
commit 8481ff0e61
3 changed files with 3 additions and 5 deletions

View File

@ -91,7 +91,6 @@ BbvsEngine::BbvsEngine(OSystem *syst, const ADGameDescription *gd) :
_currWalkDistance = kMaxDistance;
_walkReachedDestArea = false;
_hasSnapshot = false;
_snapshotSize = 0;
_snapshot = nullptr;
_snapshotStream = nullptr;
_isSaveAllowed = false;

View File

@ -199,6 +199,7 @@ struct WalkArea {
bool contains(const Common::Point &pt) const;
};
const int kSnapshotSize = 23072;
const int kSceneObjectsCount = 64;
const int kSceneSoundsCount = 8;
const int kInventoryItemStatusCount = 50;
@ -304,7 +305,6 @@ public:
bool _walkReachedDestArea;
bool _hasSnapshot;
uint32 _snapshotSize;
byte *_snapshot;
Common::SeekableMemoryWriteStream *_snapshotStream;

View File

@ -212,9 +212,8 @@ bool BbvsEngine::existsSavegame(int num) {
}
void BbvsEngine::allocSnapshot() {
_snapshotSize = 23072;
_snapshot = new byte[_snapshotSize];
_snapshotStream = new Common::SeekableMemoryWriteStream(_snapshot, _snapshotSize);
_snapshot = new byte[kSnapshotSize];
_snapshotStream = new Common::SeekableMemoryWriteStream(_snapshot, kSnapshotSize);
}
void BbvsEngine::freeSnapshot() {