Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ball/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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();
Expand Down
16 changes: 7 additions & 9 deletions share/st_package.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ struct download_info
};

static int (*installed_action)(int pi);
static void (*paint_action)(int id, float st);

/*---------------------------------------------------------------------------*/

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 = {
Expand Down
1 change: 1 addition & 0 deletions share/st_package.h
Original file line number Diff line number Diff line change
Expand Up @@ -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