This commit is contained in:
parent
02694f578b
commit
09637b8863
22 changed files with 704 additions and 669 deletions
|
@ -12,6 +12,7 @@
|
|||
#include <Vector>
|
||||
#include <gfname.hpp>
|
||||
|
||||
#include "Layer.h"
|
||||
#include "TexCache.h"
|
||||
#include "Tile.h"
|
||||
|
||||
|
@ -30,7 +31,7 @@ class CTile;
|
|||
|
||||
/*****************************************************************************/
|
||||
class CTileSet;
|
||||
class CTileBank
|
||||
class CTileBank : public CLayer
|
||||
{
|
||||
public:
|
||||
CTileBank();
|
||||
|
@ -42,16 +43,43 @@ public:
|
|||
RBrush,
|
||||
MaxBrush
|
||||
};
|
||||
// Overloads
|
||||
int GetType() {return(0);}
|
||||
|
||||
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);
|
||||
|
||||
int GetWidth(){return(0);}
|
||||
int GetHeight(){return(0);}
|
||||
void CheckLayerSize(int Width,int Height){};
|
||||
bool Resize(int Width,int Height){return(false);}
|
||||
|
||||
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);
|
||||
|
||||
// Local
|
||||
void AddTileSet(const char *Filename);
|
||||
int NeedLoad() {return(LoadFlag);}
|
||||
void Delete();
|
||||
void Reload();
|
||||
void DeleteCurrent();
|
||||
void ReloadAll();
|
||||
void LoadTileSets(CCore *Core);
|
||||
CTile &GetTile(int Bank,int Tile);
|
||||
|
||||
void SetCurrent() {CurrentSet=TileBankGUI.m_List.GetCurSel()+1;}
|
||||
int GetCurrent() {return(CurrentSet);}
|
||||
int GetSetCount() {return(TileSet.size());}
|
||||
|
||||
CMap &GetLBrush() {return(Brush[LBrush]);}
|
||||
|
@ -59,44 +87,30 @@ public:
|
|||
CMap &GetBrush(int i) {return(Brush[i]);}
|
||||
CMap &GetActiveBrush() {return(GetBrush(ActiveBrush));}
|
||||
|
||||
void RenderSet(CCore *Core,Vector3 &CamPos,BOOL Is3d);
|
||||
void FindCursorPos(CCore *Core,Vector3 &CamPos,CPoint &MousePos);
|
||||
void RenderCursor(CCore *Core,Vector3 &CamPos,BOOL Is3d);
|
||||
|
||||
void GUIInit(CCore *Core);
|
||||
void GUIKill(CCore *Core);
|
||||
void GUIUpdate(CCore *Core);
|
||||
|
||||
BOOL IsTileValid(int Set,int Tile);
|
||||
bool IsTileValid(int Set,int Tile);
|
||||
bool CanClose() {return(SelStart==-1);}
|
||||
|
||||
void SetCollision(bool f);
|
||||
CTileSet &GetSet(int Set) {return(TileSet[Set]);}
|
||||
|
||||
// Functions
|
||||
BOOL SelectL(BOOL DownFlag) {return(Select(LBrush,DownFlag));}
|
||||
BOOL SelectR(BOOL DownFlag) {return(Select(RBrush,DownFlag));}
|
||||
BOOL SelectCancel();
|
||||
|
||||
void SetActiveBrushL() {ActiveBrush=LBrush;}
|
||||
void SetActiveBrushR() {ActiveBrush=RBrush;}
|
||||
|
||||
void Load(CFile *File,int Version);
|
||||
void Save(CFile *File);
|
||||
bool SelectCancel();
|
||||
void LoadSet(CCore *Core);
|
||||
void DeleteSet(CCore *Core);
|
||||
|
||||
|
||||
protected:
|
||||
BOOL Select(int BrushID,BOOL DownFlag);
|
||||
|
||||
bool Select(int BrushID,bool DownFlag);
|
||||
void SetBrush(CMap &ThisBrush);
|
||||
|
||||
// std::vector<CTileSet> TileSet;
|
||||
CList<CTileSet> TileSet;
|
||||
int CurrentSet,LastSet;
|
||||
CMap Brush[2];
|
||||
int ActiveBrush;
|
||||
int SelStart,SelEnd;
|
||||
|
||||
BOOL LoadFlag;
|
||||
bool LoadFlag;
|
||||
int LastCursorPos,CursorPos;
|
||||
|
||||
CLayerTileGUI TileBankGUI;
|
||||
|
@ -123,26 +137,26 @@ const char *GetName() {return(Name);}
|
|||
CTile &GetTile(int No) {return(Tile[No]);}
|
||||
void Purge();
|
||||
int FindCursorPos(CCore *Core,Vector3 &CamPos,CPoint &MousePos);
|
||||
void Render(CCore *Core,Vector3 &CamPos,CMap &LBrush,CMap &RBrush,BOOL Render3d);
|
||||
void Render(CCore *Core,Vector3 &CamPos,CMap &LBrush,CMap &RBrush,bool Render3d);
|
||||
void RenderCursor(Vector3 &CamPos,int Pos,int Width, int Height);
|
||||
void RenderBrush(Vector3 &CamPos,CMap &LBrush,CMap &RBrush);
|
||||
void RenderGrid(Vector3 &CamPos);
|
||||
void RenderGrid(CCore *Core,Vector3 &CamPos,bool Active);
|
||||
int GetTileBrowserWidth() {return(TileBrowserWidth);}
|
||||
BOOL IsTileValid(int No);
|
||||
bool IsTileValid(int No);
|
||||
|
||||
bool operator==(CTileSet const &v1) {return (Name==v1.Name);}
|
||||
|
||||
// if (IsStrSame((char*)Name,(char*)v1.Name) return(i);
|
||||
|
||||
private:
|
||||
BOOL Create16x16Tile(sRGBData &Src,u8 *Dst,int XOfs,int YOfs);
|
||||
bool Create16x16Tile(sRGBData &Src,u8 *Dst,int XOfs,int YOfs);
|
||||
CPoint GetTilePos(int ID);
|
||||
|
||||
GString Filename,Name;
|
||||
|
||||
int SetNumber;
|
||||
CList<CTile> Tile;
|
||||
BOOL Loaded;
|
||||
bool Loaded;
|
||||
int TileBrowserWidth;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue