SBSPSS/Utils/MapEdit/LayerTile.h

93 lines
2.4 KiB
C
Raw Normal View History

2000-11-07 22:15:35 +01:00
/******************/
/*** Layer Tile ***/
/******************/
#ifndef __LAYER_TILE_HEADER__
#define __LAYER_TILE_HEADER__
#include "Layer.h"
/*****************************************************************************/
enum TileLayerEnum
{
2000-11-30 23:17:55 +01:00
TileLayerMinWidth=32,
TileLayerMinHeight=22,
2000-11-07 22:15:35 +01:00
};
/*****************************************************************************/
class CCore;
class CMapEditView;
class CLayerTile : public CLayer
{
public:
2000-11-15 22:22:40 +01:00
enum MouseMode
{
2000-11-17 22:36:13 +01:00
MouseModePaint=0,
2000-11-15 22:22:40 +01:00
MouseModeSelect,
};
2001-01-23 22:53:48 +01:00
CLayerTile(){};
CLayerTile(int SubType,int Width,int Height); // New Layer
CLayerTile(CFile *File,int Version); // Load Layer
2000-11-07 22:15:35 +01:00
~CLayerTile();
2000-11-20 21:33:42 +01:00
int GetType() {return(LAYER_TYPE_TILE);}
2000-11-28 22:16:00 +01:00
int GetSubType() {return(SubType);}
2000-11-20 21:33:42 +01:00
2000-12-04 17:47:34 +01:00
void Render(CCore *Core,Vector3 &CamPos,BOOL Is3d);
void RenderGrid(CCore *Core,Vector3 &CamPos,BOOL Active);
2000-12-29 23:20:38 +01:00
void RenderSelection(CCore *Core,Vector3 &ThisCam);
2000-11-17 22:36:13 +01:00
2000-12-04 17:47:34 +01:00
void FindCursorPos(CCore *Core,CMapEditView *View,Vector3 &CamPos,CPoint &MousePos);
void RenderCursor(CCore *Core,Vector3 &CamPos,BOOL Is3d);
2000-11-14 16:03:04 +01:00
void InitGUI(CCore *Core);
void UpdateGUI(CCore *Core);
2000-11-07 22:15:35 +01:00
2000-11-20 17:21:43 +01:00
int GetWidth() {return(Map.GetWidth());}
int GetHeight() {return(Map.GetHeight());}
2000-11-30 23:17:55 +01:00
BOOL Resize(int Width,int Height);
2000-11-20 17:21:43 +01:00
2001-01-23 22:53:48 +01:00
void Load(CFile *File,int Version);
2000-11-20 21:33:42 +01:00
void Save(CFile *File);
2000-11-30 23:17:55 +01:00
void CheckLayerSize(int Width,int Height);
2000-11-17 22:36:13 +01:00
2000-11-29 18:07:57 +01:00
void Export(CCore *Core,CExport &Exp);
2000-11-24 23:34:20 +01:00
2000-11-15 22:22:40 +01:00
// Functions
BOOL SetMode(int NewMode);
BOOL InitMode();
BOOL ExitMode();
2000-11-17 00:08:54 +01:00
2000-11-15 22:22:40 +01:00
BOOL LButtonControl(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag);
BOOL RButtonControl(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag);
BOOL MouseMove(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &point);
2000-11-17 22:36:13 +01:00
BOOL MirrorX(CCore *Core);
BOOL MirrorY(CCore *Core);
2000-11-15 22:22:40 +01:00
2000-12-29 23:20:38 +01:00
BOOL CopySelection(CCore *Core);
BOOL PasteSelection(CCore *Core);
2000-12-11 22:29:59 +01:00
void DeleteSet(int Set);
void RemapSet(int OrigSet,int NewSet);
2000-11-07 22:15:35 +01:00
protected:
2001-01-17 22:52:08 +01:00
void Render(CCore *Core,Vector3 &CamPos,CMap &ThisMap,BOOL Render3d,float Alpha=1.0f,Vector3 *Ofs=0);
2000-12-04 17:47:34 +01:00
void RenderCursorPaint(CCore *Core,Vector3 &CamPos,BOOL Is3d);
2000-11-17 22:36:13 +01:00
BOOL Paint(CMap &Blk,CPoint &CursorPos);
2000-11-07 22:15:35 +01:00
CMap Map;
2000-11-28 22:16:00 +01:00
int SubType;
2000-11-15 22:22:40 +01:00
MouseMode Mode;
2000-11-28 22:16:00 +01:00
2001-01-23 22:53:48 +01:00
//static char *LayerName[];
2000-11-28 22:16:00 +01:00
2000-11-07 22:15:35 +01:00
};
/*****************************************************************************/
#endif