22 |
|
#include <intuition/intuition.h> |
23 |
|
#include <graphics/rastport.h> |
24 |
|
#include <graphics/gfx.h> |
25 |
< |
#include <cybergraphx/cybergraphics.h> |
25 |
> |
#include <cybergraphics/cybergraphics.h> |
26 |
|
#include <dos/dostags.h> |
27 |
|
#include <devices/timer.h> |
28 |
|
#include <proto/exec.h> |
57 |
|
static struct Screen *the_screen = NULL; |
58 |
|
static struct Window *the_win = NULL; |
59 |
|
static struct BitMap *the_bitmap = NULL; |
60 |
+ |
static UWORD *null_pointer = NULL; // Blank mouse pointer data |
61 |
+ |
static UWORD *current_pointer = (UWORD *)-1; // Currently visible mouse pointer data |
62 |
|
static LONG black_pen = -1, white_pen = -1; |
63 |
|
static struct Process *periodic_proc = NULL; // Periodic process |
64 |
|
|
354 |
|
|
355 |
|
bool VideoInit(bool classic) |
356 |
|
{ |
357 |
+ |
// Allocate blank mouse pointer data |
358 |
+ |
null_pointer = (UWORD *)AllocMem(12, MEMF_PUBLIC | MEMF_CHIP | MEMF_CLEAR); |
359 |
+ |
if (null_pointer == NULL) { |
360 |
+ |
ErrorAlert(GetString(STR_NO_MEM_ERR)); |
361 |
+ |
return false; |
362 |
+ |
} |
363 |
+ |
|
364 |
|
// Read frame skip prefs |
365 |
|
frame_skip = PrefsFindInt32("frameskip"); |
366 |
|
if (frame_skip == 0) |
497 |
|
} |
498 |
|
break; |
499 |
|
} |
500 |
+ |
|
501 |
+ |
// Free mouse pointer |
502 |
+ |
if (null_pointer) { |
503 |
+ |
FreeMem(null_pointer, 12); |
504 |
+ |
null_pointer = NULL; |
505 |
+ |
} |
506 |
|
} |
507 |
|
|
508 |
|
|
613 |
|
// Handle message according to class |
614 |
|
switch (cl) { |
615 |
|
case IDCMP_MOUSEMOVE: |
616 |
< |
if (display_type == DISPLAY_SCREEN || display_type == DISPLAY_SCREEN_CGFX) |
616 |
> |
if (display_type == DISPLAY_SCREEN_P96 || display_type == DISPLAY_SCREEN_CGFX) |
617 |
|
ADBMouseMoved(mx, my); |
618 |
< |
else |
618 |
> |
else { |
619 |
|
ADBMouseMoved(mx - the_win->BorderLeft, my - the_win->BorderTop); |
620 |
+ |
if (mx < the_win->BorderLeft |
621 |
+ |
|| my < the_win->BorderTop |
622 |
+ |
|| mx >= the_win->BorderLeft + VideoMonitor.x |
623 |
+ |
|| my >= the_win->BorderTop + VideoMonitor.y) { |
624 |
+ |
if (current_pointer) { |
625 |
+ |
ClearPointer(the_win); |
626 |
+ |
current_pointer = NULL; |
627 |
+ |
} |
628 |
+ |
} else { |
629 |
+ |
if (current_pointer != null_pointer) { |
630 |
+ |
// Hide mouse pointer inside window |
631 |
+ |
SetPointer(the_win, null_pointer, 1, 16, 0, 0); |
632 |
+ |
current_pointer = null_pointer; |
633 |
+ |
} |
634 |
+ |
} |
635 |
+ |
} |
636 |
|
break; |
637 |
|
|
638 |
|
case IDCMP_MOUSEBUTTONS: |