polyadvent

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

commit e10fbec6715724f9d7f662d25846222e5c8f20bb
parent 5a1933690d2751e653fdc71cb9fe4c09be2c116f
Author: William Casarin <jb55@jb55.com>
Date:   Sun,  7 Jul 2019 00:34:45 -0700

initial mdl stubs

Diffstat:
MMakefile | 3---
Msrc/dae.c | 4++--
Msrc/dae.h | 4++--
Asrc/mdl.c | 7+++++++
Asrc/mdl.h | 10++++++++++
Mtest/test_dae.c | 2+-
Mtools/compile-model.c | 11+++--------
7 files changed, 25 insertions(+), 16 deletions(-)

diff --git a/Makefile b/Makefile @@ -62,9 +62,6 @@ install: $(BIN) install -d $(PREFIX)/bin install $(BIN) $(PREFIX)/bin -nixbuild: - nix-shell shell.nix --command 'make -j4' - TAGS: etags $(SRCS) diff --git a/src/dae.c b/src/dae.c @@ -233,8 +233,8 @@ static void process_joint_children(struct joint *joints, int njoints) } } -void load_model(const char *filename, struct model *model, - struct make_geometry *geom) +void load_dae(const char *filename, struct model *model, + struct make_geometry *geom) { struct xmlparser x = {0}; struct dae_data data = { diff --git a/src/dae.h b/src/dae.h @@ -5,7 +5,7 @@ #include "geometry.h" #include "model.h" -void load_model(const char *filename, struct model *model, - struct make_geometry *geom); +void load_dae(const char *filename, struct model *model, + struct make_geometry *geom); #endif /* DAE_H */ diff --git a/src/mdl.c b/src/mdl.c @@ -0,0 +1,7 @@ + +#include "mdl.h" + +void save_mdl(struct model *model, struct make_geometry *geom) +{ + +} diff --git a/src/mdl.h b/src/mdl.h @@ -0,0 +1,10 @@ + +#ifndef MDL_H +#define MDL_H + +#include "geometry.h" +#include "model.h" + +void save_mdl(struct model *model, struct make_geometry *geom); + +#endif /* MDL_H */ diff --git a/test/test_dae.c b/test/test_dae.c @@ -20,7 +20,7 @@ int main(int argc, char *argv[]) init_model(&model); init_make_geometry(&geom); - load_model("data/models/pirate-officer.dae", &model, &geom); + load_dae("data/models/pirate-officer.dae", &model, &geom); assert(model.nposes == 1); pose = &model.poses[0]; diff --git a/tools/compile-model.c b/tools/compile-model.c @@ -4,11 +4,7 @@ #include <assert.h> #include "dae.h" - - -static void save_mdl(struct model *model, struct make_geometry *geom) -{ -} +#include "mdl.h" void usage() @@ -35,9 +31,8 @@ int main(int argc, char *argv[]) init_model(&model); init_make_geometry(&geom); - int nposes; - - load_model(filename, &model, &geom); + load_dae(filename, &model, &geom); + save_mdl(outfile, &model, &geom); FILE *out = fopen(outfile, "wb"); fprintf(out, "hello, world\n");