scenefile
annotate src/file_milk.c @ 4:d251485d33d8
scnviewgl makefile
author | John Tsiombikas <nuclear@mutantstargoat.com> |
---|---|
date | Sat, 21 Jan 2012 04:14:38 +0200 |
parents | |
children |
rev | line source |
---|---|
nuclear@3 | 1 #include <stdio.h> |
nuclear@3 | 2 #include <stdlib.h> |
nuclear@3 | 3 #include "scene.h" |
nuclear@3 | 4 |
nuclear@3 | 5 #ifdef __GNUC__ |
nuclear@3 | 6 #define PACKED __attribute__((packed)) |
nuclear@3 | 7 #endif |
nuclear@3 | 8 |
nuclear@3 | 9 |
nuclear@3 | 10 struct header { |
nuclear@3 | 11 char magic[10]; |
nuclear@3 | 12 int fmt_ver; |
nuclear@3 | 13 } PACKED; |
nuclear@3 | 14 |
nuclear@3 | 15 struct vertex { |
nuclear@3 | 16 char flags; |
nuclear@3 | 17 float pos[3]; |
nuclear@3 | 18 char bone_id; /* -1 means no bone */ |
nuclear@3 | 19 char ref_count; |
nuclear@3 | 20 } PACKED; |
nuclear@3 | 21 |
nuclear@3 | 22 struct triangle { |
nuclear@3 | 23 uint16_t flags; |
nuclear@3 | 24 uint16_t v[3]; |
nuclear@3 | 25 float vnorm[3][3]; |
nuclear@3 | 26 float s[3]; |
nuclear@3 | 27 float t[3]; |
nuclear@3 | 28 unsigned char smoothing_group; |
nuclear@3 | 29 unsigned char group_idx; |
nuclear@3 | 30 } PACKED; |
nuclear@3 | 31 |
nuclear@3 | 32 |