SBSPSS/source/level/layertile.h

69 lines
1.4 KiB
C
Raw Normal View History

2000-12-07 02:15:53 +01:00
/************************/
/*** Tile Layer Class ***/
/************************/
#ifndef __LAYER_TILE_H__
#define __LAYER_TILE_H__
2001-01-16 17:20:45 +01:00
#include <dstructs.h>
2001-01-15 16:22:33 +01:00
#include "gfx\prim.h"
2000-12-07 02:15:53 +01:00
2001-01-16 17:20:45 +01:00
2001-01-15 16:22:33 +01:00
/*****************************************************************************/
const s32 LayerOT=MAX_OT-1;
2000-12-09 18:22:06 +01:00
/*****************************************************************************/
class CLayerTile
2000-12-07 02:15:53 +01:00
{
public:
2000-12-09 18:22:06 +01:00
enum LAYER_TILE_TYPE
{ // Stored reverse for rendering :o)
LAYER_TILE_TYPE_FORE,
LAYER_TILE_TYPE_ACTION,
LAYER_TILE_TYPE_MID,
LAYER_TILE_TYPE_BACK,
LAYER_TILE_TYPE_MAX
};
enum
2000-12-07 02:15:53 +01:00
{
2000-12-09 18:22:06 +01:00
TILE_WIDTH=16,
TILE_HEIGHT=16,
2001-02-22 15:55:13 +01:00
SCREEN_TILE_WIDTH=34,
SCREEN_TILE_HEIGHT=18,
2000-12-09 18:22:06 +01:00
SCREEN_TILE_SIZE=SCREEN_TILE_WIDTH*SCREEN_TILE_HEIGHT
2000-12-07 02:15:53 +01:00
};
2000-12-12 21:56:51 +01:00
CLayerTile(sLayerHdr *Hdr,sTile *TileList,sTri *TriList,sQuad *QuadList,sVtx *VtxList);
2000-12-09 18:22:06 +01:00
virtual ~CLayerTile();
2001-02-22 15:55:13 +01:00
virtual void init(DVECTOR &MapPos,int Shift);
2000-12-12 21:56:51 +01:00
virtual void shutdown();
2001-01-09 21:38:20 +01:00
virtual void think(DVECTOR &MapPos);
2000-12-12 21:56:51 +01:00
virtual void render();
2000-12-09 18:22:06 +01:00
2001-02-22 15:55:13 +01:00
int GetMapOfs() {return(MapXY.vx+(MapXY.vy*MapWidth));}
virtual sTileMapElem *GetMapPos() {return(Map+GetMapOfs());}
2000-12-09 18:22:06 +01:00
protected:
2001-01-04 22:53:14 +01:00
2000-12-07 02:15:53 +01:00
2000-12-09 18:22:06 +01:00
sLayerHdr *LayerHdr;
2000-12-07 16:56:20 +01:00
sTile *TileList;
sTri *TriList;
sQuad *QuadList;
sVtx *VtxList;
2000-12-07 02:15:53 +01:00
2000-12-14 17:38:34 +01:00
int MapWidth,MapHeight,MapXYShift;
2001-02-22 15:55:13 +01:00
int RenderW,RenderH;
2001-01-03 23:12:25 +01:00
2001-02-22 15:55:13 +01:00
DVECTOR MapXY;
2001-01-03 23:12:25 +01:00
u16 ShiftX,ShiftY;
2001-01-04 22:53:14 +01:00
sTileMapElem *Map;
2000-12-07 02:15:53 +01:00
};
/*****************************************************************************/
#endif