Ejemplo n.º 1
0
static void input_overlay_free_overlays(input_overlay_t *ol)
{
   size_t i;
   for (i = 0; i < ol->size; i++)
      input_overlay_free_overlay(&ol->overlays[i]);
   free(ol->overlays);
}
Ejemplo n.º 2
0
/* task_data = overlay_task_data_t* */
void input_overlay_loaded(void *task_data, void *user_data, const char *err)
{
   size_t i;
   overlay_task_data_t              *data = (overlay_task_data_t*)task_data;
   settings_t                   *settings = config_get_ptr();
   input_overlay_t                    *ol = NULL;
   const video_overlay_interface_t *iface = NULL;

   if (err)
      return;

#ifdef HAVE_MENU
   /* We can't display when the menu is up */
   if (settings->input.overlay_hide_in_menu && menu_driver_ctl(RARCH_MENU_CTL_IS_ALIVE, NULL))
   {
      if (!input_driver_is_onscreen_keyboard_enabled() && settings->input.overlay_enable)
         goto abort_load;
   }
#endif

   if (!settings->input.overlay_enable)
      goto abort_load;

   if (!video_driver_overlay_interface(&iface) || !iface)
   {
      RARCH_ERR("Overlay interface is not present in video driver.\n");
      goto abort_load;
   }

   ol             = (input_overlay_t*)calloc(1, sizeof(*ol));
   ol->overlays   = data->overlays;
   ol->size       = data->size;
   ol->active     = data->active;
   ol->iface      = iface;
   ol->iface_data = video_driver_get_ptr(true);

   input_overlay_load_active(ol, settings->input.overlay_opacity);

   if (input_driver_is_onscreen_keyboard_enabled())
      input_overlay_enable(ol, settings->osk.enable);
   else
      input_overlay_enable(ol, settings->input.overlay_enable);
   input_overlay_set_scale_factor(ol, settings->input.overlay_scale);

   ol->next_index = (ol->index + 1) % ol->size;
   ol->state      = OVERLAY_STATUS_NONE;
   ol->alive      = true;
   overlay_ptr    = ol;

   free(data);
   return;

abort_load:
   for (i = 0; i < data->size; i++)
      input_overlay_free_overlay(&data->overlays[i]);

   free(data->overlays);
   free(data);
}
Ejemplo n.º 3
0
static void input_overlay_free_overlays(input_overlay_t *ol)
{
   size_t i;

   if (!ol)
      return;

   for (i = 0; i < ol->size; i++)
      input_overlay_free_overlay(&ol->overlays[i]);

   if (ol->overlays)
      free(ol->overlays);
   ol->overlays = NULL;
}