diff options
Diffstat (limited to 'src/splash-plugins')
| -rw-r--r-- | src/splash-plugins/spinfinity/plugin.c | 4 | ||||
| -rw-r--r-- | src/splash-plugins/spinfinity/throbber.c | 26 | ||||
| -rw-r--r-- | src/splash-plugins/spinfinity/throbber.h | 1 |
3 files changed, 21 insertions, 10 deletions
diff --git a/src/splash-plugins/spinfinity/plugin.c b/src/splash-plugins/spinfinity/plugin.c index 7db3e8a..91e0407 100644 --- a/src/splash-plugins/spinfinity/plugin.c +++ b/src/splash-plugins/spinfinity/plugin.c @@ -325,6 +325,10 @@ show_splash_screen (ply_boot_splash_plugin_t *plugin, if (!ply_image_load (plugin->box_image)) return false; + ply_trace ("loading throbber"); + if (!throbber_load (plugin->throbber)) + return false; + plugin->window = window; ply_trace ("setting graphics mode"); diff --git a/src/splash-plugins/spinfinity/throbber.c b/src/splash-plugins/spinfinity/throbber.c index d5a8e90..998f229 100644 --- a/src/splash-plugins/spinfinity/throbber.c +++ b/src/splash-plugins/spinfinity/throbber.c @@ -85,12 +85,12 @@ throbber_new (const char *image_dir, throbber->frames = ply_array_new (); throbber->frames_prefix = strdup (frames_prefix); throbber->image_dir = strdup (image_dir); - throbber->width = 82; - throbber->height = 47; + throbber->width = 0; + throbber->height = 0; throbber->frame_area.width = 0; throbber->frame_area.height = 0; - throbber->frame_area.x = 700; - throbber->frame_area.y = 700; + throbber->frame_area.x = 0; + throbber->frame_area.y = 0; return throbber; } @@ -262,6 +262,18 @@ out: } bool +throbber_load (throbber_t *throbber) +{ + if (ply_array_get_size (throbber->frames) != 0) + throbber_remove_frames (throbber->frames); + + if (!throbber_add_frames (throbber)) + return false; + + return true; +} + +bool throbber_start (throbber_t *throbber, ply_event_loop_t *loop, ply_window_t *window, @@ -271,12 +283,6 @@ throbber_start (throbber_t *throbber, assert (throbber != NULL); assert (throbber->loop == NULL); - if (ply_array_get_size (throbber->frames) == 0) - { - if (!throbber_add_frames (throbber)) - return false; - } - throbber->loop = loop; throbber->window = window; throbber->frame_buffer = ply_window_get_frame_buffer (window);; diff --git a/src/splash-plugins/spinfinity/throbber.h b/src/splash-plugins/spinfinity/throbber.h index 191bfcb..c1e7b1a 100644 --- a/src/splash-plugins/spinfinity/throbber.h +++ b/src/splash-plugins/spinfinity/throbber.h @@ -37,6 +37,7 @@ throbber_t *throbber_new (const char *image_dir, const char *frames_prefix); void throbber_free (throbber_t *throbber); +bool throbber_load (throbber_t *throbber); bool throbber_start (throbber_t *throbber, ply_event_loop_t *loop, ply_window_t *window, |
