diff --git a/game/src/chunk/chunkman.h b/game/src/chunk/chunkman.h index cb3b577..9f5b8e9 100644 --- a/game/src/chunk/chunkman.h +++ b/game/src/chunk/chunkman.h @@ -9,7 +9,7 @@ #include "../entity/entman.h" #include "../graphics.h" #include "../gvar.h" -#include "../pak/pakman.h" +#include "../pakman.h" #define TERRAIN_HEIGHT 8.0 diff --git a/game/src/entity/entman.h b/game/src/entity/entman.h index d235bc6..35d537c 100644 --- a/game/src/entity/entman.h +++ b/game/src/entity/entman.h @@ -14,7 +14,7 @@ #include "../chunk/chunkman.h" #include "../graphics.h" #include "../gvar.h" -#include "../pak/pakman.h" +#include "../pakman.h" #define ENTADD(entity) (entman_add_entity (entity)) diff --git a/game/src/graphics.h b/game/src/graphics.h index cc20af9..20890f7 100644 --- a/game/src/graphics.h +++ b/game/src/graphics.h @@ -10,7 +10,7 @@ #include "state.h" #include "util.h" #include "gvar.h" -#include "pak/pakman.h" +#include "pakman.h" #define FRUSTUM_CULL 1 diff --git a/game/src/main.c b/game/src/main.c index b3d6a91..df3cb94 100644 --- a/game/src/main.c +++ b/game/src/main.c @@ -11,8 +11,7 @@ #include "state.h" #include "graphics.h" #include "gvar.h" -#include "pak/pakman.h" -#include "pak/pak_guile.h" +#include "pakman.h" extern vec3 camera_position; @@ -26,7 +25,7 @@ SDL_AppInit (void **appstate, int argc, char **argv) gvar_guile_register (); widget_guile_register (); entity_guile_register (); - pak_guile_register (); + pakman_guile_register (); gvar_init (); graphics_init (); diff --git a/game/src/pak/pak_guile.c b/game/src/pak/pak_guile.c deleted file mode 100644 index e9eb79b..0000000 --- a/game/src/pak/pak_guile.c +++ /dev/null @@ -1,24 +0,0 @@ -#include "pak_guile.h" - -static SCM -_scm_get_program (SCM pak_scm, SCM key_scm) -{ - const char *pak = scm_to_utf8_string (pak_scm); - const char *key = scm_to_utf8_string (key_scm); - return scm_from_int (pakman_pak_program (pak, key)); -} - -static SCM -_scm_get_texture (SCM pak_scm, SCM key_scm) -{ - const char *pak = scm_to_utf8_string (pak_scm); - const char *key = scm_to_utf8_string (key_scm); - return scm_from_int (pakman_pak_texture (pak, key)); -} - -void -pak_guile_register () -{ - scm_c_define_gsubr ("pak-program", 2, 0, 0, _scm_get_program); - scm_c_define_gsubr ("pak-texture", 2, 0, 0, _scm_get_texture); -} diff --git a/game/src/pak/pak_guile.h b/game/src/pak/pak_guile.h deleted file mode 100644 index b40f388..0000000 --- a/game/src/pak/pak_guile.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once - -#include - -#include "pakman.h" - -void pak_guile_register (); diff --git a/game/src/pak/pakman.c b/game/src/pakman.c similarity index 89% rename from game/src/pak/pakman.c rename to game/src/pakman.c index cd9a2cd..af7c36d 100644 --- a/game/src/pak/pakman.c +++ b/game/src/pakman.c @@ -8,6 +8,29 @@ pakman_init () paks = g_hash_table_new (g_str_hash, g_str_equal); } +static SCM +_scm_get_program (SCM pak_scm, SCM key_scm) +{ + const char *pak = scm_to_utf8_string (pak_scm); + const char *key = scm_to_utf8_string (key_scm); + return scm_from_int (pakman_pak_program (pak, key)); +} + +static SCM +_scm_get_texture (SCM pak_scm, SCM key_scm) +{ + const char *pak = scm_to_utf8_string (pak_scm); + const char *key = scm_to_utf8_string (key_scm); + return scm_from_int (pakman_pak_texture (pak, key)); +} + +void +pakman_guile_register () +{ + scm_c_define_gsubr ("pak-program", 2, 0, 0, _scm_get_program); + scm_c_define_gsubr ("pak-texture", 2, 0, 0, _scm_get_texture); +} + unsigned int _pm_load_program (const char *v_path, const char *f_path) { diff --git a/game/src/pak/pakman.h b/game/src/pakman.h similarity index 84% rename from game/src/pak/pakman.h rename to game/src/pakman.h index ee75311..8d4b8cb 100644 --- a/game/src/pak/pakman.h +++ b/game/src/pakman.h @@ -3,10 +3,11 @@ #include #include #include +#include -#include "../gl/program.h" -#include "../gl/texture.h" -#include "../util.h" +#include "gl/program.h" +#include "gl/texture.h" +#include "util.h" typedef struct PakFile { @@ -15,6 +16,7 @@ typedef struct PakFile } PakFile; void pakman_init (); +void pakman_guile_register (); void pakman_load_pak (const char *path); unsigned int pakman_pak_program (const char *pak, const char *program); diff --git a/game/src/ui/widget_core.h b/game/src/ui/widget_core.h index 4847c4a..77b0063 100644 --- a/game/src/ui/widget_core.h +++ b/game/src/ui/widget_core.h @@ -10,7 +10,7 @@ #include "widget_boilerplate.h" #include "../util.h" -#include "../pak/pakman.h" +#include "../pakman.h" #include "../gl/mesh.h" #include "../gl/program.h"