-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathxmd2.h
79 lines (66 loc) · 1.4 KB
/
xmd2.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
/**
* This file belongs to the 'xlab' game engine.
* Copyright 2009 xfacter
* Copyright 2016 wickles
* This work is licensed under the LGPLv3
* subject to all terms as reproduced in the included LICENSE file.
*/
#pragma once
#include "xconfig.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct
{
int num_frames;
int num_verts;
int num_glcmds;
ScePspFVector3* vertices;
u8* normal_indices;
int* gl_commands;
} xMd2;
typedef struct
{
int anim;
int frame_cur;
int frame_next;
int def_anim;
int num_anims;
float time;
float interp;
x_anim* anims_use;
xMd2* md2_use;
} xMd2Object;
enum md2Anims
{
MD2_STAND = 0,
MD2_RUN,
MD2_ATTACK,
MD2_PAIN_A,
MD2_PAIN_B,
MD2_PAIN_C,
MD2_JUMP,
MD2_FLIP,
MD2_SALUTE,
MD2_FALLBACK,
MD2_WAVE,
MD2_POINT,
MD2_CROUCH_STAND,
MD2_CROUCH_WALK,
MD2_CROUCH_ATTACK,
MD2_CROUCH_PAIN,
MD2_CROUCH_DEATH,
MD2_DEATH_FALLBACK,
MD2_DEATH_FALLFORWARD,
MD2_DEATH_FALLBACKSLOW,
MD2_BOOM
};
int xMd2Load(xMd2* my_md2, char* filename);
void xMd2Free(xMd2* my_md2);
void xMd2AnimBind(xMd2Object* object, xMd2* my_md2, x_anim* my_anims, int num_anim, int default_anim);
void xMd2AnimSet(xMd2Object* object, int anim, int loop, int ifnot);
void xMd2AnimUpdate(xMd2Object* object, float dt);
void xMd2AnimDraw(xMd2Object* object);
#ifdef __cplusplus
}
#endif