SBSPSS/Utils/MapEdit/LayerTile.h

88 lines
2.3 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"
2000-11-15 22:22:40 +01:00
/*****************************************************************************/
2000-11-07 22:15:35 +01:00
/*****************************************************************************/
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,
MouseModePicker,
};
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-20 17:21:43 +01:00
CLayerTile(char *_Name,int Width,int Height,float MapDiv,float ZDiv,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-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-24 23:34:20 +01:00
void Export(CExport &Exp);
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-15 22:22:40 +01:00
MouseMode Mode;
2000-11-07 22:15:35 +01:00
};
/*****************************************************************************/
#endif