(Overlay) Add some logic

This commit is contained in:
twinaphex 2015-02-23 06:03:53 +01:00
parent 68fe4bcec6
commit 2390e17fc7
4 changed files with 19 additions and 2 deletions

View File

@ -604,7 +604,6 @@ struct global
struct
{
bool is_blocking;
bool is_processing;
bool is_finished;
transfer_cb_t cb;
msg_queue_t *msg_queue;

View File

@ -73,6 +73,7 @@ enum overlay_status
OVERLAY_STATUS_NONE = 0,
OVERLAY_STATUS_DEFERRED_LOAD,
OVERLAY_STATUS_DEFERRED_LOADING_IMAGE,
OVERLAY_STATUS_DEFERRED_LOADING_IMAGE_PROCESS,
OVERLAY_STATUS_DEFERRED_LOADING,
OVERLAY_STATUS_DEFERRED_LOADING_RESOLVE,
OVERLAY_STATUS_DEFERRED_DONE,
@ -80,6 +81,14 @@ enum overlay_status
OVERLAY_STATUS_ALIVE,
};
enum overlay_image_transfer_status
{
OVERLAY_IMAGE_TRANSFER_NONE = 0,
OVERLAY_IMAGE_TRANSFER_BUSY,
OVERLAY_IMAGE_TRANSFER_DONE,
OVERLAY_IMAGE_TRANSFER_ERROR,
};
struct overlay_desc
{
float x;
@ -135,6 +144,7 @@ struct input_overlay
const video_overlay_interface_t *iface;
bool enable;
enum overlay_image_transfer_status loading_status;
bool blocked;
struct overlay *overlays;

View File

@ -900,6 +900,8 @@ void rarch_main_iterate_overlay_state(void)
case OVERLAY_STATUS_DEFERRED_ERROR:
input_overlay_free(driver.overlay);
break;
default:
break;
}
}

View File

@ -135,7 +135,13 @@ static int cb_image_overlay(void *data, size_t len)
{
g_extern.images.is_finished = true;
g_extern.images.is_blocking = true;
g_extern.images.is_processing = true;
if (!driver.overlay)
return -1;
RARCH_LOG("Gets here.\n");
driver.overlay->loading_status = OVERLAY_IMAGE_TRANSFER_DONE;
return 0;
}