#ifndef GAME_MAPITEMS_H #define GAME_MAPITEMS_H // 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, //DDRace ENTITY_LASER_FAST_CW, //M&F ENTITY_LASER_NORMAL_CW, //M&F ENTITY_LASER_SLOW_CW, //M&F ENTITY_LASER_STOP, //M&F ENTITY_LASER_SLOW_CCW, //M&F ENTITY_LASER_NORMAL_CCW,//M&F ENTITY_LASER_FAST_CCW, //M&F ENTITY_LASER_SHORT, //M&F ENTITY_LASER_MIDDLE, //M&F ENTITY_LASER_LONG, //M&F ENTITY_LASER_C_SLOW, //M&F ENTITY_LASER_C_NORMAL, //M&F ENTITY_LASER_C_FAST, //M&F ENTITY_LASER_O_SLOW, //M&F ENTITY_LASER_O_NORMAL, //M&F ENTITY_LASER_O_FAST, //M&F ENTITY_DRAGER_WEAK, //M&F ENTITY_DRAGER_NORMAL, //M&F ENTITY_DRAGER_STRONG, //M&F ENTITY_PLASMA, //M&F ENTITY_NOTHING1, ENTITY_NOTHING2, ENTITY_NOTHING3, ENTITY_NOTHING4, ENTITY_NOTHING5, ENTITY_NOTHING6, ENTITY_NOTHING7, ENTITY_NOTHING8, ENTITY_NOTHING9, ENTITY_NOTHING10, ENTITY_NOTHING11, ENTITY_NOTHING12, ENTITY_DRAGER_WEAK_NW, //M&F ENTITY_DRAGER_NORMAL_NW, //M&F ENTITY_DRAGER_STRONG_NW, //M&F NUM_ENTITIES, TILE_AIR=0, TILE_SOLID, TILE_DEATH, TILE_NOHOOK, TILE_NOLASER, //M TILE_BOOST_L, //M TILE_BOOST_R, //M TILE_BOOST_D, //M TILE_BOOST_U, //M TILE_FREEZE, //M&F TILE_KICK, //M&F TILE_UNFREEZE, //M&F TILE_BOOST_L2, //M TILE_BOOST_R2, //M TILE_BOOST_D2, //M TILE_BOOST_U2, //M TILE_NOTHING, //M&F TILE_CP_D, //M //no collision TILE_CP_U, //M //endless hook TILE_CP_R, //M TILE_CP_L, //M TILE_CP_D_F, //M TILE_CP_U_F, //M TILE_CP_R_F, //M TILE_CP_L_F, //M TILE_BEGIN=33, //M TILE_END, //M TILEFLAG_VFLIP=1, TILEFLAG_HFLIP=2, TILEFLAG_OPAQUE=4, LAYERFLAG_DETAIL=1, ENTITY_OFFSET=255-16*4, }; 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; }; class CTile { public: unsigned char m_Index; unsigned char m_Flags; unsigned char m_Skip; unsigned char m_Reserved; }; struct CMapItemImage { int m_Version; int m_Width; int m_Height; int m_External; int m_ImageName; int m_ImageData; } ; 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; } ; 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; int m_aName[8]; } ; #endif