Add prefs item init_grab

This commit is contained in:
kanjitalk755 2024-01-11 11:00:04 +09:00
parent 9088a674ad
commit 3176aa887d
4 changed files with 6 additions and 0 deletions

View File

@ -1097,6 +1097,8 @@ void driver_base::init()
sdl_palette = SDL_AllocPalette(256);
sdl_palette->colors[1] = (SDL_Color){ .r = 0, .g = 0, .b = 0, .a = 255 };
SDL_SetSurfacePalette(s, sdl_palette);
if (PrefsFindBool("init_grab") && !PrefsFindBool("hardcursor")) grab_mouse();
}
void driver_base::adapt_to_video_mode() {

View File

@ -1084,6 +1084,8 @@ void driver_base::init()
sdl_palette = SDL_CreatePalette(256);
sdl_palette->colors[1] = (SDL_Color){ .r = 0, .g = 0, .b = 0, .a = 255 };
SDL_SetSurfacePalette(s, sdl_palette);
if (PrefsFindBool("init_grab") && !PrefsFindBool("hardcursor")) grab_mouse();
}
void driver_base::adapt_to_video_mode() {

View File

@ -86,6 +86,7 @@ prefs_desc common_prefs_items[] = {
{"sound_buffer", TYPE_INT32, false, "sound buffer length"},
{"name_encoding", TYPE_INT32, false, "file name encoding"},
{"delay", TYPE_INT32, false, "additional delay [uS] every 64k instructions"},
{"init_grab", TYPE_BOOLEAN, false, "initially grabbing mouse"},
{NULL, TYPE_END, false, NULL} // End of list
};

View File

@ -73,6 +73,7 @@ prefs_desc common_prefs_items[] = {
{"title", TYPE_STRING, false, "window title"},
{"sound_buffer", TYPE_INT32, false, "sound buffer length"},
{"name_encoding", TYPE_INT32, false, "file name encoding"},
{"init_grab", TYPE_BOOLEAN, false, "initially grabbing mouse"},
{NULL, TYPE_END, false, NULL} // End of list
};