SBSPSS/Utils/MapEdit/TileSet.h

93 lines
2.3 KiB
C
Raw Normal View History

2000-10-27 02:06:19 +02:00
/*********************/
/*** TileSet Stuph ***/
/*********************/
#ifndef __TILESET_HEADER__
#define __TILESET_HEADER__
#include "stdafx.h"
#include "gl3d.h"
#include <gl\gl.h>
#include <gl\glu.h>
#include <gl\glut.h>
#include <Vector>
2000-10-27 20:18:30 +02:00
#include "TexCache.h"
#include "Tile.h"
2000-10-27 02:06:19 +02:00
2000-11-14 16:03:04 +01:00
/*****************************************************************************/
enum TileSetEnum
{
TileBrowserWidth=8,
};
2000-10-27 20:18:30 +02:00
/*****************************************************************************/
2000-11-06 21:24:11 +01:00
class CCore;
class CTile;
2000-10-27 20:18:30 +02:00
/*****************************************************************************/
2000-11-06 21:24:11 +01:00
class CTileBank
{
public:
2000-11-14 16:03:04 +01:00
CTileBank();
~CTileBank();
2000-11-15 22:22:40 +01:00
void AddTileSet(char *Filename);
int NeedLoad() {return(LoadFlag);}
void Reload();
void LoadTileSets(CCore *Core);
CTile &GetTile(int Bank,int Tile);
void SetCurrent(int Set) {CurrentSet=Set;}
sMapElem &GetLTile() {return(LTile);}
sMapElem &GetRTile() {return(RTile);}
2000-11-06 21:24:11 +01:00
2000-11-15 22:22:40 +01:00
void RenderSet(CCore *Core,Vec &CamPos,BOOL Is3d);
void FindCursorPos(CCore *Core,CMapEditView *View,Vec &CamPos,CPoint &MousePos);
2000-11-14 16:03:04 +01:00
2000-11-15 22:22:40 +01:00
void UpdateGUI(CCore *Core,BOOL IsTileView);
2000-11-14 16:03:04 +01:00
2000-11-15 22:22:40 +01:00
// Functions
BOOL TileSelectL() {return(TileSelect(LTile,RTile));}
BOOL TileSelectR() {return(TileSelect(RTile,LTile));}
2000-11-06 21:24:11 +01:00
private:
2000-11-15 22:22:40 +01:00
BOOL TileSelect(sMapElem &ThisTile,sMapElem &OtherTile);
2000-11-14 16:03:04 +01:00
2000-11-06 21:24:11 +01:00
std::vector<CTileSet> TileSet;
2000-11-15 22:22:40 +01:00
int CurrentSet;
sMapElem LTile,RTile;
2000-11-06 21:24:11 +01:00
2000-11-15 22:22:40 +01:00
BOOL LoadFlag;
int CursorPos;
2000-11-06 21:24:11 +01:00
};
2000-10-27 02:06:19 +02:00
/*****************************************************************************/
class CTileSet
{
public:
2000-11-06 21:24:11 +01:00
CTileSet(char *_Filename);
2000-10-27 02:06:19 +02:00
~CTileSet();
2000-10-27 22:21:39 +02:00
2000-11-06 21:24:11 +01:00
int IsLoaded() {return(Loaded);}
void Load(CCore *Core);
2000-10-27 22:21:39 +02:00
char *GetPath() {return(Path);}
2000-11-07 21:38:19 +01:00
char *GetName() {return(Name);}
2000-11-06 21:24:11 +01:00
CTile &GetTile(int No) {return(Tile[No]);}
2000-11-14 16:03:04 +01:00
void Purge();
int FindCursorPos(CCore *Core,CMapEditView *View,Vec &CamPos,CPoint &MousePos);
2000-11-15 22:22:40 +01:00
void Render2d(Vec &CamPos,int LTile,int RTile,int CursorPos,BOOL GridFlag);
void Render3d(Vec &CamPos,int LTile,int RTile,int CursorPos,BOOL GridFlag);
2000-10-27 02:06:19 +02:00
private:
2000-11-15 22:22:40 +01:00
void RenderMisc(BOOL LTileFlag,BOOL RTileFlag,BOOL CursorFlag,BOOL GridFlag);
2000-11-07 21:38:19 +01:00
char Path[256],Name[256];
2000-10-27 20:18:30 +02:00
std::vector<CTile> Tile;
2000-11-06 21:24:11 +01:00
BOOL Loaded;
2000-10-27 02:06:19 +02:00
};
/*****************************************************************************/
#endif