--- np2/macosx/mousemng.cpp 2003/10/19 14:48:07 1.2 +++ np2/macosx/mousemng.cpp 2003/10/24 12:35:19 1.5 @@ -1,4 +1,6 @@ + #if defined(NP2GCC) + #include "compiler.h" #include "np2.h" #include "mousemng.h" @@ -28,12 +30,12 @@ void mouseonoff(BYTE flg) { if ((lastmouse ^ flg) & 1) { lastmouse = (flg & 1); if (lastmouse & 1) { - CGDisplayHideCursor(kCGDirectMainDisplay); + HideCursor(); getmaincenter(&cp); CGWarpMouseCursorPosition(CGPointMake(cp.h, cp.v)); } else { - CGDisplayShowCursor(kCGDirectMainDisplay); + ShowCursor(); } } } @@ -73,22 +75,15 @@ void mouse_running(BYTE flg) { } -void mouse_callback(void) { +void mouse_callback(HIPoint delta) { Point cp; - CGMouseDelta x,y; - static CGMouseDelta pastx=0,pasty=0; if (lastmouse & 1) { - CGGetLastMouseDelta(&x, &y); - if ((pastx!=x) && (pasty!=y)) { - mousex += (short)x; - mousey += (short)y; - pastx = x; - pasty = y; - getmaincenter(&cp); - CGWarpMouseCursorPosition(CGPointMake(cp.h, cp.v)); - } + mousex += (short)delta.x; + mousey += (short)delta.y; + getmaincenter(&cp); + CGWarpMouseCursorPosition(CGPointMake(cp.h, cp.v)); } } @@ -129,10 +124,10 @@ BYTE mouse_btn(BYTE btn) { } #else + #include "compiler.h" #include "mousemng.h" - BYTE mousemng_getstat(SINT16 *x, SINT16 *y, int clear) { *x = 0; @@ -141,4 +136,5 @@ BYTE mousemng_getstat(SINT16 *x, SINT16 return(0xa0); } -#endif \ No newline at end of file +#endif +