SBSPSS/Utils/MapEdit/Core.h

118 lines
3.0 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-11-20 21:33:42 +01:00
const float FileVersion=1.0f;
2000-09-22 17:11:29 +02:00
2000-11-24 23:34:20 +01:00
//#define UseLighting
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:
2000-11-20 21:33:42 +01:00
enum
{
LAYER_BACK=0,
LAYER_MID,
LAYER_ACTION,
LAYER_FORE,
};
2000-09-22 17:11:29 +02:00
CCore();
~CCore();
2000-11-02 16:46:17 +01:00
2000-11-06 21:24:11 +01:00
void Init();
2000-11-20 21:33:42 +01:00
void New();
void Load(CFile *File);
void Save(CFile *File);
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-24 23:34:20 +01:00
void Export();
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-24 23:34:20 +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-21 22:27:55 +01:00
void UpdateLayerGUI(CMapEditView *View);
2000-11-20 21:33:42 +01:00
// void SetActiveLayer(int Layer);
// int GetActiveLayer() {return(ActiveLayer);}
// CLayer *GetLayer(int i) {return(Layer[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-21 22:27:55 +01:00
void UpdateGUI(CMapEditView *View);
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);
2000-11-20 21:33:42 +01:00
int GetMapWidth() {return(Layer[LAYER_ACTION]->GetWidth());}
int GetMapHeight() {return(Layer[LAYER_ACTION]->GetHeight());}
2000-11-20 17:21:43 +01:00
2000-11-22 23:08:47 +01:00
void Toggle2d3d(CMapEditView *View);
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
2000-11-20 21:33:42 +01:00
std::vector<CLayer*> Layer;
2000-10-27 02:06:19 +02:00
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