summaryrefslogtreecommitdiff
path: root/src/win95/animchnk.hpp
blob: 531f7f85b4ec791b4e841d4020fa6b8649d1d13a (plain)
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
#ifndef _animchnk_hpp
#define _animchnk_hpp
#include "chunk.hpp"
#include "chnktype.hpp"

struct TEXANIM;


class Animation_Chunk : public Chunk
{
public :
	Animation_Chunk(Chunk_With_Children* parent,const char*,size_t);
	Animation_Chunk(Chunk_With_Children* parent);
	~Animation_Chunk();
	
	virtual BOOL output_chunk (HANDLE &hand);
	
	virtual size_t size_chunk();
	
	virtual void fill_data_block(char* data_start);

	int NumPolys; //with animation in this shape
	TEXANIM** AnimList;
	
};

#define txa_flag_nointerptofirst 0x80000000

struct FrameList
{
	~FrameList();
	FrameList(TEXANIM*);
	#if InterfaceEngine
	FrameList(TEXANIM* p,FrameList* templ);
	#endif
	FrameList(TEXANIM* p,FrameList* fl,int* conv);
	int Speed;
	int Flags;
	
	int NumFrames;
	int CurFrame;
	TEXANIM* parent;

	int* Textures;
	int* UVCoords;
	int spare1,spare2;

	
	#if InterfaceEngine
	void CopyToSID(int shape,int poly);
	void CopyFromSID(int shape,int poly);
	void AddFrame();
	void RemoveFrame();
	#endif
};

#define AnimFlag_NotPlaying 0x00000001
struct TEXANIM
{
	TEXANIM(TEXANIM*);
	TEXANIM();
	~TEXANIM();
	
	#if InterfaceEngine
	TEXANIM(int s,int p,int id);
	//construct a TEXANIM using templ as a template.
	TEXANIM(int s,int p,TEXANIM* templ);
	#endif
	int shape;
	int poly;
	int NumVerts;
	int ID;
	int NumSeq;//number of sequences
	int CurSeq;
	int AnimFlags;
	int Identifier;
	FrameList** Seq;

	#if InterfaceEngine
	void ChangeFrame(int newseq,int newframe);
	void AddSeq();
	void RemoveSeq();
	void CopySeq(int seq_num);
	#endif
	void CopyAnimData(TEXANIM* ta,int* conv);
};

#endif