SBSPSS/Utils/MapEdit/LayerTile.h

91 lines
2.5 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"
2001-02-09 22:17:01 +01:00
#include "MapEdit.h"
2001-03-13 22:00:34 +01:00
#include "GUIToolbar.h"
2000-11-07 22:15:35 +01:00
/*****************************************************************************/
class CCore;
2001-03-01 18:28:20 +01:00
class CTileBank;
2000-11-07 22:15:35 +01:00
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(){};
2001-03-26 23:29:09 +02:00
// CLayerTile(int Type,int SubType,int Width,int Height);
CLayerTile(sLayerDef &Def);
CLayerTile(CFile *File,int Version) {Load(File,Version);}
2000-11-07 22:15:35 +01:00
~CLayerTile();
2001-03-26 23:29:09 +02:00
void InitLayer(sLayerDef &Def);
2001-03-01 18:28:20 +01:00
void InitSubView(CCore *Core);
2000-11-20 21:33:42 +01:00
2001-03-01 18:28:20 +01:00
virtual void Render(CCore *Core,Vector3 &CamPos,bool Is3d);
2001-02-20 16:57:03 +01:00
virtual void RenderSelection(CCore *Core,Vector3 &ThisCam);
2001-03-01 18:28:20 +01:00
void RenderCursor(CCore *Core,Vector3 &CamPos,bool Is3d);
2001-04-05 16:20:56 +02:00
void Render4TGA(const char *Filename);
void WriteTile2Buffer(sMapElem &Elem,u8 *Buffer,int X,int Y,int PixW,int PixH);
2000-11-14 16:03:04 +01:00
2001-02-14 23:35:47 +01:00
virtual void GUIInit(CCore *Core);
virtual void GUIKill(CCore *Core);
virtual void GUIUpdate(CCore *Core);
virtual void GUIChanged(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());}
2001-03-01 18:28:20 +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);
2001-03-26 23:29:09 +02:00
void Validate(CCore *Core);
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
2001-03-01 18:28:20 +01:00
virtual bool LButtonControl(CCore *Core,UINT nFlags, CPoint &point,bool DownFlag);
virtual bool RButtonControl(CCore *Core,UINT nFlags, CPoint &point,bool DownFlag);
virtual bool MouseMove(CCore *Core,UINT nFlags, CPoint &point);
virtual bool Command(int CmdMsg,CCore *Core,int Param0=0,int Param1=0);
2000-11-17 00:08:54 +01:00
2001-03-01 18:28:20 +01:00
bool MirrorX(CCore *Core);
bool MirrorY(CCore *Core);
bool SetColFlags(CCore *Core,int Flags);
2000-11-15 22:22:40 +01:00
2001-03-01 18:28:20 +01:00
bool CopySelection(CCore *Core);
bool PasteSelection(CCore *Core);
2000-12-29 23:20:38 +01:00
2001-03-01 18:28:20 +01:00
// Local
CTileBank *GetTileBank() {return(TileBank);}
2001-03-05 21:49:46 +01:00
void RemoveSet(int Set);
2000-12-11 22:29:59 +01:00
void RemapSet(int OrigSet,int NewSet);
2000-11-07 22:15:35 +01:00
protected:
2001-03-01 18:28:20 +01:00
void Render(CCore *Core,Vector3 &CamPos,CMap &ThisMap,bool Render3d,float Alpha=1.0f,Vector3 *Ofs=0);
void RenderCursorPaint(CCore *Core,Vector3 &CamPos,bool Is3d);
2000-11-17 22:36:13 +01:00
2001-03-01 18:28:20 +01:00
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-28 22:16:00 +01:00
2001-03-01 18:28:20 +01:00
CTileBank *TileBank;
2001-03-13 22:00:34 +01:00
CGUIToolBar GUIToolBar;
2000-11-28 22:16:00 +01:00
2000-11-07 22:15:35 +01:00
};
/*****************************************************************************/
#endif