Merge pull request #11324 from jdgleaver/overlay-fixes

Miscellaneous overlay fixes
This commit is contained in:
Autechre 2020-09-11 18:52:19 +02:00 committed by GitHub
commit e6b3e21f5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 7 deletions

View File

@ -2788,6 +2788,9 @@ static void vulkan_overlay_free(vk_t *vk)
vk->context->device,
&vk->overlay.images[i]);
if (vk->overlay.images)
free(vk->overlay.images);
memset(&vk->overlay, 0, sizeof(vk->overlay));
}

View File

@ -439,8 +439,6 @@ static bool video_thread_handle_packet(
case CMD_OVERLAY_LOAD:
{
float *tmp_alpha_mod = NULL;
if (thr->overlay && thr->overlay->load)
ret = thr->overlay->load(thr->driver_data,
pkt.data.image.data,
@ -448,11 +446,21 @@ static bool video_thread_handle_packet(
pkt.data.b = ret;
thr->alpha_mods = pkt.data.image.num;
tmp_alpha_mod = (float*)realloc(thr->alpha_mod,
thr->alpha_mods * sizeof(float));
if (tmp_alpha_mod)
thr->alpha_mod = tmp_alpha_mod;
if (thr->alpha_mods > 0)
{
float *tmp_alpha_mod = (float*)realloc(thr->alpha_mod,
thr->alpha_mods * sizeof(float));
if (tmp_alpha_mod)
thr->alpha_mod = tmp_alpha_mod;
}
else
{
if (thr->alpha_mod)
free(thr->alpha_mod);
thr->alpha_mod = NULL;
}
/* Avoid temporary garbage data. */
for (i = 0; i < thr->alpha_mods; i++)

View File

@ -24368,7 +24368,9 @@ static int16_t input_state_device(
res = 1;
/* Don't allow turbo for D-pad. */
if ((id < RETRO_DEVICE_ID_JOYPAD_UP || id > RETRO_DEVICE_ID_JOYPAD_RIGHT))
if ((id < RETRO_DEVICE_ID_JOYPAD_UP) ||
((id > RETRO_DEVICE_ID_JOYPAD_RIGHT) &&
(id <= RETRO_DEVICE_ID_JOYPAD_R3)))
{
/*
* Apply turbo button if activated.