From efadc1fe659ed3ddcecdf1d886b7ab834fa8ca2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Jahoda?= Date: Fri, 5 Jan 2018 23:22:23 +0100 Subject: [PATCH] Don't show mouse if we don't use it for input. --- src/studio.c | 18 +++++++++++------- src/tic.c | 4 ++-- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/studio.c b/src/studio.c index 686cb16..fa7f676 100644 --- a/src/studio.c +++ b/src/studio.c @@ -2300,13 +2300,17 @@ static void blitCursor(const u8* in) static void renderCursor() { - if(studio.mode == TIC_RUN_MODE && - studio.tic->ram.vram.vars.cursor) - { - SDL_ShowCursor(SDL_DISABLE); - blitCursor(studio.tic->ram.sprites.data[studio.tic->ram.vram.vars.cursor].data); - return; - } + if(studio.mode == TIC_RUN_MODE && !studio.tic->input.mouse) + { + SDL_ShowCursor(SDL_DISABLE); + return; + } + if(studio.mode == TIC_RUN_MODE && studio.tic->ram.vram.vars.cursor) + { + SDL_ShowCursor(SDL_DISABLE); + blitCursor(studio.tic->ram.sprites.data[studio.tic->ram.vram.vars.cursor].data); + return; + } SDL_ShowCursor(getConfig()->theme.cursor.sprite >= 0 ? SDL_DISABLE : SDL_ENABLE); diff --git a/src/tic.c b/src/tic.c index da91c19..0ca2caa 100644 --- a/src/tic.c +++ b/src/tic.c @@ -1577,7 +1577,7 @@ static void api_tick(tic_mem* tic, tic_tick_data* data) tic->input.gamepad = 1; else if(compareMetatag(code, "input", "keyboard", config->singleComment)) tic->input.keyboard = 1; - else tic->input.data = -1; + else tic->input.data = -1; // default is all enabled data->start = data->counter(); @@ -2139,4 +2139,4 @@ void parseCode(const tic_script_config* config, const char* start, u8* color, co ptr++; } -} \ No newline at end of file +}