SBSPSS/Utils/MapEdit/Core.h

100 lines
2.7 KiB
C
Raw Normal View History

2000-09-22 17:11:29 +02:00
/***********************/
/*** Map Editor Core ***/
/***********************/
#ifndef __CORE_HEADER__
#define __CORE_HEADER__
#include <Vector>
2000-09-22 23:19:46 +02:00
#include "gl3d.h"
2000-09-25 17:43:52 +02:00
#include "Layer.h"
2000-11-07 21:38:19 +01:00
//#include "LayerTile.h"
2000-09-22 17:11:29 +02:00
2000-10-27 20:18:30 +02:00
#include "TexCache.h"
2000-10-27 02:06:19 +02:00
#include "TileSet.h"
2000-09-22 17:11:29 +02:00
/*****************************************************************************/
2000-09-22 23:19:46 +02:00
class CMapEditView;
2000-09-22 17:11:29 +02:00
class CCore
{
public:
CCore();
~CCore();
2000-11-02 16:46:17 +01:00
2000-11-06 21:24:11 +01:00
void Init();
void NewMap();
void OpenMap();
2000-11-14 16:03:04 +01:00
void Render(CMapEditView *View,BOOL ForceRender=FALSE);
void RenderLayers(CMapEditView *View);
void RenderTileView(CMapEditView *View);
2000-11-02 16:46:17 +01:00
2000-09-22 23:19:46 +02:00
// Control
2000-11-15 22:22:40 +01:00
void SetMode(int NewMode);
2000-11-06 21:24:11 +01:00
void LButtonControl(CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag);
void MButtonControl(CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag);
void RButtonControl(CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag);
void MouseWheel(CMapEditView *View,UINT nFlags, short zDelta, CPoint &pt);
void MouseMove(CMapEditView *View,UINT nFlags, CPoint &point);
2000-09-22 23:19:46 +02:00
2000-11-02 16:46:17 +01:00
// TileBank
2000-11-14 16:03:04 +01:00
void UpdateTileView(CMapEditView *View,BOOL Toggle=FALSE);
2000-09-22 17:11:29 +02:00
2000-11-15 22:22:40 +01:00
CTileBank &GetTileBank() {return(TileBank);}
2000-11-06 21:24:11 +01:00
CTile GetTile(int Bank,int TileNo) {return(TileBank.GetTile(Bank,TileNo));}
2000-11-15 22:22:40 +01:00
void TileBankLoad(char *Filename);
void TileBankReload();
void TileBankSet();
2000-11-20 17:21:43 +01:00
void MirrorX(CMapEditView *View);
void MirrorY(CMapEditView *View);
void ActiveBrushLeft(CMapEditView *View);
void ActiveBrushRight(CMapEditView *View);
2000-11-08 15:49:33 +01:00
// Param Bar
2000-11-17 00:08:54 +01:00
void UpdateParamBar();
2000-11-14 16:03:04 +01:00
2000-09-22 17:11:29 +02:00
// Layers
2000-11-06 21:24:11 +01:00
void SetActiveLayer(int Layer);
int GetActiveLayer() {return(ActiveLayer);}
CLayer *GetLayer(int i) {return(Layers[i]);}
2000-09-22 17:11:29 +02:00
2000-11-14 16:03:04 +01:00
// Grid
void UpdateGrid(CMapEditView *View,BOOL Toggle=FALSE);
BOOL IsGridOn() {return(GridFlag);}
2000-10-27 22:21:39 +02:00
// Tex Cache
2000-11-06 21:24:11 +01:00
CTexCache &GetTexCache() {return(TexCache);}
2000-10-27 22:21:39 +02:00
2000-11-02 16:46:17 +01:00
// Misc
2000-11-06 21:24:11 +01:00
void UpdateAll(CMapEditView *View);
void UpdateView(CMapEditView *View,Vec Ofs=Vec(0,0,0));
2000-09-22 17:11:29 +02:00
2000-11-06 21:24:11 +01:00
Vec &GetCam();
void SetCursorPos(CPoint &Pos) {CursorPos=Pos;}
CPoint &GetCursorPos() {return(CursorPos);}
2000-11-14 16:03:04 +01:00
2000-11-20 17:21:43 +01:00
void SetMapSize(CMapEditView *View,int Width,int Height);
int GetMapWidth() {return(Layers[LAYER_TYPE_ACTION]->GetWidth());}
int GetMapHeight() {return(Layers[LAYER_TYPE_ACTION]->GetHeight());}
2000-09-22 17:11:29 +02:00
private:
2000-10-27 02:06:19 +02:00
CPoint CurrentMousePos,LastMousePos;
2000-11-03 23:40:41 +01:00
CPoint CursorPos,LastCursorPos;
2000-11-02 16:46:17 +01:00
Vec MapCam,TileCam;
2000-10-27 02:06:19 +02:00
CLayer *Layers[LAYER_TYPE_MAX];
int ActiveLayer;
2000-09-22 23:19:46 +02:00
2000-11-06 21:24:11 +01:00
CTileBank TileBank;
2000-11-15 22:22:40 +01:00
2000-10-27 20:18:30 +02:00
CTexCache TexCache;
2000-09-22 23:19:46 +02:00
2000-10-31 23:37:59 +01:00
BOOL TileViewFlag;
2000-11-14 16:03:04 +01:00
BOOL GridFlag;
BOOL Is3dFlag;
2000-11-15 22:22:40 +01:00
2000-10-31 23:37:59 +01:00
2000-09-22 17:11:29 +02:00
};
/*****************************************************************************/
#endif