Move pakman
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
#include "state.h"
|
||||
#include "util.h"
|
||||
#include "gvar.h"
|
||||
#include "pak/pakman.h"
|
||||
#include "pakman.h"
|
||||
|
||||
#define FRUSTUM_CULL 1
|
||||
|
||||
|
||||
+2
-3
@@ -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 ();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <libguile.h>
|
||||
|
||||
#include "pakman.h"
|
||||
|
||||
void pak_guile_register ();
|
||||
@@ -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)
|
||||
{
|
||||
@@ -3,10 +3,11 @@
|
||||
#include <SDL3_image/SDL_image.h>
|
||||
#include <glib-2.0/glib.h>
|
||||
#include <cglm/cglm.h>
|
||||
#include <libguile.h>
|
||||
|
||||
#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);
|
||||
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user