From 3dd648b8c8fb4557bfda332b4087fd61e4707b97 Mon Sep 17 00:00:00 2001 From: Ruediger Hanke Date: Wed, 25 Dec 2002 17:22:01 +0000 Subject: Some fixes for COMI mouse pointer svn-id: r6138 --- backends/morphos/morphos.cpp | 19 ++++++++++++------- backends/morphos/morphos.h | 4 ++-- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/backends/morphos/morphos.cpp b/backends/morphos/morphos.cpp index a8ca0e9d12..2dbfca2f14 100644 --- a/backends/morphos/morphos.cpp +++ b/backends/morphos/morphos.cpp @@ -1180,12 +1180,16 @@ void OSystem_MorphOS::DrawMouse() return; MouseDrawn = true; - const int ydraw = MouseY - MouseHotspotY; - const int xdraw = MouseX - MouseHotspotX; - const int w = MouseWidth; - const int h = MouseHeight; - bak = MouseBackup; - byte *buf = MouseImage; + int ydraw = MouseY - MouseHotspotY; + int xdraw = MouseX - MouseHotspotX; + int w = MouseWidth; + int h = MouseHeight; + int x_mouseimg_offs = 0; + int y_mouseimg_offs = 0; + byte *buf; + + if (xdraw < 0) { x_mouseimg_offs = -xdraw; w += xdraw; xdraw = 0; } + if (ydraw < 0) { y_mouseimg_offs = -ydraw; h += ydraw; ydraw = 0; } MouseOldX = xdraw; MouseOldY = ydraw; @@ -1195,8 +1199,9 @@ void OSystem_MorphOS::DrawMouse() AddUpdateRect(xdraw, ydraw, w, h); dst = (byte*)ScummBuffer + ydraw*ScummBufferWidth + xdraw; bak = MouseBackup; + buf = MouseImage + y_mouseimg_offs*MAX_MOUSE_W + x_mouseimg_offs; - for (y = 0; y < h; y++, dst += ScummBufferWidth, bak += MAX_MOUSE_W, buf += w) + for (y = 0; y < h; y++, dst += ScummBufferWidth, bak += MAX_MOUSE_W, buf += MouseWidth) { if (ydraw+y < ScummBufferHeight) { diff --git a/backends/morphos/morphos.h b/backends/morphos/morphos.h index 225ee6d6df..aa6184f16d 100644 --- a/backends/morphos/morphos.h +++ b/backends/morphos/morphos.h @@ -123,8 +123,8 @@ class OSystem_MorphOS : public OSystem private: typedef enum { CSDSPTYPE_WINDOWED, CSDSPTYPE_FULLSCREEN, CSDSPTYPE_TOGGLE, CSDSPTYPE_KEEP } CS_DSPTYPE; - static const int MAX_MOUSE_W = 40; - static const int MAX_MOUSE_H = 40; + static const int MAX_MOUSE_W = 80; + static const int MAX_MOUSE_H = 80; void CreateScreen(CS_DSPTYPE dspType); void SwitchScalerTo(SCALERTYPE newScaler); -- cgit v1.2.3