This commit is contained in:
parent
114268ff23
commit
3602018f1a
25 changed files with 565 additions and 1169 deletions
|
@ -1,94 +1,38 @@
|
|||
/*******************/
|
||||
/*** Layer Thing ***/
|
||||
/*** Layer Actor ***/
|
||||
/*******************/
|
||||
|
||||
#ifndef __LAYER_THING_HEADER__
|
||||
#define __LAYER_THING_HEADER__
|
||||
#ifndef __LAYER_ACTOR_HEADER__
|
||||
#define __LAYER_ACTOR_HEADER__
|
||||
|
||||
#include "LayerThing.h"
|
||||
#include "Layer.h"
|
||||
#include "MapEdit.h"
|
||||
#include "GUIToolbar.h"
|
||||
#include "Elem.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
struct sLayerThing
|
||||
{
|
||||
std::vector<CPoint> XY;
|
||||
int Type;
|
||||
int SubType;
|
||||
int Spare[8];
|
||||
|
||||
bool operator==(sLayerThing const &v1)
|
||||
{
|
||||
if (XY[0]!=v1.XY[0]) return(false);
|
||||
return(true);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
class CIni;
|
||||
class CLayerThing : public CLayer
|
||||
class CLayerActor : public CLayerThing
|
||||
{
|
||||
public:
|
||||
enum MouseMode
|
||||
{
|
||||
MouseModeNormal=0,
|
||||
MouseModePoints,
|
||||
};
|
||||
// CLayerActor(int Type,int SubType,int Width,int Height);
|
||||
CLayerActor(sLayerDef &Def);
|
||||
CLayerActor(CFile *File,int Version) {Load(File,Version);}
|
||||
|
||||
CLayerThing(){};
|
||||
CLayerThing(int SubType,int Width,int Height); // New Layer
|
||||
CLayerThing(CFile *File,int Version); // Load Layer
|
||||
~CLayerThing();
|
||||
void InitSubView(CCore *Core);
|
||||
|
||||
virtual int GetType() {return(LAYER_TYPE_ITEM);}
|
||||
virtual void InitSubView(CCore *Core);
|
||||
void GUIInit(CCore *Core);
|
||||
void GUIKill(CCore *Core);
|
||||
void GUIUpdate(CCore *Core);
|
||||
void GUIChanged(CCore *Core);
|
||||
|
||||
virtual void Render(CCore *Core,Vector3 &CamPos,bool Is3d);
|
||||
void RenderCursor(CCore *Core,Vector3 &CamPos,bool Is3d);
|
||||
// void FindCursorPos(CCore *Core,Vector3 &CamPos,CPoint &MousePos);
|
||||
void Load(CFile *File,int Version);
|
||||
void Save(CFile *File);
|
||||
void LoadThingScript(const char *Filename);
|
||||
|
||||
virtual void GUIInit(CCore *Core);
|
||||
virtual void GUIKill(CCore *Core);
|
||||
virtual void GUIUpdate(CCore *Core);
|
||||
virtual void GUIChanged(CCore *Core);
|
||||
|
||||
int GetWidth() {return(Width);}
|
||||
int GetHeight() {return(Height);}
|
||||
|
||||
virtual void Load(CFile *File,int Version);
|
||||
virtual void Save(CFile *File);
|
||||
virtual void LoadThingScript(const char *Filename);
|
||||
|
||||
virtual void Export(CCore *Core,CExport &Exp);
|
||||
|
||||
// Functions
|
||||
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);
|
||||
void Export(CCore *Core,CExport &Exp);
|
||||
|
||||
protected:
|
||||
void RenderThing(CCore *Core,Vector3 &CamPos,sLayerThing &ThisThing,bool Render3d,bool Selected);
|
||||
int CheckThing(CPoint &Pos);
|
||||
void AddThing(CPoint &Pos);
|
||||
void SelectThing(CPoint &Pos);
|
||||
int CheckThingPoint(CPoint &Pos);
|
||||
void AddThingPoint(CPoint &Pos);
|
||||
void SelectThingPoint(CPoint &Pos);
|
||||
|
||||
void UpdatePos(CPoint &Pos,int Thing,int PosNo,bool Recurs=false);
|
||||
|
||||
|
||||
int Width,Height;
|
||||
CIni ThingScript;
|
||||
CElemBank *ThingBank;
|
||||
CList<sLayerThing> ThingList;
|
||||
int CurrentThing,CurrentPoint;
|
||||
MouseMode Mode;
|
||||
|
||||
|
||||
CGUIToolBar GUIToolBar;
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue