mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-02-18 12:30:33 +00:00
SDL: Move cursor initialization to base
Also decide in just one place whether to use hardware or software cursor.
This commit is contained in:
parent
6eb54dccbe
commit
b2e5125868
@ -721,6 +721,19 @@ void driver_base::init()
|
|||||||
// Set frame buffer base
|
// Set frame buffer base
|
||||||
set_mac_frame_buffer(monitor, VIDEO_MODE_DEPTH, true);
|
set_mac_frame_buffer(monitor, VIDEO_MODE_DEPTH, true);
|
||||||
|
|
||||||
|
bool hardware_cursor = false;
|
||||||
|
#ifdef SHEEPSHAVER
|
||||||
|
hardware_cursor = video_can_change_cursor();
|
||||||
|
if (hardware_cursor) {
|
||||||
|
// Create cursor
|
||||||
|
if ((sdl_cursor = SDL_CreateCursor(MacCursor + 4, MacCursor + 36, 16, 16, 0, 0)) != NULL) {
|
||||||
|
SDL_SetCursor(sdl_cursor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
// Hide cursor
|
||||||
|
SDL_ShowCursor(hardware_cursor);
|
||||||
|
|
||||||
// Everything went well
|
// Everything went well
|
||||||
init_ok = true;
|
init_ok = true;
|
||||||
}
|
}
|
||||||
@ -804,16 +817,6 @@ void driver_window::init()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
driver_base::init();
|
driver_base::init();
|
||||||
|
|
||||||
#ifdef SHEEPSHAVER
|
|
||||||
// Create cursor
|
|
||||||
if ((sdl_cursor = SDL_CreateCursor(MacCursor + 4, MacCursor + 36, 16, 16, 0, 0)) != NULL) {
|
|
||||||
SDL_SetCursor(sdl_cursor);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
// Hide cursor
|
|
||||||
SDL_ShowCursor(0);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Set window name/class
|
// Set window name/class
|
||||||
set_window_name(STR_WINDOW_TITLE);
|
set_window_name(STR_WINDOW_TITLE);
|
||||||
@ -884,9 +887,6 @@ void driver_fullscreen::init()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
driver_base::init();
|
driver_base::init();
|
||||||
|
|
||||||
// Hide cursor
|
|
||||||
SDL_ShowCursor(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close display
|
// Close display
|
||||||
|
Loading…
x
Reference in New Issue
Block a user