This commit is contained in:
parent
1b5d03f9db
commit
cd1c32cfd1
24 changed files with 466 additions and 595 deletions
|
@ -45,6 +45,8 @@ public:
|
||||||
|
|
||||||
void clear() {List.clear();}
|
void clear() {List.clear();}
|
||||||
void resize(int i) {List.resize(i);}
|
void resize(int i) {List.resize(i);}
|
||||||
|
void erase(int i) {List.erase(List.begin()+i);}
|
||||||
|
// int begin() {return(List.begin);}
|
||||||
|
|
||||||
|
|
||||||
int size() {return(List.size());}
|
int size() {return(List.size());}
|
||||||
|
|
|
@ -157,6 +157,7 @@ public:
|
||||||
void FlipY(void);
|
void FlipY(void);
|
||||||
|
|
||||||
void Resize(int NewWidth,int NewHeight);
|
void Resize(int NewWidth,int NewHeight);
|
||||||
|
u8 GetPixel(int PixX,int PixY) { return(Buffa[PixX+(PixY*Width)]);}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void CopyFrame(Frame const &);
|
void CopyFrame(Frame const &);
|
||||||
|
|
|
@ -25,22 +25,20 @@
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
#include "Export.h"
|
#include "Export.h"
|
||||||
|
|
||||||
#include "LayerList.h"
|
#include "LayerList.h"
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
CCore::CCore()
|
CCore::CCore()
|
||||||
{
|
{
|
||||||
CurrentMousePos=CPoint(0,0);
|
CurrentMousePos=CPoint(0,0);
|
||||||
|
CurrentView=NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
CCore::~CCore()
|
CCore::~CCore()
|
||||||
{
|
{
|
||||||
GUIRemoveAll();
|
|
||||||
int ListSize=Layer.size();
|
int ListSize=Layer.size();
|
||||||
for (int i=0; i<ListSize; i++) delete Layer[i];
|
for (int i=0; i<ListSize; i++) delete Layer[i];
|
||||||
}
|
}
|
||||||
|
@ -62,9 +60,8 @@ int Width,Height;
|
||||||
// Create Tile Layers
|
// Create Tile Layers
|
||||||
AddLayer(LAYER_TYPE_TILE,LAYER_SUBTYPE_ACTION, Width, Height);
|
AddLayer(LAYER_TYPE_TILE,LAYER_SUBTYPE_ACTION, Width, Height);
|
||||||
AddLayer(LAYER_TYPE_TILE,LAYER_SUBTYPE_SCRATCH, Width, Height);
|
AddLayer(LAYER_TYPE_TILE,LAYER_SUBTYPE_SCRATCH, Width, Height);
|
||||||
// AddLayer(LAYER_TYPE_COLLISION,-1, Width, Height);
|
|
||||||
|
|
||||||
ActiveLayer=FindActionLayer();
|
ActiveLayer=FindLayer(LAYER_TYPE_TILE,LAYER_SUBTYPE_ACTION);
|
||||||
MapCam.Zero();
|
MapCam.Zero();
|
||||||
TileCam.Zero();
|
TileCam.Zero();
|
||||||
TileViewFlag=FALSE;
|
TileViewFlag=FALSE;
|
||||||
|
@ -129,12 +126,13 @@ int LayerCount;
|
||||||
|
|
||||||
|
|
||||||
// Check Layers
|
// Check Layers
|
||||||
int MapWidth=Layer[FindActionLayer()]->GetWidth();
|
int MapWidth=ActionLayer->GetWidth();
|
||||||
int MapHeight=Layer[FindActionLayer()]->GetHeight();
|
int MapHeight=ActionLayer->GetHeight();
|
||||||
for (i=0;i<LayerCount;i++)
|
for (i=0;i<LayerCount;i++)
|
||||||
{
|
{
|
||||||
Layer[i]->CheckLayerSize(MapWidth,MapHeight);
|
Layer[i]->CheckLayerSize(MapWidth,MapHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -171,30 +169,42 @@ int LayerCount=Layer.size();
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
BOOL CCore::Question(char *Txt)
|
BOOL CCore::Question(char *Txt)
|
||||||
{
|
{
|
||||||
return(theApp.GetCurrent()->Question(Txt));
|
CString Str;
|
||||||
|
Str.Format(Txt);
|
||||||
|
int Ret=AfxMessageBox(Str,MB_YESNO , MB_ICONQUESTION);
|
||||||
|
|
||||||
|
if (Ret==IDYES) return(true);
|
||||||
|
return(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CCore::Render(CMapEditView *View,BOOL ForceRender)
|
void CCore::Render(BOOL ForceRender)
|
||||||
{
|
{
|
||||||
|
if (!CurrentView)
|
||||||
|
{
|
||||||
|
TRACE0("No View\n");
|
||||||
|
UpdateAll();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (TileBank.NeedLoad()) TileBank.LoadTileSets(this);
|
if (TileBank.NeedLoad()) TileBank.LoadTileSets(this);
|
||||||
|
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear Screen
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear Screen
|
||||||
if (TileViewFlag)
|
if (TileViewFlag)
|
||||||
{
|
{
|
||||||
RenderTileView(View);
|
RenderTileView();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RenderLayers(View);
|
RenderLayers();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CCore::RenderLayers(CMapEditView *View)
|
void CCore::RenderLayers()
|
||||||
{
|
{
|
||||||
Vector3 &ThisCam=GetCam();
|
Vector3 &ThisCam=GetCam();
|
||||||
int ListSize=Layer.size();
|
int ListSize=Layer.size();
|
||||||
|
@ -225,16 +235,16 @@ int StartLayer,EndLayer;
|
||||||
|
|
||||||
// Get Cursor Pos
|
// Get Cursor Pos
|
||||||
LastCursorPos=CursorPos;
|
LastCursorPos=CursorPos;
|
||||||
Layer[ActiveLayer]->FindCursorPos(this,View,GetCam(),CurrentMousePos);
|
Layer[ActiveLayer]->FindCursorPos(this,GetCam(),CurrentMousePos);
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/*****************************************************************************/
|
||||||
void CCore::RenderTileView(CMapEditView *View)
|
void CCore::RenderTileView()
|
||||||
{
|
{
|
||||||
Vector3 &ThisCam=GetCam();
|
Vector3 &ThisCam=GetCam();
|
||||||
|
|
||||||
GetTileBank().RenderSet(this,ThisCam,Is3dFlag);
|
GetTileBank().RenderSet(this,ThisCam,Is3dFlag);
|
||||||
GetTileBank().FindCursorPos(this,View,GetCam(),CurrentMousePos);
|
GetTileBank().FindCursorPos(this,GetCam(),CurrentMousePos);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -247,7 +257,7 @@ BOOL RedrawFlag=FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CCore::LButtonControl(CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag)
|
void CCore::LButtonControl(UINT nFlags, CPoint &point,BOOL DownFlag)
|
||||||
{
|
{
|
||||||
BOOL RedrawFlag=FALSE;
|
BOOL RedrawFlag=FALSE;
|
||||||
|
|
||||||
|
@ -262,21 +272,21 @@ BOOL RedrawFlag=FALSE;
|
||||||
{
|
{
|
||||||
if (Layer[ActiveLayer]->IsVisible())
|
if (Layer[ActiveLayer]->IsVisible())
|
||||||
{
|
{
|
||||||
RedrawFlag=Layer[ActiveLayer]->LButtonControl(this,View,nFlags,CursorPos,DownFlag);
|
RedrawFlag=Layer[ActiveLayer]->LButtonControl(this,nFlags,CursorPos,DownFlag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GetTileBank().SetActiveBrushL();
|
GetTileBank().SetActiveBrushL();
|
||||||
|
|
||||||
if (RedrawFlag) RedrawView();//View->Invalidate();
|
if (RedrawFlag) RedrawView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CCore::MButtonControl(CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag)
|
void CCore::MButtonControl(UINT nFlags, CPoint &point,BOOL DownFlag)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CCore::RButtonControl(CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag)
|
void CCore::RButtonControl(UINT nFlags, CPoint &point,BOOL DownFlag)
|
||||||
{
|
{
|
||||||
BOOL RedrawFlag=FALSE;
|
BOOL RedrawFlag=FALSE;
|
||||||
|
|
||||||
|
@ -291,12 +301,12 @@ BOOL RedrawFlag=FALSE;
|
||||||
{
|
{
|
||||||
if (Layer[ActiveLayer]->IsVisible())
|
if (Layer[ActiveLayer]->IsVisible())
|
||||||
{
|
{
|
||||||
RedrawFlag=Layer[ActiveLayer]->RButtonControl(this,View,nFlags,CursorPos,DownFlag);
|
RedrawFlag=Layer[ActiveLayer]->RButtonControl(this,nFlags,CursorPos,DownFlag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GetTileBank().SetActiveBrushR();
|
GetTileBank().SetActiveBrushR();
|
||||||
|
|
||||||
if (RedrawFlag) RedrawView();//View->Invalidate();
|
if (RedrawFlag) RedrawView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -310,7 +320,7 @@ Vector3 Ofs;
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CCore::MouseWheel(CMapEditView *View,UINT nFlags, short zDelta, CPoint &pt)
|
void CCore::MouseWheel(UINT nFlags, short zDelta, CPoint &pt)
|
||||||
{
|
{
|
||||||
if (zDelta>0)
|
if (zDelta>0)
|
||||||
Zoom(-0.1f);
|
Zoom(-0.1f);
|
||||||
|
@ -319,14 +329,14 @@ void CCore::MouseWheel(CMapEditView *View,UINT nFlags, short zDelta, CPoint &pt)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CCore::MouseMove(CMapEditView *View,UINT nFlags, CPoint &point)
|
void CCore::MouseMove(UINT nFlags, CPoint &point)
|
||||||
{
|
{
|
||||||
Vector3 Ofs;
|
Vector3 Ofs;
|
||||||
Vector3 &ThisCam=GetCam();
|
Vector3 &ThisCam=GetCam();
|
||||||
// check if active doc
|
// check if active doc
|
||||||
Ofs.Zero();
|
Ofs.Zero();
|
||||||
if (theApp.GetCurrent()!=View->GetDocument()) return;
|
if (theApp.GetCurrent()!=CurrentView->GetDocument()) return;
|
||||||
|
GetWorkingPath();
|
||||||
CurrentMousePos=point;
|
CurrentMousePos=point;
|
||||||
|
|
||||||
// Handle Drag Movement
|
// Handle Drag Movement
|
||||||
|
@ -340,7 +350,7 @@ Vector3 &ThisCam=GetCam();
|
||||||
{
|
{
|
||||||
MoveSpd*=4;
|
MoveSpd*=4;
|
||||||
}
|
}
|
||||||
View->GetWindowRect(&ThisRect);
|
CurrentView->GetWindowRect(&ThisRect);
|
||||||
XS=ThisCam.z*MoveSpd;
|
XS=ThisCam.z*MoveSpd;
|
||||||
YS=ThisCam.z*MoveSpd;
|
YS=ThisCam.z*MoveSpd;
|
||||||
XS/=((ThisRect.right-ThisRect.left));
|
XS/=((ThisRect.right-ThisRect.left));
|
||||||
|
@ -362,10 +372,10 @@ Vector3 &ThisCam=GetCam();
|
||||||
{
|
{
|
||||||
if (Layer[ActiveLayer]->IsVisible())
|
if (Layer[ActiveLayer]->IsVisible())
|
||||||
{
|
{
|
||||||
Layer[ActiveLayer]->MouseMove(this,View,nFlags,CursorPos);
|
Layer[ActiveLayer]->MouseMove(this,nFlags,CursorPos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Mouse still moved, so need to redraw windows, to get CursorPos (And pos render)
|
// Mouse still moved, so need to redraw windows, to get CursorPos
|
||||||
RedrawView();
|
RedrawView();
|
||||||
}
|
}
|
||||||
LastMousePos=CurrentMousePos;
|
LastMousePos=CurrentMousePos;
|
||||||
|
@ -377,13 +387,12 @@ Vector3 &ThisCam=GetCam();
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CCore::UpdateParamBar()
|
void CCore::UpdateParamBar()
|
||||||
{
|
{
|
||||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
CMainFrame *Frm=(CMainFrame*)AfxGetMainWnd();
|
||||||
CMultiBar *ParamBar=Frm->GetParamBar();
|
CMultiBar *ParamBar=Frm->GetParamBar();
|
||||||
|
|
||||||
GUIRemoveAll();
|
GUIRemoveAll();
|
||||||
GUIAdd(LayerList,IDD_LAYER_LIST_DIALOG);
|
GUIAdd(LayerList,IDD_LAYER_LIST_DIALOG);
|
||||||
Layer[ActiveLayer]->GUIInit(this);
|
Layer[ActiveLayer]->GUIInit(this);
|
||||||
// Layer[ActiveLayer]->GUIUpdate(this);
|
|
||||||
GUIUpdate();
|
GUIUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -410,8 +419,11 @@ int ListSize=Layer.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CCore::SetLayer(int NewLayer)
|
void CCore::SetLayer(int NewLayer,bool Force)
|
||||||
{
|
{
|
||||||
|
int LayerCount=Layer.size()-1;
|
||||||
|
int LastLayer=ActiveLayer;
|
||||||
|
|
||||||
if (NewLayer<0) NewLayer=0;
|
if (NewLayer<0) NewLayer=0;
|
||||||
|
|
||||||
// If toggling layer, dont change the layer
|
// If toggling layer, dont change the layer
|
||||||
|
@ -426,12 +438,19 @@ void CCore::SetLayer(int NewLayer)
|
||||||
TileBank.SetCollision(IsCol);
|
TileBank.SetCollision(IsCol);
|
||||||
ActiveLayer=NewLayer;
|
ActiveLayer=NewLayer;
|
||||||
}
|
}
|
||||||
UpdateParamBar();
|
|
||||||
|
if (LastLayer!=ActiveLayer || Force)
|
||||||
|
{
|
||||||
|
if (TileViewFlag) TileViewFlag=false;
|
||||||
|
if (LastLayer<=LayerCount) Layer[LastLayer]->GUIKill(this);
|
||||||
|
Layer[ActiveLayer]->GUIInit(this);
|
||||||
|
GUIUpdate();
|
||||||
|
}
|
||||||
RedrawView();
|
RedrawView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
CLayer *CCore::AddLayer(CLayer *NewLayer)
|
int CCore::AddLayer(CLayer *NewLayer)
|
||||||
{
|
{
|
||||||
int ListSize=Layer.size();
|
int ListSize=Layer.size();
|
||||||
int NewIdx=CLayer::GetLayerIdx(NewLayer->GetType(),NewLayer->GetSubType());
|
int NewIdx=CLayer::GetLayerIdx(NewLayer->GetType(),NewLayer->GetSubType());
|
||||||
|
@ -447,29 +466,31 @@ int Idx=ListSize;
|
||||||
|
|
||||||
Layer.insert(Layer.begin() + Idx,NewLayer);
|
Layer.insert(Layer.begin() + Idx,NewLayer);
|
||||||
|
|
||||||
return(NewLayer);
|
if (NewLayer->GetType()==LAYER_TYPE_TILE && NewLayer->GetSubType()==LAYER_SUBTYPE_ACTION) ActionLayer=NewLayer;
|
||||||
|
return(Idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CCore::AddLayer(int Type, int SubType, int Width, int Height)
|
int CCore::AddLayer(int Type, int SubType, int Width, int Height)
|
||||||
{
|
{
|
||||||
CLayer *Layer;
|
int Idx;
|
||||||
switch (Type)
|
switch (Type)
|
||||||
{
|
{
|
||||||
case LAYER_TYPE_TILE:
|
case LAYER_TYPE_TILE:
|
||||||
Layer=AddLayer(new CLayerTile(SubType, Width,Height));
|
Idx=AddLayer(new CLayerTile(SubType, Width,Height));
|
||||||
break;
|
break;
|
||||||
case LAYER_TYPE_COLLISION:
|
case LAYER_TYPE_COLLISION:
|
||||||
Layer=AddLayer(new CLayerCollision(SubType, Width,Height));
|
Idx=AddLayer(new CLayerCollision(SubType, Width,Height));
|
||||||
break;
|
break;
|
||||||
case LAYER_TYPE_SHADE:
|
case LAYER_TYPE_SHADE:
|
||||||
Layer=AddLayer(new CLayerShade(SubType, Width,Height));
|
Idx=AddLayer(new CLayerShade(SubType, Width,Height));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(!"AddLayer - Invalid Layer Type");
|
ASSERT(!"AddLayer - Invalid Layer Type");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
return(Idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -497,11 +518,13 @@ int Sel;
|
||||||
|
|
||||||
TRACE2("Add Layer %i %s\n",NewLayerId,CLayer::InfoTable[NewLayerId].Name);
|
TRACE2("Add Layer %i %s\n",NewLayerId,CLayer::InfoTable[NewLayerId].Name);
|
||||||
|
|
||||||
int Width=Layer[FindActionLayer()]->GetWidth();
|
int Width=ActionLayer->GetWidth();
|
||||||
int Height=Layer[FindActionLayer()]->GetHeight();
|
int Height=ActionLayer->GetHeight();
|
||||||
|
|
||||||
AddLayer(CLayer::InfoTable[NewLayerId].Type,CLayer::InfoTable[NewLayerId].SubType,Width,Height);
|
int Idx=AddLayer(CLayer::InfoTable[NewLayerId].Type,CLayer::InfoTable[NewLayerId].SubType,Width,Height);
|
||||||
UpdateAll();
|
if (ActiveLayer>=Idx) ActiveLayer++;
|
||||||
|
|
||||||
|
SetLayer(Idx,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -512,8 +535,7 @@ void CCore::DeleteLayer(int CurrentLayer)
|
||||||
Layer[CurrentLayer]->GUIKill(this);
|
Layer[CurrentLayer]->GUIKill(this);
|
||||||
delete Layer[CurrentLayer];
|
delete Layer[CurrentLayer];
|
||||||
Layer.erase(Layer.begin() + CurrentLayer);
|
Layer.erase(Layer.begin() + CurrentLayer);
|
||||||
SetLayer(CurrentLayer-1);
|
SetLayer(CurrentLayer-1,true);
|
||||||
UpdateAll();
|
|
||||||
TRACE1("Deleted Layer %i\n",CurrentLayer);
|
TRACE1("Deleted Layer %i\n",CurrentLayer);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -528,7 +550,7 @@ void CCore::DeleteLayer(int CurrentLayer)
|
||||||
void CCore::UpdateGrid(BOOL Toggle)
|
void CCore::UpdateGrid(BOOL Toggle)
|
||||||
{
|
{
|
||||||
if (Toggle) GridFlag=!GridFlag;
|
if (Toggle) GridFlag=!GridFlag;
|
||||||
UpdateView();
|
RedrawView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -536,10 +558,24 @@ void CCore::UpdateGrid(BOOL Toggle)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CCore::UpdateTileView(BOOL Toggle)
|
void CCore::UpdateTileView(BOOL Toggle)
|
||||||
{
|
{
|
||||||
if (Toggle) TileViewFlag=!TileViewFlag;
|
if (!Layer[ActiveLayer]->HasTileView()) return;
|
||||||
GUIRemoveAll();
|
if (Toggle)
|
||||||
UpdateParamBar();
|
{
|
||||||
UpdateView();
|
TileViewFlag=!TileViewFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TileViewFlag)
|
||||||
|
{
|
||||||
|
Layer[ActiveLayer]->GUIKill(this);
|
||||||
|
TileBank.GUIInit(this);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TileBank.GUIKill(this);
|
||||||
|
Layer[ActiveLayer]->GUIInit(this);
|
||||||
|
}
|
||||||
|
GUIUpdate();
|
||||||
|
RedrawView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -547,7 +583,7 @@ void CCore::TileBankLoad(char *Filename)
|
||||||
{
|
{
|
||||||
TileBank.AddTileSet(Filename);
|
TileBank.AddTileSet(Filename);
|
||||||
TileBank.GUIUpdate(this);
|
TileBank.GUIUpdate(this);
|
||||||
UpdateView();
|
RedrawView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -573,7 +609,7 @@ void CCore::TileBankDelete()
|
||||||
Layer[i]->RemapSet(Set,Set-1);
|
Layer[i]->RemapSet(Set,Set-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UpdateView();
|
RedrawView();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -582,7 +618,7 @@ void CCore::TileBankReload()
|
||||||
{
|
{
|
||||||
TileBank.Reload();
|
TileBank.Reload();
|
||||||
TexCache.Purge();
|
TexCache.Purge();
|
||||||
UpdateView();
|
RedrawView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -596,7 +632,7 @@ void CCore::MirrorX()
|
||||||
{
|
{
|
||||||
if (TileViewFlag) return;
|
if (TileViewFlag) return;
|
||||||
Layer[ActiveLayer]->MirrorX(this);
|
Layer[ActiveLayer]->MirrorX(this);
|
||||||
UpdateView();
|
RedrawView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -604,21 +640,21 @@ void CCore::MirrorY()
|
||||||
{
|
{
|
||||||
if (TileViewFlag) return;
|
if (TileViewFlag) return;
|
||||||
Layer[ActiveLayer]->MirrorY(this);
|
Layer[ActiveLayer]->MirrorY(this);
|
||||||
UpdateView();
|
RedrawView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CCore::ActiveBrushLeft()
|
void CCore::ActiveBrushLeft()
|
||||||
{
|
{
|
||||||
GetTileBank().SetActiveBrushL();
|
GetTileBank().SetActiveBrushL();
|
||||||
UpdateView();
|
RedrawView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CCore::ActiveBrushRight()
|
void CCore::ActiveBrushRight()
|
||||||
{
|
{
|
||||||
GetTileBank().SetActiveBrushR();
|
GetTileBank().SetActiveBrushR();
|
||||||
UpdateView();
|
RedrawView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -631,14 +667,14 @@ BOOL CCore::IsTileValid(int Set,int Tile)
|
||||||
void CCore::CopySelection()
|
void CCore::CopySelection()
|
||||||
{
|
{
|
||||||
Layer[ActiveLayer]->CopySelection(this);
|
Layer[ActiveLayer]->CopySelection(this);
|
||||||
UpdateView();
|
RedrawView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CCore::PasteSelection()
|
void CCore::PasteSelection()
|
||||||
{
|
{
|
||||||
Layer[ActiveLayer]->PasteSelection(this);
|
Layer[ActiveLayer]->PasteSelection(this);
|
||||||
UpdateView();
|
RedrawView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -662,7 +698,7 @@ float ZS=XS/YS;
|
||||||
|
|
||||||
ScaleVector.x=1.0f/XS;
|
ScaleVector.x=1.0f/XS;
|
||||||
ScaleVector.y=1.0f/XS;
|
ScaleVector.y=1.0f/XS;
|
||||||
ScaleVector.z=1.0f/XS;//4.0f;
|
ScaleVector.z=1.0f/XS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -686,7 +722,7 @@ Vector3 &ThisCam=GetCam();
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CCore::GUIAdd(CDialog &Dlg,int ID,bool Visible,bool Lock)
|
void CCore::GUIAdd(CDialog &Dlg,int ID,bool Visible,bool Lock)
|
||||||
{
|
{
|
||||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
CMainFrame *Frm=(CMainFrame*)AfxGetMainWnd();
|
||||||
CMultiBar *ParamBar=Frm->GetParamBar();
|
CMultiBar *ParamBar=Frm->GetParamBar();
|
||||||
|
|
||||||
ParamBar->Add(Dlg,ID,Visible,Lock);
|
ParamBar->Add(Dlg,ID,Visible,Lock);
|
||||||
|
@ -695,7 +731,7 @@ CMultiBar *ParamBar=Frm->GetParamBar();
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CCore::GUIRemove(CDialog &Dlg,int ID,bool Force)
|
void CCore::GUIRemove(CDialog &Dlg,int ID,bool Force)
|
||||||
{
|
{
|
||||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
CMainFrame *Frm=(CMainFrame*)AfxGetMainWnd();
|
||||||
CMultiBar *ParamBar=Frm->GetParamBar();
|
CMultiBar *ParamBar=Frm->GetParamBar();
|
||||||
|
|
||||||
ParamBar->Remove(Dlg,Force);
|
ParamBar->Remove(Dlg,Force);
|
||||||
|
@ -704,7 +740,7 @@ CMultiBar *ParamBar=Frm->GetParamBar();
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CCore::GUIRemoveAll(bool Force)
|
void CCore::GUIRemoveAll(bool Force)
|
||||||
{
|
{
|
||||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
CMainFrame *Frm=(CMainFrame*)AfxGetMainWnd();
|
||||||
CMultiBar *ParamBar=Frm->GetParamBar();
|
CMultiBar *ParamBar=Frm->GetParamBar();
|
||||||
|
|
||||||
ParamBar->RemoveAll(Force);
|
ParamBar->RemoveAll(Force);
|
||||||
|
@ -713,7 +749,7 @@ CMultiBar *ParamBar=Frm->GetParamBar();
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CCore::GUIUpdate()
|
void CCore::GUIUpdate()
|
||||||
{
|
{
|
||||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
CMainFrame *Frm=(CMainFrame*)AfxGetMainWnd();
|
||||||
CMultiBar *ParamBar=Frm->GetParamBar();
|
CMultiBar *ParamBar=Frm->GetParamBar();
|
||||||
|
|
||||||
UpdateLayerGUI();
|
UpdateLayerGUI();
|
||||||
|
@ -725,7 +761,6 @@ CMultiBar *ParamBar=Frm->GetParamBar();
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CCore::GUIChanged()
|
void CCore::GUIChanged()
|
||||||
{
|
{
|
||||||
// UpdateLayerGUI();
|
|
||||||
Layer[ActiveLayer]->GUIChanged(this);
|
Layer[ActiveLayer]->GUIChanged(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -733,17 +768,13 @@ void CCore::GUIChanged()
|
||||||
void CCore::UpdateAll()
|
void CCore::UpdateAll()
|
||||||
{
|
{
|
||||||
UpdateParamBar();
|
UpdateParamBar();
|
||||||
GUIUpdate();
|
RedrawView();
|
||||||
UpdateView();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CCore::RedrawView()
|
void CCore::RedrawView()
|
||||||
{
|
{
|
||||||
if (theApp.GetCurrent())
|
if (CurrentView) CurrentView->Invalidate();
|
||||||
{
|
|
||||||
theApp.GetCurrent()->UpdateAllViews(NULL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -780,14 +811,14 @@ int ListSize=Layer.size();
|
||||||
Layer[i]->Resize(Width,Height);
|
Layer[i]->Resize(Width,Height);
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateView();
|
RedrawView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CCore::Toggle2d3d()
|
void CCore::Toggle2d3d()
|
||||||
{
|
{
|
||||||
Is3dFlag=!Is3dFlag;
|
Is3dFlag=!Is3dFlag;
|
||||||
UpdateView();
|
RedrawView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -804,14 +835,6 @@ int ListSize=Layer.size();
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
int CCore::FindActionLayer()
|
|
||||||
{
|
|
||||||
int Idx=FindLayer(LAYER_TYPE_TILE,LAYER_SUBTYPE_ACTION);
|
|
||||||
|
|
||||||
return(Idx);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
Vector3 CCore::OffsetCam(Vector3 &Cam,float DivVal)
|
Vector3 CCore::OffsetCam(Vector3 &Cam,float DivVal)
|
||||||
|
@ -848,12 +871,3 @@ CExport Exp(ExportName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
GString CCore::GetCurrentPath()
|
|
||||||
{
|
|
||||||
GFName FullPath=theApp.GetCurrent()->GetPathName();
|
|
||||||
GString Path=FullPath.Dir();
|
|
||||||
|
|
||||||
return(Path);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -34,9 +34,9 @@ public:
|
||||||
void Load(CFile *File);
|
void Load(CFile *File);
|
||||||
void Save(CFile *File);
|
void Save(CFile *File);
|
||||||
BOOL Question(char *Txt);
|
BOOL Question(char *Txt);
|
||||||
void Render(CMapEditView *View,BOOL ForceRender=FALSE);
|
void Render(BOOL ForceRender=FALSE);
|
||||||
void RenderLayers(CMapEditView *View);
|
void RenderLayers();
|
||||||
void RenderTileView(CMapEditView *View);
|
void RenderTileView();
|
||||||
void Export(char *Filename);
|
void Export(char *Filename);
|
||||||
|
|
||||||
// View Stuff
|
// View Stuff
|
||||||
|
@ -44,11 +44,11 @@ public:
|
||||||
CMapEditView *GetView() {return(CurrentView);}
|
CMapEditView *GetView() {return(CurrentView);}
|
||||||
// Control
|
// Control
|
||||||
void SetMode(int NewMode);
|
void SetMode(int NewMode);
|
||||||
void LButtonControl(CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag);
|
void LButtonControl(UINT nFlags, CPoint &point,BOOL DownFlag);
|
||||||
void MButtonControl(CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag);
|
void MButtonControl(UINT nFlags, CPoint &point,BOOL DownFlag);
|
||||||
void RButtonControl(CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag);
|
void RButtonControl(UINT nFlags, CPoint &point,BOOL DownFlag);
|
||||||
void MouseWheel(CMapEditView *View,UINT nFlags, short zDelta, CPoint &pt);
|
void MouseWheel(UINT nFlags, short zDelta, CPoint &pt);
|
||||||
void MouseMove(CMapEditView *View,UINT nFlags, CPoint &point);
|
void MouseMove(UINT nFlags, CPoint &point);
|
||||||
void Zoom(float Dst);
|
void Zoom(float Dst);
|
||||||
|
|
||||||
// TileBank
|
// TileBank
|
||||||
|
@ -67,6 +67,7 @@ public:
|
||||||
BOOL IsTileValid(int Set,int Tile);
|
BOOL IsTileValid(int Set,int Tile);
|
||||||
BOOL IsTileView() {return(TileViewFlag);}
|
BOOL IsTileView() {return(TileViewFlag);}
|
||||||
void TileBankGUIInit() {TileBank.GUIInit(this);}
|
void TileBankGUIInit() {TileBank.GUIInit(this);}
|
||||||
|
void TileBankGUIKill() {TileBank.GUIKill(this);}
|
||||||
void TileBankGUIUpdate() {TileBank.GUIUpdate(this);}
|
void TileBankGUIUpdate() {TileBank.GUIUpdate(this);}
|
||||||
|
|
||||||
// GUI
|
// GUI
|
||||||
|
@ -78,9 +79,9 @@ public:
|
||||||
void GUIChanged();
|
void GUIChanged();
|
||||||
|
|
||||||
// Layers
|
// Layers
|
||||||
void AddLayer(int Type, int SubType, int Width, int Height);
|
int AddLayer(int Type, int SubType, int Width, int Height);
|
||||||
CLayer *AddLayer(CLayer *Layer);
|
int AddLayer(CLayer *Layer);
|
||||||
void SetLayer(int Layer);
|
void SetLayer(int Layer,bool Force=false);
|
||||||
void AddLayer(int Layer);
|
void AddLayer(int Layer);
|
||||||
void DeleteLayer(int Layer);
|
void DeleteLayer(int Layer);
|
||||||
void UpdateLayerGUI();
|
void UpdateLayerGUI();
|
||||||
|
@ -103,12 +104,12 @@ public:
|
||||||
CPoint &GetCursorPos() {return(CursorPos);}
|
CPoint &GetCursorPos() {return(CursorPos);}
|
||||||
|
|
||||||
void SetMapSize(int Width,int Height);
|
void SetMapSize(int Width,int Height);
|
||||||
int GetMapWidth() {return(Layer[FindActionLayer()]->GetWidth());}
|
int GetMapWidth() {return(ActionLayer->GetWidth());}
|
||||||
int GetMapHeight() {return(Layer[FindActionLayer()]->GetHeight());}
|
int GetMapHeight() {return(ActionLayer->GetHeight());}
|
||||||
|
|
||||||
void Toggle2d3d();
|
void Toggle2d3d();
|
||||||
int FindLayer(int Type,int SubType=-1);
|
int FindLayer(int Type,int SubType=-1);
|
||||||
int FindActionLayer();
|
int SetActionLayer(CLayer *Lyr) {ActionLayer=Lyr;}
|
||||||
|
|
||||||
void SetScale();
|
void SetScale();
|
||||||
Vector3 &GetScaleVector() {return(ScaleVector);}
|
Vector3 &GetScaleVector() {return(ScaleVector);}
|
||||||
|
@ -118,8 +119,6 @@ public:
|
||||||
void CopySelection();
|
void CopySelection();
|
||||||
void PasteSelection();
|
void PasteSelection();
|
||||||
|
|
||||||
GString GetCurrentPath();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CMapEditView *CurrentView;
|
CMapEditView *CurrentView;
|
||||||
CPoint CurrentMousePos,LastMousePos;
|
CPoint CurrentMousePos,LastMousePos;
|
||||||
|
@ -129,6 +128,7 @@ private:
|
||||||
Vector3 ScaleVector;
|
Vector3 ScaleVector;
|
||||||
|
|
||||||
std::vector<CLayer*> Layer;
|
std::vector<CLayer*> Layer;
|
||||||
|
CLayer *ActionLayer;
|
||||||
int ActiveLayer;
|
int ActiveLayer;
|
||||||
|
|
||||||
CTileBank TileBank;
|
CTileBank TileBank;
|
||||||
|
|
|
@ -16,13 +16,13 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
sLayerInfoTable CLayer::InfoTable[]=
|
sLayerInfoTable CLayer::InfoTable[]=
|
||||||
{
|
{
|
||||||
//Type SubType Name delete? Scale 3d Resizable Export
|
//Type SubType Name delete? Scale 3d Resizable Export TileView?
|
||||||
{LAYER_TYPE_TILE, LAYER_SUBTYPE_SCRATCH, "WorkPad", false, 1.0f, true, false, false,},
|
{LAYER_TYPE_TILE, LAYER_SUBTYPE_SCRATCH, "WorkPad", true, 1.0f, true, false, false, true,},
|
||||||
{LAYER_TYPE_SHADE, LAYER_SUBTYPE_BACK, "Back Shade", true, 4.0f, false, true, true,},
|
{LAYER_TYPE_SHADE, LAYER_SUBTYPE_BACK, "Back Shade", true, 4.0f, false, true, true, false,},
|
||||||
{LAYER_TYPE_TILE, LAYER_SUBTYPE_BACK, "Back", true, 4.0f, false, false, true,},
|
{LAYER_TYPE_TILE, LAYER_SUBTYPE_BACK, "Back", true, 4.0f, false, false, true, true,},
|
||||||
{LAYER_TYPE_TILE, LAYER_SUBTYPE_MID, "Mid", true, 2.0f, false, true, true,},
|
{LAYER_TYPE_TILE, LAYER_SUBTYPE_MID, "Mid", true, 2.0f, false, true, true, true,},
|
||||||
{LAYER_TYPE_TILE, LAYER_SUBTYPE_ACTION, "Action", false, 1.0f, true, true, true,},
|
{LAYER_TYPE_TILE, LAYER_SUBTYPE_ACTION, "Action", false, 1.0f, true, true, true, true,},
|
||||||
{LAYER_TYPE_COLLISION, LAYER_SUBTYPE_NONE, "Collision", true, 1.0f, false, true, true,},
|
{LAYER_TYPE_COLLISION, LAYER_SUBTYPE_NONE, "Collision", true, 1.0f, false, true, true, true,},
|
||||||
};
|
};
|
||||||
|
|
||||||
int CLayer::InfoTableSize=sizeof(InfoTable)/sizeof(sLayerInfoTable);
|
int CLayer::InfoTableSize=sizeof(InfoTable)/sizeof(sLayerInfoTable);
|
||||||
|
|
|
@ -23,6 +23,7 @@ struct sLayerInfoTable
|
||||||
bool Render3dFlag;
|
bool Render3dFlag;
|
||||||
bool ResizeFlag;
|
bool ResizeFlag;
|
||||||
bool ExportFlag;
|
bool ExportFlag;
|
||||||
|
bool HasTileView;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -36,7 +37,6 @@ TileLayerMinHeight=22,
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
class CCore;
|
class CCore;
|
||||||
class CMapEditView;
|
|
||||||
class CExport;
|
class CExport;
|
||||||
class CLayer
|
class CLayer
|
||||||
{
|
{
|
||||||
|
@ -55,6 +55,7 @@ static int GetLayerIdx(int Type,int SubType);
|
||||||
bool CanDelete() {return(InfoTable[GetLayerIdx(GetType(),GetSubType())].DeleteFlag);}
|
bool CanDelete() {return(InfoTable[GetLayerIdx(GetType(),GetSubType())].DeleteFlag);}
|
||||||
bool CanExport() {return(InfoTable[GetLayerIdx(GetType(),GetSubType())].ExportFlag);}
|
bool CanExport() {return(InfoTable[GetLayerIdx(GetType(),GetSubType())].ExportFlag);}
|
||||||
bool IsUnique() {return(!(InfoTable[GetLayerIdx(GetType(),GetSubType())].ExportFlag));}
|
bool IsUnique() {return(!(InfoTable[GetLayerIdx(GetType(),GetSubType())].ExportFlag));}
|
||||||
|
bool HasTileView() {return((InfoTable[GetLayerIdx(GetType(),GetSubType())].HasTileView));}
|
||||||
|
|
||||||
virtual void SetVisible(BOOL f) {VisibleFlag=f;}
|
virtual void SetVisible(BOOL f) {VisibleFlag=f;}
|
||||||
virtual BOOL IsVisible() {return(VisibleFlag);}
|
virtual BOOL IsVisible() {return(VisibleFlag);}
|
||||||
|
@ -68,7 +69,7 @@ virtual void RenderGrid(CCore *Core,Vector3 &CamPos,BOOL Active)=0;
|
||||||
virtual void RenderSelection(CCore *Core,Vector3 &ThisCam)=0;
|
virtual void RenderSelection(CCore *Core,Vector3 &ThisCam)=0;
|
||||||
|
|
||||||
|
|
||||||
virtual void FindCursorPos(CCore *Core,CMapEditView *View,Vector3 &CamPos,CPoint &MousePos)=0;
|
virtual void FindCursorPos(CCore *Core,Vector3 &CamPos,CPoint &MousePos)=0;
|
||||||
virtual void RenderCursor(CCore *Core,Vector3 &CamPos,BOOL Is3d)=0;
|
virtual void RenderCursor(CCore *Core,Vector3 &CamPos,BOOL Is3d)=0;
|
||||||
|
|
||||||
virtual void GUIInit(CCore *Core)=0;
|
virtual void GUIInit(CCore *Core)=0;
|
||||||
|
@ -91,9 +92,9 @@ virtual void Export(CCore *Core,CExport &Exp)=0;
|
||||||
virtual BOOL SetMode(int NewMode)=0;
|
virtual BOOL SetMode(int NewMode)=0;
|
||||||
virtual BOOL InitMode()=0;
|
virtual BOOL InitMode()=0;
|
||||||
virtual BOOL ExitMode()=0;
|
virtual BOOL ExitMode()=0;
|
||||||
virtual BOOL LButtonControl(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &CursorPos,BOOL DownFlag)=0;
|
virtual BOOL LButtonControl(CCore *Core,UINT nFlags, CPoint &CursorPos,BOOL DownFlag)=0;
|
||||||
virtual BOOL RButtonControl(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &CursorPos,BOOL DownFlag)=0;
|
virtual BOOL RButtonControl(CCore *Core,UINT nFlags, CPoint &CursorPos,BOOL DownFlag)=0;
|
||||||
virtual BOOL MouseMove(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &CursorPos)=0;
|
virtual BOOL MouseMove(CCore *Core,UINT nFlags, CPoint &CursorPos)=0;
|
||||||
|
|
||||||
virtual BOOL MirrorX(CCore *Core){return(false);};
|
virtual BOOL MirrorX(CCore *Core){return(false);};
|
||||||
virtual BOOL MirrorY(CCore *Core){return(false);};
|
virtual BOOL MirrorY(CCore *Core){return(false);};
|
||||||
|
|
|
@ -28,11 +28,8 @@
|
||||||
CLayerCollision::CLayerCollision(int _SubType,int Width,int Height)
|
CLayerCollision::CLayerCollision(int _SubType,int Width,int Height)
|
||||||
{
|
{
|
||||||
SubType=LAYER_SUBTYPE_NONE;
|
SubType=LAYER_SUBTYPE_NONE;
|
||||||
|
|
||||||
SetDefaultParams();
|
SetDefaultParams();
|
||||||
|
|
||||||
Mode=MouseModePaint;
|
Mode=MouseModePaint;
|
||||||
|
|
||||||
Map.SetSize(Width,Height,TRUE);
|
Map.SetSize(Width,Height,TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,12 +81,14 @@ void CLayerCollision::Save(CFile *File)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CLayerCollision::GUIInit(CCore *Core)
|
void CLayerCollision::GUIInit(CCore *Core)
|
||||||
{
|
{
|
||||||
Core->GUIAdd(ToolBarGUI,IDD_LAYERTILE_TOOLBAR);
|
// Core->TileBankGUIInit();
|
||||||
|
Core->GUIAdd(ToolBarGUI,IDD_LAYERTILE_TOOLBAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CLayerCollision::GUIKill(CCore *Core)
|
void CLayerCollision::GUIKill(CCore *Core)
|
||||||
{
|
{
|
||||||
|
// Core->TileBankGUIKill();
|
||||||
Core->GUIRemove(ToolBarGUI,IDD_LAYERTILE_TOOLBAR);
|
Core->GUIRemove(ToolBarGUI,IDD_LAYERTILE_TOOLBAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
class CCore;
|
class CCore;
|
||||||
//class CMapEditView;
|
|
||||||
class CLayerCollision : public CLayerTile
|
class CLayerCollision : public CLayerTile
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -128,10 +128,10 @@ float y1=y0-Height;
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
BOOL CLayerShade::Resize(int Width,int Height)
|
BOOL CLayerShade::Resize(int _Width,int _Height)
|
||||||
{
|
{
|
||||||
Width=TileLayerMinWidth+(Width-TileLayerMinWidth)/ScaleFactor;
|
Width=TileLayerMinWidth+(_Width-TileLayerMinWidth)/ScaleFactor;
|
||||||
Height=TileLayerMinHeight+(Height-TileLayerMinHeight)/ScaleFactor;
|
Height=TileLayerMinHeight+(_Height-TileLayerMinHeight)/ScaleFactor;
|
||||||
|
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
@ -149,9 +149,7 @@ void CLayerShade::GUIInit(CCore *Core)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CLayerShade::GUIKill(CCore *Core)
|
void CLayerShade::GUIKill(CCore *Core)
|
||||||
{
|
{
|
||||||
ShadeDlg.GetRGB0(RGB[0]);
|
Core->GUIRemove(ShadeDlg,IDD_LAYERSHADE_GUI);
|
||||||
ShadeDlg.GetRGB1(RGB[1]);
|
|
||||||
Core->GUIRemove(ShadeDlg,IDD_LAYERSHADE_GUI);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -164,9 +162,6 @@ void CLayerShade::GUIChanged(CCore *Core)
|
||||||
{
|
{
|
||||||
ShadeDlg.GetRGB0(RGB[0]);
|
ShadeDlg.GetRGB0(RGB[0]);
|
||||||
ShadeDlg.GetRGB1(RGB[1]);
|
ShadeDlg.GetRGB1(RGB[1]);
|
||||||
|
|
||||||
TRACE3("RGB0 is %i,%i,%i\n",RGB[0].rgbRed,RGB[0].rgbGreen,RGB[0].rgbBlue);
|
|
||||||
TRACE3("RGB1 is %i,%i,%i\n",RGB[1].rgbRed,RGB[1].rgbGreen,RGB[1].rgbBlue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
class CCore;
|
class CCore;
|
||||||
class CMapEditView;
|
|
||||||
class CLayerShade : public CLayer
|
class CLayerShade : public CLayer
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -28,7 +27,7 @@ public:
|
||||||
void RenderGrid(CCore *Core,Vector3 &CamPos,BOOL Active){};
|
void RenderGrid(CCore *Core,Vector3 &CamPos,BOOL Active){};
|
||||||
void RenderSelection(CCore *Core,Vector3 &ThisCam){};
|
void RenderSelection(CCore *Core,Vector3 &ThisCam){};
|
||||||
|
|
||||||
void FindCursorPos(CCore *Core,CMapEditView *View,Vector3 &CamPos,CPoint &MousePos){};
|
void FindCursorPos(CCore *Core,Vector3 &CamPos,CPoint &MousePos){};
|
||||||
void RenderCursor(CCore *Core,Vector3 &CamPos,BOOL Is3d){};
|
void RenderCursor(CCore *Core,Vector3 &CamPos,BOOL Is3d){};
|
||||||
|
|
||||||
void GUIInit(CCore *Core);
|
void GUIInit(CCore *Core);
|
||||||
|
@ -49,9 +48,9 @@ public:
|
||||||
BOOL SetMode(int NewMode) {return(false);}
|
BOOL SetMode(int NewMode) {return(false);}
|
||||||
BOOL InitMode() {return(false);}
|
BOOL InitMode() {return(false);}
|
||||||
BOOL ExitMode() {return(false);}
|
BOOL ExitMode() {return(false);}
|
||||||
BOOL LButtonControl(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &CursorPos,BOOL DownFlag) {return(false);}
|
BOOL LButtonControl(CCore *Core,UINT nFlags, CPoint &CursorPos,BOOL DownFlag) {return(false);}
|
||||||
BOOL RButtonControl(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &CursorPos,BOOL DownFlag) {return(false);}
|
BOOL RButtonControl(CCore *Core,UINT nFlags, CPoint &CursorPos,BOOL DownFlag) {return(false);}
|
||||||
BOOL MouseMove(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &CursorPos) {return(false);}
|
BOOL MouseMove(CCore *Core,UINT nFlags, CPoint &CursorPos) {return(false);}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void Render(CCore *Core,Vector3 &CamPos,CMap &ThisMap,BOOL Render3d,float Alpha=1.0f,Vector3 *Ofs=0);
|
void Render(CCore *Core,Vector3 &CamPos,CMap &ThisMap,BOOL Render3d,float Alpha=1.0f,Vector3 *Ofs=0);
|
||||||
|
|
|
@ -306,7 +306,7 @@ const float OverVal=0.1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CLayerTile::FindCursorPos(CCore *Core,CMapEditView *View,Vector3 &CamPos,CPoint &MousePos)
|
void CLayerTile::FindCursorPos(CCore *Core,Vector3 &CamPos,CPoint &MousePos)
|
||||||
{
|
{
|
||||||
Vector3 ThisCam=Core->OffsetCam(CamPos,GetScaleFactor());
|
Vector3 ThisCam=Core->OffsetCam(CamPos,GetScaleFactor());
|
||||||
int MapWidth=Map.GetWidth();
|
int MapWidth=Map.GetWidth();
|
||||||
|
@ -347,7 +347,7 @@ int DrawH=ZoomH+8;
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
gluPickMatrix( MousePos.x ,(Viewport[3]-MousePos.y),5.0,5.0,Viewport);
|
gluPickMatrix( MousePos.x ,(Viewport[3]-MousePos.y),5.0,5.0,Viewport);
|
||||||
View->SetupPersMatrix();
|
Core->GetView()->SetupPersMatrix();
|
||||||
|
|
||||||
glMatrixMode(GL_MODELVIEW);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
|
@ -393,13 +393,14 @@ GLuint *HitPtr=SelectBuffer;
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CLayerTile::GUIInit(CCore *Core)
|
void CLayerTile::GUIInit(CCore *Core)
|
||||||
{
|
{
|
||||||
Core->GUIAdd(ToolBarGUI,IDD_LAYERTILE_TOOLBAR);
|
Core->TileBankGUIInit();
|
||||||
Core->TileBankGUIInit();
|
Core->GUIAdd(ToolBarGUI,IDD_LAYERTILE_TOOLBAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CLayerTile::GUIKill(CCore *Core)
|
void CLayerTile::GUIKill(CCore *Core)
|
||||||
{
|
{
|
||||||
|
Core->TileBankGUIKill();
|
||||||
Core->GUIRemove(ToolBarGUI,IDD_LAYERTILE_TOOLBAR);
|
Core->GUIRemove(ToolBarGUI,IDD_LAYERTILE_TOOLBAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -472,7 +473,7 @@ BOOL CLayerTile::ExitMode()
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
BOOL CLayerTile::LButtonControl(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &CursorPos,BOOL DownFlag)
|
BOOL CLayerTile::LButtonControl(CCore *Core,UINT nFlags, CPoint &CursorPos,BOOL DownFlag)
|
||||||
{
|
{
|
||||||
BOOL Ret=FALSE;
|
BOOL Ret=FALSE;
|
||||||
CTileBank &TileBank=Core->GetTileBank();
|
CTileBank &TileBank=Core->GetTileBank();
|
||||||
|
@ -497,7 +498,7 @@ CTileBank &TileBank=Core->GetTileBank();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
BOOL CLayerTile::RButtonControl(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &CursorPos,BOOL DownFlag)
|
BOOL CLayerTile::RButtonControl(CCore *Core,UINT nFlags, CPoint &CursorPos,BOOL DownFlag)
|
||||||
{
|
{
|
||||||
BOOL Ret=FALSE;
|
BOOL Ret=FALSE;
|
||||||
CTileBank &TileBank=Core->GetTileBank();
|
CTileBank &TileBank=Core->GetTileBank();
|
||||||
|
@ -522,7 +523,7 @@ CTileBank &TileBank=Core->GetTileBank();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
BOOL CLayerTile::MouseMove(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &CursorPos)
|
BOOL CLayerTile::MouseMove(CCore *Core,UINT nFlags, CPoint &CursorPos)
|
||||||
{
|
{
|
||||||
BOOL Ret=FALSE;
|
BOOL Ret=FALSE;
|
||||||
CTileBank &TileBank=Core->GetTileBank();
|
CTileBank &TileBank=Core->GetTileBank();
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
class CCore;
|
class CCore;
|
||||||
class CMapEditView;
|
|
||||||
class CLayerTile : public CLayer
|
class CLayerTile : public CLayer
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -34,13 +33,13 @@ public:
|
||||||
void RenderGrid(CCore *Core,Vector3 &CamPos,BOOL Active);
|
void RenderGrid(CCore *Core,Vector3 &CamPos,BOOL Active);
|
||||||
void RenderSelection(CCore *Core,Vector3 &ThisCam);
|
void RenderSelection(CCore *Core,Vector3 &ThisCam);
|
||||||
|
|
||||||
void FindCursorPos(CCore *Core,CMapEditView *View,Vector3 &CamPos,CPoint &MousePos);
|
void FindCursorPos(CCore *Core,Vector3 &CamPos,CPoint &MousePos);
|
||||||
void RenderCursor(CCore *Core,Vector3 &CamPos,BOOL Is3d);
|
void RenderCursor(CCore *Core,Vector3 &CamPos,BOOL Is3d);
|
||||||
|
|
||||||
void GUIInit(CCore *Core);
|
virtual void GUIInit(CCore *Core);
|
||||||
void GUIKill(CCore *Core);
|
virtual void GUIKill(CCore *Core);
|
||||||
void GUIUpdate(CCore *Core);
|
virtual void GUIUpdate(CCore *Core);
|
||||||
void GUIChanged(CCore *Core);
|
virtual void GUIChanged(CCore *Core);
|
||||||
|
|
||||||
int GetWidth() {return(Map.GetWidth());}
|
int GetWidth() {return(Map.GetWidth());}
|
||||||
int GetHeight() {return(Map.GetHeight());}
|
int GetHeight() {return(Map.GetHeight());}
|
||||||
|
@ -57,9 +56,9 @@ public:
|
||||||
BOOL InitMode();
|
BOOL InitMode();
|
||||||
BOOL ExitMode();
|
BOOL ExitMode();
|
||||||
|
|
||||||
BOOL LButtonControl(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag);
|
BOOL LButtonControl(CCore *Core,UINT nFlags, CPoint &point,BOOL DownFlag);
|
||||||
BOOL RButtonControl(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag);
|
BOOL RButtonControl(CCore *Core,UINT nFlags, CPoint &point,BOOL DownFlag);
|
||||||
BOOL MouseMove(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &point);
|
BOOL MouseMove(CCore *Core,UINT nFlags, CPoint &point);
|
||||||
|
|
||||||
BOOL MirrorX(CCore *Core);
|
BOOL MirrorX(CCore *Core);
|
||||||
BOOL MirrorY(CCore *Core);
|
BOOL MirrorY(CCore *Core);
|
||||||
|
|
|
@ -110,5 +110,3 @@ void CMainFrame::Dump(CDumpContext& dc) const
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,47 +8,48 @@ NewFileInclude1=#include "stdafx.h"
|
||||||
NewFileInclude2=#include "mapedit.h"
|
NewFileInclude2=#include "mapedit.h"
|
||||||
LastPage=0
|
LastPage=0
|
||||||
|
|
||||||
ClassCount=17
|
ClassCount=15
|
||||||
Class1=CChildFrame
|
Class1=CAddLayerDlg
|
||||||
Class2=CGLEnabledView
|
Class2=CChildFrame
|
||||||
Class3=CMainFrame
|
Class3=CGLEnabledView
|
||||||
Class4=CMapEditApp
|
Class4=CLayerList
|
||||||
Class5=CAboutDlg
|
Class5=CLayerShadeGUI
|
||||||
Class6=CMapEditDoc
|
Class6=CLayerTileGUI
|
||||||
Class7=CMapEditView
|
Class7=CLayerTileToolbar
|
||||||
|
Class8=CMainFrame
|
||||||
|
Class9=CMapEditApp
|
||||||
|
Class10=CAboutDlg
|
||||||
|
Class11=CMapEditDoc
|
||||||
|
Class12=CMapEditView
|
||||||
|
Class13=CMapSizeDlg
|
||||||
|
Class14=CMultiBar
|
||||||
|
Class15=CNewMapGUI
|
||||||
|
|
||||||
ResourceCount=14
|
ResourceCount=12
|
||||||
Resource1=IDD_NEW_LAYER
|
Resource1=IDD_ABOUTBOX (English (U.S.))
|
||||||
Resource2=IDR_MAPEDITYPE (English (U.S.))
|
Resource2=IDD_MULTIBAR (English (U.S.))
|
||||||
Resource3=IDD_MAPSIZE
|
Resource3=IDR_MAPEDITYPE (English (U.S.))
|
||||||
Resource4=IDD_DIALOGBAR (English (U.S.))
|
Resource4=IDD_LAYER_LIST_DIALOG
|
||||||
Resource5=IDD_LAYERTILE_TOOLBAR
|
Resource5=IDD_MAPSIZE
|
||||||
Class8=CMultiBar
|
Resource6=IDD_NEWMAP
|
||||||
Resource6=IDD_ABOUTBOX (English (U.S.))
|
Resource7=IDD_ADDLAYER
|
||||||
Resource7=IDR_MAINFRAME (English (U.S.))
|
Resource8=IDD_LAYERTILE_GUI
|
||||||
Class9=CLayerList
|
Resource9=IDD_LAYERTILE_TOOLBAR
|
||||||
Class10=CMapSizeDlg
|
Resource10=IDR_TOOLBAR (English (U.S.))
|
||||||
Resource8=IDD_LAYER_LIST_DIALOG
|
Resource11=IDR_MAINFRAME (English (U.S.))
|
||||||
Class11=CGfxToolBar
|
Resource12=IDD_LAYERSHADE_GUI
|
||||||
Class12=CLayerTileGUI
|
|
||||||
Resource9=IDD_ADDLAYER
|
[CLS:CAddLayerDlg]
|
||||||
Resource10=IDD_LAYERTILE_GUI
|
Type=0
|
||||||
Class13=CNewMapGUI
|
BaseClass=CDialog
|
||||||
Class14=CProgressDlg
|
HeaderFile=AddLayerDlg.h
|
||||||
Resource11=IDD_NEWMAP
|
ImplementationFile=AddLayerDlg.cpp
|
||||||
Class15=CAddLayerDlg
|
|
||||||
Resource12=IDD_MULTIBAR (English (U.S.))
|
|
||||||
Class16=CLayerTileToolbar
|
|
||||||
Resource13=IDR_TOOLBAR (English (U.S.))
|
|
||||||
Class17=CLayerShadeGUI
|
|
||||||
Resource14=IDD_LAYERSHADE_GUI
|
|
||||||
|
|
||||||
[CLS:CChildFrame]
|
[CLS:CChildFrame]
|
||||||
Type=0
|
Type=0
|
||||||
BaseClass=CMDIChildWnd
|
BaseClass=CMDIChildWnd
|
||||||
HeaderFile=ChildFrm.h
|
HeaderFile=ChildFrm.h
|
||||||
ImplementationFile=ChildFrm.cpp
|
ImplementationFile=ChildFrm.cpp
|
||||||
LastObject=CChildFrame
|
|
||||||
|
|
||||||
[CLS:CGLEnabledView]
|
[CLS:CGLEnabledView]
|
||||||
Type=0
|
Type=0
|
||||||
|
@ -56,12 +57,37 @@ BaseClass=CView
|
||||||
HeaderFile=GLEnabledView.h
|
HeaderFile=GLEnabledView.h
|
||||||
ImplementationFile=GLEnabledView.cpp
|
ImplementationFile=GLEnabledView.cpp
|
||||||
|
|
||||||
|
[CLS:CLayerList]
|
||||||
|
Type=0
|
||||||
|
HeaderFile=LayerList.h
|
||||||
|
ImplementationFile=LayerList.cpp
|
||||||
|
|
||||||
|
[CLS:CLayerShadeGUI]
|
||||||
|
Type=0
|
||||||
|
BaseClass=CDialog
|
||||||
|
HeaderFile=LayerShadeGUI.h
|
||||||
|
ImplementationFile=LayerShadeGUI.cpp
|
||||||
|
|
||||||
|
[CLS:CLayerTileGUI]
|
||||||
|
Type=0
|
||||||
|
BaseClass=CDialog
|
||||||
|
HeaderFile=LayerTileGUI.h
|
||||||
|
ImplementationFile=LayerTileGUI.cpp
|
||||||
|
|
||||||
|
[CLS:CLayerTileToolbar]
|
||||||
|
Type=0
|
||||||
|
BaseClass=CDialog
|
||||||
|
HeaderFile=LayerTileToolbar.h
|
||||||
|
ImplementationFile=LayerTileToolbar.cpp
|
||||||
|
|
||||||
[CLS:CMainFrame]
|
[CLS:CMainFrame]
|
||||||
Type=0
|
Type=0
|
||||||
BaseClass=CMDIFrameWnd
|
BaseClass=CMDIFrameWnd
|
||||||
HeaderFile=MainFrm.h
|
HeaderFile=MainFrm.h
|
||||||
ImplementationFile=MainFrm.cpp
|
ImplementationFile=MainFrm.cpp
|
||||||
LastObject=CMainFrame
|
LastObject=CMainFrame
|
||||||
|
Filter=T
|
||||||
|
VirtualFilter=fWC
|
||||||
|
|
||||||
[CLS:CMapEditApp]
|
[CLS:CMapEditApp]
|
||||||
Type=0
|
Type=0
|
||||||
|
@ -69,15 +95,15 @@ BaseClass=CWinApp
|
||||||
HeaderFile=MapEdit.h
|
HeaderFile=MapEdit.h
|
||||||
ImplementationFile=MapEdit.cpp
|
ImplementationFile=MapEdit.cpp
|
||||||
LastObject=CMapEditApp
|
LastObject=CMapEditApp
|
||||||
|
Filter=N
|
||||||
|
VirtualFilter=AC
|
||||||
|
|
||||||
[CLS:CAboutDlg]
|
[CLS:CAboutDlg]
|
||||||
Type=0
|
Type=0
|
||||||
BaseClass=CDialog
|
BaseClass=CDialog
|
||||||
HeaderFile=MapEdit.cpp
|
HeaderFile=MapEdit.cpp
|
||||||
ImplementationFile=MapEdit.cpp
|
ImplementationFile=MapEdit.cpp
|
||||||
LastObject=ID_ZOOM_IN
|
LastObject=CAboutDlg
|
||||||
Filter=D
|
|
||||||
VirtualFilter=dWC
|
|
||||||
|
|
||||||
[CLS:CMapEditDoc]
|
[CLS:CMapEditDoc]
|
||||||
Type=0
|
Type=0
|
||||||
|
@ -97,10 +123,100 @@ LastObject=CMapEditView
|
||||||
Filter=C
|
Filter=C
|
||||||
VirtualFilter=VWC
|
VirtualFilter=VWC
|
||||||
|
|
||||||
|
[CLS:CMapSizeDlg]
|
||||||
|
Type=0
|
||||||
|
BaseClass=CDialog
|
||||||
|
HeaderFile=MapSizeDlg.h
|
||||||
|
ImplementationFile=MapSizeDlg.cpp
|
||||||
|
|
||||||
|
[CLS:CMultiBar]
|
||||||
|
Type=0
|
||||||
|
BaseClass=CDialogBar
|
||||||
|
HeaderFile=MultiBar.h
|
||||||
|
ImplementationFile=MultiBar.cpp
|
||||||
|
|
||||||
|
[CLS:CNewMapGUI]
|
||||||
|
Type=0
|
||||||
|
BaseClass=CDialog
|
||||||
|
HeaderFile=NewMapGUI.h
|
||||||
|
ImplementationFile=NewMapGUI.cpp
|
||||||
|
|
||||||
|
[DLG:IDD_ADDLAYER]
|
||||||
|
Type=1
|
||||||
|
Class=CAddLayerDlg
|
||||||
|
ControlCount=3
|
||||||
|
Control1=IDOK,button,1342242817
|
||||||
|
Control2=IDCANCEL,button,1342242816
|
||||||
|
Control3=IDC_ADDLAYER_LIST,listbox,1352728833
|
||||||
|
|
||||||
|
[DLG:IDD_LAYER_LIST_DIALOG]
|
||||||
|
Type=1
|
||||||
|
Class=CLayerList
|
||||||
|
ControlCount=3
|
||||||
|
Control1=IDC_LAYER_LIST,listbox,1352728913
|
||||||
|
Control2=IDC_LAYERLIST_ADD,button,1342242816
|
||||||
|
Control3=IDC_LAYERLIST_DELETE,button,1342242816
|
||||||
|
|
||||||
|
[DLG:IDD_LAYERSHADE_GUI]
|
||||||
|
Type=1
|
||||||
|
Class=CLayerShadeGUI
|
||||||
|
ControlCount=8
|
||||||
|
Control1=IDC_LAYERSHADE_TEXT0,static,1342308352
|
||||||
|
Control2=IDC_LAYERSHADE_EDITR0,edit,1350770688
|
||||||
|
Control3=IDC_LAYERSHADE_EDITG0,edit,1350770816
|
||||||
|
Control4=IDC_LAYERSHADE_EDITB0,edit,1350770816
|
||||||
|
Control5=IDC_LAYERSHADE_TEXT1,static,1342308352
|
||||||
|
Control6=IDC_LAYERSHADE_EDITR1,edit,1350639744
|
||||||
|
Control7=IDC_LAYERSHADE_EDITG1,edit,1350639744
|
||||||
|
Control8=IDC_LAYERSHADE_EDITB1,edit,1350639744
|
||||||
|
|
||||||
|
[DLG:IDD_LAYERTILE_GUI]
|
||||||
|
Type=1
|
||||||
|
Class=CLayerTileGUI
|
||||||
|
ControlCount=4
|
||||||
|
Control1=IDD_LAYERTILE_LIST,combobox,1342242819
|
||||||
|
Control2=IDD_LAYERTILE_BTN_UPDATE,button,1342242816
|
||||||
|
Control3=IDD_LAYERTILE_BTN_LOAD,button,1342242816
|
||||||
|
Control4=IDD_LAYERTILE_BTN_DELETE,button,1342242816
|
||||||
|
|
||||||
|
[DLG:IDD_LAYERTILE_TOOLBAR]
|
||||||
|
Type=1
|
||||||
|
Class=CLayerTileToolbar
|
||||||
|
ControlCount=2
|
||||||
|
Control1=IDD_LAYERTILE_BTN_PAINT,button,1342177344
|
||||||
|
Control2=IDD_LAYERTILE_BTN_SELECT,button,1342177344
|
||||||
|
|
||||||
[DLG:IDD_ABOUTBOX]
|
[DLG:IDD_ABOUTBOX]
|
||||||
Type=1
|
Type=1
|
||||||
Class=CAboutDlg
|
Class=CAboutDlg
|
||||||
|
|
||||||
|
[DLG:IDD_MAPSIZE]
|
||||||
|
Type=1
|
||||||
|
Class=CMapSizeDlg
|
||||||
|
ControlCount=7
|
||||||
|
Control1=IDOK,button,1342177281
|
||||||
|
Control2=IDCANCEL,button,1342177280
|
||||||
|
Control3=IDC_MAPSIZE_WIDTH_TEXT,static,1342308866
|
||||||
|
Control4=IDC_MAPSIZE_WIDTH,edit,1350639744
|
||||||
|
Control5=IDC_MAPSIZE_HEIGHT_TEXT,static,1342308866
|
||||||
|
Control6=IDC_MAPSIZE_HEIGHT,edit,1350639744
|
||||||
|
Control7=IDC_MAPSIZE_WARNING,static,1342308352
|
||||||
|
|
||||||
|
[DLG:IDD_MULTIBAR]
|
||||||
|
Type=1
|
||||||
|
Class=CMultiBar
|
||||||
|
|
||||||
|
[DLG:IDD_NEWMAP]
|
||||||
|
Type=1
|
||||||
|
Class=CNewMapGUI
|
||||||
|
ControlCount=6
|
||||||
|
Control1=IDOK,button,1342177281
|
||||||
|
Control2=IDCANCEL,button,1342177280
|
||||||
|
Control3=IDC_MAPSIZE_WIDTH_TEXT,static,1342308866
|
||||||
|
Control4=IDC_MAPSIZE_WIDTH,edit,1350639744
|
||||||
|
Control5=IDC_MAPSIZE_HEIGHT_TEXT,static,1342308866
|
||||||
|
Control6=IDC_MAPSIZE_HEIGHT,edit,1350639744
|
||||||
|
|
||||||
[TB:IDR_TOOLBAR (English (U.S.))]
|
[TB:IDR_TOOLBAR (English (U.S.))]
|
||||||
Type=1
|
Type=1
|
||||||
Class=?
|
Class=?
|
||||||
|
@ -195,191 +311,8 @@ Control1=IDC_STATIC,static,1342177283
|
||||||
Control2=IDC_STATIC,static,1342308480
|
Control2=IDC_STATIC,static,1342308480
|
||||||
Control3=IDOK,button,1342373889
|
Control3=IDOK,button,1342373889
|
||||||
|
|
||||||
[DLG:IDD_DIALOGBAR (English (U.S.))]
|
|
||||||
Type=1
|
|
||||||
Class=?
|
|
||||||
ControlCount=3
|
|
||||||
Control1=IDC_STATIC,static,1342308352
|
|
||||||
Control2=IDC_CHECK1,button,1342242819
|
|
||||||
Control3=IDC_RADIO1,button,1342177289
|
|
||||||
|
|
||||||
[CLS:CMultiBar]
|
|
||||||
Type=0
|
|
||||||
HeaderFile=multibar.h
|
|
||||||
ImplementationFile=multibar.cpp
|
|
||||||
BaseClass=CDialogBar
|
|
||||||
LastObject=CMultiBar
|
|
||||||
Filter=D
|
|
||||||
VirtualFilter=dWC
|
|
||||||
|
|
||||||
[DLG:IDD_MULTIBAR (English (U.S.))]
|
[DLG:IDD_MULTIBAR (English (U.S.))]
|
||||||
Type=1
|
Type=1
|
||||||
Class=CMultiBar
|
Class=?
|
||||||
ControlCount=0
|
ControlCount=0
|
||||||
|
|
||||||
[DLG:IDD_LAYER_LIST_DIALOG]
|
|
||||||
Type=1
|
|
||||||
Class=CLayerList
|
|
||||||
ControlCount=3
|
|
||||||
Control1=IDC_LAYER_LIST,listbox,1352728913
|
|
||||||
Control2=IDC_LAYERLIST_ADD,button,1342242816
|
|
||||||
Control3=IDC_LAYERLIST_DELETE,button,1342242816
|
|
||||||
|
|
||||||
[CLS:CLayerList]
|
|
||||||
Type=0
|
|
||||||
HeaderFile=LayerList.h
|
|
||||||
ImplementationFile=LayerList.cpp
|
|
||||||
BaseClass=CDialog
|
|
||||||
Filter=D
|
|
||||||
VirtualFilter=dWC
|
|
||||||
LastObject=IDC_LAYER_LIST
|
|
||||||
|
|
||||||
[CLS:CGfxToolBar]
|
|
||||||
Type=0
|
|
||||||
HeaderFile=GfxToolBar.h
|
|
||||||
ImplementationFile=GfxToolBar.cpp
|
|
||||||
BaseClass=CDialog
|
|
||||||
Filter=D
|
|
||||||
LastObject=CGfxToolBar
|
|
||||||
VirtualFilter=dWC
|
|
||||||
|
|
||||||
[DLG:IDD_MAPSIZE]
|
|
||||||
Type=1
|
|
||||||
Class=CMapSizeDlg
|
|
||||||
ControlCount=7
|
|
||||||
Control1=IDOK,button,1342177281
|
|
||||||
Control2=IDCANCEL,button,1342177280
|
|
||||||
Control3=IDC_MAPSIZE_WIDTH_TEXT,static,1342308866
|
|
||||||
Control4=IDC_MAPSIZE_WIDTH,edit,1350639744
|
|
||||||
Control5=IDC_MAPSIZE_HEIGHT_TEXT,static,1342308866
|
|
||||||
Control6=IDC_MAPSIZE_HEIGHT,edit,1350639744
|
|
||||||
Control7=IDC_MAPSIZE_WARNING,static,1342308352
|
|
||||||
|
|
||||||
[CLS:CMapSizeDlg]
|
|
||||||
Type=0
|
|
||||||
HeaderFile=MapSizeDlg.h
|
|
||||||
ImplementationFile=MapSizeDlg.cpp
|
|
||||||
BaseClass=CDialog
|
|
||||||
Filter=D
|
|
||||||
VirtualFilter=dWC
|
|
||||||
LastObject=CMapSizeDlg
|
|
||||||
|
|
||||||
[DLG:IDD_LAYERTILE_GUI]
|
|
||||||
Type=1
|
|
||||||
Class=CLayerTileGUI
|
|
||||||
ControlCount=4
|
|
||||||
Control1=IDD_LAYERTILE_LIST,combobox,1342242819
|
|
||||||
Control2=IDD_LAYERTILE_BTN_UPDATE,button,1342242816
|
|
||||||
Control3=IDD_LAYERTILE_BTN_LOAD,button,1342242816
|
|
||||||
Control4=IDD_LAYERTILE_BTN_DELETE,button,1342242816
|
|
||||||
|
|
||||||
[CLS:CLayerTileGUI]
|
|
||||||
Type=0
|
|
||||||
HeaderFile=LayerTileGUI.h
|
|
||||||
ImplementationFile=LayerTileGUI.cpp
|
|
||||||
BaseClass=CDialog
|
|
||||||
Filter=D
|
|
||||||
VirtualFilter=dWC
|
|
||||||
LastObject=CLayerTileGUI
|
|
||||||
|
|
||||||
[DLG:IDD_NEW_LAYER]
|
|
||||||
Type=1
|
|
||||||
Class=?
|
|
||||||
ControlCount=12
|
|
||||||
Control1=IDOK,button,1342242817
|
|
||||||
Control2=IDCANCEL,button,1342242816
|
|
||||||
Control3=IDC_NEW_LAYER_TYPE_LIST,combobox,1344340226
|
|
||||||
Control4=IDC_NEW_LAYER_TYPE_NAME,static,1342308352
|
|
||||||
Control5=IDC_NEW_LAYER_WIDTH_NAME,static,1342308352
|
|
||||||
Control6=IDC_NEW_LAYER_HEIGHT_NAME,static,1342308352
|
|
||||||
Control7=IDC_NEW_LAYER_WIDTH_EDIT,edit,1350631552
|
|
||||||
Control8=IDC_NEW_LAYER_HEIGHT_EDIT,edit,1350631552
|
|
||||||
Control9=IDC_NEW_LAYER_NAME_NAME,static,1342308352
|
|
||||||
Control10=IDC_NEW_LAYER_NAME_EDIT,edit,1350631552
|
|
||||||
Control11=IDC_NEW_LAYER_WIDTH_NAME2,static,1342308352
|
|
||||||
Control12=IDC_NEW_LAYER_WIDTH_EDIT2,edit,1350631552
|
|
||||||
|
|
||||||
[DLG:IDD_NEWMAP]
|
|
||||||
Type=1
|
|
||||||
Class=CNewMapGUI
|
|
||||||
ControlCount=6
|
|
||||||
Control1=IDOK,button,1342177281
|
|
||||||
Control2=IDCANCEL,button,1342177280
|
|
||||||
Control3=IDC_MAPSIZE_WIDTH_TEXT,static,1342308866
|
|
||||||
Control4=IDC_MAPSIZE_WIDTH,edit,1350639744
|
|
||||||
Control5=IDC_MAPSIZE_HEIGHT_TEXT,static,1342308866
|
|
||||||
Control6=IDC_MAPSIZE_HEIGHT,edit,1350639744
|
|
||||||
|
|
||||||
[CLS:CNewMapGUI]
|
|
||||||
Type=0
|
|
||||||
HeaderFile=NewMapGUI.h
|
|
||||||
ImplementationFile=NewMapGUI.cpp
|
|
||||||
BaseClass=CDialog
|
|
||||||
Filter=D
|
|
||||||
LastObject=CNewMapGUI
|
|
||||||
VirtualFilter=dWC
|
|
||||||
|
|
||||||
[CLS:CProgressDlg]
|
|
||||||
Type=0
|
|
||||||
HeaderFile=ProgressDlg.h
|
|
||||||
ImplementationFile=ProgressDlg.cpp
|
|
||||||
BaseClass=CDialog
|
|
||||||
Filter=D
|
|
||||||
LastObject=IDC_EDIT1
|
|
||||||
VirtualFilter=dWC
|
|
||||||
|
|
||||||
[CLS:CAddLayerDlg]
|
|
||||||
Type=0
|
|
||||||
HeaderFile=AddLayerDlg.h
|
|
||||||
ImplementationFile=AddLayerDlg.cpp
|
|
||||||
BaseClass=CDialog
|
|
||||||
Filter=D
|
|
||||||
LastObject=CAddLayerDlg
|
|
||||||
VirtualFilter=dWC
|
|
||||||
|
|
||||||
[DLG:IDD_ADDLAYER]
|
|
||||||
Type=1
|
|
||||||
Class=CAddLayerDlg
|
|
||||||
ControlCount=3
|
|
||||||
Control1=IDOK,button,1342242817
|
|
||||||
Control2=IDCANCEL,button,1342242816
|
|
||||||
Control3=IDC_ADDLAYER_LIST,listbox,1352728833
|
|
||||||
|
|
||||||
[DLG:IDD_LAYERTILE_TOOLBAR]
|
|
||||||
Type=1
|
|
||||||
Class=CLayerTileToolbar
|
|
||||||
ControlCount=2
|
|
||||||
Control1=IDD_LAYERTILE_BTN_PAINT,button,1342177344
|
|
||||||
Control2=IDD_LAYERTILE_BTN_SELECT,button,1342177344
|
|
||||||
|
|
||||||
[CLS:CLayerTileToolbar]
|
|
||||||
Type=0
|
|
||||||
HeaderFile=LayerTileToolbar.h
|
|
||||||
ImplementationFile=LayerTileToolbar.cpp
|
|
||||||
BaseClass=CDialog
|
|
||||||
Filter=D
|
|
||||||
LastObject=CLayerTileToolbar
|
|
||||||
VirtualFilter=dWC
|
|
||||||
|
|
||||||
[DLG:IDD_LAYERSHADE_GUI]
|
|
||||||
Type=1
|
|
||||||
Class=CLayerShadeGUI
|
|
||||||
ControlCount=8
|
|
||||||
Control1=IDC_LAYERSHADE_TEXT0,static,1342308352
|
|
||||||
Control2=IDC_LAYERSHADE_EDITR0,edit,1350770688
|
|
||||||
Control3=IDC_LAYERSHADE_EDITG0,edit,1350770816
|
|
||||||
Control4=IDC_LAYERSHADE_EDITB0,edit,1350770816
|
|
||||||
Control5=IDC_LAYERSHADE_TEXT1,static,1342308352
|
|
||||||
Control6=IDC_LAYERSHADE_EDITR1,edit,1350639744
|
|
||||||
Control7=IDC_LAYERSHADE_EDITG1,edit,1350639744
|
|
||||||
Control8=IDC_LAYERSHADE_EDITB1,edit,1350639744
|
|
||||||
|
|
||||||
[CLS:CLayerShadeGUI]
|
|
||||||
Type=0
|
|
||||||
HeaderFile=LayerShadeGUI.h
|
|
||||||
ImplementationFile=LayerShadeGUI.cpp
|
|
||||||
BaseClass=CDialog
|
|
||||||
Filter=D
|
|
||||||
VirtualFilter=dWC
|
|
||||||
LastObject=CLayerShadeGUI
|
|
||||||
|
|
||||||
|
|
|
@ -42,12 +42,13 @@ CMapEditApp::CMapEditApp()
|
||||||
{
|
{
|
||||||
// TODO: add construction code here,
|
// TODO: add construction code here,
|
||||||
// Place all significant initialization in InitInstance
|
// Place all significant initialization in InitInstance
|
||||||
|
CurrentDoc=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// The one and only CMapEditApp object
|
// The one and only CMapEditApp object
|
||||||
|
|
||||||
CMapEditApp theApp;
|
CMapEditApp theApp;
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// CMapEditApp initialization
|
// CMapEditApp initialization
|
||||||
|
@ -105,10 +106,20 @@ BOOL CMapEditApp::InitInstance()
|
||||||
pMainFrame->ShowWindow(m_nCmdShow);
|
pMainFrame->ShowWindow(m_nCmdShow);
|
||||||
pMainFrame->UpdateWindow();
|
pMainFrame->UpdateWindow();
|
||||||
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
void CMapEditApp::SetCurrent(CMapEditDoc *Cur)
|
||||||
|
{
|
||||||
|
// prevent over initialisation
|
||||||
|
ASSERT(Cur);
|
||||||
|
if (CurrentDoc!=Cur)
|
||||||
|
{
|
||||||
|
CurrentDoc=Cur;
|
||||||
|
CurrentDoc->UpdateAll();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// CAboutDlg dialog used for App About
|
// CAboutDlg dialog used for App About
|
||||||
|
@ -164,5 +175,4 @@ void CMapEditApp::OnAppAbout()
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// CMapEditApp message handlers
|
|
||||||
|
|
||||||
|
|
|
@ -19,16 +19,13 @@
|
||||||
// See MapEdit.cpp for the implementation of this class
|
// See MapEdit.cpp for the implementation of this class
|
||||||
//
|
//
|
||||||
class CMapEditDoc;
|
class CMapEditDoc;
|
||||||
|
class CMapEditView;
|
||||||
class CMapEditApp : public CWinApp
|
class CMapEditApp : public CWinApp
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CMapEditApp();
|
CMapEditApp();
|
||||||
|
|
||||||
void SetCurrent(CMapEditDoc *Cur)
|
void SetCurrent(CMapEditDoc *Cur);
|
||||||
{
|
|
||||||
CurrentDoc=Cur;
|
|
||||||
}
|
|
||||||
|
|
||||||
CMapEditDoc *GetCurrent()
|
CMapEditDoc *GetCurrent()
|
||||||
{
|
{
|
||||||
return(CurrentDoc);
|
return(CurrentDoc);
|
||||||
|
@ -50,8 +47,7 @@ public:
|
||||||
DECLARE_MESSAGE_MAP()
|
DECLARE_MESSAGE_MAP()
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
CMapEditDoc *CurrentDoc;
|
||||||
CMapEditDoc *CurrentDoc;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,18 @@ BEGIN_MESSAGE_MAP(CMapEditDoc, CDocument)
|
||||||
ON_COMMAND(ID_EXPORT, OnExport)
|
ON_COMMAND(ID_EXPORT, OnExport)
|
||||||
ON_COMMAND(ID_ZOOM_IN, OnZoomIn)
|
ON_COMMAND(ID_ZOOM_IN, OnZoomIn)
|
||||||
ON_COMMAND(ID_ZOOM_OUT, OnZoomOut)
|
ON_COMMAND(ID_ZOOM_OUT, OnZoomOut)
|
||||||
|
ON_COMMAND(ID_TOGGLE_TILEVIEW, OnToggleTileview)
|
||||||
|
ON_COMMAND(ID_TOOLBAR_GRID, OnToggleGrid)
|
||||||
|
ON_COMMAND(ID_MIRRORX, OnMirrorx)
|
||||||
|
ON_COMMAND(ID_MIRRORY, OnMirrory)
|
||||||
|
ON_COMMAND(ID_ACTIVEBRUSH_LEFT, OnActivebrushLeft)
|
||||||
|
ON_COMMAND(ID_ACTIVEBRUSH_RIGHT, OnActivebrushRight)
|
||||||
|
ON_COMMAND(ID_MAP_SETSIZE, OnMapSetSize)
|
||||||
|
ON_COMMAND(ID_EDIT_COPY, OnEditCopy)
|
||||||
|
ON_COMMAND(ID_EDIT_PASTE, OnEditPaste)
|
||||||
|
ON_COMMAND(ID_TOOLBAR_TILEPALETTE, OnToggleTileview)
|
||||||
|
ON_COMMAND(ID_TOGGLE_GRID, OnToggleGrid)
|
||||||
|
ON_COMMAND(ID_2D_3D_TOGGLE, On2d3dToggle)
|
||||||
//}}AFX_MSG_MAP
|
//}}AFX_MSG_MAP
|
||||||
END_MESSAGE_MAP()
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
@ -55,6 +67,12 @@ BOOL CMapEditDoc::OnOpenDocument(LPCTSTR lpszPathName)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CMapEditDoc::OnCloseDocument()
|
||||||
|
{
|
||||||
|
Core.GUIRemoveAll();
|
||||||
|
CDocument::OnCloseDocument();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// CMapEditDoc serialization
|
// CMapEditDoc serialization
|
||||||
|
@ -91,7 +109,10 @@ void CMapEditDoc::Dump(CDumpContext& dc) const
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
void CMapEditDoc::SetView(CMapEditView *View)
|
void CMapEditDoc::SetView(CMapEditView *View)
|
||||||
{
|
{
|
||||||
|
//CMapEditView *LastView=Core.GetView();
|
||||||
Core.SetView(View);
|
Core.SetView(View);
|
||||||
|
// if (LastView!=View)
|
||||||
|
UpdateView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
|
@ -101,23 +122,20 @@ CMapEditView *CMapEditDoc::GetView()
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
void CMapEditDoc::UpdateView(CMapEditView *View)
|
void CMapEditDoc::UpdateView()
|
||||||
{
|
{
|
||||||
CView *V=(CView*)View;
|
Core.UpdateView();
|
||||||
V->Invalidate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
void CMapEditDoc::Render(CMapEditView *View)
|
void CMapEditDoc::Render()
|
||||||
{
|
{
|
||||||
// if (View)
|
Core.Render();
|
||||||
Core.Render(View);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
void CMapEditDoc::UpdateAll(CMapEditView *View)
|
void CMapEditDoc::UpdateAll()
|
||||||
{
|
{
|
||||||
// if (View)
|
|
||||||
Core.UpdateAll();
|
Core.UpdateAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,18 +150,6 @@ CString XYStr;
|
||||||
pCmdUI->SetText(XYStr);
|
pCmdUI->SetText(XYStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************************/
|
|
||||||
bool CMapEditDoc::Question(char *Txt)
|
|
||||||
{
|
|
||||||
CString Str;
|
|
||||||
Str.Format(Txt);
|
|
||||||
int Ret=AfxMessageBox(Str,MB_YESNO , MB_ICONQUESTION);
|
|
||||||
|
|
||||||
if (Ret==IDYES) return(true);
|
|
||||||
return(false);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
void CMapEditDoc::GUIUpdate()
|
void CMapEditDoc::GUIUpdate()
|
||||||
{
|
{
|
||||||
|
@ -155,7 +161,7 @@ void CMapEditDoc::GUIUpdate()
|
||||||
void CMapEditDoc::GUIChanged()
|
void CMapEditDoc::GUIChanged()
|
||||||
{
|
{
|
||||||
Core.GUIChanged();
|
Core.GUIChanged();
|
||||||
UpdateAllViews(NULL);
|
UpdateView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
|
@ -163,82 +169,32 @@ void CMapEditDoc::GUIChanged()
|
||||||
/*** Windows Message Handlers ****************************************************/
|
/*** Windows Message Handlers ****************************************************/
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
void CMapEditDoc::LButtonControl(CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag)
|
void CMapEditDoc::LButtonControl(UINT nFlags, CPoint &point,BOOL DownFlag) {Core.LButtonControl(nFlags,point,DownFlag);}
|
||||||
{
|
void CMapEditDoc::MButtonControl(UINT nFlags, CPoint &point,BOOL DownFlag) {Core.MButtonControl(nFlags,point,DownFlag);}
|
||||||
Core.LButtonControl(View,nFlags,point,DownFlag);
|
void CMapEditDoc::RButtonControl(UINT nFlags, CPoint &point,BOOL DownFlag) {Core.RButtonControl(nFlags,point,DownFlag);}
|
||||||
}
|
void CMapEditDoc::MouseWheel(UINT nFlags, short zDelta, CPoint &point) {Core.MouseWheel(nFlags,zDelta,point);}
|
||||||
|
void CMapEditDoc::MouseMove(UINT nFlags, CPoint &point) {Core.MouseMove(nFlags,point);}
|
||||||
|
|
||||||
|
void CMapEditDoc::OnToggleTileview() {Core.UpdateTileView(true); FocusView();}
|
||||||
|
void CMapEditDoc::OnToggleGrid() {Core.UpdateGrid(TRUE); FocusView();}
|
||||||
|
void CMapEditDoc::OnMirrorx() {Core.MirrorX(); FocusView();}
|
||||||
|
void CMapEditDoc::OnMirrory() {Core.MirrorY();FocusView();}
|
||||||
|
void CMapEditDoc::OnEditCopy() {Core.CopySelection(); FocusView();}
|
||||||
|
void CMapEditDoc::OnEditPaste() {Core.PasteSelection(); FocusView(); }
|
||||||
|
void CMapEditDoc::OnActivebrushLeft() {Core.ActiveBrushLeft();}
|
||||||
|
void CMapEditDoc::OnActivebrushRight() {Core.ActiveBrushRight();}
|
||||||
|
void CMapEditDoc::On2d3dToggle() {Core.Toggle2d3d();}
|
||||||
|
void CMapEditDoc::OnZoomIn() {Core.Zoom(-0.1f); UpdateView();}
|
||||||
|
void CMapEditDoc::OnZoomOut() {Core.Zoom(+0.1f); UpdateView();}
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
void CMapEditDoc::MButtonControl(CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag)
|
|
||||||
{
|
|
||||||
Core.MButtonControl(View,nFlags,point,DownFlag);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
void CMapEditDoc::RButtonControl(CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag)
|
|
||||||
{
|
|
||||||
Core.RButtonControl(View,nFlags,point,DownFlag);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************************************************************/
|
|
||||||
void CMapEditDoc::MouseWheel(CMapEditView *View,UINT nFlags, short zDelta, CPoint &point)
|
|
||||||
{
|
|
||||||
Core.MouseWheel(View,nFlags,zDelta,point);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************************************************************/
|
|
||||||
void CMapEditDoc::MouseMove(CMapEditView *View,UINT nFlags, CPoint &point)
|
|
||||||
{
|
|
||||||
Core.MouseMove(View,nFlags,point);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************************************************************/
|
|
||||||
void CMapEditDoc::ToggleTileView(CMapEditView *View)
|
|
||||||
{
|
|
||||||
Core.UpdateTileView(true);
|
|
||||||
Core.UpdateAll();
|
|
||||||
FocusView();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************************************************************/
|
|
||||||
void CMapEditDoc::ToggleGrid(CMapEditView *View)
|
|
||||||
{
|
|
||||||
Core.UpdateGrid(TRUE);
|
|
||||||
FocusView();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************************************************************/
|
|
||||||
void CMapEditDoc::MirrorX(CMapEditView *View)
|
|
||||||
{
|
|
||||||
Core.MirrorX();
|
|
||||||
FocusView();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************************************************************/
|
|
||||||
void CMapEditDoc::MirrorY(CMapEditView *View)
|
|
||||||
{
|
|
||||||
Core.MirrorY();
|
|
||||||
FocusView();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************************************************************/
|
|
||||||
void CMapEditDoc::CopySelection(CMapEditView *View)
|
|
||||||
{
|
|
||||||
Core.CopySelection();
|
|
||||||
FocusView();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************************************************************/
|
|
||||||
void CMapEditDoc::PasteSelection(CMapEditView *View)
|
|
||||||
{
|
|
||||||
Core.PasteSelection();
|
|
||||||
FocusView();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
void CMapEditDoc::SetMode(int NewMode)
|
void CMapEditDoc::SetMode(int NewMode)
|
||||||
{
|
{
|
||||||
Core.SetMode(NewMode);
|
Core.SetMode(NewMode);
|
||||||
|
Core.GUIUpdate();
|
||||||
FocusView();
|
FocusView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -292,7 +248,7 @@ CFileDialog Dlg(TRUE,"Gin",NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,GinFilter
|
||||||
char Filename[256];
|
char Filename[256];
|
||||||
sprintf(Filename,"%s",Dlg.GetPathName());
|
sprintf(Filename,"%s",Dlg.GetPathName());
|
||||||
Core.TileBankLoad(Filename);
|
Core.TileBankLoad(Filename);
|
||||||
UpdateAllViews(NULL);
|
UpdateView();
|
||||||
FocusView();
|
FocusView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -300,7 +256,7 @@ char Filename[256];
|
||||||
void CMapEditDoc::TileBankDelete()
|
void CMapEditDoc::TileBankDelete()
|
||||||
{
|
{
|
||||||
Core.TileBankDelete();
|
Core.TileBankDelete();
|
||||||
UpdateAllViews(NULL);
|
UpdateView();
|
||||||
FocusView();
|
FocusView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -308,31 +264,19 @@ void CMapEditDoc::TileBankDelete()
|
||||||
void CMapEditDoc::TileBankReload()
|
void CMapEditDoc::TileBankReload()
|
||||||
{
|
{
|
||||||
Core.TileBankReload();
|
Core.TileBankReload();
|
||||||
UpdateAllViews(NULL);
|
UpdateView();
|
||||||
FocusView();
|
FocusView();
|
||||||
}
|
}
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
void CMapEditDoc::TileBankSet()
|
void CMapEditDoc::TileBankSet()
|
||||||
{
|
{
|
||||||
Core.TileBankSet();
|
Core.TileBankSet();
|
||||||
UpdateAllViews(NULL);
|
UpdateView();
|
||||||
FocusView();
|
FocusView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
void CMapEditDoc::ActiveBrushLeft(CMapEditView *View)
|
void CMapEditDoc::OnMapSetSize()
|
||||||
{
|
|
||||||
Core.ActiveBrushLeft();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************************************************************/
|
|
||||||
void CMapEditDoc::ActiveBrushRight(CMapEditView *View)
|
|
||||||
{
|
|
||||||
Core.ActiveBrushRight();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************************************************************/
|
|
||||||
void CMapEditDoc::MapSetSize(CMapEditView *View)
|
|
||||||
{
|
{
|
||||||
CMapSizeDlg Dlg;
|
CMapSizeDlg Dlg;
|
||||||
|
|
||||||
|
@ -344,25 +288,6 @@ CMapSizeDlg Dlg;
|
||||||
Core.SetMapSize(Dlg.m_Width,Dlg.m_Height);
|
Core.SetMapSize(Dlg.m_Width,Dlg.m_Height);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************************/
|
|
||||||
void CMapEditDoc::OnZoomIn()
|
|
||||||
{
|
|
||||||
Core.Zoom(-0.1f);
|
|
||||||
UpdateAllViews(NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************************************************************/
|
|
||||||
void CMapEditDoc::OnZoomOut()
|
|
||||||
{
|
|
||||||
Core.Zoom(+0.1f);
|
|
||||||
UpdateAllViews(NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************************************************************/
|
|
||||||
void CMapEditDoc::Toggle2d3d(CMapEditView *View)
|
|
||||||
{
|
|
||||||
Core.Toggle2d3d();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
void CMapEditDoc::FocusView()
|
void CMapEditDoc::FocusView()
|
||||||
|
@ -370,4 +295,3 @@ void CMapEditDoc::FocusView()
|
||||||
theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o)
|
theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,20 +21,21 @@ protected: // create from serialization only
|
||||||
public:
|
public:
|
||||||
void SetView(CMapEditView *View);
|
void SetView(CMapEditView *View);
|
||||||
CMapEditView *GetView();
|
CMapEditView *GetView();
|
||||||
void UpdateView(CMapEditView *View);
|
void UpdateView();
|
||||||
void Render(CMapEditView *View);
|
void Render();
|
||||||
void UpdateAll(CMapEditView *View);
|
void UpdateAll();
|
||||||
void FocusView();
|
void FocusView();
|
||||||
bool Question(char *Txt);
|
|
||||||
void GUIUpdate();
|
void GUIUpdate();
|
||||||
void GUIChanged();
|
void GUIChanged();
|
||||||
|
|
||||||
// Windows Messages Thru Point
|
// Windows Messages Thru Point
|
||||||
void LButtonControl(CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag);
|
|
||||||
void MButtonControl(CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag);
|
void LButtonControl(UINT nFlags, CPoint &point,BOOL DownFlag);
|
||||||
void RButtonControl(CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag);
|
void MButtonControl(UINT nFlags, CPoint &point,BOOL DownFlag);
|
||||||
void MouseWheel(CMapEditView *View,UINT nFlags, short zDelta, CPoint &pt);
|
void RButtonControl(UINT nFlags, CPoint &point,BOOL DownFlag);
|
||||||
void MouseMove(CMapEditView *View,UINT nFlags, CPoint &point);
|
void MouseWheel(UINT nFlags, short zDelta, CPoint &pt);
|
||||||
|
void MouseMove(UINT nFlags, CPoint &point);
|
||||||
|
/*
|
||||||
void ToggleTileView(CMapEditView *View);
|
void ToggleTileView(CMapEditView *View);
|
||||||
void ToggleGrid(CMapEditView *View);
|
void ToggleGrid(CMapEditView *View);
|
||||||
void MirrorX(CMapEditView *View);
|
void MirrorX(CMapEditView *View);
|
||||||
|
@ -45,7 +46,7 @@ public:
|
||||||
void ActiveBrushRight(CMapEditView *View);
|
void ActiveBrushRight(CMapEditView *View);
|
||||||
void MapSetSize(CMapEditView *View);
|
void MapSetSize(CMapEditView *View);
|
||||||
void Toggle2d3d(CMapEditView *View);
|
void Toggle2d3d(CMapEditView *View);
|
||||||
|
*/
|
||||||
void TileBankLoad();
|
void TileBankLoad();
|
||||||
void TileBankDelete();
|
void TileBankDelete();
|
||||||
void TileBankReload();
|
void TileBankReload();
|
||||||
|
@ -66,6 +67,7 @@ public:
|
||||||
virtual BOOL OnNewDocument();
|
virtual BOOL OnNewDocument();
|
||||||
virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
|
virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
|
||||||
virtual void Serialize(CArchive& ar);
|
virtual void Serialize(CArchive& ar);
|
||||||
|
virtual void OnCloseDocument();
|
||||||
//}}AFX_VIRTUAL
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
|
@ -86,6 +88,16 @@ protected:
|
||||||
afx_msg void OnExport();
|
afx_msg void OnExport();
|
||||||
afx_msg void OnZoomIn();
|
afx_msg void OnZoomIn();
|
||||||
afx_msg void OnZoomOut();
|
afx_msg void OnZoomOut();
|
||||||
|
afx_msg void OnToggleTileview();
|
||||||
|
afx_msg void OnToggleGrid();
|
||||||
|
afx_msg void OnMirrorx();
|
||||||
|
afx_msg void OnMirrory();
|
||||||
|
afx_msg void OnActivebrushLeft();
|
||||||
|
afx_msg void OnActivebrushRight();
|
||||||
|
afx_msg void OnMapSetSize();
|
||||||
|
afx_msg void OnEditCopy();
|
||||||
|
afx_msg void OnEditPaste();
|
||||||
|
afx_msg void On2d3dToggle();
|
||||||
//}}AFX_MSG
|
//}}AFX_MSG
|
||||||
DECLARE_MESSAGE_MAP()
|
DECLARE_MESSAGE_MAP()
|
||||||
|
|
||||||
|
|
|
@ -33,18 +33,7 @@ BEGIN_MESSAGE_MAP(CMapEditView, CGLEnabledView)
|
||||||
ON_WM_RBUTTONDOWN()
|
ON_WM_RBUTTONDOWN()
|
||||||
ON_WM_RBUTTONUP()
|
ON_WM_RBUTTONUP()
|
||||||
ON_WM_MOUSEMOVE()
|
ON_WM_MOUSEMOVE()
|
||||||
ON_COMMAND(ID_TOGGLE_TILEVIEW, OnToggleTileview)
|
ON_WM_SETFOCUS()
|
||||||
ON_COMMAND(ID_TOOLBAR_GRID, OnToggleGrid)
|
|
||||||
ON_COMMAND(ID_MIRRORX, OnMirrorx)
|
|
||||||
ON_COMMAND(ID_MIRRORY, OnMirrory)
|
|
||||||
ON_COMMAND(ID_ACTIVEBRUSH_LEFT, OnActivebrushLeft)
|
|
||||||
ON_COMMAND(ID_ACTIVEBRUSH_RIGHT, OnActivebrushRight)
|
|
||||||
ON_COMMAND(ID_MAP_SETSIZE, OnMapSetSize)
|
|
||||||
ON_COMMAND(ID_2D_3D_TOGGLE, On2d3dToggle)
|
|
||||||
ON_COMMAND(ID_EDIT_COPY, OnEditCopy)
|
|
||||||
ON_COMMAND(ID_EDIT_PASTE, OnEditPaste)
|
|
||||||
ON_COMMAND(ID_TOOLBAR_TILEPALETTE, OnToggleTileview)
|
|
||||||
ON_COMMAND(ID_TOGGLE_GRID, OnToggleGrid)
|
|
||||||
//}}AFX_MSG_MAP
|
//}}AFX_MSG_MAP
|
||||||
END_MESSAGE_MAP()
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
@ -85,7 +74,7 @@ void CMapEditView::OnCreateGL()
|
||||||
|
|
||||||
void CMapEditView::OnDrawGL()
|
void CMapEditView::OnDrawGL()
|
||||||
{
|
{
|
||||||
GetDocument()->Render(this);
|
GetDocument()->Render();
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -101,7 +90,7 @@ void CMapEditView::OnSizeGL(int cx, int cy)
|
||||||
SetupPersMatrix();
|
SetupPersMatrix();
|
||||||
glMatrixMode(GL_MODELVIEW);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
GetDocument()->UpdateView(this);
|
GetDocument()->UpdateView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -136,39 +125,26 @@ CMapEditDoc* CMapEditView::GetDocument() // non-debug version is inline
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// CMapEditView message handlers
|
// CMapEditView message handlers
|
||||||
|
|
||||||
/*********************************************************************************/
|
void CMapEditView::OnLButtonDown(UINT nFlags, CPoint point) {GetDocument()->LButtonControl(nFlags,point,TRUE);}
|
||||||
/*********************************************************************************/
|
void CMapEditView::OnLButtonUp(UINT nFlags, CPoint point) {GetDocument()->LButtonControl(nFlags,point,FALSE);}
|
||||||
/*********************************************************************************/
|
void CMapEditView::OnMButtonDown(UINT nFlags, CPoint point) {GetDocument()->MButtonControl(nFlags,point,TRUE);}
|
||||||
void CMapEditView::OnLButtonDown(UINT nFlags, CPoint point) {GetDocument()->LButtonControl(this,nFlags,point,TRUE);}
|
void CMapEditView::OnMButtonUp(UINT nFlags, CPoint point) {GetDocument()->MButtonControl(nFlags,point,FALSE);}
|
||||||
void CMapEditView::OnLButtonUp(UINT nFlags, CPoint point) {GetDocument()->LButtonControl(this,nFlags,point,FALSE);}
|
BOOL CMapEditView::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt) {GetDocument()->MouseWheel(nFlags,zDelta,pt) ;return(0);}
|
||||||
void CMapEditView::OnMButtonDown(UINT nFlags, CPoint point) {GetDocument()->MButtonControl(this,nFlags,point,TRUE);}
|
void CMapEditView::OnRButtonDown(UINT nFlags, CPoint point) {GetDocument()->RButtonControl(nFlags,point,TRUE);}
|
||||||
void CMapEditView::OnMButtonUp(UINT nFlags, CPoint point) {GetDocument()->MButtonControl(this,nFlags,point,FALSE);}
|
void CMapEditView::OnRButtonUp(UINT nFlags, CPoint point) {GetDocument()->RButtonControl(nFlags,point,FALSE);}
|
||||||
BOOL CMapEditView::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt) {GetDocument()->MouseWheel(this,nFlags,zDelta,pt) ;return(0);}
|
void CMapEditView::OnMouseMove(UINT nFlags, CPoint point) {GetDocument()->MouseMove(nFlags, point);}
|
||||||
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::OnToggleTileview() {GetDocument()->ToggleTileView(this);}
|
|
||||||
void CMapEditView::OnToggleGrid() {GetDocument()->ToggleGrid(this);}
|
|
||||||
void CMapEditView::OnMirrorx() {GetDocument()->MirrorX(this);}
|
|
||||||
void CMapEditView::OnMirrory() {GetDocument()->MirrorY(this);}
|
|
||||||
void CMapEditView::OnEditCopy() {GetDocument()->CopySelection(this);}
|
|
||||||
void CMapEditView::OnEditPaste() {GetDocument()->PasteSelection(this);}
|
|
||||||
|
|
||||||
void CMapEditView::OnActivebrushLeft() {GetDocument()->ActiveBrushLeft(this);}
|
|
||||||
void CMapEditView::OnActivebrushRight() {GetDocument()->ActiveBrushRight(this);}
|
|
||||||
|
|
||||||
void CMapEditView::OnMapSetSize() {GetDocument()->MapSetSize(this);}
|
void CMapEditView::OnSetFocus(CWnd* pOldWnd)
|
||||||
|
|
||||||
void CMapEditView::On2d3dToggle() {GetDocument()->Toggle2d3d(this);}
|
|
||||||
|
|
||||||
void CMapEditView::OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView)
|
|
||||||
{
|
{
|
||||||
CGLEnabledView::OnActivateView(bActivate, pActivateView, pDeactiveView);
|
CGLEnabledView::OnSetFocus(pOldWnd);
|
||||||
if (bActivate)
|
theApp.SetCurrent(GetDocument());
|
||||||
{
|
|
||||||
CMapEditDoc *CurDoc=GetDocument();
|
|
||||||
theApp.SetCurrent(CurDoc);
|
|
||||||
CurDoc->SetView(this);
|
|
||||||
CurDoc->UpdateAll(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CMapEditView::OnInitialUpdate()
|
||||||
|
{
|
||||||
|
CGLEnabledView::OnInitialUpdate();
|
||||||
|
GetDocument()->SetView(this);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,8 +30,8 @@ public:
|
||||||
// Overrides
|
// Overrides
|
||||||
// ClassWizard generated virtual function overrides
|
// ClassWizard generated virtual function overrides
|
||||||
//{{AFX_VIRTUAL(CMapEditView)
|
//{{AFX_VIRTUAL(CMapEditView)
|
||||||
protected:
|
public:
|
||||||
virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);
|
virtual void OnInitialUpdate();
|
||||||
//}}AFX_VIRTUAL
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
|
@ -56,16 +56,7 @@ protected:
|
||||||
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
|
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
|
||||||
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
|
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
|
||||||
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
||||||
afx_msg void OnToggleTileview();
|
afx_msg void OnSetFocus(CWnd* pOldWnd);
|
||||||
afx_msg void OnToggleGrid();
|
|
||||||
afx_msg void OnMirrorx();
|
|
||||||
afx_msg void OnMirrory();
|
|
||||||
afx_msg void OnActivebrushLeft();
|
|
||||||
afx_msg void OnActivebrushRight();
|
|
||||||
afx_msg void OnMapSetSize();
|
|
||||||
afx_msg void On2d3dToggle();
|
|
||||||
afx_msg void OnEditCopy();
|
|
||||||
afx_msg void OnEditPaste();
|
|
||||||
//}}AFX_MSG
|
//}}AFX_MSG
|
||||||
DECLARE_MESSAGE_MAP()
|
DECLARE_MESSAGE_MAP()
|
||||||
};
|
};
|
||||||
|
|
|
@ -95,6 +95,7 @@ char FixPath[1024];
|
||||||
FilePath=RootPath.Drive();
|
FilePath=RootPath.Drive();
|
||||||
FilePath+=RootPath.Dir();
|
FilePath+=RootPath.Dir();
|
||||||
FilePath.Append('\\');
|
FilePath.Append('\\');
|
||||||
|
FilePath.Upper();
|
||||||
|
|
||||||
File->Read(&ListSize,sizeof(int));
|
File->Read(&ListSize,sizeof(int));
|
||||||
File->Read(&CurrentSet,sizeof(int));
|
File->Read(&CurrentSet,sizeof(int));
|
||||||
|
@ -110,7 +111,7 @@ char FixPath[1024];
|
||||||
for (int i=0;i<ListSize;i++)
|
for (int i=0;i<ListSize;i++)
|
||||||
{
|
{
|
||||||
char c=1;
|
char c=1;
|
||||||
GString FullName=FilePath;
|
GString FullName;//=FilePath;
|
||||||
|
|
||||||
while (c)
|
while (c)
|
||||||
{
|
{
|
||||||
|
@ -118,10 +119,17 @@ char FixPath[1024];
|
||||||
FullName.Append(c);
|
FullName.Append(c);
|
||||||
}
|
}
|
||||||
FullName.Upper();
|
FullName.Upper();
|
||||||
|
GFName::makeabsolute(FilePath,FullName,FixPath);
|
||||||
|
FullName=FixPath;
|
||||||
_fullpath( FixPath, FullName, 1024);
|
_fullpath( FixPath, FullName, 1024);
|
||||||
|
for (int z=0; z<strlen(FixPath); z++)
|
||||||
|
{// Invalidate any long name short cackness
|
||||||
|
if (FixPath[z]=='~') FixPath[z]='_';
|
||||||
|
}
|
||||||
FullName=FixPath;
|
FullName=FixPath;
|
||||||
|
|
||||||
CheckFilename(FullName);
|
CheckFilename(FullName);
|
||||||
|
FullName.Upper();
|
||||||
AddTileSet(FullName);
|
AddTileSet(FullName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -243,11 +251,11 @@ void CTileBank::RenderSet(CCore *Core,Vector3 &CamPos,BOOL Is3d)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CTileBank::FindCursorPos(CCore *Core,CMapEditView *View,Vector3 &CamPos,CPoint &MousePos)
|
void CTileBank::FindCursorPos(CCore *Core,Vector3 &CamPos,CPoint &MousePos)
|
||||||
{
|
{
|
||||||
if (!TileSet.size()) return; // No tiles, return
|
if (!TileSet.size()) return; // No tiles, return
|
||||||
|
|
||||||
CursorPos=TileSet[CurrentSet].FindCursorPos(Core,View,CamPos,MousePos);
|
CursorPos=TileSet[CurrentSet].FindCursorPos(Core,CamPos,MousePos);
|
||||||
SelEnd=CursorPos;
|
SelEnd=CursorPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -256,7 +264,13 @@ void CTileBank::FindCursorPos(CCore *Core,CMapEditView *View,Vector3 &CamPos,CPo
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CTileBank::GUIInit(CCore *Core)
|
void CTileBank::GUIInit(CCore *Core)
|
||||||
{
|
{
|
||||||
Core->GUIAdd(TileBankGUI,IDD_LAYERTILE_GUI);
|
Core->GUIAdd(TileBankGUI,IDD_LAYERTILE_GUI);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
void CTileBank::GUIKill(CCore *Core)
|
||||||
|
{
|
||||||
|
Core->GUIRemove(TileBankGUI,IDD_LAYERTILE_GUI);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -695,7 +709,7 @@ float Scale=CamPos.z/(float)TileBrowserWidth/2.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
int CTileSet::FindCursorPos(CCore *Core,CMapEditView *View,Vector3 &CamPos,CPoint &MousePos)
|
int CTileSet::FindCursorPos(CCore *Core,Vector3 &CamPos,CPoint &MousePos)
|
||||||
{
|
{
|
||||||
int ListSize=Tile.size();
|
int ListSize=Tile.size();
|
||||||
GLint Viewport[4];
|
GLint Viewport[4];
|
||||||
|
@ -716,7 +730,7 @@ float Scale=CamPos.z/(float)TileBrowserWidth/2.0;
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
gluPickMatrix( MousePos.x ,(Viewport[3]-MousePos.y),5.0,5.0,Viewport);
|
gluPickMatrix( MousePos.x ,(Viewport[3]-MousePos.y),5.0,5.0,Viewport);
|
||||||
View->SetupPersMatrix();
|
Core->GetView()->SetupPersMatrix();
|
||||||
|
|
||||||
glMatrixMode(GL_MODELVIEW);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
|
|
|
@ -60,10 +60,11 @@ public:
|
||||||
CMap &GetActiveBrush() {return(GetBrush(ActiveBrush));}
|
CMap &GetActiveBrush() {return(GetBrush(ActiveBrush));}
|
||||||
|
|
||||||
void RenderSet(CCore *Core,Vector3 &CamPos,BOOL Is3d);
|
void RenderSet(CCore *Core,Vector3 &CamPos,BOOL Is3d);
|
||||||
void FindCursorPos(CCore *Core,CMapEditView *View,Vector3 &CamPos,CPoint &MousePos);
|
void FindCursorPos(CCore *Core,Vector3 &CamPos,CPoint &MousePos);
|
||||||
void RenderCursor(CCore *Core,Vector3 &CamPos,BOOL Is3d);
|
void RenderCursor(CCore *Core,Vector3 &CamPos,BOOL Is3d);
|
||||||
|
|
||||||
void GUIInit(CCore *Core);
|
void GUIInit(CCore *Core);
|
||||||
|
void GUIKill(CCore *Core);
|
||||||
void GUIUpdate(CCore *Core);
|
void GUIUpdate(CCore *Core);
|
||||||
|
|
||||||
BOOL IsTileValid(int Set,int Tile);
|
BOOL IsTileValid(int Set,int Tile);
|
||||||
|
@ -120,7 +121,7 @@ const char *GetName() {return(Name);}
|
||||||
|
|
||||||
CTile &GetTile(int No) {return(Tile[No]);}
|
CTile &GetTile(int No) {return(Tile[No]);}
|
||||||
void Purge();
|
void Purge();
|
||||||
int FindCursorPos(CCore *Core,CMapEditView *View,Vector3 &CamPos,CPoint &MousePos);
|
int FindCursorPos(CCore *Core,Vector3 &CamPos,CPoint &MousePos);
|
||||||
void Render(CCore *Core,Vector3 &CamPos,CMap &LBrush,CMap &RBrush,BOOL Render3d);
|
void Render(CCore *Core,Vector3 &CamPos,CMap &LBrush,CMap &RBrush,BOOL Render3d);
|
||||||
void RenderCursor(Vector3 &CamPos,int Pos,int Width, int Height);
|
void RenderCursor(Vector3 &CamPos,int Pos,int Width, int Height);
|
||||||
void RenderBrush(Vector3 &CamPos,CMap &LBrush,CMap &RBrush);
|
void RenderBrush(Vector3 &CamPos,CMap &LBrush,CMap &RBrush);
|
||||||
|
|
|
@ -255,6 +255,7 @@ char Name[_MAX_FNAME];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************************/
|
/**************************************************************************************/
|
||||||
|
/***
|
||||||
void MakeFullFilename(const char* In,GString &Out)
|
void MakeFullFilename(const char* In,GString &Out)
|
||||||
{
|
{
|
||||||
GFName FName=theApp.GetCurrent()->GetPathName();
|
GFName FName=theApp.GetCurrent()->GetPathName();
|
||||||
|
@ -267,15 +268,16 @@ GString Path;
|
||||||
Out=Path;
|
Out=Path;
|
||||||
Out+=In;
|
Out+=In;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
/**************************************************************************************/
|
/**************************************************************************************/
|
||||||
|
/*!!!
|
||||||
void MakePathRel2App(const char* In,char *Out)
|
void MakePathRel2App(const char* In,char *Out)
|
||||||
{
|
{
|
||||||
GString RootPath=theApp.GetCurrent()->GetPathName();
|
GString RootPath=theApp.GetCurrent()->GetPathName();
|
||||||
|
|
||||||
GFName::makerelative(RootPath,In,Out);
|
GFName::makerelative(RootPath,In,Out);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
/**************************************************************************************/
|
/**************************************************************************************/
|
||||||
GString GetWorkingPath()
|
GString GetWorkingPath()
|
||||||
{
|
{
|
||||||
|
@ -320,3 +322,5 @@ CFileDialog Dlg(true,NULL,Name,OFN_HIDEREADONLY | OFN_PATHMUSTEXIST,Filter);
|
||||||
Filename=Dlg.GetPathName();
|
Filename=Dlg.GetPathName();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
|
@ -32,6 +32,7 @@ typedef u32 U32;
|
||||||
|
|
||||||
/**************************************************************************************/
|
/**************************************************************************************/
|
||||||
class GString;
|
class GString;
|
||||||
|
class CMapEditDoc;
|
||||||
void DbgMsg(const char * pszFmt,...);
|
void DbgMsg(const char * pszFmt,...);
|
||||||
|
|
||||||
void BuildGLBox(float XMin,float XMax,float YMin,float YMax,float ZMin,float ZMax);
|
void BuildGLBox(float XMin,float XMax,float YMin,float YMax,float ZMin,float ZMax);
|
||||||
|
@ -53,4 +54,5 @@ void MakePathRel2App(const char* In,char *Out);
|
||||||
GString GetWorkingPath();
|
GString GetWorkingPath();
|
||||||
void CheckFilename(GString &Filename);
|
void CheckFilename(GString &Filename);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
Loading…
Add table
Add a link
Reference in a new issue