diff options
author | Peter Kohaut | 2018-03-24 17:20:27 +0100 |
---|---|---|
committer | Peter Kohaut | 2018-03-24 17:28:34 +0100 |
commit | 5e9985bd6e4d136ec20e5e3be7589d34051227f1 (patch) | |
tree | e8b8f70ad0f509ec7b919c68c2f09bd2bbf0e8a1 /engines/bladerunner/regions.cpp | |
parent | 2a646f8cc287a98f90e561ce8072c2af4322fd22 (diff) | |
download | scummvm-rg350-5e9985bd6e4d136ec20e5e3be7589d34051227f1.tar.gz scummvm-rg350-5e9985bd6e4d136ec20e5e3be7589d34051227f1.tar.bz2 scummvm-rg350-5e9985bd6e4d136ec20e5e3be7589d34051227f1.zip |
BLADERUNNER: Load game methods
save methods update
replaced few char* with Common::String
changed few pointers to references
Diffstat (limited to 'engines/bladerunner/regions.cpp')
-rw-r--r-- | engines/bladerunner/regions.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/engines/bladerunner/regions.cpp b/engines/bladerunner/regions.cpp index 51b2bae2d7..f74186240b 100644 --- a/engines/bladerunner/regions.cpp +++ b/engines/bladerunner/regions.cpp @@ -101,12 +101,21 @@ void Regions::enable() { _enabled = true; } -void Regions::save(SaveFile &f) { - f.write(_enabled); +void Regions::save(SaveFileWriteStream &f) { + f.writeBool(_enabled); for (int i = 0; i != 10; ++i) { - f.write(_regions[i].rectangle); - f.write(_regions[i].type); - f.write(_regions[i].present); + f.writeRect(_regions[i].rectangle); + f.writeInt(_regions[i].type); + f.writeInt(_regions[i].present); + } +} + +void Regions::load(SaveFileReadStream &f) { + _enabled = f.readBool(); + for (int i = 0; i != 10; ++i) { + _regions[i].rectangle = f.readRect(); + _regions[i].type = f.readInt(); + _regions[i].present = f.readInt(); } } |