From bbcc0ed2224e2822b1c5c4546c2ecb30fb94963a Mon Sep 17 00:00:00 2001 From: Trey Harrison Date: Tue, 30 Apr 2024 00:23:56 +0300 Subject: [PATCH] renders: add SAM/SBM/DEF model files definitions Author: Trey Harrison Based on: https://web.archive.org/web/20001212060900/http://starbase.neosoft.com:80/~otaku/program.html --- src/common/header/files.h | 67 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/src/common/header/files.h b/src/common/header/files.h index d69ac451..b632f0b3 100644 --- a/src/common/header/files.h +++ b/src/common/header/files.h @@ -1011,5 +1011,72 @@ typedef struct int unknown; /* no idea what is it */ } drbrushside_t; +#define SDEFHEADER (('F' << 24) + ('E' << 16) + ('D' << 8) + 'S') /* little-endian "SDEF" */ + +typedef struct +{ + unsigned char x,y,z,normal_index; +} trivertx_t; + +typedef struct +{ + float s,t; +} st_vert_t; + +typedef struct +{ + short index_xyz[3]; + short index_st[3]; + int id; +} sin_triangle_t; + +typedef struct +{ + int id; + int num_tris; + int num_glcmds; // dwords in strip/fan command list + int ofs_glcmds; + int ofs_tris; + int ofs_end; +} sin_trigroup_t; + +typedef struct +{ + int ident; + int version; + + int num_xyz; + int num_st; // greater than num_xyz for seams + int num_groups; // groups should be exactly after it as sin_trigroup_t + + int ofs_st; // byte offset from start for stverts + int ofs_end; // end of file +} sin_sbm_header_t; + +typedef struct +{ + float movedelta[3]; // used for driving the model around + float frametime; + float scale[3]; // multiply byte verts by this + float translate[3]; // then add this + int ofs_verts; +} sin_frame_t; + +typedef struct +{ + int ident; + int version; + char name[64]; + float scale[3]; // multiply byte verts by this + float translate[3]; // then add this + float totaldelta[3]; // total displacement of this animation + float totaltime; + int num_xyz; + int num_frames; + int ofs_frames; + int ofs_end; // end of file +} sin_sam_header_t; + + #endif