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/waypoints.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/waypoints.cpp')
-rw-r--r-- | engines/bladerunner/waypoints.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/engines/bladerunner/waypoints.cpp b/engines/bladerunner/waypoints.cpp index 0783af8e07..bf2f09b8a6 100644 --- a/engines/bladerunner/waypoints.cpp +++ b/engines/bladerunner/waypoints.cpp @@ -91,13 +91,23 @@ float Waypoints::getZ(int waypointId) const { return _waypoints[waypointId].position.z; } -void Waypoints::save(SaveFile &f) { - f.write(_count); +void Waypoints::save(SaveFileWriteStream &f) { + f.writeInt(_count); for (int i = 0; i < _count; ++i) { Waypoint &w = _waypoints[i]; - f.write(w.setId); - f.write(w.position); - f.write(w.present); + f.writeInt(w.setId); + f.writeVector3(w.position); + f.writeInt(w.present); + } +} + +void Waypoints::load(SaveFileReadStream &f) { + _count = f.readInt(); + for (int i = 0; i < _count; ++i) { + Waypoint &w = _waypoints[i]; + w.setId = f.readInt(); + w.position = f.readVector3(); + w.present = f.readInt(); } } |