This commit is contained in:
parent
2518a438e2
commit
23d9f79f4c
11 changed files with 283 additions and 164 deletions
|
@ -24,7 +24,6 @@
|
|||
|
||||
|
||||
BOOL Test3dFlag=TRUE;
|
||||
GLint TestTile;
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
|
@ -32,16 +31,20 @@ GLint TestTile;
|
|||
CCore::CCore()
|
||||
{
|
||||
MouseMode=MOUSE_MODE_NONE;
|
||||
Layers[LAYER_TYPE_BACK]= new CLayerBack;
|
||||
Layers[LAYER_TYPE_MID]= new CLayerMid;
|
||||
Layers[LAYER_TYPE_ACTION]= new CLayerAction;
|
||||
Layers[LAYER_TYPE_FORE]= new CLayerFore;
|
||||
Layers[LAYER_TYPE_BACK]= new CLayerBack(this);
|
||||
Layers[LAYER_TYPE_MID]= new CLayerMid(this);
|
||||
Layers[LAYER_TYPE_ACTION]= new CLayerAction(this);
|
||||
Layers[LAYER_TYPE_FORE]= new CLayerFore(this);
|
||||
|
||||
TileViewFlag=0;
|
||||
LayerViewFlag=1;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
CCore::~CCore()
|
||||
{
|
||||
for (int i=0; i<LAYER_TYPE_MAX; i++) delete Layers[i];
|
||||
int i;
|
||||
for (i=0; i<LAYER_TYPE_MAX; i++) delete Layers[i];
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -49,22 +52,25 @@ void CCore::Init(CMapEditView *Wnd)
|
|||
{
|
||||
ParentWindow=Wnd;
|
||||
ActiveLayer=0;
|
||||
CamPos.x=CamPos.y=CamPos.z=0;
|
||||
UpdateView(0,0,0);
|
||||
CTileSet NewSet("c:/temp/2/test.gin",this);
|
||||
TileSet.push_back(NewSet);
|
||||
MapCam=Vec(0,0,0);
|
||||
TileCam=Vec(0,0,0);
|
||||
UpdateView();
|
||||
|
||||
|
||||
TileSet.push_back(CTileSet("c:/temp/3/test.gin",this));
|
||||
TRACE1("%i\n",TileSet.size());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
void CCore::Render()
|
||||
{
|
||||
// theApp.SetTileView(TRUE);
|
||||
Vec &ThisCam=GetCam();
|
||||
|
||||
if (GetTileView())
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -73,23 +79,13 @@ void CCore::Render()
|
|||
if (i==LAYER_TYPE_ACTION)
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
Layers[i]->Render(CamPos,Test3dFlag);
|
||||
Layers[i]->Render(ThisCam,Test3dFlag);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
}
|
||||
}
|
||||
// ParentWindow->Invalidate();
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::UpdateView(float XOfs,float YOfs,float ZOfs)
|
||||
{
|
||||
CamPos=CamPos+Vec(XOfs,YOfs,ZOfs);
|
||||
if (CamPos.z>-1) CamPos.z=-1;
|
||||
|
||||
ParentWindow->Invalidate();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*** Control *****************************************************************/
|
||||
/*****************************************************************************/
|
||||
|
@ -106,25 +102,24 @@ void CCore::MButtonControl(UINT nFlags, CPoint &point,BOOL DownFlag)
|
|||
/*****************************************************************************/
|
||||
void CCore::RButtonControl(UINT nFlags, CPoint &point,BOOL DownFlag)
|
||||
{
|
||||
// Test3dFlag=!Test3dFlag;
|
||||
UpdateView(0,0,0);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::MouseWheel(UINT nFlags, short zDelta, CPoint &pt)
|
||||
{
|
||||
if (zDelta>0)
|
||||
UpdateView(0,0,1.0f);
|
||||
UpdateView(Vec(0,0,1.0f));
|
||||
else
|
||||
UpdateView(0,0,-1.0f);
|
||||
UpdateView(Vec(0,0,-1.0f));
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::MouseMove(UINT nFlags, CPoint &point)
|
||||
{
|
||||
float XOfs=0;
|
||||
float YOfs=0;
|
||||
|
||||
Vec Ofs(0,0,0);
|
||||
//float XOfs=0;
|
||||
//float YOfs=0;
|
||||
Vec &ThisCam=GetCam();
|
||||
// check if active doc
|
||||
if (theApp.GetCurrent()!=ParentWindow->GetDocument()) return;
|
||||
|
||||
|
@ -137,85 +132,109 @@ float YOfs=0;
|
|||
RECT ThisRect;
|
||||
|
||||
ParentWindow->GetWindowRect(&ThisRect);
|
||||
XS=CamPos.z*2;//*Layers[ActiveLayer]->GetLayerZPos();
|
||||
YS=CamPos.z*2;//*Layers[ActiveLayer]->GetLayerZPos();
|
||||
XS=ThisCam.z*2;//*Layers[ActiveLayer]->GetLayerZPos();
|
||||
YS=ThisCam.z*2;//*Layers[ActiveLayer]->GetLayerZPos();
|
||||
XS/=((ThisRect.right-ThisRect.left));
|
||||
YS/=((ThisRect.bottom-ThisRect.top));
|
||||
|
||||
XOfs=LastMousePos.x-CurrentMousePos.x;
|
||||
YOfs=LastMousePos.y-CurrentMousePos.y;
|
||||
Ofs.x=LastMousePos.x-CurrentMousePos.x;
|
||||
Ofs.y=LastMousePos.y-CurrentMousePos.y;
|
||||
LastMousePos=CurrentMousePos;
|
||||
|
||||
XOfs*=XS;
|
||||
YOfs*=YS;
|
||||
Ofs.x*=XS;
|
||||
Ofs.y*=YS;
|
||||
|
||||
TRACE2("Move %i %i \n",point.x,point.y);
|
||||
UpdateView(+XOfs,-YOfs,0);
|
||||
UpdateView(Ofs);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*** Layer Code **************************************************************/
|
||||
/*** Layers ******************************************************************/
|
||||
/*****************************************************************************/
|
||||
void CCore::LayerSetActive(int i)
|
||||
void CCore::UpdateLayerBar(BOOL ViewFlag)
|
||||
{
|
||||
}
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CToolBar *ToolBar=Frm->GetToolBar();
|
||||
CDialogBar *LayerBar=Frm->GetLayerBar();
|
||||
CListBox *Dlg=(CListBox *)LayerBar->GetDlgItem(IDC_LAYERBAR_LIST);
|
||||
|
||||
/*****************************************************************************/
|
||||
int CCore::LayerGetActive()
|
||||
LayerViewFlag=ViewFlag;
|
||||
if (LayerViewFlag)
|
||||
{
|
||||
return(ActiveLayer);
|
||||
}
|
||||
Dlg->ResetContent();
|
||||
|
||||
/*****************************************************************************/
|
||||
CLayer *CCore::LayerGet(int i)
|
||||
for (int i=0;i<LAYER_TYPE_MAX;i++)
|
||||
{
|
||||
return(Layers[i]);
|
||||
CLayer *ThisLayer=GetLayer(i);
|
||||
Dlg->AddString(ThisLayer->GetName());
|
||||
}
|
||||
Dlg->SetCurSel(ActiveLayer);
|
||||
}
|
||||
|
||||
ToolBar->GetToolBarCtrl().PressButton(ID_TOOLBAR_LAYERBAR,LayerViewFlag);
|
||||
Frm->ShowControlBar(LayerBar, LayerViewFlag, FALSE);
|
||||
// UpdateView();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::SetActiveLayer(int i)
|
||||
{
|
||||
UpdateLayerBar(LayerViewFlag);
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/*** TileBank ****************************************************************/
|
||||
/*****************************************************************************/
|
||||
void CCore::SetTileView(BOOL f)
|
||||
void CCore::UpdateTileView(BOOL ViewFlag)
|
||||
{
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CToolBar *ToolBar=Frm->GetToolBar();
|
||||
|
||||
TileViewFlag=f;
|
||||
TileViewFlag=ViewFlag;
|
||||
ToolBar->GetToolBarCtrl().PressButton(ID_TOOLBAR_TILEPALETTE,TileViewFlag);
|
||||
|
||||
UpdateView();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::ToggleTileView()
|
||||
GLint CCore::GetTile(int Bank,int TileNo)
|
||||
{
|
||||
SetTileView(!TileViewFlag);
|
||||
TRACE1("%i\n",TileSet.size());
|
||||
return(TileSet[Bank].GetTile(TileNo));
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/*** Misc ********************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
void CCore::SetLayerPalette(BOOL f)
|
||||
Vec &CCore::GetCam()
|
||||
{
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CToolBar *ToolBar=Frm->GetToolBar();
|
||||
CDialogBar *LayerPalette=Frm->GetLayerBar();
|
||||
if (GetTileView())
|
||||
return(TileCam);
|
||||
else
|
||||
return(MapCam);
|
||||
|
||||
LayerPaletteFlag=f;
|
||||
ToolBar->GetToolBarCtrl().PressButton(ID_TOOLBAR_LAYERBAR,LayerPaletteFlag);
|
||||
Frm->ShowControlBar(LayerPalette, LayerPaletteFlag, FALSE);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::ToggleLayerPalette()
|
||||
void CCore::UpdateAll()
|
||||
{
|
||||
SetLayerPalette(!LayerPaletteFlag);
|
||||
UpdateView();
|
||||
UpdateLayerBar(LayerViewFlag);
|
||||
UpdateTileView(TileViewFlag);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::UpdateView(Vec Ofs)
|
||||
{
|
||||
Vec &ThisCam=GetCam();
|
||||
|
||||
ThisCam=ThisCam+Ofs;
|
||||
if (ThisCam.z>-1) ThisCam.z=-1;
|
||||
|
||||
ParentWindow->Invalidate();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -32,6 +32,10 @@ class CCore
|
|||
public:
|
||||
CCore();
|
||||
~CCore();
|
||||
|
||||
void Init(CMapEditView *Wnd);
|
||||
void Render();
|
||||
|
||||
// Control
|
||||
void LButtonControl(UINT nFlags, CPoint &point,BOOL DownFlag);
|
||||
void MButtonControl(UINT nFlags, CPoint &point,BOOL DownFlag);
|
||||
|
@ -39,36 +43,37 @@ public:
|
|||
void MouseWheel(UINT nFlags, short zDelta, CPoint &pt);
|
||||
void MouseMove(UINT nFlags, CPoint &point);
|
||||
|
||||
// Blah
|
||||
void Init(CMapEditView *Wnd);
|
||||
void Render();
|
||||
void UpdateView(float XOfs,float YOfs,float ZOfs);
|
||||
void SetMouseMode(MOUSE_MODE CurrentMode,MOUSE_MODE NewMode);
|
||||
|
||||
Vec &GetCamPos() {return(CamPos);}
|
||||
|
||||
void SetTileView(BOOL f);
|
||||
// TileBank
|
||||
void UpdateTileView(BOOL ViewFlag);
|
||||
BOOL GetTileView() {return(TileViewFlag);}
|
||||
void ToggleTileView();
|
||||
void ToggleTileView() {UpdateTileView(!TileViewFlag);}
|
||||
|
||||
void SetLayerPalette(BOOL f);
|
||||
BOOL GetLayerPalette() {return(LayerPaletteFlag);}
|
||||
void ToggleLayerPalette();
|
||||
GLint GetTile(int Bank,int TileNo);
|
||||
|
||||
// Layers
|
||||
void LayerSetActive(int Layer);
|
||||
int LayerGetActive();
|
||||
CLayer *LayerGet(int i);
|
||||
void UpdateLayerBar(BOOL ViewFlag);
|
||||
BOOL GetLayerViewFlag() {return(LayerViewFlag);}
|
||||
void ToggleLayerView() {UpdateLayerBar(!LayerViewFlag);}
|
||||
|
||||
void SetActiveLayer(int Layer);
|
||||
int GetActiveLayer() {return(ActiveLayer);}
|
||||
CLayer *GetLayer(int i) {return(Layers[i]);}
|
||||
|
||||
// Tex Cache
|
||||
CTexCache &GetTexCache() {return(TexCache);}
|
||||
|
||||
// Misc
|
||||
void UpdateAll();
|
||||
void UpdateView(Vec Ofs=Vec(0,0,0));
|
||||
|
||||
Vec &GetCam();
|
||||
|
||||
|
||||
private:
|
||||
CMapEditView *ParentWindow;
|
||||
MOUSE_MODE MouseMode;
|
||||
CPoint CurrentMousePos,LastMousePos;
|
||||
Vec CamPos;
|
||||
Vec MapCam,TileCam;
|
||||
|
||||
CLayer *Layers[LAYER_TYPE_MAX];
|
||||
int ActiveLayer;
|
||||
|
@ -77,7 +82,7 @@ private:
|
|||
CTexCache TexCache;
|
||||
|
||||
BOOL TileViewFlag;
|
||||
BOOL LayerPaletteFlag;
|
||||
BOOL LayerViewFlag;
|
||||
|
||||
|
||||
};
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
//#include "MapEditDoc.h"
|
||||
//#include "MapEditView.h"
|
||||
|
||||
#include "Core.h"
|
||||
#include "Layer.h"
|
||||
#include "Utils.h"
|
||||
|
||||
|
@ -20,7 +21,7 @@
|
|||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
CLayer::CLayer()
|
||||
CLayer::CLayer(CCore *_Core)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -29,6 +30,16 @@ CLayer::~CLayer()
|
|||
{
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CLayer::InitLayer(CCore *_Core)
|
||||
{
|
||||
int Width=Map.GetWidth();
|
||||
int Height=Map.GetHeight();
|
||||
|
||||
Core=_Core;
|
||||
TRACE3("%i x %i = %i\t",Width,Height,Width*Height);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CLayer::Render(Vec &MapPos,BOOL Is3d)
|
||||
{
|
||||
|
@ -39,22 +50,23 @@ void CLayer::Render(Vec &MapPos,BOOL Is3d)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
extern GLint TestTile;
|
||||
|
||||
void CLayer::Render2d(Vec &MapPos)
|
||||
{
|
||||
float XYDiv=GetLayerZPosDiv();
|
||||
return;
|
||||
int Width=Map.GetWidth();
|
||||
int Height=Map.GetHeight();
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(MapPos.x/XYDiv,MapPos.y/XYDiv,MapPos.z);
|
||||
|
||||
glBegin(GL_QUADS);
|
||||
SetTestColor();
|
||||
BuildGLQuad(-1,LayerWidth+1,-1,0,0); // Bottom
|
||||
BuildGLQuad(-1,LayerWidth+1,LayerHeight+1,LayerHeight,0); // Top
|
||||
BuildGLQuad(-1,0,LayerHeight,0,0); // Left
|
||||
BuildGLQuad(LayerWidth,LayerWidth+1,LayerHeight,0,0); // Right
|
||||
BuildGLQuad(-1,Width+1,-1,0,0); // Bottom
|
||||
BuildGLQuad(-1,Width+1,Height+1,Height,0); // Top
|
||||
BuildGLQuad(-1,0,Height,0,0); // Left
|
||||
BuildGLQuad(Width,Width+1,Height,0,0); // Right
|
||||
glEnd();
|
||||
|
||||
|
||||
|
@ -65,14 +77,31 @@ float asd=0;
|
|||
void CLayer::Render3d(Vec &MapPos)
|
||||
{
|
||||
float XYDiv=GetLayerZPosDiv();
|
||||
float X,Y;
|
||||
int XX=0;
|
||||
int YY=0;
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(MapPos.x/XYDiv,MapPos.y/XYDiv,MapPos.z);
|
||||
glRotatef(asd,0,1,0);
|
||||
asd+=0.5;
|
||||
|
||||
glCallList(TestTile);
|
||||
Y=MapPos.y;
|
||||
|
||||
for (YY=0; YY<3; YY++)
|
||||
{
|
||||
X=MapPos.x;
|
||||
for (XX=0; XX<3; XX++)
|
||||
{
|
||||
glLoadIdentity();
|
||||
glTranslatef(X/XYDiv,Y/XYDiv,MapPos.z);
|
||||
// glRotatef(asd,0,1,0);
|
||||
// asd+=0.5;
|
||||
// glCallList(Core->GetTile(0,2));
|
||||
glCallList(Core->GetTile(0,XX+(YY*3)));
|
||||
|
||||
X+=1.0f;
|
||||
}
|
||||
Y+=1.0f;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include <Vector>
|
||||
#include "gl3d.h"
|
||||
#include "Map.h"
|
||||
|
||||
enum LAYER_TYPE
|
||||
{
|
||||
|
@ -18,15 +19,26 @@ enum LAYER_TYPE
|
|||
LAYER_TYPE_MAX
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
struct sMapElem
|
||||
{
|
||||
int Bank;
|
||||
int Tile;
|
||||
int Flags;
|
||||
};
|
||||
*/
|
||||
|
||||
/*****************************************************************************/
|
||||
class CCore;
|
||||
class CMap;
|
||||
class CLayer
|
||||
{
|
||||
public:
|
||||
CLayer();
|
||||
CLayer(){ASSERT(1);}
|
||||
CLayer(CCore *_Core);
|
||||
~CLayer();
|
||||
|
||||
void InitLayer(CCore *_Core);
|
||||
|
||||
// Virtual
|
||||
virtual void Init()=0;
|
||||
|
@ -43,8 +55,14 @@ virtual void SetTestColor()=0;
|
|||
|
||||
|
||||
protected:
|
||||
float LayerWidth,LayerHeight;
|
||||
// float Width,Height;
|
||||
CCore *Core;
|
||||
// std::vector< std::vector<sMapElem> > Map;
|
||||
// sMapElem *Map;
|
||||
CMap Map;
|
||||
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
#endif
|
||||
|
|
53
Utils/MapEdit/Map.cpp
Normal file
53
Utils/MapEdit/Map.cpp
Normal file
|
@ -0,0 +1,53 @@
|
|||
/******************/
|
||||
/*** Map Stuph ***/
|
||||
/*****************/
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Map.h"
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
int CMap::GetWidth()
|
||||
{
|
||||
return(Map.size());
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
int CMap::GetHeight()
|
||||
{
|
||||
return(Map[0].size());
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CMap::SetSize(int Width,int Height)
|
||||
{
|
||||
Map.resize(Width);
|
||||
for (int i=0;i<Width;i++)
|
||||
{
|
||||
Map[i].resize(Height);
|
||||
}
|
||||
|
||||
for (int Y=0;Y<Height;Y++)
|
||||
for (int X=0;X<Width;X++)
|
||||
{
|
||||
TRACE2("%i,%i\n",X,Y);
|
||||
Map[X][Y].Bank=0;
|
||||
Map[X][Y].Tile=(X+Y)%9;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CMap::SetWidth(int Width)
|
||||
{
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CMap::SetHeight(int Height)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
|
37
Utils/MapEdit/Map.h
Normal file
37
Utils/MapEdit/Map.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
/******************/
|
||||
/*** Map Stuph ***/
|
||||
/*****************/
|
||||
|
||||
#ifndef __MAP_HEADER__
|
||||
#define __MAP_HEADER__
|
||||
|
||||
#include <Vector>
|
||||
|
||||
struct sMapElem
|
||||
{
|
||||
int Bank;
|
||||
int Tile;
|
||||
int Flags;
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
class CMap
|
||||
{
|
||||
public:
|
||||
CMap(){};
|
||||
~CMap(){};
|
||||
|
||||
int GetWidth();
|
||||
int GetHeight();
|
||||
|
||||
void SetSize(int Width,int Height);
|
||||
void SetWidth(int Width);
|
||||
void SetHeight(int Height);
|
||||
|
||||
protected:
|
||||
std::vector< std::vector<sMapElem> > Map;
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
#endif
|
|
@ -143,6 +143,14 @@ SOURCE=.\Core.h
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Map.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Map.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\TexCache.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
|
@ -123,47 +123,7 @@ CMapEditDoc *CurDoc=GetDocument();
|
|||
/*********************************************************************************/
|
||||
void CMapEditView::UpdateAll()
|
||||
{
|
||||
UpdateLayerBar();
|
||||
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
void CMapEditView::UpdateLayerBar()
|
||||
{
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CDialogBar *LayerBar=Frm->GetLayerBar();
|
||||
CListBox *Dlg=(CListBox *)LayerBar->GetDlgItem(IDC_LAYERBAR_LIST);
|
||||
int CurSel=Dlg->GetCurSel();
|
||||
|
||||
Dlg->ResetContent();
|
||||
|
||||
for (int i=0;i<LAYER_TYPE_MAX;i++)
|
||||
{
|
||||
CLayer *ThisLayer=Core.LayerGet(i);
|
||||
Dlg->AddString(ThisLayer->GetName());
|
||||
}
|
||||
Dlg->SetCurSel(CurSel);
|
||||
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
int CMapEditView::GetLayerCurSel()
|
||||
{
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CDialogBar *LayerBar=Frm->GetLayerBar();
|
||||
CListBox *Dlg=(CListBox *)LayerBar->GetDlgItem(IDC_LAYERBAR_LIST);
|
||||
return(Dlg->GetCurSel());
|
||||
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
int CMapEditView::GetLayerCount()
|
||||
{
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CDialogBar *LayerBar=Frm->GetLayerBar();
|
||||
CListBox *Dlg=(CListBox *)LayerBar->GetDlgItem(IDC_LAYERBAR_LIST);
|
||||
return(Dlg->GetCount());
|
||||
|
||||
Core.UpdateAll();
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
|
@ -178,14 +138,5 @@ void CMapEditView::OnRButtonDown(UINT nFlags, CPoint point) {Core.RButtonCont
|
|||
void CMapEditView::OnRButtonUp(UINT nFlags, CPoint point) {Core.RButtonControl(nFlags,point,FALSE);}
|
||||
void CMapEditView::OnMouseMove(UINT nFlags, CPoint point) {Core.MouseMove(nFlags, point);}
|
||||
|
||||
|
||||
|
||||
void CMapEditView::OnToolbarLayerbar()
|
||||
{
|
||||
Core.ToggleLayerPalette();
|
||||
}
|
||||
|
||||
void CMapEditView::OnToolbarTilepalette()
|
||||
{
|
||||
Core.ToggleTileView();
|
||||
}
|
||||
void CMapEditView::OnToolbarLayerbar() {Core.ToggleLayerView();}
|
||||
void CMapEditView::OnToolbarTilepalette() {Core.ToggleTileView();}
|
||||
|
|
|
@ -38,9 +38,6 @@ public:
|
|||
virtual void Dump(CDumpContext& dc) const;
|
||||
#endif
|
||||
void UpdateAll();
|
||||
void UpdateLayerBar();
|
||||
int GetLayerCurSel();
|
||||
int GetLayerCount();
|
||||
|
||||
protected:
|
||||
void VideoMode(ColorsNumber &c,ZAccuracy &z,BOOL &dbuf);
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
//
|
||||
#pragma warning( disable : 4786 )
|
||||
|
||||
#if !defined(AFX_STDAFX_H__67922BC1_781B_4EBB_86D3_B87FA7642774__INCLUDED_)
|
||||
#define AFX_STDAFX_H__67922BC1_781B_4EBB_86D3_B87FA7642774__INCLUDED_
|
||||
|
|
|
@ -30,6 +30,7 @@ public:
|
|||
int Load(CCore *Core,char *_Filename);
|
||||
char *GetPath() {return(Path);}
|
||||
char *GetFilename() {return(Filename);}
|
||||
GLint GetTile(int No) {return(Tile[No].GetTile());}
|
||||
|
||||
private:
|
||||
char Path[256];
|
||||
|
|
Loading…
Add table
Reference in a new issue