added updated jungle_main rules by Landil
[twcon.git] / src / game / mapitems.h
blobd99d6724f206d353ecd1e662953fd4edd238028e
1 /* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
2 /* If you are missing that file, acquire a complete release at teeworlds.com. */
3 #ifndef GAME_MAPITEMS_H
4 #define GAME_MAPITEMS_H
6 // layer types
7 enum
9 LAYERTYPE_INVALID=0,
10 LAYERTYPE_GAME, // not used
11 LAYERTYPE_TILES,
12 LAYERTYPE_QUADS,
14 MAPITEMTYPE_VERSION=0,
15 MAPITEMTYPE_INFO,
16 MAPITEMTYPE_IMAGE,
17 MAPITEMTYPE_ENVELOPE,
18 MAPITEMTYPE_GROUP,
19 MAPITEMTYPE_LAYER,
20 MAPITEMTYPE_ENVPOINTS,
23 CURVETYPE_STEP=0,
24 CURVETYPE_LINEAR,
25 CURVETYPE_SLOW,
26 CURVETYPE_FAST,
27 CURVETYPE_SMOOTH,
28 NUM_CURVETYPES,
30 // game layer tiles
31 ENTITY_NULL=0,
32 ENTITY_SPAWN,
33 ENTITY_SPAWN_RED,
34 ENTITY_SPAWN_BLUE,
35 ENTITY_FLAGSTAND_RED,
36 ENTITY_FLAGSTAND_BLUE,
37 ENTITY_ARMOR_1,
38 ENTITY_HEALTH_1,
39 ENTITY_WEAPON_SHOTGUN,
40 ENTITY_WEAPON_GRENADE,
41 ENTITY_POWERUP_NINJA,
42 ENTITY_WEAPON_RIFLE,
43 NUM_ENTITIES,
45 TILE_AIR=0,
46 TILE_SOLID,
47 TILE_DEATH,
48 TILE_NOHOOK,
50 TILEFLAG_VFLIP=1,
51 TILEFLAG_HFLIP=2,
52 TILEFLAG_OPAQUE=4,
53 TILEFLAG_ROTATE=8,
55 LAYERFLAG_DETAIL=1,
57 ENTITY_OFFSET=255-16*4,
60 struct CPoint
62 int x, y; // 22.10 fixed point
65 struct CColor
67 int r, g, b, a;
70 struct CQuad
72 CPoint m_aPoints[5];
73 CColor m_aColors[4];
74 CPoint m_aTexcoords[4];
76 int m_PosEnv;
77 int m_PosEnvOffset;
79 int m_ColorEnv;
80 int m_ColorEnvOffset;
83 class CTile
85 public:
86 unsigned char m_Index;
87 unsigned char m_Flags;
88 unsigned char m_Skip;
89 unsigned char m_Reserved;
92 struct CMapItemImage
94 int m_Version;
95 int m_Width;
96 int m_Height;
97 int m_External;
98 int m_ImageName;
99 int m_ImageData;
102 struct CMapItemGroup_v1
104 int m_Version;
105 int m_OffsetX;
106 int m_OffsetY;
107 int m_ParallaxX;
108 int m_ParallaxY;
110 int m_StartLayer;
111 int m_NumLayers;
115 struct CMapItemGroup : public CMapItemGroup_v1
117 enum { CURRENT_VERSION=2 };
119 int m_UseClipping;
120 int m_ClipX;
121 int m_ClipY;
122 int m_ClipW;
123 int m_ClipH;
126 struct CMapItemLayer
128 int m_Version;
129 int m_Type;
130 int m_Flags;
133 struct CMapItemLayerTilemap
135 CMapItemLayer m_Layer;
136 int m_Version;
138 int m_Width;
139 int m_Height;
140 int m_Flags;
142 CColor m_Color;
143 int m_ColorEnv;
144 int m_ColorEnvOffset;
146 int m_Image;
147 int m_Data;
150 struct CMapItemLayerQuads
152 CMapItemLayer m_Layer;
153 int m_Version;
155 int m_NumQuads;
156 int m_Data;
157 int m_Image;
160 struct CMapItemVersion
162 int m_Version;
165 struct CEnvPoint
167 int m_Time; // in ms
168 int m_Curvetype;
169 int m_aValues[4]; // 1-4 depending on envelope (22.10 fixed point)
171 bool operator<(const CEnvPoint &Other) { return m_Time < Other.m_Time; }
174 struct CMapItemEnvelope
176 int m_Version;
177 int m_Channels;
178 int m_StartPoint;
179 int m_NumPoints;
180 int m_aName[8];
183 #endif