polyadvent

A game engine from scratch in C
git clone git://jb55.com/polyadvent
Log | Files | Refs | README

commit 05751e91a10f559eb24c07508b001f83183b68c7
parent 1330cf8b09f481a3b36386b16a0f29e4fc24032f
Author: William Casarin <bill@casarin.me>
Date:   Fri, 26 Jun 2015 09:50:58 -0700

geom_t -> geom, slab_t -> slab

Diffstat:
Msrc/geometry.h | 2+-
Msrc/main.c | 4++--
Msrc/render.c | 2+-
Msrc/render.h | 2+-
Msrc/slab.c | 10+++++-----
Msrc/slab.h | 12++++++------
Msrc/slab_geom.c | 6+++---
Msrc/slab_geom.h | 6+++---
8 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/src/geometry.h b/src/geometry.h @@ -5,7 +5,7 @@ #define GEOMETRY_H -struct geom_t { +struct geom { int num_elements; float *vertices; float *normals; diff --git a/src/main.c b/src/main.c @@ -13,8 +13,8 @@ int main(void) { struct game_state game; - struct slab_t slab; - struct geom_t slab_geom; + struct slab slab; + struct geom slab_geom; size_t length; void *slab_buffer; diff --git a/src/render.c b/src/render.c @@ -145,7 +145,7 @@ recalc_normals(GLint norm_uniform, mat4 *mvp, mat4 *normal) { static float tmp_matrix[MAT4_ELEMS] = { 0 }; void -render (struct test_resources * resources, struct geom_t *geom) { +render (struct test_resources * resources, struct geom *geom) { static float id[MAT4_ELEMS] = { 0 }; mat4_id(id); diff --git a/src/render.h b/src/render.h @@ -4,7 +4,7 @@ #include "geometry.h" void init_gl(struct test_resources * resources); -void render (struct test_resources * resources, struct geom_t *geom); +void render (struct test_resources * resources, struct geom *geom); void wireframe_mode_on(); void wireframe_mode_off(); diff --git a/src/slab.c b/src/slab.c @@ -20,13 +20,13 @@ defconsume(int) //defconsume(char) /* slab_vbo(const void *data) { */ -/* struct slab_t *slab = (struct slab_t*)data; */ +/* struct slab *slab = (struct slab*)data; */ /* assert(slab->x == 3); */ /* assert(slab->y == 3); */ /* assert(slab->z == 3); */ /* } */ -struct slab_t *slab_parse(struct slab_t *slab, void *data) { +struct slab *slab_parse(struct slab *slab, void *data) { void *p = data; slab->x = consume_int(&p); slab->y = consume_int(&p); @@ -35,13 +35,13 @@ struct slab_t *slab_parse(struct slab_t *slab, void *data) { return slab; } -int slab_size(const struct slab_t *slab) { +int slab_size(const struct slab *slab) { return slab->x * slab->y * slab->z; } -void slab_show(const struct slab_t *slab) { +void slab_show(const struct slab *slab) { printf("slab %d %d %d\n", slab->x, slab->y, slab->z); } @@ -86,7 +86,7 @@ static const u16 cube_indices[] = { }; void -slab_arrays(const struct slab_t *slab, +slab_arrays(const struct slab *slab, float *verts, u16 *indices, float *normals) { diff --git a/src/slab.h b/src/slab.h @@ -4,23 +4,23 @@ #include "common.h" -struct slab_t { +struct slab { int x; int y; int z; char *voxels; }; -struct slab_t * -slab_parse(struct slab_t *slab, void *data); +struct slab * +slab_parse(struct slab *slab, void *data); void -slab_show(const struct slab_t *slab); +slab_show(const struct slab *slab); -int slab_size(const struct slab_t *slab); +int slab_size(const struct slab *slab); void -slab_arrays(const struct slab_t *slab, +slab_arrays(const struct slab *slab, float *verts, u16 *indices, float *normals); diff --git a/src/slab_geom.c b/src/slab_geom.c @@ -2,9 +2,9 @@ #include "slab_geom.h" #include <stdlib.h> -struct geom_t* -alloc_slab_geom(const struct slab_t *slab, - struct geom_t *geom, +struct geom* +alloc_slab_geom(const struct slab *slab, + struct geom *geom, void* (*_realloc)(void*, size_t)) { _realloc = _realloc ? _realloc : realloc; float *verts, *normals; diff --git a/src/slab_geom.h b/src/slab_geom.h @@ -6,13 +6,13 @@ #include "slab.h" #include <stddef.h> -struct geom_t* +struct geom* alloc_slab_geom(const struct slab_t *slab, - struct geom_t *geom, + struct geom *geom, void* (*_realloc)(void*, size_t)); void -free_slab_geom(struct geom_t *geom, +free_slab_geom(struct geom *geom, void (*_free)(void*)); #endif // SLAB_GEOM