-
Notifications
You must be signed in to change notification settings - Fork 0
CAR
Jon Daniel edited this page Aug 30, 2025
·
8 revisions
#pragma pack(push,1)
typedef struct {
struct animap {
u16 model[20];
u16 sub_model[6][2];
} anims;
struct gsnd {
u16 id[3];
} gsnd;
struct sfx {
u16 len[8];
u16 vol[8];
} sfx;
struct { face faces[400]; };
struct verts { i16x3 o[256]; i16x3 r[256]; i16x3 sh[256]; i16x2 sc[256]; } verts;
struct count { u16 verts; u16 faces; } count;
struct { u16 th; };
} car_header;
#pragma pack(pop)
case CHASM_FORMAT_CAR:
{
dst.car = (car_header*)dst.data;
dst.c3o = (c3o_header*)dst.data + sizeof(car_header) - sizeof(c3o_header);
dst.tw = 64;
dst.th = dst.car->th / dst.tw;
dst.tdim = dst.th * dst.tw;
dst.tdata = dst.data + sizeof(car_header);
dst.pal = settings.pal;
dst.trgba = tpal2rgba(dst.tdata, dst.tdim, dst.pal);
dst.anim_frames = (i16x3*)(dst.tdata + dst.tdim);
dst.anim_count = csm_model_car_anim_count(&dst);
break;
}