aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2015-05-19 07:50:50 -0400
committerPaul Gilbert2015-05-19 07:50:50 -0400
commit2752db8103c2076bc7838f6306de338f986f68a4 (patch)
tree5c867352354b00587f66ac34b794b31e06c79828
parent1df183ffcb08a69ed414afd69284a0596fee4e82 (diff)
downloadscummvm-rg350-2752db8103c2076bc7838f6306de338f986f68a4.tar.gz
scummvm-rg350-2752db8103c2076bc7838f6306de338f986f68a4.tar.bz2
scummvm-rg350-2752db8103c2076bc7838f6306de338f986f68a4.zip
SHERLOCK: Remove iimplicit conversion operator from ImageFrame
-rw-r--r--engines/sherlock/events.cpp2
-rw-r--r--engines/sherlock/map.cpp6
-rw-r--r--engines/sherlock/resources.h2
-rw-r--r--engines/sherlock/surface.cpp13
-rw-r--r--engines/sherlock/surface.h23
5 files changed, 36 insertions, 10 deletions
diff --git a/engines/sherlock/events.cpp b/engines/sherlock/events.cpp
index 38093a6c72..b01437d54b 100644
--- a/engines/sherlock/events.cpp
+++ b/engines/sherlock/events.cpp
@@ -63,7 +63,7 @@ void Events::setCursor(CursorId cursorId) {
_cursorId = cursorId;
// Set the cursor data
- Graphics::Surface &s = (*_cursorImages)[cursorId];
+ Graphics::Surface &s = (*_cursorImages)[cursorId]._frame;
setCursor(s);
}
diff --git a/engines/sherlock/map.cpp b/engines/sherlock/map.cpp
index 737abb4895..ae19e65280 100644
--- a/engines/sherlock/map.cpp
+++ b/engines/sherlock/map.cpp
@@ -228,7 +228,7 @@ int Map::show() {
// Show wait cursor
_cursorIndex = 1;
- events.setCursor((*_mapCursors)[_cursorIndex]);
+ events.setCursor((*_mapCursors)[_cursorIndex]._frame);
}
}
@@ -269,7 +269,7 @@ void Map::setupSprites() {
_mapCursors = new ImageFile("omouse.vgs");
_cursorIndex = 0;
- events.setCursor((*_mapCursors)[_cursorIndex]);
+ events.setCursor((*_mapCursors)[_cursorIndex]._frame);
_shapes = new ImageFile("mapicon.vgs");
_iconShapes = new ImageFile("overicon.vgs");
@@ -369,7 +369,7 @@ void Map::updateMap(bool flushScreen) {
if (++_cursorIndex > (1 + 8))
_cursorIndex = 1;
- events.setCursor((*_mapCursors)[(_cursorIndex + 1) / 2]);
+ events.setCursor((*_mapCursors)[(_cursorIndex + 1) / 2]._frame);
}
if (!_drawMap && !flushScreen)
diff --git a/engines/sherlock/resources.h b/engines/sherlock/resources.h
index 4ca4038529..fb91b30f94 100644
--- a/engines/sherlock/resources.h
+++ b/engines/sherlock/resources.h
@@ -158,8 +158,6 @@ struct ImageFrame {
Common::Point _offset;
byte _rleMarker;
Graphics::Surface _frame;
-
- operator Graphics::Surface &() { return _frame; }
};
class ImageFile : public Common::Array<ImageFrame> {
diff --git a/engines/sherlock/surface.cpp b/engines/sherlock/surface.cpp
index b54f43bf52..83d4b78a0a 100644
--- a/engines/sherlock/surface.cpp
+++ b/engines/sherlock/surface.cpp
@@ -22,6 +22,7 @@
#include "sherlock/surface.h"
#include "sherlock/sherlock.h"
+#include "sherlock/resources.h"
#include "common/system.h"
#include "graphics/palette.h"
@@ -51,10 +52,18 @@ void Surface::blitFrom(const Graphics::Surface &src) {
blitFrom(src, Common::Point(0, 0));
}
+void Surface::blitFrom(const ImageFrame &src) {
+ blitFrom(src._frame, Common::Point(0, 0));
+}
+
void Surface::blitFrom(const Graphics::Surface &src, const Common::Point &pt) {
blitFrom(src, pt, Common::Rect(0, 0, src.w, src.h));
}
+void Surface::blitFrom(const ImageFrame &src, const Common::Point &pt) {
+ blitFrom(src._frame, pt, Common::Rect(0, 0, src._frame.w, src._frame.h));
+}
+
void Surface::blitFrom(const Graphics::Surface &src, const Common::Point &pt,
const Common::Rect &srcBounds) {
Common::Rect srcRect = srcBounds;
@@ -67,6 +76,10 @@ void Surface::blitFrom(const Graphics::Surface &src, const Common::Point &pt,
}
}
+void Surface::blitFrom(const ImageFrame &src, const Common::Point &pt, const Common::Rect &srcBounds) {
+ blitFrom(src._frame, pt, srcBounds);
+}
+
void Surface::transBlitFrom(const ImageFrame &src, const Common::Point &pt,
bool flipped, int overrideColor) {
transBlitFrom(src._frame, pt + src._offset, flipped, overrideColor);
diff --git a/engines/sherlock/surface.h b/engines/sherlock/surface.h
index 7049d8ae76..4b7166b090 100644
--- a/engines/sherlock/surface.h
+++ b/engines/sherlock/surface.h
@@ -25,10 +25,11 @@
#include "common/rect.h"
#include "graphics/surface.h"
-#include "sherlock/resources.h"
namespace Sherlock {
+struct ImageFrame;
+
class Surface : public Graphics::Surface {
private:
bool _freePixels;
@@ -56,16 +57,30 @@ public:
void blitFrom(const Graphics::Surface &src);
/**
+ * Copy an image frame into this surface
+ */
+ void blitFrom(const ImageFrame &src);
+
+ /**
* Draws a surface at a given position within this surface
*/
void blitFrom(const Graphics::Surface &src, const Common::Point &pt);
/**
+ * Copy an image frame onto this surface at a given position
+ */
+ void blitFrom(const ImageFrame &src, const Common::Point &pt);
+
+ /**
* Draws a sub-section of a surface at a given position within this surface
*/
- void blitFrom(const Graphics::Surface &src, const Common::Point &pt,
- const Common::Rect &srcBounds);
-
+ void blitFrom(const Graphics::Surface &src, const Common::Point &pt, const Common::Rect &srcBounds);
+
+ /**
+ * Copy a sub-area of a source image frame into this surface at a given position
+ */
+ void blitFrom(const ImageFrame &src, const Common::Point &pt, const Common::Rect &srcBounds);
+
/**
* Draws an image frame at a given position within this surface with transparency
*/