SBSPSS/Utils/MapEdit/Core.h

134 lines
3.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-12-04 17:47:34 +01:00
#include <Vector3.h>
2000-09-25 17:43:52 +02:00
#include "Layer.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-12-04 17:47:34 +01:00
const float FileVersion=1.01f;
2000-09-22 17:11:29 +02:00
2000-12-29 23:20:38 +01:00
#define SCREEN_MAP_WIDTH 30
#define SCREEN_MAP_HEIGHT 20
2000-11-24 23:34:20 +01:00
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();
2000-11-28 22:16:00 +01:00
BOOL New();
2000-11-20 21:33:42 +01:00
void Load(CFile *File);
void Save(CFile *File);
2000-12-29 23:20:38 +01:00
BOOL Question(char *Txt);
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-28 00:07:07 +01:00
void ExportAGB(char *Filename);
void ExportPSX(char *Filename);
2000-11-24 23:34:20 +01:00
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-12-11 22:52:32 +01:00
void Zoom(CMapEditView *View,float Dst);
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-28 15:34:42 +01:00
void UpdateTileViewGUI() {TileBank.UpdateGUI(this,TileViewFlag);}
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);
2000-11-29 18:07:57 +01:00
void TileBankDelete();
2000-11-15 22:22:40 +01:00
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-29 18:07:57 +01:00
BOOL IsTileValid(int Set,int Tile);
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-28 00:07:07 +01:00
void SetLayer(int Layer);
2001-01-21 19:04:00 +01:00
void AddLayer(int Layer);
void DeleteLayer(int Layer);
2000-11-21 22:27:55 +01:00
void UpdateLayerGUI(CMapEditView *View);
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);
2000-12-04 17:47:34 +01:00
void UpdateView(CMapEditView *View);
void UpdateView(CMapEditView *View,Vector3 &Ofs);
2000-09-22 17:11:29 +02:00
2000-12-04 17:47:34 +01:00
Vector3 &GetCam();
Vector3 OffsetCam(Vector3 &Cam,float DivVal);
2000-11-06 21:24:11 +01:00
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-28 22:16:00 +01:00
int GetMapWidth() {return(Layer[FindActionLayer()]->GetWidth());}
int GetMapHeight() {return(Layer[FindActionLayer()]->GetHeight());}
2000-11-20 17:21:43 +01:00
2000-11-22 23:08:47 +01:00
void Toggle2d3d(CMapEditView *View);
2000-11-28 22:16:00 +01:00
int FindLayer(int Type,int SubType=-1);
int FindActionLayer();
2000-12-29 23:20:38 +01:00
void SetScale();
Vector3 &GetScaleVector() {return(ScaleVector);}
float GetZoomW();
float GetZoomH();
2000-12-04 17:47:34 +01:00
2001-01-02 15:34:02 +01:00
void CopySelection(CMapEditView *View);
void PasteSelection(CMapEditView *View);
2000-12-29 23:20:38 +01:00
2000-12-04 17:47:34 +01:00
GString GetCurrentPath();
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-12-04 17:47:34 +01:00
Vector3 MapCam,TileCam;
Vector3 MapCamOfs,TileCamOfs;
2000-12-29 23:20:38 +01:00
Vector3 ScaleVector;
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-11-28 00:07:07 +01: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-09-22 17:11:29 +02:00
};
/*****************************************************************************/
#endif