mirror of
https://github.com/libretro/RetroArch
synced 2025-03-31 10:20:41 +00:00
Merge pull request #13247 from Jamiras/cheevos_placard_gl
(cheevos) ensure placard is initialized on main thread
This commit is contained in:
commit
e9ca17ea41
@ -1357,14 +1357,23 @@ static void rcheevos_start_session_async(retro_task_t* task)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
rcheevos_show_game_placard();
|
|
||||||
|
|
||||||
task_set_finished(task, true);
|
task_set_finished(task, true);
|
||||||
|
|
||||||
if (rcheevos_end_load_state() == 0)
|
if (rcheevos_end_load_state() == 0)
|
||||||
rcheevos_fetch_badges();
|
rcheevos_fetch_badges();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void rcheevos_start_session_finish(retro_task_t* task, void* data, void* userdata, const char* error)
|
||||||
|
{
|
||||||
|
(void)task;
|
||||||
|
(void)data;
|
||||||
|
(void)userdata;
|
||||||
|
(void)error;
|
||||||
|
|
||||||
|
/* this must be called on the main thread */
|
||||||
|
rcheevos_show_game_placard();
|
||||||
|
}
|
||||||
|
|
||||||
static void rcheevos_start_session(void)
|
static void rcheevos_start_session(void)
|
||||||
{
|
{
|
||||||
retro_task_t* task;
|
retro_task_t* task;
|
||||||
@ -1391,6 +1400,7 @@ static void rcheevos_start_session(void)
|
|||||||
/* this is called on the primary thread. use a task to do the initialization on a background thread */
|
/* this is called on the primary thread. use a task to do the initialization on a background thread */
|
||||||
task = task_init();
|
task = task_init();
|
||||||
task->handler = rcheevos_start_session_async;
|
task->handler = rcheevos_start_session_async;
|
||||||
|
task->callback = rcheevos_start_session_finish;
|
||||||
task_queue_push(task);
|
task_queue_push(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "../menu/menu_entries.h"
|
#include "../menu/menu_entries.h"
|
||||||
|
|
||||||
#include <features/features_cpu.h>
|
#include <features/features_cpu.h>
|
||||||
|
#include <retro_assert.h>
|
||||||
|
|
||||||
enum rcheevos_menuitem_bucket
|
enum rcheevos_menuitem_bucket
|
||||||
{
|
{
|
||||||
@ -657,6 +658,9 @@ uintptr_t rcheevos_get_badge_texture(const char *badge, bool locked)
|
|||||||
if (!badge)
|
if (!badge)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
/* OpenGL driver crashes if gfx_display_reset_textures_list is called on a background thread */
|
||||||
|
retro_assert(task_is_on_main_thread());
|
||||||
|
|
||||||
snprintf(badge_file, sizeof(badge_file), "%s%s%s", badge,
|
snprintf(badge_file, sizeof(badge_file), "%s%s%s", badge,
|
||||||
locked ? "_lock" : "", FILE_PATH_PNG_EXTENSION);
|
locked ? "_lock" : "", FILE_PATH_PNG_EXTENSION);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user