SBSPSS/Utils/MapEdit/LayerTile.h

97 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-20 21:33:42 +01:00
TileLayerDefaultWidth=30,
TileLayerDefaultHeight=20,
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,
};
enum MouseFlag
{
2000-11-17 00:08:54 +01:00
MouseFlagMirrorX=1<<0,
MouseFlagMirrorY=1<<1,
2000-11-24 23:34:20 +01:00
MouseFlagMirrorXY=MouseFlagMirrorX|MouseFlagMirrorY,
2000-11-15 22:22:40 +01:00
};
2000-11-28 22:16:00 +01:00
enum SubType
{
Back=0,
Mid,
Action,
Fore,
};
2000-11-15 22:22:40 +01:00
2000-11-28 22:16:00 +01:00
CLayerTile(int SubType,int Width,int Height,float Scale,BOOL Is3d,BOOL Resizable); // New Layer
2000-11-20 21:33:42 +01:00
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);}
char *GetName() {return(LayerName[SubType]);}
2000-11-20 21:33:42 +01:00
2000-11-14 16:03:04 +01:00
void Render(CCore *Core,Vec &CamPos,BOOL Is3d);
2000-11-28 00:07:07 +01:00
void RenderGrid(CCore *Core,Vec &CamPos,BOOL Active);
2000-11-17 22:36:13 +01:00
2000-11-14 16:03:04 +01:00
void FindCursorPos(CCore *Core,CMapEditView *View,Vec &CamPos,CPoint &MousePos);
2000-11-17 22:36:13 +01:00
void RenderCursor(CCore *Core,Vec &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());}
void Resize(int Width,int Height);
2000-11-20 21:33:42 +01:00
void Load(CFile *File,float Version);
void Save(CFile *File);
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-11-07 22:15:35 +01:00
protected:
2000-11-22 23:08:47 +01:00
void Render(CCore *Core,Vec &CamPos,CMap &ThisMap,BOOL Render3d,float Alpha=1.0f);
2000-11-17 22:36:13 +01:00
void RenderCursorPaint(CCore *Core,Vec &CamPos,BOOL Is3d);
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
static char *LayerName[];
2000-11-07 22:15:35 +01:00
};
/*****************************************************************************/
#endif