aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/events.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2015-08-02 19:04:48 -0400
committerPaul Gilbert2015-08-02 19:04:48 -0400
commitb06cfaed9c2f890551d357fbc88fd7359b7f9158 (patch)
tree3767383ebf495f6596d46eb6224520b07800fc53 /engines/sherlock/events.cpp
parent9f74d342a87da25c96550f2528e0eab67eb6897a (diff)
downloadscummvm-rg350-b06cfaed9c2f890551d357fbc88fd7359b7f9158.tar.gz
scummvm-rg350-b06cfaed9c2f890551d357fbc88fd7359b7f9158.tar.bz2
scummvm-rg350-b06cfaed9c2f890551d357fbc88fd7359b7f9158.zip
SHERLOCK: RT: Fix transparency when dragging lab items with cursor
Diffstat (limited to 'engines/sherlock/events.cpp')
-rw-r--r--engines/sherlock/events.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/engines/sherlock/events.cpp b/engines/sherlock/events.cpp
index fb09a31c5a..204db8bd15 100644
--- a/engines/sherlock/events.cpp
+++ b/engines/sherlock/events.cpp
@@ -27,6 +27,7 @@
#include "graphics/cursorman.h"
#include "sherlock/sherlock.h"
#include "sherlock/events.h"
+#include "sherlock/surface.h"
namespace Sherlock {
@@ -120,9 +121,8 @@ void Events::setCursor(CursorId cursorId, const Common::Point &cursorPos, const
r.moveTo(0, 0);
// Form a single surface containing both frames
- Graphics::Surface s;
- s.create(r.width(), r.height(), Graphics::PixelFormat::createFormatCLUT8());
- s.fillRect(r, TRANSPARENCY);
+ Surface s(r.width(), r.height());
+ s.fill(TRANSPARENCY);
// Draw the passed image
Common::Point drawPos;
@@ -130,11 +130,11 @@ void Events::setCursor(CursorId cursorId, const Common::Point &cursorPos, const
drawPos.x = -cursorPt.x;
if (cursorPt.y < 0)
drawPos.y = -cursorPt.y;
- s.copyRectToSurface(surface, drawPos.x, drawPos.y, Common::Rect(0, 0, surface.w, surface.h));
+ s.blitFrom(surface, Common::Point(drawPos.x, drawPos.y));
// Draw the cursor image
drawPos = Common::Point(MAX(cursorPt.x, (int16)0), MAX(cursorPt.y, (int16)0));
- s.copyRectToSurface(cursorImg, drawPos.x, drawPos.y, Common::Rect(0, 0, cursorImg.w, cursorImg.h));
+ s.transBlitFrom(cursorImg, Common::Point(drawPos.x, drawPos.y));
// Set up hotspot position for cursor, adjusting for cursor image's position within the surface
Common::Point hotspot;
@@ -142,7 +142,7 @@ void Events::setCursor(CursorId cursorId, const Common::Point &cursorPos, const
hotspot = Common::Point(8, 8);
hotspot += drawPos;
// Set the cursor
- setCursor(s, hotspot.x, hotspot.y);
+ setCursor(s.getRawSurface(), hotspot.x, hotspot.y);
}
void Events::animateCursorIfNeeded() {