SBSPSS/Utils/MapEdit/TileSet.h

109 lines
2.8 KiB
C
Raw Normal View History

2000-10-27 02:06:19 +02:00
/*********************/
/*** TileSet Stuph ***/
/*********************/
#ifndef __TILESET_HEADER__
#define __TILESET_HEADER__
#include "stdafx.h"
2000-12-04 17:47:34 +01:00
#include <Vector3.h>
2000-10-27 02:06:19 +02:00
#include <gl\gl.h>
#include <gl\glu.h>
#include <Vector>
2000-12-04 17:47:34 +01:00
#include <gfname.hpp>
2000-10-27 02:06:19 +02:00
2001-03-01 18:28:20 +01:00
#include "Layer.h"
2000-10-27 20:18:30 +02:00
#include "TexCache.h"
2001-03-05 21:49:46 +01:00
#include "Elem.h"
2000-10-27 02:06:19 +02:00
2001-02-09 22:17:01 +01:00
#include "MapEdit.h"
#include "LayerTileGui.h"
2000-11-14 16:03:04 +01:00
/*****************************************************************************/
enum TileSetEnum
{
2000-11-28 22:16:00 +01:00
DefTileBrowserWidth=8,
2000-11-14 16:03:04 +01:00
};
2000-10-27 20:18:30 +02:00
/*****************************************************************************/
2000-11-06 21:24:11 +01:00
class CCore;
2000-10-27 20:18:30 +02:00
/*****************************************************************************/
2001-03-05 21:49:46 +01:00
class CTileBank : public CLayer, public CElemBank
2000-11-06 21:24:11 +01:00
{
public:
2000-11-14 16:03:04 +01:00
CTileBank();
~CTileBank();
2000-11-17 22:36:13 +01:00
enum BrushEnum
{
LBrush=0,
RBrush,
MaxBrush
};
2001-03-01 18:28:20 +01:00
// Overloads
int GetType() {return(0);}
2000-11-17 22:36:13 +01:00
2001-03-01 18:28:20 +01:00
void Render(CCore *Core,Vector3 &CamPos,bool Is3d);
void RenderGrid(CCore *Core,Vector3 &CamPos,bool Active);
void RenderSelection(CCore *Core,Vector3 &ThisCam){};
void RenderCursor(CCore *Core,Vector3 &CamPos,bool Is3d);
void FindCursorPos(CCore *Core,Vector3 &CamPos,CPoint &MousePos);
void GUIInit(CCore *Core);
void GUIKill(CCore *Core);
void GUIUpdate(CCore *Core);
void GUIChanged(CCore *Core);
void Load(CFile *File,int Version);
void Save(CFile *File);
void Export(CCore *Core,CExport &Exp){};
bool LButtonControl(CCore *Core,UINT nFlags, CPoint &CursorPos,bool DownFlag);
bool RButtonControl(CCore *Core,UINT nFlags, CPoint &CursorPos,bool DownFlag);
bool MouseMove(CCore *Core,UINT nFlags, CPoint &CursorPos);
bool Command(int CmdMsg,CCore *Core,int Param0=0,int Param1=0);
2001-03-05 21:49:46 +01:00
// ElemSet Thruput
const char *GetSetName(int Set) {return(SetList[Set].GetName());}
const char *GetSetFilename(int Set) {return(SetList[Set].GetFilename());}
CElem &GetTile(int Set,int Tile) {return(SetList[Set].GetElem(Tile));}
void RenderTile(int Set,int Elem,int Flags,bool Is3d) {SetList[Set].RenderElem(Elem,Flags,Is3d);}
2001-03-01 18:28:20 +01:00
// Local
void DeleteCurrent();
2000-11-15 22:22:40 +01:00
2001-03-05 21:49:46 +01:00
CMap &GetLBrush() {return(Brush[LBrush]);}
CMap &GetRBrush() {return(Brush[RBrush]);}
CMap &GetBrush(int i) {return(Brush[i]);}
CMap &GetActiveBrush() {return(GetBrush(ActiveBrush));}
2000-11-29 18:07:57 +01:00
2001-03-05 21:49:46 +01:00
bool CanClose() {return(SelStart==-1);}
CPoint GetTilePos(int ID,int Width);
2001-01-23 22:53:48 +01:00
2000-11-15 22:22:40 +01:00
// Functions
2001-03-01 18:28:20 +01:00
bool SelectCancel();
void DeleteSet(CCore *Core);
2000-11-20 21:33:42 +01:00
2001-02-09 22:17:01 +01:00
protected:
2001-03-01 18:28:20 +01:00
bool Select(int BrushID,bool DownFlag);
2000-11-17 22:36:13 +01:00
void SetBrush(CMap &ThisBrush);
2000-11-14 16:03:04 +01:00
2001-03-05 21:49:46 +01:00
//!! CList<CTileSet> TileSet;
2001-01-23 22:53:48 +01:00
int CurrentSet,LastSet;
2000-11-17 22:36:13 +01:00
CMap Brush[2];
int ActiveBrush;
int SelStart,SelEnd;
2000-11-06 21:24:11 +01:00
2001-03-01 18:28:20 +01:00
bool LoadFlag;
2000-11-17 22:36:13 +01:00
int LastCursorPos,CursorPos;
2001-02-09 22:17:01 +01:00
2001-02-10 21:21:20 +01:00
CLayerTileGUI TileBankGUI;
2001-02-09 22:17:01 +01:00
2000-11-06 21:24:11 +01:00
};
2000-10-27 02:06:19 +02:00
/*****************************************************************************/
#endif