diff --git a/ball/main.c b/ball/main.c index 0e4acc359..1a485b34a 100644 --- a/ball/main.c +++ b/ball/main.c @@ -57,6 +57,7 @@ #include "st_common.h" #include "st_start.h" #include "st_package.h" +#include "st_shared.h" const char TITLE[] = "Neverball"; const char ICON[] = "icon/neverball.png"; @@ -493,6 +494,8 @@ static int process_link(const char *link) else if ((index = package_search(set_file)) >= 0) { log_printf("Found package with the given reference.\n"); + load_title_background(); + game_kill_fade(); goto_package(index, &st_title); processed = 1; } @@ -938,6 +941,8 @@ static int main_init(int argc, char *argv[]) package_set_installed_action(handle_installed_action); + package_set_paint_action(shared_paint); + /* Enable joystick events. */ joy_init(); diff --git a/share/st_package.c b/share/st_package.c index 880ac84c8..baa00958e 100644 --- a/share/st_package.c +++ b/share/st_package.c @@ -63,6 +63,7 @@ struct download_info }; static int (*installed_action)(int pi); +static void (*paint_action)(int id, float st); /*---------------------------------------------------------------------------*/ @@ -521,8 +522,6 @@ static int package_enter(struct state *st, struct state *prev) { common_init(package_action); - back_init("back/gui.png"); - if (do_init) { package_back = prev; @@ -576,13 +575,8 @@ static void package_leave(struct state *st, struct state *next, int id) void package_paint(int id, float st) { - video_push_persp((float) config_get_d(CONFIG_VIEW_FOV), 0.1f, FAR_DIST); - { - back_draw_easy(); - } - video_pop_matrix(); - - gui_paint(id); + if (paint_action) + paint_action(id, st); } static void package_point(int id, int x, int y, int dx, int dy) @@ -627,6 +621,10 @@ void package_set_installed_action(int (*installed_action_fn)(int pi)) installed_action = installed_action_fn; } +void package_set_paint_action(void (*paint_action_fn)(int id, float st)) { + paint_action = paint_action_fn; +} + /*---------------------------------------------------------------------------*/ struct state st_package = { diff --git a/share/st_package.h b/share/st_package.h index d768938df..34cec95a5 100644 --- a/share/st_package.h +++ b/share/st_package.h @@ -7,5 +7,6 @@ extern struct state st_package; void goto_package(int package_id, struct state *back_state); void package_set_installed_action(int (*installed_action_fn)(int pi)); +void package_set_paint_action(void (*paint_action_fn)(int id, float st)); #endif \ No newline at end of file