2000-09-25 17:43:52 +02:00
|
|
|
/******************/
|
|
|
|
/*** Layer Core ***/
|
|
|
|
/******************/
|
|
|
|
|
|
|
|
#ifndef __LAYER_HEADER__
|
|
|
|
#define __LAYER_HEADER__
|
|
|
|
|
|
|
|
#include <Vector>
|
2000-12-04 17:47:34 +01:00
|
|
|
#include <Vector3.h>
|
2000-11-02 16:46:17 +01:00
|
|
|
#include "Map.h"
|
2000-12-29 23:20:38 +01:00
|
|
|
#include "Select.h"
|
2000-12-06 20:29:40 +01:00
|
|
|
#include "LayerDef.h"
|
2000-09-25 17:43:52 +02:00
|
|
|
|
2000-11-03 23:40:41 +01:00
|
|
|
/*****************************************************************************/
|
2001-01-23 22:53:48 +01:00
|
|
|
struct sLayerInfoTable
|
2000-11-03 23:40:41 +01:00
|
|
|
{
|
2001-01-23 22:53:48 +01:00
|
|
|
LAYER_TYPE Type;
|
|
|
|
LAYER_SUBTYPE SubType;
|
|
|
|
char *Name;
|
|
|
|
|
|
|
|
bool DeleteFlag;
|
|
|
|
float ScaleFactor;
|
|
|
|
bool Render3dFlag;
|
|
|
|
bool ResizeFlag;
|
2001-02-07 22:31:31 +01:00
|
|
|
bool ExportFlag;
|
2001-03-01 18:28:20 +01:00
|
|
|
int SubView;
|
2001-01-23 22:53:48 +01:00
|
|
|
|
2000-11-03 23:40:41 +01:00
|
|
|
};
|
|
|
|
|
2001-01-23 22:53:48 +01:00
|
|
|
/*****************************************************************************/
|
|
|
|
enum LAYER_ENUMS
|
2000-11-30 23:17:55 +01:00
|
|
|
{
|
2001-01-23 22:53:48 +01:00
|
|
|
SELECT_BUFFER_SIZE=16,
|
2001-02-09 22:17:01 +01:00
|
|
|
TileLayerMinWidth=32,
|
|
|
|
TileLayerMinHeight=22,
|
2000-11-30 23:17:55 +01:00
|
|
|
};
|
2000-09-25 17:43:52 +02:00
|
|
|
|
|
|
|
/*****************************************************************************/
|
2000-11-02 16:46:17 +01:00
|
|
|
class CCore;
|
2000-11-24 23:34:20 +01:00
|
|
|
class CExport;
|
2000-09-25 17:43:52 +02:00
|
|
|
class CLayer
|
|
|
|
{
|
|
|
|
public:
|
2001-03-01 18:28:20 +01:00
|
|
|
CLayer();
|
2000-11-07 21:38:19 +01:00
|
|
|
virtual ~CLayer(){};
|
2000-09-25 17:43:52 +02:00
|
|
|
|
2001-01-23 22:53:48 +01:00
|
|
|
static sLayerInfoTable InfoTable[];
|
|
|
|
static int InfoTableSize;
|
|
|
|
|
|
|
|
static int GetLayerIdx(int Type,int SubType);
|
|
|
|
|
|
|
|
void SetDefaultParams();
|
|
|
|
|
|
|
|
char *GetName() {return(InfoTable[GetLayerIdx(GetType(),GetSubType())].Name);}
|
|
|
|
bool CanDelete() {return(InfoTable[GetLayerIdx(GetType(),GetSubType())].DeleteFlag);}
|
2001-02-07 22:31:31 +01:00
|
|
|
bool CanExport() {return(InfoTable[GetLayerIdx(GetType(),GetSubType())].ExportFlag);}
|
|
|
|
bool IsUnique() {return(!(InfoTable[GetLayerIdx(GetType(),GetSubType())].ExportFlag));}
|
2001-03-01 18:28:20 +01:00
|
|
|
int GetSubViewType() {return((InfoTable[GetLayerIdx(GetType(),GetSubType())].SubView));}
|
2001-01-23 22:53:48 +01:00
|
|
|
|
2001-03-01 18:28:20 +01:00
|
|
|
virtual void InitSubView(CCore *Core){};
|
|
|
|
virtual CLayer *GetSubView() {return(SubView);}
|
|
|
|
|
|
|
|
|
|
|
|
virtual void SetVisible(bool f) {VisibleFlag=f;}
|
|
|
|
virtual bool IsVisible() {return(VisibleFlag);}
|
2000-11-20 21:33:42 +01:00
|
|
|
virtual int GetType()=0;
|
2001-01-23 22:53:48 +01:00
|
|
|
virtual int GetSubType() {return(LAYER_SUBTYPE_NONE);}
|
|
|
|
float GetScaleFactor() {return(ScaleFactor);}
|
2000-09-25 17:43:52 +02:00
|
|
|
|
2001-03-01 18:28:20 +01:00
|
|
|
virtual void Render(CCore *Core,Vector3 &CamPos,bool Is3d)=0;
|
|
|
|
virtual void RenderGrid(CCore *Core,Vector3 &CamPos,bool Active)=0;
|
2000-12-29 23:20:38 +01:00
|
|
|
virtual void RenderSelection(CCore *Core,Vector3 &ThisCam)=0;
|
2001-03-01 18:28:20 +01:00
|
|
|
virtual void RenderCursor(CCore *Core,Vector3 &CamPos,bool Is3d)=0;
|
2001-02-14 23:35:47 +01:00
|
|
|
virtual void FindCursorPos(CCore *Core,Vector3 &CamPos,CPoint &MousePos)=0;
|
2000-11-14 16:03:04 +01:00
|
|
|
|
2001-02-09 22:17:01 +01:00
|
|
|
virtual void GUIInit(CCore *Core)=0;
|
|
|
|
virtual void GUIKill(CCore *Core)=0;
|
|
|
|
virtual void GUIUpdate(CCore *Core)=0;
|
|
|
|
virtual void GUIChanged(CCore *Core)=0;
|
2000-11-02 16:46:17 +01:00
|
|
|
|
2001-03-05 21:49:46 +01:00
|
|
|
virtual int GetWidth() {return(-1);}
|
|
|
|
virtual int GetHeight() {return(-1);}
|
2000-11-30 23:17:55 +01:00
|
|
|
virtual void CheckLayerSize(int Width,int Height){};
|
2001-03-05 21:49:46 +01:00
|
|
|
virtual bool Resize(int Width,int Height) {return(false);}
|
2000-11-17 22:36:13 +01:00
|
|
|
|
2001-01-23 22:53:48 +01:00
|
|
|
virtual void Load(CFile *File,int Version)=0;
|
2000-11-20 21:33:42 +01:00
|
|
|
virtual void Save(CFile *File)=0;
|
|
|
|
|
2000-11-29 18:07:57 +01:00
|
|
|
virtual void Export(CCore *Core,CExport &Exp)=0;
|
2000-11-24 23:34:20 +01:00
|
|
|
|
2001-03-05 21:49:46 +01:00
|
|
|
virtual Vector3 &GetCam() {return(LayerCam);}
|
2001-01-21 19:04:00 +01:00
|
|
|
|
2000-11-15 22:22:40 +01:00
|
|
|
// Functions
|
2001-03-01 18:28:20 +01:00
|
|
|
virtual bool LButtonControl(CCore *Core,UINT nFlags, CPoint &CursorPos,bool DownFlag){return(false);}
|
|
|
|
virtual bool RButtonControl(CCore *Core,UINT nFlags, CPoint &CursorPos,bool DownFlag){return(false);}
|
|
|
|
virtual bool MouseMove(CCore *Core,UINT nFlags, CPoint &CursorPos){return(false);}
|
|
|
|
virtual bool Command(int CmdMsg,CCore *Core,int Param0=0,int Param1=0){return(false);};
|
2000-12-11 22:29:59 +01:00
|
|
|
|
2000-11-07 21:38:19 +01:00
|
|
|
protected:
|
2000-11-28 22:16:00 +01:00
|
|
|
float ScaleFactor;
|
2001-01-23 22:53:48 +01:00
|
|
|
bool Render3dFlag;
|
|
|
|
bool ResizeFlag;
|
|
|
|
|
2001-03-01 18:28:20 +01:00
|
|
|
bool VisibleFlag;
|
2000-12-29 23:20:38 +01:00
|
|
|
CSelect Selection;
|
2001-03-01 18:28:20 +01:00
|
|
|
CLayer *SubView;
|
2001-03-05 21:49:46 +01:00
|
|
|
Vector3 LayerCam;
|
|
|
|
|
2000-09-25 17:43:52 +02:00
|
|
|
};
|
|
|
|
|
2000-11-02 16:46:17 +01:00
|
|
|
|
2000-09-25 17:43:52 +02:00
|
|
|
/*****************************************************************************/
|
|
|
|
#endif
|