SBSPSS/source/level/layertile.h

59 lines
1.3 KiB
C
Raw Permalink 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_ACTION,
LAYER_TILE_TYPE_MID,
LAYER_TILE_TYPE_BACK,
LAYER_TILE_TYPE_MAX
};
2001-04-19 17:12:21 +02:00
CLayerTile(sLevelHdr *LevelHdr,sLayerHdr *Hdr);
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));}
2001-07-28 18:45:46 +02:00
//virtual sTileMapElem *GetMapPos() {return(Map+GetMapOfs());}
2001-05-16 21:06:47 +02:00
virtual sTileMapElem *getMapPtr(int _x,int _y) {return(&Map[(_x>>4)+((_y>>4)*MapWidth)]);}
2000-12-09 18:22:06 +01:00
protected:
2001-01-04 22:53:14 +01:00
2000-12-09 18:22:06 +01:00
sLayerHdr *LayerHdr;
2001-06-28 19:48:30 +02:00
sElem2d *ElemBank2d;
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;
2001-08-13 23:28:35 +02:00
TSPRT *PrimBank[2];
int PrimBankID;
2000-12-07 02:15:53 +01:00
};
/*****************************************************************************/
#endif