35 |
|
* - Events processing is bound to the general emulation thread as SDL requires |
36 |
|
* to PumpEvents() within the same thread as the one that called SetVideoMode(). |
37 |
|
* Besides, there can't seem to be a way to call SetVideoMode() from a child thread. |
38 |
+ |
* - Refresh performance is still slow. Use SDL_CreateRGBSurface()? |
39 |
+ |
* - Backport hw cursor acceleration to Basilisk II? |
40 |
+ |
* - Move generic Native QuickDraw acceleration routines to gfxaccel.cpp |
41 |
|
*/ |
42 |
|
|
43 |
|
#include "sysdeps.h" |
117 |
|
|
118 |
|
// SDL variables |
119 |
|
static int screen_depth; // Depth of current screen |
120 |
+ |
static SDL_Cursor *sdl_cursor; // Copy of Mac cursor |
121 |
+ |
static volatile bool cursor_changed = false; // Flag: cursor changed, redraw_func must update the cursor |
122 |
|
static SDL_Color sdl_palette[256]; // Color palette to be used as CLUT and gamma table |
123 |
|
static bool sdl_palette_changed = false; // Flag: Palette changed, redraw thread must set new colors |
124 |
|
static const int sdl_eventmask = SDL_MOUSEBUTTONDOWNMASK | SDL_MOUSEBUTTONUPMASK | SDL_MOUSEMOTIONMASK | SDL_KEYUPMASK | SDL_KEYDOWNMASK | SDL_VIDEOEXPOSEMASK | SDL_QUITMASK; |
632 |
|
D(bug("the_buffer = %p, the_buffer_copy = %p\n", the_buffer, the_buffer_copy)); |
633 |
|
#endif |
634 |
|
|
635 |
< |
// Set window name/class |
636 |
< |
set_window_name(STR_WINDOW_TITLE); |
637 |
< |
|
635 |
> |
#ifdef SHEEPSHAVER |
636 |
> |
// Create cursor |
637 |
> |
if ((sdl_cursor = SDL_CreateCursor(MacCursor + 4, MacCursor + 36, 16, 16, 0, 0)) != NULL) { |
638 |
> |
SDL_SetCursor(sdl_cursor); |
639 |
> |
cursor_changed = false; |
640 |
> |
} |
641 |
> |
#else |
642 |
|
// Hide cursor |
643 |
|
SDL_ShowCursor(0); |
644 |
+ |
#endif |
645 |
+ |
|
646 |
+ |
// Set window name/class |
647 |
+ |
set_window_name(STR_WINDOW_TITLE); |
648 |
|
|
649 |
|
// Init blitting routines |
650 |
|
SDL_PixelFormat *f = s->format; |
1234 |
|
#ifdef SHEEPSHAVER |
1235 |
|
bool video_can_change_cursor(void) |
1236 |
|
{ |
1237 |
< |
// return hw_mac_cursor_accl && (display_type != DISPLAY_SCREEN); |
1225 |
< |
return false; |
1237 |
> |
return (display_type == DISPLAY_WINDOW); |
1238 |
|
} |
1239 |
|
#endif |
1240 |
|
|
1246 |
|
#ifdef SHEEPSHAVER |
1247 |
|
void video_set_cursor(void) |
1248 |
|
{ |
1249 |
< |
// cursor_changed = true; |
1249 |
> |
cursor_changed = true; |
1250 |
|
} |
1251 |
|
#endif |
1252 |
|
|
2170 |
|
// Refresh display |
2171 |
|
video_refresh(); |
2172 |
|
|
2173 |
+ |
#ifdef SHEEPSHAVER |
2174 |
+ |
// Set new cursor image if it was changed |
2175 |
+ |
if (cursor_changed && sdl_cursor) { |
2176 |
+ |
cursor_changed = false; |
2177 |
+ |
SDL_FreeCursor(sdl_cursor); |
2178 |
+ |
sdl_cursor = SDL_CreateCursor(MacCursor + 4, MacCursor + 36, 16, 16, MacCursor[2], MacCursor[3]); |
2179 |
+ |
if (sdl_cursor) |
2180 |
+ |
SDL_SetCursor(sdl_cursor); |
2181 |
+ |
} |
2182 |
+ |
#endif |
2183 |
+ |
|
2184 |
|
// Set new palette if it was changed |
2185 |
|
handle_palette_changes(); |
2186 |
|
} |