Merge pull request #498 from jahodfra/hide_mouse

Don't show mouse if we don't use it for input.
This commit is contained in:
Vadim Grigoruk 2018-01-08 10:41:06 +03:00 committed by GitHub
commit dc1aa89fd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 9 deletions

View File

@ -2300,13 +2300,17 @@ static void blitCursor(const u8* in)
static void renderCursor() static void renderCursor()
{ {
if(studio.mode == TIC_RUN_MODE && if(studio.mode == TIC_RUN_MODE && !studio.tic->input.mouse)
studio.tic->ram.vram.vars.cursor) {
{ SDL_ShowCursor(SDL_DISABLE);
SDL_ShowCursor(SDL_DISABLE); return;
blitCursor(studio.tic->ram.sprites.data[studio.tic->ram.vram.vars.cursor].data); }
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); SDL_ShowCursor(getConfig()->theme.cursor.sprite >= 0 ? SDL_DISABLE : SDL_ENABLE);

View File

@ -1577,7 +1577,7 @@ static void api_tick(tic_mem* tic, tic_tick_data* data)
tic->input.gamepad = 1; tic->input.gamepad = 1;
else if(compareMetatag(code, "input", "keyboard", config->singleComment)) else if(compareMetatag(code, "input", "keyboard", config->singleComment))
tic->input.keyboard = 1; tic->input.keyboard = 1;
else tic->input.data = -1; else tic->input.data = -1; // default is all enabled
data->start = data->counter(); data->start = data->counter();
@ -2139,4 +2139,4 @@ void parseCode(const tic_script_config* config, const char* start, u8* color, co
ptr++; ptr++;
} }
} }