aboutsummaryrefslogtreecommitdiff
path: root/src/ray.c
diff options
context:
space:
mode:
authorTristan Riehs <tristan.riehs@bordeaux-inp.fr>2024-06-30 16:20:34 +0900
committerTristan Riehs <tristan.riehs@bordeaux-inp.fr>2024-06-30 16:20:34 +0900
commit46e6de294243e8dc593551bfe8c0e7090d03a159 (patch)
treea898e2c4504c8da30fdea2aebf034f7edb0e7a3e /src/ray.c
parent5d5ff4076abe2e8aeb40980ec1b3ef9ee5fa92e6 (diff)
Improve dynamic loading
Make loading code cleaner and prefix public function names to allow static compilation.
Diffstat (limited to 'src/ray.c')
-rw-r--r--src/ray.c14
1 files changed, 7 insertions, 7 deletions
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));