This commit is contained in:
parent
5eddd7d792
commit
545a3d1304
@ -19,7 +19,6 @@
|
||||
#include "Layer.h"
|
||||
#include "LayerTile.h"
|
||||
|
||||
BOOL Test3dFlag=TRUE;
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
@ -28,13 +27,18 @@ CCore::CCore()
|
||||
{
|
||||
for (int i=0; i<LAYER_TYPE_MAX; i++) Layers[i]=0;
|
||||
|
||||
RenderFlag=TRUE;
|
||||
TileViewFlag=FALSE;
|
||||
ParamViewFlag=TRUE;
|
||||
GridFlag=TRUE;
|
||||
CurrentMousePos=CPoint(0,0);
|
||||
ActiveLayer=0;
|
||||
MapCam=Vec(0,0,0);
|
||||
TileCam=Vec(0,0,0);
|
||||
Is3dFlag=TRUE;
|
||||
|
||||
CurrentTileBank=0;
|
||||
MouseTileL.Bank=0; MouseTileL.Tile=1;
|
||||
MouseTileR.Bank=0; MouseTileR.Tile=1;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -57,6 +61,11 @@ void CCore::NewMap()
|
||||
MapCam=Vec(0,0,0);
|
||||
TileCam=Vec(0,0,0);
|
||||
TileBank.AddTileSet("c:/temp/3/test.gin");
|
||||
// TileBank.AddTileSet("c:/temp/slope/slope.gin");
|
||||
// TileBank.AddTileSet("c:/temp/2/2.gin");
|
||||
// TileBank.AddTileSet("c:/temp/1/1.gin");
|
||||
TileBank.AddTileSet("c:/temp/4/4.gin");
|
||||
TileBank.AddTileSet("c:/temp/5/5.gin");
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
@ -67,34 +76,47 @@ void CCore::OpenMap()
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
void CCore::Render(CMapEditView *View)
|
||||
void CCore::Render(CMapEditView *View,BOOL ForceRender)
|
||||
{
|
||||
|
||||
Vec &ThisCam=GetCam();
|
||||
|
||||
if (TileBank.NeedLoad()) TileBank.LoadTileSets(this);
|
||||
|
||||
|
||||
if (RenderFlag)
|
||||
{
|
||||
RenderFlag=FALSE;
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear Screen
|
||||
if (GetTileView())
|
||||
if (TileViewFlag)
|
||||
{
|
||||
|
||||
RenderTileView(View);
|
||||
}
|
||||
else
|
||||
{
|
||||
RenderLayers(View);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::RenderLayers(CMapEditView *View)
|
||||
{
|
||||
Vec &ThisCam=GetCam();
|
||||
|
||||
for (int i=0;i<LAYER_TYPE_MAX;i++)
|
||||
{
|
||||
Layers[i]->Render(this,ThisCam,Test3dFlag);
|
||||
Layers[i]->Render(this,ThisCam,Is3dFlag);
|
||||
}
|
||||
}
|
||||
Layers[ActiveLayer]->RenderGrid(this,ThisCam);
|
||||
}
|
||||
// Calc CursorPos
|
||||
Layers[ActiveLayer]->FindCursorPos(this,View,ThisCam,CurrentMousePos);
|
||||
|
||||
if (GridFlag) Layers[ActiveLayer]->RenderGrid(this,ThisCam);
|
||||
|
||||
// Get Cursor Pos
|
||||
Layers[ActiveLayer]->FindCursorPos(this,View,GetCam(),CurrentMousePos);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::RenderTileView(CMapEditView *View)
|
||||
{
|
||||
Vec &ThisCam=GetCam();
|
||||
|
||||
TileBank.RenderSet(this,ThisCam,Is3dFlag);
|
||||
|
||||
// Get Cursor Pos
|
||||
TileBank.FindCursorPos(this,View,GetCam(),CurrentMousePos);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
@ -102,6 +124,10 @@ Vec &ThisCam=GetCam();
|
||||
/*****************************************************************************/
|
||||
void CCore::LButtonControl(CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag)
|
||||
{
|
||||
if (TileViewFlag)
|
||||
TileBank.LButtonControl(this,View,nFlags,point,DownFlag);
|
||||
else
|
||||
;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
@ -113,6 +139,11 @@ void CCore::MButtonControl(CMapEditView *View,UINT nFlags, CPoint &point,BOOL Do
|
||||
/*****************************************************************************/
|
||||
void CCore::RButtonControl(CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag)
|
||||
{
|
||||
if (TileViewFlag)
|
||||
TileBank.RButtonControl(this,View,nFlags,point,DownFlag);
|
||||
else
|
||||
;
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
@ -168,7 +199,6 @@ Vec &ThisCam=GetCam();
|
||||
/*****************************************************************************/
|
||||
void CCore::UpdateParamBar(CMapEditView *View,BOOL ViewFlag)
|
||||
{
|
||||
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CToolBar *ToolBar=Frm->GetToolBar();
|
||||
CMultiBar *ParamBar=Frm->GetParamBar();
|
||||
@ -192,44 +222,69 @@ CMultiBar *ParamBar=Frm->GetParamBar();
|
||||
// Dlg->SetCurSel(ActiveLayer);
|
||||
}
|
||||
*/
|
||||
ToolBar->GetToolBarCtrl().PressButton(ID_TOOLBAR_PARAMBAR,ParamViewFlag);
|
||||
Frm->ShowControlBar(ParamBar, ParamViewFlag, FALSE);
|
||||
ParamBar->ShowWindow(SW_SHOW);
|
||||
if (View) UpdateView(View);
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::ToggleParamView(CMapEditView *View)
|
||||
{
|
||||
UpdateParamBar(View,!ParamViewFlag);
|
||||
// ToolBar->GetToolBarCtrl().PressButton(ID_TOOLBAR_PARAMBAR,ParamViewFlag);
|
||||
// Frm->ShowControlBar(ParamBar, ParamViewFlag, FALSE);
|
||||
// ParamBar->ShowWindow(SW_SHOW);
|
||||
// if (View) UpdateView(View);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::SetActiveLayer(int i)
|
||||
{
|
||||
UpdateParamBar(NULL,ParamViewFlag);
|
||||
// UpdateParamBar(NULL,ParamViewFlag);
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/*** TileBank ****************************************************************/
|
||||
/*** Grid ********************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
void CCore::UpdateTileView(CMapEditView *View,BOOL ViewFlag)
|
||||
void CCore::UpdateGrid(CMapEditView *View,BOOL Toggle)
|
||||
{
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CToolBar *ToolBar=Frm->GetToolBar();
|
||||
|
||||
TileViewFlag=ViewFlag;
|
||||
if (Toggle) GridFlag=!GridFlag;
|
||||
|
||||
ToolBar->GetToolBarCtrl().PressButton(ID_TOOLBAR_GRID,GridFlag);
|
||||
UpdateView(View);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*** TileBank ****************************************************************/
|
||||
/*****************************************************************************/
|
||||
void CCore::UpdateTileView(CMapEditView *View,BOOL Toggle)
|
||||
{
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CToolBar *ToolBar=Frm->GetToolBar();
|
||||
|
||||
if (Toggle)
|
||||
{
|
||||
TileViewFlag=!TileViewFlag;
|
||||
if (TileViewFlag)
|
||||
TileBank.InitGUI(this);
|
||||
else
|
||||
Layers[ActiveLayer]->InitGUI(this);
|
||||
|
||||
}
|
||||
|
||||
ToolBar->GetToolBarCtrl().PressButton(ID_TOOLBAR_TILEPALETTE,TileViewFlag);
|
||||
UpdateView(View);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::ToggleTileView(CMapEditView *View)
|
||||
void CCore::ReloadTileBank()
|
||||
{
|
||||
UpdateTileView(View,!TileViewFlag);
|
||||
TileBank.Reload();
|
||||
TexCache.Purge();
|
||||
UpdateView(NULL);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::ChangeTileBank()
|
||||
{
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CTileSetDlg *TileSetDlg=(CTileSetDlg*)Frm->GetDialog(IDD_TILESET_DIALOG);
|
||||
|
||||
CurrentTileBank=TileSetDlg->TileSetList.GetCurSel();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
@ -237,7 +292,7 @@ void CCore::ToggleTileView(CMapEditView *View)
|
||||
/*****************************************************************************/
|
||||
Vec &CCore::GetCam()
|
||||
{
|
||||
if (GetTileView())
|
||||
if (TileViewFlag)
|
||||
return(TileCam);
|
||||
else
|
||||
return(MapCam);
|
||||
@ -248,8 +303,13 @@ Vec &CCore::GetCam()
|
||||
void CCore::UpdateAll(CMapEditView *View)
|
||||
{
|
||||
UpdateView(View);
|
||||
UpdateParamBar(View,ParamViewFlag);
|
||||
UpdateTileView(View,TileViewFlag);
|
||||
UpdateGrid(View);
|
||||
|
||||
if (TileViewFlag)
|
||||
TileBank.UpdateGUI(this);
|
||||
else
|
||||
Layers[ActiveLayer]->UpdateGUI(this);
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
@ -260,6 +320,5 @@ Vec &ThisCam=GetCam();
|
||||
Ofs.y=-Ofs.y;
|
||||
ThisCam+=Ofs;
|
||||
if (ThisCam.z>-1) ThisCam.z=-1;
|
||||
RenderFlag=TRUE;
|
||||
View->Invalidate();
|
||||
if (View) View->Invalidate();
|
||||
}
|
||||
|
@ -26,7 +26,9 @@ public:
|
||||
void Init();
|
||||
void NewMap();
|
||||
void OpenMap();
|
||||
void Render(CMapEditView *View);
|
||||
void Render(CMapEditView *View,BOOL ForceRender=FALSE);
|
||||
void RenderLayers(CMapEditView *View);
|
||||
void RenderTileView(CMapEditView *View);
|
||||
|
||||
// Control
|
||||
void LButtonControl(CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag);
|
||||
@ -36,21 +38,29 @@ public:
|
||||
void MouseMove(CMapEditView *View,UINT nFlags, CPoint &point);
|
||||
|
||||
// TileBank
|
||||
void UpdateTileView(CMapEditView *View,BOOL ViewFlag);
|
||||
void ToggleTileView(CMapEditView *View);
|
||||
BOOL GetTileView() {return(TileViewFlag);}
|
||||
void UpdateTileView(CMapEditView *View,BOOL Toggle=FALSE);
|
||||
|
||||
CTile GetTile(int Bank,int TileNo) {return(TileBank.GetTile(Bank,TileNo));}
|
||||
void ReloadTileBank();
|
||||
void ChangeTileBank();
|
||||
|
||||
int GetCurrentTileBank() {return(CurrentTileBank);}
|
||||
void SetCurrentTileBank(int Bnk) {CurrentTileBank=Bnk;}
|
||||
sMapElem &GetMouseTileL() {return(MouseTileL);}
|
||||
sMapElem &GetMouseTileR() {return(MouseTileR);}
|
||||
|
||||
// Param Bar
|
||||
void UpdateParamBar(CMapEditView *View,BOOL ViewFlag);
|
||||
void ToggleParamView(CMapEditView *View);
|
||||
BOOL GetParamViewFlag() {return(ParamViewFlag);}
|
||||
|
||||
// Layers
|
||||
void SetActiveLayer(int Layer);
|
||||
int GetActiveLayer() {return(ActiveLayer);}
|
||||
CLayer *GetLayer(int i) {return(Layers[i]);}
|
||||
|
||||
// Grid
|
||||
void UpdateGrid(CMapEditView *View,BOOL Toggle=FALSE);
|
||||
BOOL IsGridOn() {return(GridFlag);}
|
||||
|
||||
// Tex Cache
|
||||
CTexCache &GetTexCache() {return(TexCache);}
|
||||
|
||||
@ -61,6 +71,7 @@ public:
|
||||
Vec &GetCam();
|
||||
void SetCursorPos(CPoint &Pos) {CursorPos=Pos;}
|
||||
CPoint &GetCursorPos() {return(CursorPos);}
|
||||
|
||||
private:
|
||||
CPoint CurrentMousePos,LastMousePos;
|
||||
CPoint CursorPos,LastCursorPos;
|
||||
@ -71,10 +82,12 @@ private:
|
||||
|
||||
CTileBank TileBank;
|
||||
CTexCache TexCache;
|
||||
int CurrentTileBank;
|
||||
sMapElem MouseTileL,MouseTileR;
|
||||
|
||||
BOOL RenderFlag;
|
||||
BOOL TileViewFlag;
|
||||
BOOL ParamViewFlag;
|
||||
BOOL GridFlag;
|
||||
BOOL Is3dFlag;
|
||||
|
||||
};
|
||||
|
||||
|
@ -41,10 +41,13 @@ virtual void SetName(char *_Name);
|
||||
|
||||
virtual float GetLayerZPosDiv() {return(ZPosDiv);}
|
||||
|
||||
virtual void Render(CCore *Core,Vec &MapPos,BOOL Is3d)=0;
|
||||
virtual void RenderGrid(CCore *Core,Vec &MapPos)=0;
|
||||
virtual void Render(CCore *Core,Vec &CamPos,BOOL Is3d)=0;
|
||||
virtual void RenderGrid(CCore *Core,Vec &CamPos)=0;
|
||||
|
||||
virtual void FindCursorPos(CCore *Core,CMapEditView *View,Vec &MapPos,CPoint &MousePos)=0;
|
||||
virtual void FindCursorPos(CCore *Core,CMapEditView *View,Vec &CamPos,CPoint &MousePos)=0;
|
||||
|
||||
virtual void InitGUI(CCore *Core)=0;
|
||||
virtual void UpdateGUI(CCore *Core)=0;
|
||||
|
||||
protected:
|
||||
char Name[256];
|
||||
|
@ -10,8 +10,10 @@
|
||||
#include <gl\glut.h>
|
||||
#include "GLEnabledView.h"
|
||||
|
||||
#include "MapEdit.h"
|
||||
#include "MapEditDoc.h"
|
||||
#include "MapEditView.h"
|
||||
#include "MainFrm.h"
|
||||
|
||||
#include "Core.h"
|
||||
#include "Layer.h"
|
||||
@ -46,29 +48,29 @@ CLayerTile::~CLayerTile()
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
void CLayerTile::Render(CCore *Core,Vec &MapPos,BOOL Is3d)
|
||||
void CLayerTile::Render(CCore *Core,Vec &CamPos,BOOL Is3d)
|
||||
{
|
||||
if (Is3d && Render3dFlag)
|
||||
{
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
Render3d(Core,MapPos);
|
||||
Render3d(Core,CamPos);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
}
|
||||
else
|
||||
{
|
||||
Render2d(Core,MapPos);
|
||||
Render2d(Core,CamPos);
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CLayerTile::Render2d(CCore *Core,Vec &MapPos)
|
||||
void CLayerTile::Render2d(CCore *Core,Vec &CamPos)
|
||||
{
|
||||
return;
|
||||
float XYDiv=GetLayerZPosDiv();
|
||||
int MapW=Map.GetWidth();
|
||||
int MapH=Map.GetHeight();
|
||||
float StartX=MapPos.x/XYDiv;
|
||||
float StartY=MapPos.y/XYDiv;
|
||||
float StartX=CamPos.x/XYDiv;
|
||||
float StartY=CamPos.y/XYDiv;
|
||||
CTexCache &TexCache=Core->GetTexCache();
|
||||
|
||||
glColor3f(0.5,0.5,0.5);
|
||||
@ -82,7 +84,7 @@ CTexCache &TexCache=Core->GetTexCache();
|
||||
CTile &ThisTile=Core->GetTile(ThisElem.Bank,ThisElem.Tile);
|
||||
|
||||
glLoadIdentity(); // Slow way, but good to go for the mo
|
||||
glTranslatef(StartX+XLoop,StartY-YLoop,MapPos.z);
|
||||
glTranslatef(StartX+XLoop,StartY-YLoop,CamPos.z);
|
||||
// ThisTile.Render();
|
||||
int c=(XLoop+YLoop)&1;
|
||||
glColor3f(c,1,1);
|
||||
@ -95,13 +97,13 @@ int c=(XLoop+YLoop)&1;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CLayerTile::Render3d(CCore *Core,Vec &MapPos)
|
||||
void CLayerTile::Render3d(CCore *Core,Vec &CamPos)
|
||||
{
|
||||
float XYDiv=GetLayerZPosDiv();
|
||||
int MapW=Map.GetWidth();
|
||||
int MapH=Map.GetHeight();
|
||||
float StartX=MapPos.x/XYDiv;
|
||||
float StartY=MapPos.y/XYDiv;
|
||||
float StartX=CamPos.x/XYDiv;
|
||||
float StartY=CamPos.y/XYDiv;
|
||||
CTexCache &TexCache=Core->GetTexCache();
|
||||
|
||||
glColor3f(0.5,0.5,0.5);
|
||||
@ -115,7 +117,7 @@ CTexCache &TexCache=Core->GetTexCache();
|
||||
CTile &ThisTile=Core->GetTile(ThisElem.Bank,ThisElem.Tile);
|
||||
|
||||
glLoadIdentity(); // Slow way, but good to go for the mo
|
||||
glTranslatef(StartX+XLoop,StartY-YLoop,MapPos.z);
|
||||
glTranslatef(StartX+XLoop,StartY-YLoop,CamPos.z);
|
||||
ThisTile.Render();
|
||||
}
|
||||
}
|
||||
@ -123,18 +125,18 @@ CTexCache &TexCache=Core->GetTexCache();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CLayerTile::RenderGrid(CCore *Core,Vec &MapPos)
|
||||
void CLayerTile::RenderGrid(CCore *Core,Vec &CamPos)
|
||||
{
|
||||
float XYDiv=GetLayerZPosDiv();
|
||||
int MapW=Map.GetWidth();
|
||||
int MapH=Map.GetHeight();
|
||||
float StartX=MapPos.x/XYDiv;
|
||||
float StartY=MapPos.y/XYDiv;
|
||||
float StartX=CamPos.x/XYDiv;
|
||||
float StartY=CamPos.y/XYDiv;
|
||||
float OverVal=0.5;
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(StartX,StartY,MapPos.z);
|
||||
glTranslatef(StartX,StartY,CamPos.z);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
|
||||
glBegin(GL_LINES);
|
||||
@ -158,7 +160,7 @@ float OverVal=0.5;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CLayerTile::FindCursorPos(CCore *Core,CMapEditView *View,Vec &MapPos,CPoint &MousePos)
|
||||
void CLayerTile::FindCursorPos(CCore *Core,CMapEditView *View,Vec &CamPos,CPoint &MousePos)
|
||||
{
|
||||
GLint Viewport[4];
|
||||
GLuint SelectBuffer[SELECT_BUFFER_SIZE];
|
||||
@ -169,8 +171,8 @@ CPoint &CursorPos=Core->GetCursorPos();
|
||||
float XYDiv=GetLayerZPosDiv();
|
||||
int MapW=Map.GetWidth();
|
||||
int MapH=Map.GetHeight();
|
||||
float StartX=MapPos.x/XYDiv;
|
||||
float StartY=MapPos.y/XYDiv;
|
||||
float StartX=CamPos.x/XYDiv;
|
||||
float StartY=CamPos.y/XYDiv;
|
||||
|
||||
|
||||
glGetIntegerv(GL_VIEWPORT, Viewport);
|
||||
@ -188,7 +190,7 @@ float StartY=MapPos.y/XYDiv;
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(StartX,StartY,MapPos.z);
|
||||
glTranslatef(StartX,StartY,CamPos.z);
|
||||
|
||||
for (int YLoop=0; YLoop<MapH; YLoop++)
|
||||
{
|
||||
@ -221,3 +223,20 @@ GLuint *HitPtr=SelectBuffer;
|
||||
glMatrixMode(GL_MODELVIEW); // <-- Prevent arse GL assert
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*** Gui *********************************************************************/
|
||||
/*****************************************************************************/
|
||||
void CLayerTile::InitGUI(CCore *Core)
|
||||
{
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CMultiBar *ParamBar=Frm->GetParamBar();
|
||||
|
||||
ParamBar->RemoveAll();
|
||||
ParamBar->Update();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CLayerTile::UpdateGUI(CCore *Core)
|
||||
{
|
||||
}
|
@ -25,13 +25,16 @@ public:
|
||||
CLayerTile(char *_Name); // Load Layer
|
||||
~CLayerTile();
|
||||
|
||||
void Render(CCore *Core,Vec &MapPos,BOOL Is3d);
|
||||
void RenderGrid(CCore *Core,Vec &MapPos);
|
||||
void FindCursorPos(CCore *Core,CMapEditView *View,Vec &MapPos,CPoint &MousePos);
|
||||
void Render(CCore *Core,Vec &CamPos,BOOL Is3d);
|
||||
void RenderGrid(CCore *Core,Vec &CamPos);
|
||||
void FindCursorPos(CCore *Core,CMapEditView *View,Vec &CamPos,CPoint &MousePos);
|
||||
|
||||
void InitGUI(CCore *Core);
|
||||
void UpdateGUI(CCore *Core);
|
||||
|
||||
protected:
|
||||
void Render2d(CCore *Core,Vec &MapPos);
|
||||
void Render3d(CCore *Core,Vec &MapPos);
|
||||
void Render2d(CCore *Core,Vec &CamPos);
|
||||
void Render3d(CCore *Core,Vec &CamPos);
|
||||
|
||||
CMap Map;
|
||||
|
||||
|
@ -50,39 +50,36 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
|
||||
EnableDocking(CBRS_ALIGN_ANY);
|
||||
|
||||
// Status Bar
|
||||
if (!m_wndStatusBar.Create(this) || !m_wndStatusBar.SetIndicators(indicators,sizeof(indicators)/sizeof(UINT)))
|
||||
if (!StatusBar.Create(this) || !StatusBar.SetIndicators(indicators,sizeof(indicators)/sizeof(UINT)))
|
||||
{
|
||||
TRACE0("Failed to create status bar\n");
|
||||
return -1; // fail to create
|
||||
}
|
||||
|
||||
// ParamBar
|
||||
if (!m_wndParamBar.Create(this,IDD_PARAMBAR,(CBRS_LEFT | CBRS_SIZE_DYNAMIC),IDD_PARAMBAR))
|
||||
if (!ParamBar.Create(this,IDD_PARAMBAR,(CBRS_LEFT | CBRS_SIZE_DYNAMIC),IDD_PARAMBAR))
|
||||
{
|
||||
TRACE0("Failed to create ParamBar\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
m_wndParamBar.EnableDocking( CBRS_ALIGN_ANY);
|
||||
m_wndParamBar.SetWindowText("Param");
|
||||
DockControlBar(&m_wndParamBar);
|
||||
ParamBar.EnableDocking( CBRS_ALIGN_ANY);
|
||||
ParamBar.SetWindowText("Param");
|
||||
DockControlBar(&ParamBar);
|
||||
|
||||
// Test1.Create(IDD_TEST1,NULL);
|
||||
m_wndParamBar.AddDialog(LayerList,IDD_LAYER_LIST_DIALOG,TRUE);
|
||||
m_wndParamBar.AddDialog(Test1,IDD_TEST1,TRUE);
|
||||
m_wndParamBar.AddDialog(Test2,IDD_TEST2,TRUE);
|
||||
ParamBar.Add(LayerList,IDD_LAYER_LIST_DIALOG,TRUE,TRUE); // Add default parram bar item
|
||||
|
||||
|
||||
// ToolBar (plus extra code for extra controls!!)
|
||||
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
|
||||
if (!ToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || !ToolBar.LoadToolBar(IDR_MAINFRAME))
|
||||
{
|
||||
TRACE0("Failed to create toolbar\n");
|
||||
return -1; // fail to create
|
||||
}
|
||||
m_wndToolBar.SetWindowText("ToolBar");
|
||||
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
|
||||
DockControlBar(&m_wndToolBar);
|
||||
|
||||
ToolBar.SetWindowText("ToolBar");
|
||||
ToolBar.EnableDocking(CBRS_ALIGN_ANY);
|
||||
DockControlBar(&ToolBar);
|
||||
/*
|
||||
#define SNAP_WIDTH 80 //the width of the combo box
|
||||
|
||||
//set up the ComboBox control as a snap mode select box
|
||||
@ -90,11 +87,11 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
|
||||
//First get the index of the placeholder's position in the toolbar
|
||||
int index = 0;
|
||||
RECT rect;
|
||||
while (m_wndToolBar.GetItemID(index)!=ID_TOOLBAR_COMBO) index++;
|
||||
while (ToolBar.GetItemID(index)!=ID_TOOLBAR_COMBO) index++;
|
||||
|
||||
//next convert that button to a seperator and get its position
|
||||
m_wndToolBar.SetButtonInfo(index, ID_TOOLBAR_COMBO, TBBS_SEPARATOR, SNAP_WIDTH);
|
||||
m_wndToolBar.GetItemRect(index, &rect);
|
||||
ToolBar.SetButtonInfo(index, ID_TOOLBAR_COMBO, TBBS_SEPARATOR, SNAP_WIDTH);
|
||||
ToolBar.GetItemRect(index, &rect);
|
||||
|
||||
//expand the rectangle to allow the combo box room to drop down
|
||||
rect.top+=2;
|
||||
@ -102,22 +99,22 @@ RECT rect;
|
||||
|
||||
// then .Create the combo box and show it
|
||||
|
||||
if (!m_wndToolBar.m_Combo.Create(WS_CHILD|WS_VISIBLE | CBS_AUTOHSCROLL | CBS_DROPDOWNLIST | CBS_HASSTRINGS ,rect, &m_wndToolBar, IDC_TOOLBAR_COMBO))
|
||||
if (!ToolBar.m_Combo.Create(WS_CHILD|WS_VISIBLE | CBS_AUTOHSCROLL | CBS_DROPDOWNLIST | CBS_HASSTRINGS ,rect, &ToolBar, IDC_TOOLBAR_COMBO))
|
||||
{
|
||||
TRACE0("Failed to create combo-box\n");
|
||||
return FALSE;
|
||||
}
|
||||
m_wndToolBar.m_Combo.SetFont(m_wndToolBar.GetFont()); // Set to nice font (not playskool font!!)
|
||||
m_wndToolBar.m_Combo.ShowWindow(SW_SHOW);
|
||||
ToolBar.m_Combo.SetFont(ToolBar.GetFont()); // Set to nice font (not playskool font!!)
|
||||
ToolBar.m_Combo.ShowWindow(SW_SHOW);
|
||||
|
||||
//fill the combo box
|
||||
m_wndToolBar.m_Combo.AddString("SNAP OFF");
|
||||
m_wndToolBar.m_Combo.AddString("SNAP GRID");
|
||||
m_wndToolBar.m_Combo.AddString("SNAP RASTER");
|
||||
m_wndToolBar.m_Combo.AddString("SNAP VERTEX");
|
||||
m_wndToolBar.m_Combo.AddString("SNAP LINE");
|
||||
m_wndToolBar.m_Combo.SetCurSel(0);
|
||||
|
||||
ToolBar.m_Combo.AddString("SNAP OFF");
|
||||
ToolBar.m_Combo.AddString("SNAP GRID");
|
||||
ToolBar.m_Combo.AddString("SNAP RASTER");
|
||||
ToolBar.m_Combo.AddString("SNAP VERTEX");
|
||||
ToolBar.m_Combo.AddString("SNAP LINE");
|
||||
ToolBar.m_Combo.SetCurSel(0);
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -151,5 +148,6 @@ void CMainFrame::Dump(CDumpContext& dc) const
|
||||
// CMainFrame message handlers
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include "MultiBar.h"
|
||||
#include "LayerList.h"
|
||||
#include "TileSetDlg.h"
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
@ -30,9 +31,15 @@ public:
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
CStatusBar *GetStatusBar() {return(&m_wndStatusBar);}
|
||||
CMainToolBar *GetToolBar() {return(&m_wndToolBar);}
|
||||
CMultiBar *GetParamBar() {return(&m_wndParamBar);}
|
||||
CStatusBar *GetStatusBar() {return(&StatusBar);}
|
||||
CMainToolBar *GetToolBar() {return(&ToolBar);}
|
||||
CDialog *GetDialog(int ID) {return(ParamBar.GetDialog(ID));}
|
||||
|
||||
// Param Bar
|
||||
CMultiBar *GetParamBar() {return(&ParamBar);}
|
||||
CDialog &GetLayerList() {return(LayerList);}
|
||||
CDialog &GetTileSetDlg() {return(TileSetDlg);}
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
||||
@ -51,14 +58,13 @@ public:
|
||||
#endif
|
||||
|
||||
protected: // control bar embedded members
|
||||
CStatusBar m_wndStatusBar;
|
||||
CMainToolBar m_wndToolBar;
|
||||
CStatusBar StatusBar;
|
||||
CMainToolBar ToolBar;
|
||||
|
||||
CMultiBar m_wndParamBar;
|
||||
CMultiBar ParamBar;
|
||||
// Sub Dialogs
|
||||
CLayerList LayerList;
|
||||
CDialog Test1;
|
||||
CDialog Test2;
|
||||
CTileSetDlg TileSetDlg;
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
|
@ -2,13 +2,13 @@
|
||||
|
||||
[General Info]
|
||||
Version=1
|
||||
LastClass=CMultiBar
|
||||
LastClass=CTileSetDlg
|
||||
LastTemplate=CDialog
|
||||
NewFileInclude1=#include "stdafx.h"
|
||||
NewFileInclude2=#include "mapedit.h"
|
||||
LastPage=0
|
||||
|
||||
ClassCount=9
|
||||
ClassCount=10
|
||||
Class1=CChildFrame
|
||||
Class2=CGLEnabledView
|
||||
Class3=CMainFrame
|
||||
@ -17,19 +17,18 @@ Class5=CAboutDlg
|
||||
Class6=CMapEditDoc
|
||||
Class7=CMapEditView
|
||||
|
||||
ResourceCount=10
|
||||
Resource1=IDD_TEST1
|
||||
ResourceCount=8
|
||||
Resource1=IDR_TOOLBAR (English (U.S.))
|
||||
Resource2=IDR_MAPEDITYPE (English (U.S.))
|
||||
Resource3=IDD_ABOUTBOX (English (U.S.))
|
||||
Resource3=IDR_MAINFRAME (English (U.S.))
|
||||
Resource4=IDD_DIALOGBAR (English (U.S.))
|
||||
Resource5=IDR_MAINFRAME (English (U.S.))
|
||||
Resource5=IDD_ABOUTBOX (English (U.S.))
|
||||
Class8=CMultiBar
|
||||
Resource6=IDD_TRASHHEAP
|
||||
Resource7=IDD_TEST2
|
||||
Resource8=IDR_TOOLBAR (English (U.S.))
|
||||
Resource9=IDD_MULTIBAR (English (U.S.))
|
||||
Resource6=IDD_LAYER_LIST_DIALOG
|
||||
Resource7=IDD_MULTIBAR (English (U.S.))
|
||||
Class9=CLayerList
|
||||
Resource10=IDD_LAYER_LIST_DIALOG
|
||||
Class10=CTileSetDlg
|
||||
Resource8=IDD_TILESET_DIALOG
|
||||
|
||||
[CLS:CChildFrame]
|
||||
Type=0
|
||||
@ -69,12 +68,16 @@ Type=0
|
||||
BaseClass=CDocument
|
||||
HeaderFile=MapEditDoc.h
|
||||
ImplementationFile=MapEditDoc.cpp
|
||||
LastObject=CMapEditDoc
|
||||
|
||||
[CLS:CMapEditView]
|
||||
Type=0
|
||||
BaseClass=CGLEnabledView
|
||||
HeaderFile=MapEditView.h
|
||||
ImplementationFile=MapEditView.cpp
|
||||
LastObject=ID_TOOLBAR_GRID
|
||||
Filter=C
|
||||
VirtualFilter=VWC
|
||||
|
||||
[DLG:IDD_ABOUTBOX]
|
||||
Type=1
|
||||
@ -91,10 +94,9 @@ Command5=ID_EDIT_COPY
|
||||
Command6=ID_EDIT_PASTE
|
||||
Command7=ID_FILE_PRINT
|
||||
Command8=ID_APP_ABOUT
|
||||
Command9=ID_TOOLBAR_PARAMBAR
|
||||
Command10=ID_TOOLBAR_TILEPALETTE
|
||||
Command11=ID_TOOLBAR_COMBO
|
||||
CommandCount=11
|
||||
Command9=ID_TOOLBAR_TILEPALETTE
|
||||
Command10=ID_TOOLBAR_GRID
|
||||
CommandCount=10
|
||||
|
||||
[MNU:IDR_MAINFRAME (English (U.S.))]
|
||||
Type=1
|
||||
@ -163,12 +165,6 @@ Control2=IDC_STATIC,static,1342308480
|
||||
Control3=IDC_STATIC,static,1342308352
|
||||
Control4=IDOK,button,1342373889
|
||||
|
||||
[DLG:IDD_TRASHHEAP]
|
||||
Type=1
|
||||
Class=?
|
||||
ControlCount=1
|
||||
Control1=IDC_TOOLBAR_COMBO,combobox,1344340226
|
||||
|
||||
[DLG:IDD_DIALOGBAR (English (U.S.))]
|
||||
Type=1
|
||||
Class=?
|
||||
@ -191,41 +187,6 @@ Type=1
|
||||
Class=CMultiBar
|
||||
ControlCount=0
|
||||
|
||||
[DLG:IDD_TEST1]
|
||||
Type=1
|
||||
Class=?
|
||||
ControlCount=9
|
||||
Control1=IDC_STATIC,button,1342177287
|
||||
Control2=IDC_EDIT1,edit,1350631552
|
||||
Control3=IDC_EDIT2,edit,1350631552
|
||||
Control4=IDC_EDIT3,edit,1350631552
|
||||
Control5=IDC_EDIT4,edit,1350631552
|
||||
Control6=IDC_COMBO1,combobox,1344340226
|
||||
Control7=IDC_COMBO2,combobox,1344340226
|
||||
Control8=IDC_COMBO3,combobox,1344340226
|
||||
Control9=IDC_COMBO4,combobox,1344340226
|
||||
|
||||
[DLG:IDD_TEST2]
|
||||
Type=1
|
||||
Class=?
|
||||
ControlCount=16
|
||||
Control1=IDC_CHECK1,button,1342242819
|
||||
Control2=IDC_CHECK2,button,1342242819
|
||||
Control3=IDC_CHECK3,button,1342242819
|
||||
Control4=IDC_CHECK4,button,1342242819
|
||||
Control5=IDC_CHECK5,button,1342242819
|
||||
Control6=IDC_CHECK6,button,1342242819
|
||||
Control7=IDC_CHECK7,button,1342242819
|
||||
Control8=IDC_CHECK8,button,1342242819
|
||||
Control9=IDC_CHECK9,button,1342242819
|
||||
Control10=IDC_CHECK10,button,1342242819
|
||||
Control11=IDC_CHECK11,button,1342242819
|
||||
Control12=IDC_CHECK12,button,1342242819
|
||||
Control13=IDC_CHECK13,button,1342242819
|
||||
Control14=IDC_CHECK14,button,1342242819
|
||||
Control15=IDC_CHECK15,button,1342242819
|
||||
Control16=IDC_CHECK16,button,1342242819
|
||||
|
||||
[DLG:IDD_LAYER_LIST_DIALOG]
|
||||
Type=1
|
||||
Class=CLayerList
|
||||
@ -241,3 +202,19 @@ Filter=D
|
||||
VirtualFilter=dWC
|
||||
LastObject=CLayerList
|
||||
|
||||
[DLG:IDD_TILESET_DIALOG]
|
||||
Type=1
|
||||
Class=CTileSetDlg
|
||||
ControlCount=2
|
||||
Control1=IDC_TILESETDLG_COMBO,combobox,1342242819
|
||||
Control2=IDC_TILESETDLG_BTN_UPDATE,button,1342242816
|
||||
|
||||
[CLS:CTileSetDlg]
|
||||
Type=0
|
||||
HeaderFile=TileSetDlg.h
|
||||
ImplementationFile=TileSetDlg.cpp
|
||||
BaseClass=CDialog
|
||||
Filter=D
|
||||
VirtualFilter=dWC
|
||||
LastObject=IDC_TILESETDLG_COMBO
|
||||
|
||||
|
@ -174,10 +174,6 @@ SOURCE=.\GLEnabledView.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\LayerList.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MainFrm.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@ -198,10 +194,6 @@ SOURCE=.\MapEditView.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MultiBar.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\StdAfx.cpp
|
||||
# ADD CPP /Yc"stdafx.h"
|
||||
# End Source File
|
||||
@ -223,10 +215,6 @@ SOURCE=.\GLEnabledView.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\LayerList.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MainFrm.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@ -243,10 +231,6 @@ SOURCE=.\MapEditView.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MultiBar.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Resource.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@ -274,6 +258,38 @@ SOURCE=.\res\MapEditDoc.ico
|
||||
SOURCE=.\res\Toolbar.bmp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Dlg"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\LayerList.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\LayerList.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MultiBar.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MultiBar.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\TileSetDlg.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\TileSetDlg.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\!ToDo.txt"
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
|
@ -57,10 +57,8 @@ BEGIN
|
||||
SEPARATOR
|
||||
BUTTON ID_APP_ABOUT
|
||||
SEPARATOR
|
||||
BUTTON ID_TOOLBAR_PARAMBAR
|
||||
BUTTON ID_TOOLBAR_TILEPALETTE
|
||||
SEPARATOR
|
||||
BUTTON ID_TOOLBAR_COMBO
|
||||
BUTTON ID_TOOLBAR_GRID
|
||||
END
|
||||
|
||||
|
||||
@ -415,81 +413,24 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_TRASHHEAP DIALOG DISCARDABLE 0, 0, 186, 95
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Dialog"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
COMBOBOX IDC_TOOLBAR_COMBO,7,7,87,34,CBS_DROPDOWN | CBS_SORT |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
END
|
||||
|
||||
IDD_TEST1 DIALOG DISCARDABLE 0, 0, 186, 94
|
||||
IDD_LAYER_LIST_DIALOG DIALOG DISCARDABLE 0, 0, 155, 94
|
||||
STYLE WS_CHILD | WS_BORDER
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
GROUPBOX "Static",IDC_STATIC,7,7,172,80
|
||||
EDITTEXT IDC_EDIT1,19,20,53,13,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT2,19,35,53,13,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT3,19,49,53,13,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT4,19,64,53,13,ES_AUTOHSCROLL
|
||||
COMBOBOX IDC_COMBO1,82,20,89,30,CBS_DROPDOWN | CBS_SORT |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
COMBOBOX IDC_COMBO2,81,36,89,30,CBS_DROPDOWN | CBS_SORT |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
COMBOBOX IDC_COMBO3,80,51,89,30,CBS_DROPDOWN | CBS_SORT |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
COMBOBOX IDC_COMBO4,81,67,89,30,CBS_DROPDOWN | CBS_SORT |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
END
|
||||
|
||||
IDD_TEST2 DIALOG DISCARDABLE 0, 0, 102, 86
|
||||
STYLE WS_CHILD | WS_BORDER
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
CONTROL "Check1",IDC_CHECK1,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,5,5,41,10
|
||||
CONTROL "Check1",IDC_CHECK2,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,5,15,41,10
|
||||
CONTROL "Check1",IDC_CHECK3,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,5,25,41,10
|
||||
CONTROL "Check1",IDC_CHECK4,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,5,35,41,10
|
||||
CONTROL "Check1",IDC_CHECK5,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,5,45,41,10
|
||||
CONTROL "Check1",IDC_CHECK6,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,5,55,41,10
|
||||
CONTROL "Check1",IDC_CHECK7,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,5,65,41,10
|
||||
CONTROL "Check1",IDC_CHECK8,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,5,75,41,10
|
||||
CONTROL "Check1",IDC_CHECK9,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,60,5,41,10
|
||||
CONTROL "Check1",IDC_CHECK10,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,60,15,41,10
|
||||
CONTROL "Check1",IDC_CHECK11,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,60,25,41,10
|
||||
CONTROL "Check1",IDC_CHECK12,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,60,35,41,10
|
||||
CONTROL "Check1",IDC_CHECK13,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,60,45,41,10
|
||||
CONTROL "Check1",IDC_CHECK14,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,60,55,41,10
|
||||
CONTROL "Check1",IDC_CHECK15,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,60,65,41,10
|
||||
CONTROL "Check1",IDC_CHECK16,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,60,75,41,10
|
||||
END
|
||||
|
||||
IDD_LAYER_LIST_DIALOG DIALOG DISCARDABLE 0, 0, 106, 94
|
||||
STYLE WS_CHILD | WS_BORDER
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LISTBOX IDC_LAYER_LIST,7,7,92,85,LBS_SORT | LBS_OWNERDRAWFIXED |
|
||||
LISTBOX IDC_LAYER_LIST,5,5,145,85,LBS_SORT | LBS_OWNERDRAWFIXED |
|
||||
LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
END
|
||||
|
||||
IDD_TILESET_DIALOG DIALOG DISCARDABLE 0, 0, 151, 46
|
||||
STYLE WS_CHILD
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
COMBOBOX IDC_TILESETDLG_COMBO,7,7,138,322,CBS_DROPDOWNLIST |
|
||||
WS_TABSTOP
|
||||
PUSHBUTTON "Update",IDC_TILESETDLG_BTN_UPDATE,5,25,140,15
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@ -499,37 +440,21 @@ END
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
IDD_TRASHHEAP, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 179
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 88
|
||||
END
|
||||
|
||||
IDD_TEST1, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 179
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 87
|
||||
END
|
||||
|
||||
IDD_TEST2, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 95
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 79
|
||||
END
|
||||
|
||||
IDD_LAYER_LIST_DIALOG, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 99
|
||||
RIGHTMARGIN, 148
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 87
|
||||
END
|
||||
|
||||
IDD_TILESET_DIALOG, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 144
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 39
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
@ -152,14 +152,29 @@ void CMapEditDoc::MouseMove(CMapEditView *View,UINT nFlags, CPoint &point)
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
void CMapEditDoc::ToggleParamView(CMapEditView *View)
|
||||
void CMapEditDoc::ToggleTileView(CMapEditView *View)
|
||||
{
|
||||
Core.ToggleParamView(View);
|
||||
Core.UpdateTileView(View,TRUE);
|
||||
Core.UpdateAll(View);
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
void CMapEditDoc::ToggleTileView(CMapEditView *View)
|
||||
void CMapEditDoc::ToggleGrid(CMapEditView *View)
|
||||
{
|
||||
Core.ToggleTileView(View);
|
||||
Core.UpdateGrid(View,TRUE);
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
void CMapEditDoc::ReloadTileBank()
|
||||
{
|
||||
Core.ReloadTileBank();
|
||||
UpdateAllViews(NULL);
|
||||
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
void CMapEditDoc::TileBankChange()
|
||||
{
|
||||
Core.ChangeTileBank();
|
||||
UpdateAllViews(NULL);
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ protected: // create from serialization only
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
// void SetupPersMatrix(float _m_dAspectRatio);
|
||||
void UpdateView(CMapEditView *View);
|
||||
void Render(CMapEditView *View);
|
||||
void UpdateAll(CMapEditView *View);
|
||||
@ -30,8 +29,11 @@ public:
|
||||
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);
|
||||
void ToggleParamView(CMapEditView *View);
|
||||
void ToggleTileView(CMapEditView *View);
|
||||
void ToggleGrid(CMapEditView *View);
|
||||
|
||||
void ReloadTileBank();
|
||||
void TileBankChange();
|
||||
|
||||
// Operations
|
||||
public:
|
||||
@ -55,6 +57,7 @@ public:
|
||||
|
||||
protected:
|
||||
CCore Core;
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CMapEditDoc)
|
||||
|
@ -35,8 +35,8 @@ BEGIN_MESSAGE_MAP(CMapEditView, CGLEnabledView)
|
||||
ON_WM_RBUTTONDOWN()
|
||||
ON_WM_RBUTTONUP()
|
||||
ON_WM_MOUSEMOVE()
|
||||
ON_COMMAND(ID_TOOLBAR_PARAMBAR, OnToolbarParamBar)
|
||||
ON_COMMAND(ID_TOOLBAR_TILEPALETTE, OnToolbarTilepalette)
|
||||
ON_COMMAND(ID_TOOLBAR_GRID, OnToolbarGrid)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
@ -147,5 +147,5 @@ BOOL CMapEditView::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt) {GetDocume
|
||||
void CMapEditView::OnRButtonDown(UINT nFlags, CPoint point) {GetDocument()->RButtonControl(this,nFlags,point,TRUE);}
|
||||
void CMapEditView::OnRButtonUp(UINT nFlags, CPoint point) {GetDocument()->RButtonControl(this,nFlags,point,FALSE);}
|
||||
void CMapEditView::OnMouseMove(UINT nFlags, CPoint point) {GetDocument()->MouseMove(this,nFlags, point);}
|
||||
void CMapEditView::OnToolbarParamBar() {GetDocument()->ToggleParamView(this);}
|
||||
void CMapEditView::OnToolbarTilepalette() {GetDocument()->ToggleTileView(this);}
|
||||
void CMapEditView::OnToolbarGrid() {GetDocument()->ToggleGrid(this);}
|
||||
|
@ -55,8 +55,8 @@ protected:
|
||||
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
||||
afx_msg void OnToolbarParamBar();
|
||||
afx_msg void OnToolbarTilepalette();
|
||||
afx_msg void OnToolbarGrid();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
@ -40,3 +40,17 @@ char Filename[256];
|
||||
return(Count);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CTexCache::Purge()
|
||||
{
|
||||
int ListSize=TexList.size();
|
||||
|
||||
TRACE1("Purging %i textures\n",ListSize);
|
||||
|
||||
for (int i=0; i<ListSize; i++)
|
||||
{
|
||||
glDeleteTextures(1,&TexList[i].TexID);
|
||||
}
|
||||
|
||||
TexList.clear();
|
||||
}
|
@ -30,7 +30,7 @@ public:
|
||||
int ProcessTexture(char *TexName,char *Path,int Flags);
|
||||
sTex &GetTex(int Id) {return(TexList[Id]);}
|
||||
GLuint GetTexGLId(int Id) {return(TexList[Id].TexID);}
|
||||
|
||||
void Purge();
|
||||
|
||||
std::vector<sTex> TexList;
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include <gl\gl.h>
|
||||
#include <gl\glu.h>
|
||||
#include <gl\glut.h>
|
||||
#include "GLEnabledView.h"
|
||||
#include <Vector>
|
||||
|
||||
#include "Core.h"
|
||||
@ -14,11 +15,24 @@
|
||||
#include "GinTex.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "MapEdit.h"
|
||||
#include "MapEditDoc.h"
|
||||
#include "MapEditView.h"
|
||||
#include "MainFrm.h"
|
||||
#include "TileSetDlg.h"
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*** TileBank ****************************************************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
const float TileBrowserGap=0.2f;
|
||||
const float TileBrowserX0=0-TileBrowserGap/2;
|
||||
const float TileBrowserX1=1+TileBrowserGap/2;
|
||||
const float TileBrowserY0=0-TileBrowserGap/2;
|
||||
const float TileBrowserY1=1+TileBrowserGap/2;
|
||||
|
||||
/*****************************************************************************/
|
||||
CTileBank::CTileBank()
|
||||
{
|
||||
@ -51,12 +65,131 @@ int ListSize=TileSet.size();
|
||||
LoadFlag=FALSE;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CTileBank::Reload()
|
||||
{
|
||||
int ListSize=TileSet.size();
|
||||
|
||||
for (int i=0; i<ListSize; i++)
|
||||
{
|
||||
TileSet[i].Purge();
|
||||
}
|
||||
|
||||
LoadFlag=TRUE;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
CTile &CTileBank::GetTile(int Bank,int Tile)
|
||||
{
|
||||
return(TileSet[Bank].GetTile(Tile));
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CTileBank::RenderSet(CCore *Core,Vec &CamPos,BOOL Is3d)
|
||||
{
|
||||
int CurrentBank=Core->GetCurrentTileBank();
|
||||
sMapElem &LSelTile=Core->GetMouseTileL();
|
||||
sMapElem &RSelTile=Core->GetMouseTileR();
|
||||
int LTile=-1,RTile=-1;
|
||||
|
||||
if (LSelTile.Bank==CurrentBank || LSelTile.Tile==0) LTile=LSelTile.Tile;
|
||||
if (RSelTile.Bank==CurrentBank || RSelTile.Tile==0) RTile=RSelTile.Tile;
|
||||
|
||||
if (Is3d)
|
||||
{
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
TileSet[CurrentBank].Render3d(Core,CamPos,CursPos,LTile,RTile);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
}
|
||||
else
|
||||
{
|
||||
TileSet[CurrentBank].Render2d(Core,CamPos,CursPos,LTile,RTile);
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CTileBank::FindCursorPos(CCore *Core,CMapEditView *View,Vec &CamPos,CPoint &MousePos)
|
||||
{
|
||||
int CurrentBank=Core->GetCurrentTileBank();
|
||||
|
||||
CursPos=TileSet[CurrentBank].FindCursorPos(Core,View,CamPos,MousePos);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CTileBank::LButtonControl(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag)
|
||||
{
|
||||
if (!DownFlag) return;
|
||||
|
||||
sMapElem &SelTile= Core->GetMouseTileL();
|
||||
sMapElem &OtherSelTile= Core->GetMouseTileR();
|
||||
int CurrentBank= Core->GetCurrentTileBank();
|
||||
|
||||
if (CursPos==-1) return;
|
||||
if (CurrentBank==OtherSelTile.Bank && OtherSelTile.Tile==CursPos)
|
||||
{ // Dont assign if same as other mouse
|
||||
}
|
||||
else
|
||||
{
|
||||
SelTile.Bank=CurrentBank;
|
||||
SelTile.Tile=CursPos;
|
||||
if (SelTile.Tile==0) SelTile.Bank=0; // Always make zero tile, bank 0 (dunno why, just seems handy)
|
||||
View->Invalidate();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CTileBank::RButtonControl(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag)
|
||||
{
|
||||
if (!DownFlag) return;
|
||||
|
||||
sMapElem &SelTile= Core->GetMouseTileR();
|
||||
sMapElem &OtherSelTile= Core->GetMouseTileL();
|
||||
int CurrentBank= Core->GetCurrentTileBank();
|
||||
|
||||
if (CursPos==-1) return;
|
||||
if (CurrentBank==OtherSelTile.Bank && OtherSelTile.Tile==CursPos)
|
||||
{ // Dont assign if same as other mouse
|
||||
}
|
||||
else
|
||||
{
|
||||
SelTile.Bank=CurrentBank;
|
||||
SelTile.Tile=CursPos;
|
||||
View->Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*** Gui *********************************************************************/
|
||||
/*****************************************************************************/
|
||||
void CTileBank::InitGUI(CCore *Core)
|
||||
{
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CMultiBar *ParamBar=Frm->GetParamBar();
|
||||
|
||||
ParamBar->RemoveAll();
|
||||
ParamBar->Add(Frm->GetTileSetDlg(),IDD_TILESET_DIALOG,TRUE);
|
||||
ParamBar->Update();
|
||||
UpdateGUI(Core);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CTileBank::UpdateGUI(CCore *Core)
|
||||
{
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CTileSetDlg *TileSetDlg=(CTileSetDlg*)Frm->GetDialog(IDD_TILESET_DIALOG);
|
||||
int ListSize=TileSet.size();
|
||||
|
||||
TRACE1("%i\n",TileSetDlg->TileSetList.GetCurSel());
|
||||
TileSetDlg->TileSetList.ResetContent();
|
||||
|
||||
for (int i=0; i<ListSize; i++)
|
||||
{
|
||||
TileSetDlg->TileSetList.AddString(TileSet[i].GetName());
|
||||
}
|
||||
TileSetDlg->TileSetList.SetCurSel(Core->GetCurrentTileBank());
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*** TileSet *****************************************************************/
|
||||
@ -89,6 +222,7 @@ void CTileSet::Load(CCore *Core)
|
||||
{
|
||||
CScene Scene;
|
||||
char Filename[256+64];
|
||||
CTile NewTile;
|
||||
|
||||
sprintf(Filename,"%s%s.%s",Path,Name,"Gin");
|
||||
Scene.Load(Filename);
|
||||
@ -96,9 +230,11 @@ char Filename[256+64];
|
||||
CNode &ThisNode=Scene.GetSceneNode(0);
|
||||
int ChildCount=ThisNode.GetPruneChildCount();
|
||||
|
||||
NewTile.CreateBlank(Core,this);
|
||||
Tile.push_back(NewTile);
|
||||
|
||||
for (int Child=0; Child<ChildCount; Child++)
|
||||
{
|
||||
CTile NewTile;
|
||||
NewTile.Load(Core,this,Scene,ThisNode.PruneChildList[Child]);
|
||||
Tile.push_back(NewTile);
|
||||
}
|
||||
@ -107,3 +243,156 @@ int ChildCount=ThisNode.GetPruneChildCount();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CTileSet::Purge()
|
||||
{
|
||||
int ListSize=Tile.size();
|
||||
|
||||
for (int i=0; i<ListSize; i++)
|
||||
{
|
||||
Tile[i].Purge();
|
||||
}
|
||||
Tile.clear();
|
||||
Loaded=FALSE;
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CTileSet::Render2d(CCore *Core,Vec &CamPos,int CursorPos,int LTile,int RTile)
|
||||
{
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CTileSet::Render3d(CCore *Core,Vec &CamPos,int CursorPos,int LTile,int RTile)
|
||||
{
|
||||
int ListSize=Tile.size();
|
||||
CTexCache &TexCache=Core->GetTexCache();
|
||||
int TileID=0;
|
||||
BOOL GridFlag=Core->IsGridOn();
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
while(TileID!=ListSize)
|
||||
{
|
||||
CTile &ThisTile=Tile[TileID];
|
||||
int XPos=TileID%TileBrowserWidth;
|
||||
int YPos=TileID/TileBrowserWidth;
|
||||
|
||||
glLoadIdentity();
|
||||
glTranslatef(CamPos.x+XPos*(1+TileBrowserGap),CamPos.y-YPos*(1+TileBrowserGap),CamPos.z);
|
||||
|
||||
RenderMisc(TileID==LTile,TileID==RTile,GridFlag,TileID==CursorPos);
|
||||
|
||||
glColor3f(0.5,0.5,0.5);
|
||||
ThisTile.Render();
|
||||
|
||||
TileID++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CTileSet::RenderMisc(BOOL LSelFlag,BOOL RSelFlag, BOOL GridFlag,BOOL CursorFlag)
|
||||
{
|
||||
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
|
||||
if (LSelFlag || RSelFlag || CursorFlag)
|
||||
{ // Show selected tile
|
||||
glBegin(GL_QUADS);
|
||||
glNormal3f( 1,1,1);
|
||||
if (LSelFlag)
|
||||
glColor3ub(255,0,0);
|
||||
else
|
||||
if (RSelFlag)
|
||||
glColor3ub(0,0,255);
|
||||
else
|
||||
glColor3ub(255,255,0);
|
||||
|
||||
BuildGLQuad(TileBrowserX0,TileBrowserX1,TileBrowserY0,TileBrowserY1,0);
|
||||
glEnd();
|
||||
}
|
||||
else
|
||||
if (GridFlag)
|
||||
{
|
||||
glBegin(GL_LINES);
|
||||
glNormal3f( 1,1,1);
|
||||
glColor3ub(255,255,255);
|
||||
|
||||
glVertex3f( TileBrowserX0,TileBrowserY0,0);
|
||||
glVertex3f( TileBrowserX1,TileBrowserY0,0);
|
||||
|
||||
glVertex3f( TileBrowserX0,TileBrowserY1,0);
|
||||
glVertex3f( TileBrowserX1,TileBrowserY1,0);
|
||||
|
||||
glVertex3f( TileBrowserX0,TileBrowserY0,0);
|
||||
glVertex3f( TileBrowserX0,TileBrowserY1,0);
|
||||
|
||||
glVertex3f( TileBrowserX1,TileBrowserY0,0);
|
||||
glVertex3f( TileBrowserX1,TileBrowserY1,0);
|
||||
|
||||
glEnd();
|
||||
}
|
||||
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
int CTileSet::FindCursorPos(CCore *Core,CMapEditView *View,Vec &CamPos,CPoint &MousePos)
|
||||
{
|
||||
int ListSize=Tile.size();
|
||||
GLint Viewport[4];
|
||||
GLuint SelectBuffer[SELECT_BUFFER_SIZE];
|
||||
int HitCount;
|
||||
int TileID=0;
|
||||
|
||||
glGetIntegerv(GL_VIEWPORT, Viewport);
|
||||
glSelectBuffer (SELECT_BUFFER_SIZE, SelectBuffer );
|
||||
glRenderMode (GL_SELECT);
|
||||
|
||||
glInitNames();
|
||||
glPushName(-1);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
gluPickMatrix( MousePos.x ,(Viewport[3]-MousePos.y),5.0,5.0,Viewport);
|
||||
View->SetupPersMatrix();
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
while(TileID!=ListSize)
|
||||
{
|
||||
int XPos=TileID%TileBrowserWidth;
|
||||
int YPos=TileID/TileBrowserWidth;
|
||||
|
||||
glLoadIdentity();
|
||||
glTranslatef(CamPos.x+XPos*(1+TileBrowserGap),CamPos.y-YPos*(1+TileBrowserGap),CamPos.z);
|
||||
|
||||
glLoadName (TileID);
|
||||
glBegin (GL_QUADS);
|
||||
BuildGLQuad(TileBrowserX0,TileBrowserX1,TileBrowserY0,TileBrowserY1,0);
|
||||
glEnd();
|
||||
TileID++;
|
||||
}
|
||||
|
||||
HitCount= glRenderMode (GL_RENDER);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPopMatrix();
|
||||
|
||||
// Process hits
|
||||
|
||||
GLuint *HitPtr=SelectBuffer;
|
||||
|
||||
TileID=-1;
|
||||
if (HitCount) // Just take 1st
|
||||
{
|
||||
TileID=HitPtr[3];
|
||||
}
|
||||
glMatrixMode(GL_MODELVIEW); // <-- Prevent arse GL assert
|
||||
return(TileID);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -15,6 +15,11 @@
|
||||
#include "TexCache.h"
|
||||
#include "Tile.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
enum TileSetEnum
|
||||
{
|
||||
TileBrowserWidth=8,
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
class CCore;
|
||||
@ -29,12 +34,24 @@ public:
|
||||
|
||||
void AddTileSet(char *Filename);
|
||||
int NeedLoad() {return(LoadFlag);}
|
||||
void Reload();
|
||||
void LoadTileSets(CCore *Core);
|
||||
CTile &GetTile(int Bank,int Tile);
|
||||
|
||||
void RenderSet(CCore *Core,Vec &CamPos,BOOL Is3d);
|
||||
void FindCursorPos(CCore *Core,CMapEditView *View,Vec &CamPos,CPoint &MousePos);
|
||||
|
||||
void LButtonControl(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag);
|
||||
void RButtonControl(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag);
|
||||
|
||||
void InitGUI(CCore *Core);
|
||||
void UpdateGUI(CCore *Core);
|
||||
|
||||
private:
|
||||
|
||||
std::vector<CTileSet> TileSet;
|
||||
BOOL LoadFlag;
|
||||
int CursPos;
|
||||
|
||||
};
|
||||
|
||||
@ -50,7 +67,11 @@ public:
|
||||
char *GetPath() {return(Path);}
|
||||
char *GetName() {return(Name);}
|
||||
CTile &GetTile(int No) {return(Tile[No]);}
|
||||
|
||||
void Purge();
|
||||
void Render2d(CCore *Core,Vec &CamPos,int CursorPos,int LTile,int RTile);
|
||||
void Render3d(CCore *Core,Vec &CamPos,int CursorPos,int LTile,int RTile);
|
||||
void RenderMisc(BOOL LSelFlag,BOOL RSelFlag, BOOL GridFlag,BOOL CursorFlag);
|
||||
int FindCursorPos(CCore *Core,CMapEditView *View,Vec &CamPos,CPoint &MousePos);
|
||||
|
||||
private:
|
||||
char Path[256],Name[256];
|
||||
|
@ -10,42 +10,20 @@
|
||||
#define IDR_TOOLBAR 128
|
||||
#define IDR_MAPEDITYPE 129
|
||||
#define IDD_TRASHHEAP 142
|
||||
#define IDD_TEST1 145
|
||||
#define IDD_TEST2 146
|
||||
#define IDD_LAYER_LIST_DIALOG 147
|
||||
#define IDD_TILESET_DIALOG 148
|
||||
#define IDC_PARAMBAR_LAYER_LIST 1011
|
||||
#define IDC_TILETOOLBAR_COMBO 1013
|
||||
#define IDC_TOOLBAR_COMBO 1018
|
||||
#define IDC_LIST1 1019
|
||||
#define IDC_LAYER_LIST 1019
|
||||
#define IDC_CHECK1 1023
|
||||
#define IDC_CHECK2 1024
|
||||
#define IDC_EDIT1 1024
|
||||
#define IDC_CHECK3 1025
|
||||
#define IDC_EDIT2 1025
|
||||
#define IDC_CHECK4 1026
|
||||
#define IDC_EDIT3 1026
|
||||
#define IDC_CHECK5 1027
|
||||
#define IDC_EDIT4 1027
|
||||
#define IDC_CHECK6 1028
|
||||
#define IDC_COMBO1 1028
|
||||
#define IDC_CHECK7 1029
|
||||
#define IDC_COMBO2 1029
|
||||
#define IDC_CHECK8 1030
|
||||
#define IDC_COMBO3 1030
|
||||
#define IDC_COMBO4 1031
|
||||
#define IDC_CHECK9 1039
|
||||
#define IDC_CHECK10 1040
|
||||
#define IDC_CHECK11 1041
|
||||
#define IDC_CHECK12 1042
|
||||
#define IDC_CHECK13 1043
|
||||
#define IDC_CHECK14 1044
|
||||
#define IDC_CHECK15 1045
|
||||
#define IDC_CHECK16 1046
|
||||
#define IDC_TILESETDLG_BTN_UPDATE 1029
|
||||
#define IDC_TILESETDLG_COMBO 1030
|
||||
#define ID_TOOLBAR_LAYERBAR 32773
|
||||
#define ID_TOOLBAR_TILEPALETTE 32774
|
||||
#define ID_TOOLBAR_COMBO 32777
|
||||
#define ID_TOOLBAR_PARAMBAR 32783
|
||||
#define ID_TOOLBAR_GRID 32784
|
||||
#define ID_INDICATOR_CURSORXY 59142
|
||||
|
||||
// Next default values for new objects
|
||||
@ -53,9 +31,9 @@
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_3D_CONTROLS 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 148
|
||||
#define _APS_NEXT_COMMAND_VALUE 32784
|
||||
#define _APS_NEXT_CONTROL_VALUE 1029
|
||||
#define _APS_NEXT_RESOURCE_VALUE 151
|
||||
#define _APS_NEXT_COMMAND_VALUE 32785
|
||||
#define _APS_NEXT_CONTROL_VALUE 1031
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user