1 //----------------------------------------------------------------------------
2 //  EDGE Data Definition File Code (Animated textures)
3 //----------------------------------------------------------------------------
4 //
5 //  Copyright (c) 1999-2008  The EDGE Team.
6 //
7 //  This program is free software; you can redistribute it and/or
8 //  modify it under the terms of the GNU General Public License
9 //  as published by the Free Software Foundation; either version 2
10 //  of the License, or (at your option) any later version.
11 //
12 //  This program is distributed in the hope that it will be useful,
13 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
14 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 //  GNU General Public License for more details.
16 //
17 //----------------------------------------------------------------------------
18 
19 #ifndef __DDF_ANIM_H_
20 #define __DDF_ANIM_H_
21 
22 #include "epi/utility.h"
23 
24 #include "types.h"
25 
26 
27 //
28 // source animation definition
29 //
30 // -KM- 98/07/31 Anims.ddf
31 //
32 class animdef_c
33 {
34 public:
35 	animdef_c();
~animdef_c()36 	~animdef_c() {};
37 
38 public:
39 	void Default(void);
40 	void CopyDetail(animdef_c &src);
41 
42 	// Member vars....
43 	epi::strent_c name;
44 
45 	enum  // types
46 	{
47 		A_Flat = 0,
48 		A_Texture,
49 		A_Graphic
50 	};
51 
52 	int type;
53 
54 	// -AJA- 2004/10/27: new SEQUENCE command for anims
55 	epi::strlist_c pics;
56 
57 	// first and last names in TEXTURE1/2 lump
58 	lumpname_c startname;
59 	lumpname_c endname;
60 
61 	// how many 1/35s ticks each frame lasts
62 	int speed;
63 
64 private:
65 	// disable copy construct and assignment operator
animdef_c(animdef_c & rhs)66 	explicit animdef_c(animdef_c &rhs) { }
67 	animdef_c& operator= (animdef_c &rhs) { return *this; }
68 };
69 
70 
71 // Our animdefs container
72 class animdef_container_c : public epi::array_c
73 {
74 public:
animdef_container_c()75 	animdef_container_c() : epi::array_c(sizeof(animdef_c*)) {}
~animdef_container_c()76 	~animdef_container_c() { Clear(); }
77 
78 private:
79 	void CleanupObject(void *obj);
80 
81 public:
GetSize()82 	int GetSize() {	return array_entries; }
Insert(animdef_c * a)83 	int Insert(animdef_c *a) { return InsertObject((void*)&a); }
84 	animdef_c* operator[](int idx) { return *(animdef_c**)FetchObject(idx); }
85 };
86 
87 extern animdef_container_c animdefs;		// -ACB- 2004/06/03 Implemented
88 
89 bool DDF_ReadAnims(void *data, int size);
90 
91 void DDF_ParseANIMATED(const byte *data, int size);
92 
93 #endif  /* __DDF_ANIM__ */
94 
95 //--- editor settings ---
96 // vi:ts=4:sw=4:noexpandtab
97