mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
simulator: Adjust scaling using keyboard shortcuts
Press 0-3 to to adjust current zoom level to 50% (0), 100% (1), 200% (2), or 300% (3). Press 4 to switch between "best" (linear) and nearest pixel sampling. Change-Id: Id10d361659855a0ad9c97e6b341f498f72709ef5
This commit is contained in:
parent
759cbf4e5f
commit
7aaa722a5d
3 changed files with 55 additions and 22 deletions
|
@ -351,6 +351,30 @@ static void button_event(int key, bool pressed)
|
|||
switch (key)
|
||||
{
|
||||
#ifdef SIMULATOR
|
||||
case SDLK_0:
|
||||
display_zoom = 0.5;
|
||||
case SDLK_1:
|
||||
display_zoom = display_zoom ?: 1;
|
||||
case SDLK_2:
|
||||
display_zoom = display_zoom ?: 2;
|
||||
case SDLK_3:
|
||||
display_zoom = display_zoom ?: 3;
|
||||
case SDLK_4:
|
||||
if (pressed)
|
||||
{
|
||||
display_zoom = 0;
|
||||
return;
|
||||
}
|
||||
if (!display_zoom)
|
||||
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY,
|
||||
strcmp(SDL_GetHint(SDL_HINT_RENDER_SCALE_QUALITY) ?:
|
||||
"best", "best") ? "best": "nearest");
|
||||
|
||||
sdl_window_needs_update();
|
||||
#if !defined(__WIN32) && !defined (__APPLE__)
|
||||
button_queue_post(SDLK_UNKNOWN, 0); /* update window on main thread */
|
||||
#endif
|
||||
return;
|
||||
case USB_KEY:
|
||||
if (!pressed)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue