aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/graphics.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2015-04-17 00:07:31 -0500
committerPaul Gilbert2015-04-17 00:07:31 -0500
commit19142ef58a3e632b31a87a99b817e261f47c1bc4 (patch)
tree306777f935558a3cb60a64a0985c29b38006e604 /engines/sherlock/graphics.cpp
parent9ba234c0e09c4fc034ddd82f82483e10e2470dec (diff)
downloadscummvm-rg350-19142ef58a3e632b31a87a99b817e261f47c1bc4.tar.gz
scummvm-rg350-19142ef58a3e632b31a87a99b817e261f47c1bc4.tar.bz2
scummvm-rg350-19142ef58a3e632b31a87a99b817e261f47c1bc4.zip
SHERLOCK: Implement map icon drawing/restoring
Diffstat (limited to 'engines/sherlock/graphics.cpp')
-rw-r--r--engines/sherlock/graphics.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/engines/sherlock/graphics.cpp b/engines/sherlock/graphics.cpp
index 306ff23548..6e986c839b 100644
--- a/engines/sherlock/graphics.cpp
+++ b/engines/sherlock/graphics.cpp
@@ -28,7 +28,7 @@
namespace Sherlock {
Surface::Surface(uint16 width, uint16 height): _freePixels(true) {
- create(width, height, Graphics::PixelFormat::createFormatCLUT8());
+ create(width, height);
}
Surface::Surface(Surface &src, const Common::Rect &r) : _freePixels(false) {
@@ -39,12 +39,23 @@ Surface::Surface(Surface &src, const Common::Rect &r) : _freePixels(false) {
format = Graphics::PixelFormat::createFormatCLUT8();
}
+Surface::Surface() : _freePixels(false) {
+}
Surface::~Surface() {
if (_freePixels)
free();
}
+void Surface::create(uint16 width, uint16 height) {
+ if (_freePixels)
+ free();
+
+ Graphics::Surface::create(width, height, Graphics::PixelFormat::createFormatCLUT8());
+ _freePixels = true;
+}
+
+
/**
* Copy a surface into this one
*/