diff options
author | Nipun Garg | 2019-07-06 20:34:54 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:17:14 +0200 |
commit | 55a58747e2fd10c2f5dd05d50ff2fb55a1e71ec6 (patch) | |
tree | 76b40d9909d1b38b8dd6618c5735feb7bdc6ac3c /engines | |
parent | c819a79c9b265893196e9c06dac6155235275e7e (diff) | |
download | scummvm-rg350-55a58747e2fd10c2f5dd05d50ff2fb55a1e71ec6.tar.gz scummvm-rg350-55a58747e2fd10c2f5dd05d50ff2fb55a1e71ec6.tar.bz2 scummvm-rg350-55a58747e2fd10c2f5dd05d50ff2fb55a1e71ec6.zip |
HDB: Add Gfx save() and loadSaveFile()
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hdb/gfx.cpp | 16 | ||||
-rw-r--r-- | engines/hdb/gfx.h | 2 |
2 files changed, 18 insertions, 0 deletions
diff --git a/engines/hdb/gfx.cpp b/engines/hdb/gfx.cpp index 3fdba2ed8e..57d0cc7ad4 100644 --- a/engines/hdb/gfx.cpp +++ b/engines/hdb/gfx.cpp @@ -137,6 +137,22 @@ bool Gfx::init() { return true; } +void Gfx::save(Common::OutSaveFile *out) { + out->writeSint32LE(_currentSky); + out->write(&_fadeInfo, sizeof(_fadeInfo)); + out->write(&_snowInfo, sizeof(_snowInfo)); +} + +void Gfx::loadSaveFile(Common::InSaveFile *in) { + _currentSky = in->readSint32LE(); + in->read(&_fadeInfo, sizeof(_fadeInfo)); + in->read(&_snowInfo, sizeof(_snowInfo)); + setSky(_currentSky); + turnOffSnow(); + if (_snowInfo.active) + turnOnSnow(); +} + void Gfx::fillScreen(uint32 color) { _globalSurface.fillRect(Common::Rect(kScreenWidth, kScreenHeight), color); g_system->fillScreen(color); diff --git a/engines/hdb/gfx.h b/engines/hdb/gfx.h index 597bf7fe37..88fb25063b 100644 --- a/engines/hdb/gfx.h +++ b/engines/hdb/gfx.h @@ -91,6 +91,8 @@ public: Graphics::ManagedSurface _globalSurface; bool init(); + void save(Common::OutSaveFile *out); + void loadSaveFile(Common::InSaveFile *in); void fillScreen(uint32 color); void updateVideo(); void setPointerState(int value); |