summaryrefslogtreecommitdiff
path: root/emu
diff options
context:
space:
mode:
authorCharles.Forsyth <devnull@localhost>2007-09-27 16:18:51 +0000
committerCharles.Forsyth <devnull@localhost>2007-09-27 16:18:51 +0000
commit86393c201844da762b4a04ce97fc34a2c73f7d33 (patch)
tree86cd91f3a0c092d7f60c1c1ae51da79c4919ad21 /emu
parent9fdaa1ac62dd5df02c8faa132036e0dde015e0b7 (diff)
20070927-1718
Diffstat (limited to 'emu')
-rw-r--r--emu/MacOSX/win.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/emu/MacOSX/win.c b/emu/MacOSX/win.c
index 3d7cd9f3..c6db1429 100644
--- a/emu/MacOSX/win.c
+++ b/emu/MacOSX/win.c
@@ -716,8 +716,37 @@ setpointer(int x, int y)
void
drawcursor(Drawcursor* c)
{
- if(c->data == nil){
+ Cursor crsr;
+ uchar *bc, *bs, *ps, *pm;
+ int i, j, h, w, bpl;
+
+ if(c->data == nil || c->minx >= c->maxx){
InitCursor();
return;
}
+ memset(crsr.data, 0, sizeof(crsr.data));
+ memset(crsr.mask, 0, sizeof(crsr.mask));
+ ps = (uchar*)crsr.data;
+ pm = (uchar*)crsr.mask;
+ h = (c->maxy - c->miny)/2; /* bounds include both masks, strangely */
+ bpl = bytesperline(Rect(c->minx, c->miny, c->maxx, c->maxy), 1);
+ if((w = bpl) > 2)
+ w = 2;
+ bc = c->data;
+ bs = c->data + h*bpl;
+ if(h > 16)
+ h = 16;
+ for(i = 0; i < h; i++){
+ for(j = 0; j < w; j++){
+ ps[j] = bs[j];
+ pm[j] = bs[j] | bc[j];
+ }
+ bs += bpl;
+ bc += bpl;
+ ps += 2;
+ pm += 2;
+ }
+ crsr.hotSpot.h = -c->hotx;
+ crsr.hotSpot.v = -c->hoty;
+ SetCursor(&crsr);
}