mirror of
https://github.com/libretro/RetroArch
synced 2025-04-03 10:21:31 +00:00
Add pos_increment to allow us to iterate through steps
This commit is contained in:
parent
89685c5709
commit
00beda42f2
@ -364,8 +364,10 @@ static bool input_overlay_load_overlay(input_overlay_t *ol,
|
||||
struct overlay *overlay, unsigned idx)
|
||||
{
|
||||
size_t i;
|
||||
bool not_done = overlay->pos < overlay->size;
|
||||
|
||||
for (i = 0; i < overlay->pos_increment; i++)
|
||||
{
|
||||
bool not_done = overlay->pos < overlay->size;
|
||||
if (!not_done)
|
||||
{
|
||||
overlay->pos = 0;
|
||||
@ -389,6 +391,7 @@ static bool input_overlay_load_overlay(input_overlay_t *ol,
|
||||
overlay->load_images[overlay->load_images_size++] = overlay->descs[overlay->pos].image;
|
||||
}
|
||||
overlay->pos ++;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@ -483,7 +486,15 @@ static bool input_overlay_load_overlay_image_done(struct overlay *overlay)
|
||||
{
|
||||
if (overlay->image.pixels)
|
||||
overlay->load_images[overlay->load_images_size++] = overlay->image;
|
||||
|
||||
overlay->pos = 0;
|
||||
/* Divide iteration steps by half of total descs if size is even,
|
||||
* otherwise default to 8 (arbitrary value for now to speed things up). */
|
||||
overlay->pos_increment = (overlay->size / 2) ? (overlay->size / 2) : 8;
|
||||
|
||||
#if 0
|
||||
RARCH_LOG("pos increment: %u\n", overlay->pos_increment);
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -124,6 +124,7 @@ struct overlay
|
||||
struct overlay_desc *descs;
|
||||
size_t size;
|
||||
size_t pos;
|
||||
unsigned pos_increment;
|
||||
|
||||
struct texture_image image;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user