2010-05-29 07:25:38 +00:00
|
|
|
#ifndef GAME_MAPITEMS_H
|
|
|
|
#define GAME_MAPITEMS_H
|
2010-09-28 05:06:06 +00:00
|
|
|
#include<engine/shared/protocol.h>
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
// layer types
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
LAYERTYPE_INVALID=0,
|
|
|
|
LAYERTYPE_GAME, // not used
|
|
|
|
LAYERTYPE_TILES,
|
|
|
|
LAYERTYPE_QUADS,
|
|
|
|
|
|
|
|
MAPITEMTYPE_VERSION=0,
|
|
|
|
MAPITEMTYPE_INFO,
|
|
|
|
MAPITEMTYPE_IMAGE,
|
|
|
|
MAPITEMTYPE_ENVELOPE,
|
|
|
|
MAPITEMTYPE_GROUP,
|
|
|
|
MAPITEMTYPE_LAYER,
|
|
|
|
MAPITEMTYPE_ENVPOINTS,
|
|
|
|
|
|
|
|
|
|
|
|
CURVETYPE_STEP=0,
|
|
|
|
CURVETYPE_LINEAR,
|
|
|
|
CURVETYPE_SLOW,
|
|
|
|
CURVETYPE_FAST,
|
|
|
|
CURVETYPE_SMOOTH,
|
|
|
|
NUM_CURVETYPES,
|
|
|
|
|
|
|
|
// game layer tiles
|
|
|
|
ENTITY_NULL=0,
|
|
|
|
ENTITY_SPAWN,
|
|
|
|
ENTITY_SPAWN_RED,
|
|
|
|
ENTITY_SPAWN_BLUE,
|
|
|
|
ENTITY_FLAGSTAND_RED,
|
|
|
|
ENTITY_FLAGSTAND_BLUE,
|
|
|
|
ENTITY_ARMOR_1,
|
|
|
|
ENTITY_HEALTH_1,
|
|
|
|
ENTITY_WEAPON_SHOTGUN,
|
|
|
|
ENTITY_WEAPON_GRENADE,
|
|
|
|
ENTITY_POWERUP_NINJA,
|
|
|
|
ENTITY_WEAPON_RIFLE,
|
2010-08-10 04:28:17 +00:00
|
|
|
//DDRace - Main Lasers
|
|
|
|
ENTITY_LASER_FAST_CW,
|
|
|
|
ENTITY_LASER_NORMAL_CW,
|
|
|
|
ENTITY_LASER_SLOW_CW,
|
|
|
|
ENTITY_LASER_STOP,
|
|
|
|
ENTITY_LASER_SLOW_CCW,
|
|
|
|
ENTITY_LASER_NORMAL_CCW,
|
|
|
|
ENTITY_LASER_FAST_CCW,
|
|
|
|
//DDRace - Laser Modifiers
|
|
|
|
ENTITY_LASER_SHORT,
|
|
|
|
ENTITY_LASER_MIDDLE,
|
|
|
|
ENTITY_LASER_LONG,
|
|
|
|
ENTITY_LASER_C_SLOW,
|
|
|
|
ENTITY_LASER_C_NORMAL,
|
|
|
|
ENTITY_LASER_C_FAST,
|
|
|
|
ENTITY_LASER_O_SLOW,
|
|
|
|
ENTITY_LASER_O_NORMAL,
|
|
|
|
ENTITY_LASER_O_FAST,
|
2010-08-12 11:30:46 +00:00
|
|
|
//DDRace - Plasma
|
2010-08-28 20:32:16 +00:00
|
|
|
ENTITY_PLASMAE=29,
|
2010-08-12 11:30:46 +00:00
|
|
|
ENTITY_PLASMAF,
|
2010-08-28 20:32:16 +00:00
|
|
|
ENTITY_PLASMA,
|
2010-09-11 00:01:15 +00:00
|
|
|
ENTITY_PLASMAU,
|
2010-08-10 04:28:17 +00:00
|
|
|
//DDRace - Shotgun
|
2010-11-01 01:51:17 +00:00
|
|
|
ENTITY_CRAZY_SHOTGUN_EX,
|
|
|
|
ENTITY_CRAZY_SHOTGUN,
|
2010-08-12 11:30:46 +00:00
|
|
|
//DDRace - Draggers
|
|
|
|
ENTITY_DRAGGER_WEAK=42,
|
|
|
|
ENTITY_DRAGGER_NORMAL,
|
|
|
|
ENTITY_DRAGGER_STRONG,
|
|
|
|
//Draggers Behind Walls
|
|
|
|
ENTITY_DRAGGER_WEAK_NW,
|
|
|
|
ENTITY_DRAGGER_NORMAL_NW,
|
|
|
|
ENTITY_DRAGGER_STRONG_NW,
|
2010-08-10 04:28:17 +00:00
|
|
|
//DDrace - Doors
|
2010-08-12 11:30:46 +00:00
|
|
|
ENTITY_DOOR=49,
|
|
|
|
ENTITY_TRIGGER,
|
2010-08-25 14:15:59 +00:00
|
|
|
ENTITY_CONNECTOR_D=52,//TODO: in ddrace stable used this one no need others rename ENTITY_CONNECTOR
|
2010-08-10 04:28:17 +00:00
|
|
|
ENTITY_CONNECTOR_DR,
|
|
|
|
ENTITY_CONNECTOR_R,
|
|
|
|
ENTITY_CONNECTOR_RU,
|
|
|
|
ENTITY_CONNECTOR_U,
|
|
|
|
ENTITY_CONNECTOR_UL,
|
|
|
|
ENTITY_CONNECTOR_L,
|
|
|
|
ENTITY_CONNECTOR_LD,
|
|
|
|
//End Of Lower Tiles
|
2010-05-29 07:25:38 +00:00
|
|
|
NUM_ENTITIES,
|
2010-08-10 04:28:17 +00:00
|
|
|
//Start From Top Left
|
|
|
|
//Tile Controllers
|
2010-05-29 07:25:38 +00:00
|
|
|
TILE_AIR=0,
|
|
|
|
TILE_SOLID,
|
|
|
|
TILE_DEATH,
|
|
|
|
TILE_NOHOOK,
|
2010-08-10 04:28:17 +00:00
|
|
|
TILE_NOLASER,
|
2010-11-01 01:51:17 +00:00
|
|
|
TILE_THROUGH = 6,
|
|
|
|
TILE_FREEZE = 9,
|
2010-09-11 00:01:15 +00:00
|
|
|
TILE_TELEINEVIL,
|
|
|
|
TILE_UNFREEZE,
|
2010-09-27 07:14:38 +00:00
|
|
|
TILE_TELEIN=26,
|
2010-08-10 04:28:17 +00:00
|
|
|
TILE_TELEOUT,
|
|
|
|
TILE_BOOST,
|
2010-11-01 01:51:17 +00:00
|
|
|
TILE_BEGIN = 33,
|
2010-08-10 04:28:17 +00:00
|
|
|
TILE_END,
|
2010-11-01 01:51:17 +00:00
|
|
|
TILE_STOP = 60,
|
|
|
|
TILE_STOPS,
|
2010-08-30 04:45:09 +00:00
|
|
|
TILE_STOPA,
|
2010-11-01 01:51:17 +00:00
|
|
|
TILE_CP = 64,
|
|
|
|
TILE_CP_F,
|
|
|
|
TILE_NPC = 72,
|
2010-08-10 04:28:17 +00:00
|
|
|
TILE_EHOOK,
|
|
|
|
TILE_NOHIT,
|
2010-09-11 00:01:15 +00:00
|
|
|
TILE_NPH,//Remember to change this in collision.cpp if you add anymore tiles
|
2010-08-10 04:28:17 +00:00
|
|
|
//End of higher tiles
|
|
|
|
//Untouchable Elements
|
2010-05-29 07:25:38 +00:00
|
|
|
TILEFLAG_VFLIP=1,
|
|
|
|
TILEFLAG_HFLIP=2,
|
|
|
|
TILEFLAG_OPAQUE=4,
|
2010-09-05 17:01:01 +00:00
|
|
|
TILEFLAG_ROTATE=8,
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
LAYERFLAG_DETAIL=1,
|
|
|
|
|
|
|
|
ENTITY_OFFSET=255-16*4,
|
|
|
|
};
|
|
|
|
|
2010-11-01 01:51:17 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
ROTATION_0,
|
|
|
|
ROTATION_90 = TILEFLAG_ROTATE,
|
|
|
|
ROTATION_180 = (TILEFLAG_VFLIP|TILEFLAG_HFLIP),
|
|
|
|
ROTATION_270 = (TILEFLAG_VFLIP|TILEFLAG_HFLIP|TILEFLAG_ROTATE)
|
|
|
|
};
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
struct CPoint
|
|
|
|
{
|
|
|
|
int x, y; // 22.10 fixed point
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CColor
|
|
|
|
{
|
|
|
|
int r, g, b, a;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CQuad
|
|
|
|
{
|
|
|
|
CPoint m_aPoints[5];
|
|
|
|
CColor m_aColors[4];
|
|
|
|
CPoint m_aTexcoords[4];
|
|
|
|
|
|
|
|
int m_PosEnv;
|
|
|
|
int m_PosEnvOffset;
|
|
|
|
|
|
|
|
int m_ColorEnv;
|
|
|
|
int m_ColorEnvOffset;
|
|
|
|
};
|
|
|
|
|
2010-07-05 18:57:07 +00:00
|
|
|
class CTile
|
2010-05-29 07:25:38 +00:00
|
|
|
{
|
2010-07-05 19:04:19 +00:00
|
|
|
public:
|
2010-05-29 07:25:38 +00:00
|
|
|
unsigned char m_Index;
|
|
|
|
unsigned char m_Flags;
|
|
|
|
unsigned char m_Skip;
|
|
|
|
unsigned char m_Reserved;
|
|
|
|
};
|
|
|
|
|
2010-08-10 04:28:17 +00:00
|
|
|
class CTeleTile
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
unsigned char m_Number;
|
|
|
|
unsigned char m_Type;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CSpeedupTile
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
unsigned char m_Force;
|
2010-09-22 17:43:23 +00:00
|
|
|
unsigned char m_MaxSpeed;
|
2010-09-11 00:01:15 +00:00
|
|
|
unsigned char m_Type;
|
2010-08-10 04:28:17 +00:00
|
|
|
short m_Angle;
|
|
|
|
};
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
struct CMapItemImage
|
|
|
|
{
|
|
|
|
int m_Version;
|
|
|
|
int m_Width;
|
|
|
|
int m_Height;
|
|
|
|
int m_External;
|
|
|
|
int m_ImageName;
|
|
|
|
int m_ImageData;
|
|
|
|
} ;
|
|
|
|
|
2010-09-25 16:39:52 +00:00
|
|
|
class CDoorTile
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
unsigned char m_Index;
|
2010-11-01 01:51:17 +00:00
|
|
|
unsigned char m_Flags;
|
2010-09-26 14:30:43 +00:00
|
|
|
bool m_Team[MAX_CLIENTS];
|
2010-09-25 16:39:52 +00:00
|
|
|
};
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
struct CMapItemGroup_v1
|
|
|
|
{
|
|
|
|
int m_Version;
|
|
|
|
int m_OffsetX;
|
|
|
|
int m_OffsetY;
|
|
|
|
int m_ParallaxX;
|
|
|
|
int m_ParallaxY;
|
|
|
|
|
|
|
|
int m_StartLayer;
|
|
|
|
int m_NumLayers;
|
|
|
|
} ;
|
|
|
|
|
|
|
|
|
|
|
|
struct CMapItemGroup : public CMapItemGroup_v1
|
|
|
|
{
|
|
|
|
enum { CURRENT_VERSION=2 };
|
|
|
|
|
|
|
|
int m_UseClipping;
|
|
|
|
int m_ClipX;
|
|
|
|
int m_ClipY;
|
|
|
|
int m_ClipW;
|
|
|
|
int m_ClipH;
|
|
|
|
} ;
|
|
|
|
|
|
|
|
struct CMapItemLayer
|
|
|
|
{
|
|
|
|
int m_Version;
|
|
|
|
int m_Type;
|
|
|
|
int m_Flags;
|
|
|
|
} ;
|
|
|
|
|
|
|
|
struct CMapItemLayerTilemap
|
|
|
|
{
|
|
|
|
CMapItemLayer m_Layer;
|
|
|
|
int m_Version;
|
|
|
|
|
|
|
|
int m_Width;
|
|
|
|
int m_Height;
|
|
|
|
int m_Flags;
|
|
|
|
|
|
|
|
CColor m_Color;
|
|
|
|
int m_ColorEnv;
|
|
|
|
int m_ColorEnvOffset;
|
|
|
|
|
|
|
|
int m_Image;
|
|
|
|
int m_Data;
|
2010-08-10 04:28:17 +00:00
|
|
|
|
|
|
|
int m_Tele;
|
|
|
|
int m_Speedup;
|
|
|
|
int m_Front;
|
2010-08-27 23:30:50 +00:00
|
|
|
int m_Switch;
|
2010-05-29 07:25:38 +00:00
|
|
|
} ;
|
|
|
|
|
|
|
|
struct CMapItemLayerQuads
|
|
|
|
{
|
|
|
|
CMapItemLayer m_Layer;
|
|
|
|
int m_Version;
|
|
|
|
|
|
|
|
int m_NumQuads;
|
|
|
|
int m_Data;
|
|
|
|
int m_Image;
|
|
|
|
} ;
|
|
|
|
|
|
|
|
struct CMapItemVersion
|
|
|
|
{
|
|
|
|
int m_Version;
|
|
|
|
} ;
|
|
|
|
|
|
|
|
struct CEnvPoint
|
|
|
|
{
|
|
|
|
int m_Time; // in ms
|
|
|
|
int m_Curvetype;
|
|
|
|
int m_aValues[4]; // 1-4 depending on envelope (22.10 fixed point)
|
|
|
|
|
|
|
|
bool operator<(const CEnvPoint &Other) { return m_Time < Other.m_Time; }
|
|
|
|
} ;
|
|
|
|
|
|
|
|
struct CMapItemEnvelope
|
|
|
|
{
|
|
|
|
int m_Version;
|
|
|
|
int m_Channels;
|
|
|
|
int m_StartPoint;
|
|
|
|
int m_NumPoints;
|
2010-08-25 14:15:59 +00:00
|
|
|
int m_aName[8];
|
2010-05-29 07:25:38 +00:00
|
|
|
} ;
|
|
|
|
|
|
|
|
#endif
|