X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=src%2Fmesh.h;h=410863a74358b0fdfcb3a5fcfa3876ea1bdf769b;hp=704c492bdc37026d0aec6a1228d13da9698d6196;hb=3eeca1cc95bdeaf3f6be3fd6064a065e39c08eda;hpb=a1ede8e271fee1b4d029752603096db2be780e67 diff --git a/src/mesh.h b/src/mesh.h index 704c492..410863a 100644 --- a/src/mesh.h +++ b/src/mesh.h @@ -6,11 +6,17 @@ struct g3d_mesh { int prim; struct g3d_vertex *varr; - int16_t *iarr; + uint16_t *iarr; int vcount, icount; }; +void free_mesh(struct g3d_mesh *mesh); +void destroy_mesh(struct g3d_mesh *mesh); + +int copy_mesh(struct g3d_mesh *dest, struct g3d_mesh *src); + int load_mesh(struct g3d_mesh *mesh, const char *fname); +int save_mesh(struct g3d_mesh *mesh, const char *fname); void zsort_mesh(struct g3d_mesh *mesh); void draw_mesh(struct g3d_mesh *mesh); @@ -19,6 +25,9 @@ void apply_mesh_xform(struct g3d_mesh *mesh, const float *xform); int append_mesh(struct g3d_mesh *ma, struct g3d_mesh *mb); int indexify_mesh(struct g3d_mesh *mesh); +void normalize_mesh_normals(struct g3d_mesh *mesh); + +int gen_sphere_mesh(struct g3d_mesh *mesh, float rad, int usub, int vsub); int gen_plane_mesh(struct g3d_mesh *mesh, float width, float height, int usub, int vsub); int gen_cube_mesh(struct g3d_mesh *mesh, float sz, int sub); int gen_torus_mesh(struct g3d_mesh *mesh, float rad, float ringrad, int usub, int vsub);