forked from EXL/P2kElfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel.h
106 lines (87 loc) · 2.23 KB
/
model.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/*
Copyright (C) 2003 - Derek John Evans
This file is part of Yeti3D Portable Engine
Yeti3D is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Original Source: 2003 - Derek J. Evans <[email protected]>
Prepared for public release: 10/24/2003 - Derek J. Evans <[email protected]>
*/
/*
** Name: Yeti3D
** Desc: Portable GameBoy Advanced 3D Engine
** Auth: Derek J. Evans <[email protected]>
**
** Copyright (C) 2003 Derek J. Evans. All Rights Reserved.
**
** YY YY EEEEEE TTTTTT IIIIII 33333 DDDDD
** YY YY EE TT II 33 DD DD
** YYYY EEEE TT II 333 DD DD
** YY EE TT II 33 DD DD
** YY EEEEEE TT IIIIII 33333 DDDDD
*/
#ifndef __MODEL_H__
#define __MODEL_H__
#include "yeti.h"
#ifdef __cplusplus
extern "C"{
#endif
typedef struct
{
float u, v;
int vindex;
} md2command_t;
typedef struct
{
int magic;
int version;
int skinWidth;
int skinHeight;
int frameSize;
int numSkins;
int numVertices;
int numTexCoords;
int numTriangles;
int numGlCommands;
int numFrames;
int offsetSkins;
int offsetTexCoords;
int offsetTriangles;
int offsetFrames;
int offsetGlCommands;
int offsetEnd;
} model_t;
typedef struct
{
short vertexIndices[3];
short textureIndices[3];
} triangle_t;
typedef struct
{
short s, t;
} textureCoordinate_t;
typedef struct
{
byte vertex[3];
byte lightNormalIndex;
} triangleVertex_t;
typedef struct
{
float scale[3];
float translate[3];
char name[16];
triangleVertex_t vertices[1];
} frame_t;
void md2_draw(entity_t* e);
#ifdef __cplusplus
};
#endif
#endif