From 46e6de294243e8dc593551bfe8c0e7090d03a159 Mon Sep 17 00:00:00 2001 From: Tristan Riehs Date: Sun, 30 Jun 2024 16:20:34 +0900 Subject: Improve dynamic loading Make loading code cleaner and prefix public function names to allow static compilation. --- src/ray.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/ray.c') diff --git a/src/ray.c b/src/ray.c index b71f088..3050e5a 100644 --- a/src/ray.c +++ b/src/ray.c @@ -36,7 +36,7 @@ static struct calc_data calcs[CALC_COUNT] = {0}; static int current_idx = 0; void -init(void) +ray_init(void) { #ifndef NDEBUG SetTraceLogLevel(LOG_DEBUG); @@ -195,7 +195,7 @@ redraw(void) } void -display_calc(int x, int y) +ray_display_calc(int x, int y) { current_idx = (current_idx + 1)%CALC_COUNT; calcs[current_idx].x = x; @@ -226,7 +226,7 @@ check_digits(void) } int -read_input(void) +ray_read_input(void) { TraceLog(LOG_INFO, "waiting for user input"); calcs[current_idx].input = 0; @@ -258,7 +258,7 @@ read_input(void) } void -display_res(bool right, int ms) +ray_display_res(bool right, int ms) { calcs[current_idx].right = right; calcs[current_idx].ms = ms; @@ -266,14 +266,14 @@ display_res(bool right, int ms) } void -destroy(void) +ray_destroy(void) { CloseWindow(); } #ifndef NDEBUG void * -pre_reload(void) +ray_pre_reload(void) { char *data = malloc(sizeof(calcs) + sizeof(current_idx)); memcpy(data, &calcs, sizeof(calcs)); @@ -283,7 +283,7 @@ pre_reload(void) } void -post_reload(void *state) +ray_post_reload(void *state) { char *data = state; memcpy(&calcs, data, sizeof(calcs)); -- cgit v1.2.3