aboutsummaryrefslogtreecommitdiff
path: root/engines/sludge/backdrop.cpp
diff options
context:
space:
mode:
authorSimei Yin2018-04-27 19:12:30 +0200
committerSimei Yin2018-04-27 19:48:29 +0200
commitda491601d4fca4deebe8d1a4a18e67fe48dff55d (patch)
tree53d18f67a2893bf3f870d7174a17d84392460d35 /engines/sludge/backdrop.cpp
parent5ced49576924c18dd3d04c08f4e1822f21c52894 (diff)
downloadscummvm-rg350-da491601d4fca4deebe8d1a4a18e67fe48dff55d.tar.gz
scummvm-rg350-da491601d4fca4deebe8d1a4a18e67fe48dff55d.tar.bz2
scummvm-rg350-da491601d4fca4deebe8d1a4a18e67fe48dff55d.zip
SLUDGE: Move global variable brightnessLevel to GraphicsManager and refactor save&load
Diffstat (limited to 'engines/sludge/backdrop.cpp')
-rw-r--r--engines/sludge/backdrop.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/engines/sludge/backdrop.cpp b/engines/sludge/backdrop.cpp
index c1042c7f05..1c618c7da1 100644
--- a/engines/sludge/backdrop.cpp
+++ b/engines/sludge/backdrop.cpp
@@ -504,6 +504,27 @@ void GraphicsManager::saveHSI(Common::WriteStream *stream) {
Image::writePNG(*stream, _backdropSurface);
}
+void GraphicsManager::saveBackdrop(Common::WriteStream *stream) {
+ stream->writeUint16BE(_cameraX);
+ stream->writeUint16BE(_cameraY);
+ stream->writeFloatLE(_cameraZoom);
+ stream->writeByte(_brightnessLevel);
+ saveHSI(stream);
+}
+
+void GraphicsManager::loadBackdrop(int ssgVersion, Common::SeekableReadStream *stream) {
+ _cameraX = stream->readUint16BE();
+ _cameraY = stream->readUint16BE();
+ if (ssgVersion >= VERSION(2, 0)) {
+ _cameraZoom = stream->readFloatLE();
+ } else {
+ _cameraZoom = 1.0;
+ }
+
+ _brightnessLevel = stream->readByte();
+
+ loadHSI(stream, 0, 0, true);
+}
bool GraphicsManager::getRGBIntoStack(uint x, uint y, StackHandler *sH) {
if (x >= _sceneWidth || y >= _sceneHeight) {