static void rarch_main_data_overlay_iterate(void)
{
   if (g_runloop.is_idle)
      return;
   if (!driver.overlay)
      return;

   switch (driver.overlay->state)
   {
      case OVERLAY_STATUS_NONE:
      case OVERLAY_STATUS_ALIVE:
         break;
      case OVERLAY_STATUS_DEFERRED_LOAD:
         input_overlay_load_overlays(driver.overlay);
         break;
      case OVERLAY_STATUS_DEFERRED_LOADING:
         input_overlay_load_overlays_iterate(driver.overlay);
         break;
      case OVERLAY_STATUS_DEFERRED_LOADING_RESOLVE:
         input_overlay_load_overlays_resolve_iterate(driver.overlay);
         break;
      case OVERLAY_STATUS_DEFERRED_DONE:
         input_overlay_new_done(driver.overlay);
         break;
      case OVERLAY_STATUS_DEFERRED_ERROR:
         input_overlay_free(driver.overlay);
         break;
      default:
         break;
   }
}
Exemple #2
0
void rarch_main_data_overlay_iterate(bool is_thread)
{
#ifdef HAVE_THREADS
   if (is_thread)
      slock_lock(overlay_lock);
#endif

   switch (input_overlay_status())
   {
      case OVERLAY_STATUS_DEFERRED_LOAD:
         input_overlay_load_overlays();
         break;
      case OVERLAY_STATUS_DEFERRED_LOADING_RESOLVE:
         input_overlay_load_overlays_resolve_iterate();
         break;
      case OVERLAY_STATUS_DEFERRED_DONE:
         input_overlay_new_done();
         break;
      case OVERLAY_STATUS_DEFERRED_ERROR:
         input_overlay_free();
         break;
      default:
      case OVERLAY_STATUS_NONE:
         break;
   }

#ifdef HAVE_THREADS
   if (is_thread)
      slock_unlock(overlay_lock);
#endif
}
Exemple #3
0
void rarch_main_iterate_overlay_state(void)
{
    switch (driver.overlay->state)
    {
    case OVERLAY_STATUS_NONE:
    case OVERLAY_STATUS_ALIVE:
        break;
    case OVERLAY_STATUS_DEFERRED_LOAD:
        input_overlay_load_overlays(driver.overlay);
        break;
    case OVERLAY_STATUS_DEFERRED_LOADING:
        input_overlay_load_overlays_iterate(driver.overlay);
        break;
    case OVERLAY_STATUS_DEFERRED_LOADING_RESOLVE:
        input_overlay_load_overlays_resolve_iterate(driver.overlay);
        break;
    case OVERLAY_STATUS_DEFERRED_DONE:
        input_overlay_new_done(driver.overlay);
        break;
    case OVERLAY_STATUS_DEFERRED_ERROR:
        input_overlay_free(driver.overlay);
        break;
    default:
        break;
    }
}
Exemple #4
0
input_overlay_t *input_overlay_new(const char *overlay)
{
   input_overlay_t *ol = (input_overlay_t*)calloc(1, sizeof(*ol));

   if (!ol)
      goto error;

   ol->overlay_path = strdup(overlay);
   if (!ol->overlay_path)
   {
      free(ol);
      return NULL;
   }

   if (!driver.video->overlay_interface)
   {
      RARCH_ERR("Overlay interface is not present in video driver.\n");
      goto error;
   }

   video_overlay_interface_func(&ol->iface);
   ol->iface_data = driver.video_data;

   if (!ol->iface)
      goto error;

   if (!input_overlay_load_overlays(ol, overlay))
      goto error;

   ol->active = &ol->overlays[0];

   input_overlay_load_active(ol);
   ol->iface->enable(ol->iface_data, true);
   ol->enable = true;

   input_overlay_set_alpha_mod(ol, g_settings.input.overlay_opacity);
   input_overlay_set_scale_factor(ol, g_settings.input.overlay_scale);
   ol->next_index = (ol->index + 1) % ol->size;

   return ol;

error:
   input_overlay_free(ol);
   return NULL;
}
Exemple #5
0
input_overlay_t *input_overlay_new(const char *overlay)
{
   input_overlay_t *ol = (input_overlay_t*)calloc(1, sizeof(*ol));

   if (!ol)
      goto error;

   if (!driver.video->overlay_interface)
   {
      RARCH_ERR("Overlay interface is not present in video driver.\n");
      goto error;
   }

   video_overlay_interface_func(&ol->iface);
   ol->iface_data = driver.video_data;

   if (!ol->iface)
      goto error;

   if (!input_overlay_load_overlays(ol, overlay))
      goto error;

   ol->active = &ol->overlays[0];
   ol->iface->load(ol->iface_data, ol->active->image, ol->active->width, ol->active->height);
   ol->iface->vertex_geom(ol->iface_data,
         ol->active->mod_x, ol->active->mod_y, ol->active->mod_w, ol->active->mod_h);
   ol->iface->full_screen(ol->iface_data, ol->active->full_screen);

   ol->iface->enable(ol->iface_data, true);
   ol->enable = true;

   input_overlay_set_alpha_mod(ol, g_settings.input.overlay_opacity);
   input_overlay_set_scale_factor(ol, 1.0f);
   ol->next_index = (ol->index + 1) % ol->size;

   return ol;

error:
   input_overlay_free(ol);
   return NULL;
}