This commit is contained in:
parent
425713a3aa
commit
c1309c1c96
44 changed files with 2193 additions and 1452 deletions
|
@ -14,18 +14,18 @@
|
||||||
#include "MapEditView.h"
|
#include "MapEditView.h"
|
||||||
#include "MainFrm.h"
|
#include "MainFrm.h"
|
||||||
|
|
||||||
#include "NewMapGUI.h"
|
|
||||||
#include "AddLayerDlg.h"
|
|
||||||
|
|
||||||
#include "Core.h"
|
#include "Core.h"
|
||||||
#include "Layer.h"
|
#include "Layer.h"
|
||||||
#include "LayerTile.h"
|
#include "LayerTile.h"
|
||||||
#include "LayerCollision.h"
|
#include "LayerCollision.h"
|
||||||
#include "LayerShade.h"
|
#include "LayerShade.h"
|
||||||
|
#include "LayerItem.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
#include "Export.h"
|
#include "Export.h"
|
||||||
#include "LayerList.h"
|
#include "GUILayerList.h"
|
||||||
|
#include "GUIAddLayer.h"
|
||||||
|
#include "GUINewMap.h"
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -54,7 +54,7 @@ int ListSize=Layer.size();
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
bool CCore::New()
|
bool CCore::New()
|
||||||
{
|
{
|
||||||
CNewMapGUI Dlg;
|
CGUINewMap Dlg;
|
||||||
int Width,Height;
|
int Width,Height;
|
||||||
Dlg.m_Width=TileLayerMinWidth;
|
Dlg.m_Width=TileLayerMinWidth;
|
||||||
Dlg.m_Height=TileLayerMinHeight;
|
Dlg.m_Height=TileLayerMinHeight;
|
||||||
|
@ -67,7 +67,7 @@ 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_ITEM,LAYER_SUBTYPE_NONE, Width, Height);
|
||||||
|
|
||||||
for (int i=0; i<Layer.size(); i++)
|
for (int i=0; i<Layer.size(); i++)
|
||||||
{
|
{
|
||||||
|
@ -133,6 +133,9 @@ int LayerCount;
|
||||||
case LAYER_TYPE_SHADE:
|
case LAYER_TYPE_SHADE:
|
||||||
AddLayer(new CLayerShade(File,Version));
|
AddLayer(new CLayerShade(File,Version));
|
||||||
break;
|
break;
|
||||||
|
case LAYER_TYPE_ITEM:
|
||||||
|
AddLayer(new CLayerItem(File,Version));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(!"poos");
|
ASSERT(!"poos");
|
||||||
}
|
}
|
||||||
|
@ -412,8 +415,8 @@ bool RedrawFlag=false;
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CCore::UpdateParamBar()
|
void CCore::UpdateParamBar()
|
||||||
{
|
{
|
||||||
CMainFrame *Frm=(CMainFrame*)AfxGetMainWnd();
|
CMainFrame *Frm=(CMainFrame*)AfxGetMainWnd();
|
||||||
CMultiBar *ParamBar=Frm->GetParamBar();
|
CGUIMultiBar *ParamBar=Frm->GetParamBar();
|
||||||
|
|
||||||
GUIRemoveAll();
|
GUIRemoveAll();
|
||||||
GUIAdd(LayerList,IDD_LAYER_LIST_DIALOG);
|
GUIAdd(LayerList,IDD_LAYER_LIST_DIALOG);
|
||||||
|
@ -426,20 +429,20 @@ void CCore::UpdateLayerGUI()
|
||||||
{
|
{
|
||||||
int ListSize=Layer.size();
|
int ListSize=Layer.size();
|
||||||
|
|
||||||
if (LayerList.ListBox)
|
if (LayerList.m_List)
|
||||||
{
|
{
|
||||||
LayerList.ListBox.ResetContent();
|
LayerList.m_List.ResetContent();
|
||||||
|
|
||||||
for (int i=0; i<ListSize; i++)
|
for (int i=0; i<ListSize; i++)
|
||||||
{
|
{
|
||||||
LayerList.ListBox.AddString(Layer[i]->GetName());
|
LayerList.m_List.AddString(Layer[i]->GetName());
|
||||||
}
|
}
|
||||||
// Now sets checks (silly MSoft bug!!)
|
// Now sets checks (silly MSoft bug!!)
|
||||||
for (i=0; i<ListSize; i++)
|
for (i=0; i<ListSize; i++)
|
||||||
{
|
{
|
||||||
LayerList.ListBox.SetCheck(i,Layer[i]->IsVisible());
|
LayerList.m_List.SetCheck(i,Layer[i]->IsVisible());
|
||||||
}
|
}
|
||||||
LayerList.ListBox.SetCurSel(ActiveLayer);
|
LayerList.m_List.SetCurSel(ActiveLayer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -452,10 +455,10 @@ 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
|
||||||
if ((int)LayerList.ListBox.GetCheck(NewLayer)!=(int)Layer[NewLayer]->IsVisible())
|
if ((int)LayerList.m_List.GetCheck(NewLayer)!=(int)Layer[NewLayer]->IsVisible())
|
||||||
{
|
{
|
||||||
Layer[NewLayer]->SetVisible(LayerList.ListBox.GetCheck(NewLayer)!=0);
|
Layer[NewLayer]->SetVisible(LayerList.m_List.GetCheck(NewLayer)!=0);
|
||||||
LayerList.ListBox.SetCurSel(ActiveLayer);
|
LayerList.m_List.SetCurSel(ActiveLayer);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -509,6 +512,9 @@ int Idx;
|
||||||
case LAYER_TYPE_SHADE:
|
case LAYER_TYPE_SHADE:
|
||||||
Idx=AddLayer(new CLayerShade(SubType, Width,Height));
|
Idx=AddLayer(new CLayerShade(SubType, Width,Height));
|
||||||
break;
|
break;
|
||||||
|
case LAYER_TYPE_ITEM:
|
||||||
|
Idx=AddLayer(new CLayerItem(SubType, Width,Height));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(!"AddLayer - Invalid Layer Type");
|
ASSERT(!"AddLayer - Invalid Layer Type");
|
||||||
break;
|
break;
|
||||||
|
@ -521,7 +527,7 @@ int Idx;
|
||||||
void CCore::AddLayer(int CurrentLayer)
|
void CCore::AddLayer(int CurrentLayer)
|
||||||
{
|
{
|
||||||
std::vector<int> List;
|
std::vector<int> List;
|
||||||
CAddLayerDlg Dlg;
|
CGUIAddLayer Dlg;
|
||||||
int NewLayerId=0;
|
int NewLayerId=0;
|
||||||
int Sel;
|
int Sel;
|
||||||
|
|
||||||
|
@ -669,8 +675,8 @@ 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*)AfxGetMainWnd();
|
CMainFrame *Frm=(CMainFrame*)AfxGetMainWnd();
|
||||||
CMultiBar *ParamBar=Frm->GetParamBar();
|
CGUIMultiBar *ParamBar=Frm->GetParamBar();
|
||||||
|
|
||||||
ParamBar->Add(Dlg,ID,Visible,Lock);
|
ParamBar->Add(Dlg,ID,Visible,Lock);
|
||||||
}
|
}
|
||||||
|
@ -678,8 +684,8 @@ 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*)AfxGetMainWnd();
|
CMainFrame *Frm=(CMainFrame*)AfxGetMainWnd();
|
||||||
CMultiBar *ParamBar=Frm->GetParamBar();
|
CGUIMultiBar *ParamBar=Frm->GetParamBar();
|
||||||
|
|
||||||
ParamBar->Remove(Dlg,Force);
|
ParamBar->Remove(Dlg,Force);
|
||||||
}
|
}
|
||||||
|
@ -687,8 +693,8 @@ CMultiBar *ParamBar=Frm->GetParamBar();
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CCore::GUIRemoveAll(bool Force)
|
void CCore::GUIRemoveAll(bool Force)
|
||||||
{
|
{
|
||||||
CMainFrame *Frm=(CMainFrame*)AfxGetMainWnd();
|
CMainFrame *Frm=(CMainFrame*)AfxGetMainWnd();
|
||||||
CMultiBar *ParamBar=Frm->GetParamBar();
|
CGUIMultiBar *ParamBar=Frm->GetParamBar();
|
||||||
|
|
||||||
ParamBar->RemoveAll(Force);
|
ParamBar->RemoveAll(Force);
|
||||||
}
|
}
|
||||||
|
@ -696,8 +702,8 @@ CMultiBar *ParamBar=Frm->GetParamBar();
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CCore::GUIUpdate()
|
void CCore::GUIUpdate()
|
||||||
{
|
{
|
||||||
CMainFrame *Frm=(CMainFrame*)AfxGetMainWnd();
|
CMainFrame *Frm=(CMainFrame*)AfxGetMainWnd();
|
||||||
CMultiBar *ParamBar=Frm->GetParamBar();
|
CGUIMultiBar *ParamBar=Frm->GetParamBar();
|
||||||
|
|
||||||
UpdateLayerGUI();
|
UpdateLayerGUI();
|
||||||
CurrentLayer->GUIUpdate(this);
|
CurrentLayer->GUIUpdate(this);
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
#include "TileSet.h"
|
#include "TileSet.h"
|
||||||
|
|
||||||
#include "MapEdit.h"
|
#include "MapEdit.h"
|
||||||
#include "LayerList.h"
|
#include "GUILayerList.h"
|
||||||
#include "LayerTileGUI.h"
|
#include "GUITileBank.h"
|
||||||
|
|
||||||
#include "Layer.h"
|
#include "Layer.h"
|
||||||
#include "LayerTile.h"
|
#include "LayerTile.h"
|
||||||
|
@ -128,10 +128,9 @@ private:
|
||||||
CLayerTile *ActionLayer;
|
CLayerTile *ActionLayer;
|
||||||
int ActiveLayer;
|
int ActiveLayer;
|
||||||
|
|
||||||
// CTileBank TileBank;
|
|
||||||
CTexCache TexCache;
|
CTexCache TexCache;
|
||||||
|
|
||||||
CLayerListGUI LayerList;
|
CGUILayerList LayerList;
|
||||||
|
|
||||||
bool SpareFlag;
|
bool SpareFlag;
|
||||||
bool GridFlag;
|
bool GridFlag;
|
||||||
|
|
|
@ -308,12 +308,14 @@ int ColFlags=Flags >> PC_TILE_FLAG_COLLISION_SHIFT;
|
||||||
{
|
{
|
||||||
switch (ColFlags)
|
switch (ColFlags)
|
||||||
{
|
{
|
||||||
case PC_TILE_COLLISION_NORMAL: glColor4f(1,1,1,0.5); break;
|
case PC_TILE_COLLISION_NORMAL: glColor4f(1.0f,1.0f,1.0f,0.5); break;
|
||||||
case PC_TILE_COLLISION_DAMAGE: glColor4f(1,0,0,0.5); break;
|
case PC_TILE_COLLISION_DAMAGE: glColor4f(1.0f,0.0f,0.0f,0.5); break;
|
||||||
case PC_TILE_COLLISION_SLIPPERY: glColor4f(0,1,0,0.5); break;
|
case PC_TILE_COLLISION_SLIPPERY: glColor4f(0.0f,1.0f,0.0f,0.5); break;
|
||||||
case PC_TILE_COLLISION_ELECTRIC: glColor4f(1,0,1,0.5); break;
|
case PC_TILE_COLLISION_ELECTRIC: glColor4f(1.0f,0.0f,1.0f,0.5); break;
|
||||||
case PC_TILE_COLLISION_STICKY: glColor4f(1,1,0,0.5); break;
|
case PC_TILE_COLLISION_STICKY: glColor4f(1.0f,1.0f,0.0f,0.5); break;
|
||||||
case PC_TILE_COLLISION_WATER: glColor4f(0,0,1,0.5); break;
|
case PC_TILE_COLLISION_WATER: glColor4f(0.0f,0.0f,1.0f,0.5); break;
|
||||||
|
case PC_TILE_COLLISION_SOLID: glColor4f(0.0f,1.0f,1.0f,0.5); break;
|
||||||
|
case PC_TILE_COLLISION_DEATH: glColor4f(1.0f,0.5f,0.5f,0.5); break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#include "MapEditDoc.h"
|
#include "MapEditDoc.h"
|
||||||
#include "MapEditView.h"
|
#include "MapEditView.h"
|
||||||
#include "MainFrm.h"
|
#include "MainFrm.h"
|
||||||
#include "LayerTileGui.h"
|
#include "GUITileBank.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
const float ElemBrowserGap=0.2f;
|
const float ElemBrowserGap=0.2f;
|
||||||
|
@ -33,12 +33,7 @@ const float ElemBrowserY1=1+ElemBrowserGap/2;
|
||||||
CElemStore::CElemStore()
|
CElemStore::CElemStore()
|
||||||
{
|
{
|
||||||
LoadFlag=false;
|
LoadFlag=false;
|
||||||
CurrentSet=0; LastSet=0;
|
CurrentSet=0;
|
||||||
for (int i=0; i<MaxBrush; i++) Brush[i].Delete();
|
|
||||||
LastCursorPos=CursorPos=-1;
|
|
||||||
ActiveBrush=0;
|
|
||||||
SelStart=-1;
|
|
||||||
SelEnd=-1;
|
|
||||||
VisibleFlag=true;
|
VisibleFlag=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,67 +45,9 @@ CElemStore::~CElemStore()
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CElemStore::Load(CFile *File,int Version)
|
void CElemStore::Load(CFile *File,int Version)
|
||||||
{
|
{
|
||||||
if (Version<FileVersion)
|
|
||||||
{
|
|
||||||
int ListSize;
|
|
||||||
GFName RootPath=File->GetFilePath();
|
|
||||||
GString FilePath;
|
|
||||||
char FixPath[1024];
|
|
||||||
|
|
||||||
FilePath=RootPath.Drive();
|
|
||||||
FilePath+=RootPath.Dir();
|
|
||||||
FilePath.Append('\\');
|
|
||||||
FilePath.Upper();
|
|
||||||
|
|
||||||
File->Read(&ListSize,sizeof(int));
|
|
||||||
File->Read(&CurrentSet,sizeof(int));
|
|
||||||
File->Read(&ActiveBrush,sizeof(int));
|
|
||||||
Brush[0].Load(File,Version);
|
|
||||||
Brush[1].Load(File,Version);
|
|
||||||
if (Version<2)
|
|
||||||
{
|
|
||||||
CurrentSet++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// New Style rel storage
|
|
||||||
for (int i=0;i<ListSize;i++)
|
|
||||||
{
|
|
||||||
char c=1;
|
|
||||||
GString FullName;
|
|
||||||
|
|
||||||
while (c)
|
|
||||||
{
|
|
||||||
File->Read(&c,1);
|
|
||||||
FullName.Append(c);
|
|
||||||
}
|
|
||||||
FullName.Upper();
|
|
||||||
GFName::makeabsolute(FilePath,FullName,FixPath);
|
|
||||||
FullName=FixPath;
|
|
||||||
_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;
|
|
||||||
|
|
||||||
CheckFilename(FullName);
|
|
||||||
FullName.Upper();
|
|
||||||
AddSet(FullName);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
File->Read(&LayerCam,sizeof(Vector3));
|
File->Read(&LayerCam,sizeof(Vector3));
|
||||||
File->Read(&CurrentSet,sizeof(int));
|
File->Read(&CurrentSet,sizeof(int));
|
||||||
File->Read(&ActiveBrush,sizeof(int));
|
// CElemBank::Load(File,Version);
|
||||||
Brush[0].Load(File,Version);
|
|
||||||
Brush[1].Load(File,Version);
|
|
||||||
|
|
||||||
CElemBank::Load(File,Version);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -128,11 +65,7 @@ GString SavePath;
|
||||||
|
|
||||||
File->Write(&LayerCam,sizeof(Vector3));
|
File->Write(&LayerCam,sizeof(Vector3));
|
||||||
File->Write(&CurrentSet,sizeof(int));
|
File->Write(&CurrentSet,sizeof(int));
|
||||||
File->Write(&ActiveBrush,sizeof(int));
|
// CElemBank::Save(File);
|
||||||
Brush[0].Save(File);
|
|
||||||
Brush[1].Save(File);
|
|
||||||
|
|
||||||
CElemBank::Save(File);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -148,38 +81,10 @@ void CElemStore::RenderElem(int Set,int Elem,int Flags,bool Is3d)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/*****************************************************************************/
|
|
||||||
void CElemStore::DeleteCurrent()
|
|
||||||
{
|
|
||||||
int ListSize=GetSetCount();
|
|
||||||
// Remap Brushes
|
|
||||||
for (int i=0; i<MaxBrush; i++)
|
|
||||||
{
|
|
||||||
Brush[i].RemoveSet(CurrentSet);
|
|
||||||
}
|
|
||||||
for (int Set=CurrentSet; Set<ListSize; Set++)
|
|
||||||
{
|
|
||||||
for (int i=0; i<MaxBrush; i++)
|
|
||||||
{
|
|
||||||
Brush[i].RemapSet(Set,Set);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
SetList.erase(CurrentSet);
|
|
||||||
if (CurrentSet) CurrentSet--;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
CPoint CElemStore::GetElemPos(int ID,int Width)
|
|
||||||
{
|
|
||||||
if (ID==0)
|
|
||||||
return(CPoint(-1,-1));
|
|
||||||
else
|
|
||||||
return(IDToPoint(ID-1,Width));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CElemStore::Render(CCore *Core,Vector3 &CamPos,bool Is3d)
|
void CElemStore::Render(CCore *Core,Vector3 &CamPos,bool Is3d)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
if (!GetSetCount()) return;
|
if (!GetSetCount()) return;
|
||||||
CElemSet &ThisSet=SetList[CurrentSet];
|
CElemSet &ThisSet=SetList[CurrentSet];
|
||||||
int ListSize=ThisSet.GetCount();
|
int ListSize=ThisSet.GetCount();
|
||||||
|
@ -240,12 +145,13 @@ float Scale=CamPos.z/(float)BrowserWidth/2.0;
|
||||||
ElemID++;
|
ElemID++;
|
||||||
}
|
}
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CElemStore::RenderCursor(CCore *Core,Vector3 &CamPos,bool Is3d)
|
void CElemStore::RenderCursor(CCore *Core,Vector3 &CamPos,bool Is3d)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
if (!GetSetCount()) return;
|
if (!GetSetCount()) return;
|
||||||
CElemSet &ThisSet=SetList[CurrentSet];
|
CElemSet &ThisSet=SetList[CurrentSet];
|
||||||
int ListSize=ThisSet.GetCount();
|
int ListSize=ThisSet.GetCount();
|
||||||
|
@ -297,146 +203,34 @@ float Scale=CamPos.z/(float)BrowserWidth/2.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
void CElemStore::RenderGrid(CCore *Core,Vector3 &CamPos,bool Active)
|
|
||||||
{
|
|
||||||
if (!GetSetCount()) return;
|
|
||||||
CElemSet &ThisSet=SetList[CurrentSet];
|
|
||||||
int ListSize=ThisSet.GetCount();
|
|
||||||
int BrowserWidth=ThisSet.GetBrowserWidth();
|
|
||||||
int ElemID=1; // Dont bother with blank, its sorted
|
|
||||||
float Scale=CamPos.z/(float)BrowserWidth/2.0;
|
|
||||||
|
|
||||||
if (!ListSize) return;
|
|
||||||
glMatrixMode(GL_MODELVIEW);
|
|
||||||
glPushMatrix();
|
|
||||||
|
|
||||||
while(ElemID!=ListSize)
|
|
||||||
{
|
|
||||||
CPoint Pos=GetElemPos(ElemID,BrowserWidth);
|
|
||||||
float XPos=(float)Pos.x*(1+ElemBrowserGap);
|
|
||||||
float YPos=(float)Pos.y*(1+ElemBrowserGap);
|
|
||||||
|
|
||||||
glLoadIdentity();
|
|
||||||
glScalef(Scale,Scale,Scale);
|
|
||||||
glTranslatef(-CamPos.x+XPos,CamPos.y-YPos,0);
|
|
||||||
|
|
||||||
glBegin(GL_LINES);
|
|
||||||
glColor3f(1,1,1);
|
|
||||||
|
|
||||||
glVertex3f( ElemBrowserX0,ElemBrowserY0,0);
|
|
||||||
glVertex3f( ElemBrowserX1,ElemBrowserY0,0);
|
|
||||||
|
|
||||||
glVertex3f( ElemBrowserX0,ElemBrowserY1,0);
|
|
||||||
glVertex3f( ElemBrowserX1,ElemBrowserY1,0);
|
|
||||||
|
|
||||||
glVertex3f( ElemBrowserX0,ElemBrowserY0,0);
|
|
||||||
glVertex3f( ElemBrowserX0,ElemBrowserY1,0);
|
|
||||||
|
|
||||||
glVertex3f( ElemBrowserX1,ElemBrowserY0,0);
|
|
||||||
glVertex3f( ElemBrowserX1,ElemBrowserY1,0);
|
|
||||||
|
|
||||||
glEnd();
|
|
||||||
|
|
||||||
ElemID++;
|
|
||||||
}
|
|
||||||
glPopMatrix();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
void CElemStore::FindCursorPos(CCore *Core,Vector3 &CamPos,CPoint &MousePos)
|
|
||||||
{
|
|
||||||
if (!GetSetCount()) return;
|
|
||||||
CElemSet &ThisSet=SetList[CurrentSet];
|
|
||||||
int ListSize=ThisSet.GetCount();
|
|
||||||
int BrowserWidth=ThisSet.GetBrowserWidth();
|
|
||||||
GLint Viewport[4];
|
|
||||||
GLuint SelectBuffer[SELECT_BUFFER_SIZE];
|
|
||||||
int HitCount;
|
|
||||||
int ElemID=0;
|
|
||||||
float Scale=CamPos.z/(float)BrowserWidth/2.0;
|
|
||||||
|
|
||||||
if (!ListSize) return;
|
|
||||||
glGetIntegerv(GL_VIEWPORT, Viewport);
|
|
||||||
glSelectBuffer (SELECT_BUFFER_SIZE, SelectBuffer );
|
|
||||||
glRenderMode (GL_SELECT);
|
|
||||||
|
|
||||||
glInitNames();
|
|
||||||
glPushName(-1);
|
|
||||||
|
|
||||||
glMatrixMode(GL_PROJECTION);
|
|
||||||
glPushMatrix();
|
|
||||||
glLoadIdentity();
|
|
||||||
gluPickMatrix( MousePos.x ,(Viewport[3]-MousePos.y),5.0,5.0,Viewport);
|
|
||||||
Core->GetView()->SetupPersMatrix();
|
|
||||||
|
|
||||||
glMatrixMode(GL_MODELVIEW);
|
|
||||||
glPushMatrix();
|
|
||||||
|
|
||||||
while(ElemID!=ListSize)
|
|
||||||
{
|
|
||||||
CPoint Pos=GetElemPos(ElemID,BrowserWidth);
|
|
||||||
float XPos=(float)Pos.x*(1+ElemBrowserGap);
|
|
||||||
float YPos=(float)Pos.y*(1+ElemBrowserGap);
|
|
||||||
|
|
||||||
glLoadIdentity();
|
|
||||||
glScalef(Scale,Scale,Scale);
|
|
||||||
glTranslatef(-CamPos.x+XPos,CamPos.y-YPos,0);
|
|
||||||
|
|
||||||
glLoadName (ElemID);
|
|
||||||
glBegin (GL_QUADS);
|
|
||||||
BuildGLQuad(ElemBrowserX0,ElemBrowserX1,ElemBrowserY0,ElemBrowserY1,0);
|
|
||||||
glEnd();
|
|
||||||
ElemID++;
|
|
||||||
}
|
|
||||||
|
|
||||||
HitCount= glRenderMode (GL_RENDER);
|
|
||||||
glPopMatrix();
|
|
||||||
glMatrixMode(GL_PROJECTION);
|
|
||||||
glPopMatrix();
|
|
||||||
|
|
||||||
// Process hits
|
|
||||||
|
|
||||||
GLuint *HitPtr=SelectBuffer;
|
|
||||||
|
|
||||||
ElemID=-2;
|
|
||||||
if (HitCount) // Just take 1st
|
|
||||||
{
|
|
||||||
ElemID=HitPtr[3];
|
|
||||||
}
|
|
||||||
glMatrixMode(GL_MODELVIEW); // <-- Prevent arse GL assert
|
|
||||||
|
|
||||||
CursorPos=ElemID;
|
|
||||||
SelEnd=CursorPos;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
bool CElemStore::LButtonControl(CCore *Core,UINT nFlags, CPoint &CursorPos,bool DownFlag)
|
bool CElemStore::LButtonControl(CCore *Core,UINT nFlags, CPoint &CursorPos,bool DownFlag)
|
||||||
{
|
{
|
||||||
if (nFlags & MK_RBUTTON)
|
/* if (nFlags & MK_RBUTTON)
|
||||||
{
|
{
|
||||||
SelectCancel();
|
SelectCancel();
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
Select(LBrush,DownFlag);
|
Select(LBrush,DownFlag);
|
||||||
|
*/
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
bool CElemStore::RButtonControl(CCore *Core,UINT nFlags, CPoint &CursorPos,bool DownFlag)
|
bool CElemStore::RButtonControl(CCore *Core,UINT nFlags, CPoint &CursorPos,bool DownFlag)
|
||||||
{
|
{
|
||||||
if (nFlags & MK_LBUTTON)
|
/* if (nFlags & MK_LBUTTON)
|
||||||
{
|
{
|
||||||
SelectCancel();
|
SelectCancel();
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
Select(RBrush,DownFlag);
|
Select(RBrush,DownFlag);
|
||||||
|
*/
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -449,7 +243,7 @@ bool CElemStore::MouseMove(CCore *Core,UINT nFlags, CPoint &CursorPos)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
bool CElemStore::Command(int CmdMsg,CCore *Core,int Param0,int Param1)
|
bool CElemStore::Command(int CmdMsg,CCore *Core,int Param0,int Param1)
|
||||||
{
|
{
|
||||||
switch(CmdMsg)
|
/* switch(CmdMsg)
|
||||||
{
|
{
|
||||||
case CmdMsg_SubViewLoad:
|
case CmdMsg_SubViewLoad:
|
||||||
LoadNewSet(Core);
|
LoadNewSet(Core);
|
||||||
|
@ -476,7 +270,7 @@ bool CElemStore::Command(int CmdMsg,CCore *Core,int Param0,int Param1)
|
||||||
default:
|
default:
|
||||||
TRACE3("ElemStore-Unhandled Command %i (%i,%i)\n",CmdMsg,Param0,Param1);
|
TRACE3("ElemStore-Unhandled Command %i (%i,%i)\n",CmdMsg,Param0,Param1);
|
||||||
}
|
}
|
||||||
return(true);
|
*/ return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -484,13 +278,13 @@ bool CElemStore::Command(int CmdMsg,CCore *Core,int Param0,int Param1)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CElemStore::GUIInit(CCore *Core)
|
void CElemStore::GUIInit(CCore *Core)
|
||||||
{
|
{
|
||||||
Core->GUIAdd(ElemStoreGUI,IDD_LAYERTILE_GUI);
|
Core->GUIAdd(GUIElemList,IDD_ELEMLIST);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CElemStore::GUIKill(CCore *Core)
|
void CElemStore::GUIKill(CCore *Core)
|
||||||
{
|
{
|
||||||
Core->GUIRemove(ElemStoreGUI,IDD_LAYERTILE_GUI);
|
Core->GUIRemove(GUIElemList,IDD_ELEMLIST);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -499,22 +293,22 @@ void CElemStore::GUIUpdate(CCore *Core)
|
||||||
int ListSize=GetSetCount();
|
int ListSize=GetSetCount();
|
||||||
bool IsSubView=Core->IsSubView();
|
bool IsSubView=Core->IsSubView();
|
||||||
|
|
||||||
if (ElemStoreGUI.m_List)
|
if (GUIElemList.m_List)
|
||||||
{
|
{
|
||||||
ElemStoreGUI.m_List.ResetContent();
|
GUIElemList.m_List.ResetContent();
|
||||||
if (ListSize)
|
if (ListSize)
|
||||||
{
|
{
|
||||||
for (int i=0; i<ListSize; i++)
|
for (int i=0; i<ListSize; i++)
|
||||||
{
|
{
|
||||||
ElemStoreGUI.m_List.AddString(GetSetName(i));
|
GUIElemList.m_List.AddString(GetSetName(i));
|
||||||
}
|
}
|
||||||
ElemStoreGUI.m_List.SetCurSel(CurrentSet);
|
GUIElemList.m_List.SetCurSel(CurrentSet);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
IsSubView=FALSE;
|
IsSubView=FALSE;
|
||||||
}
|
}
|
||||||
ElemStoreGUI.m_List.EnableWindow(IsSubView);
|
GUIElemList.m_List.EnableWindow(IsSubView);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -525,114 +319,3 @@ void CElemStore::GUIChanged(CCore *Core)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*** Functions ***************************************************************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
bool CElemStore::Select(int BrushID,bool DownFlag)
|
|
||||||
{
|
|
||||||
if (DownFlag && SelStart==-1)
|
|
||||||
{
|
|
||||||
if (CursorPos<0) return(FALSE);
|
|
||||||
SelStart=CursorPos;
|
|
||||||
TRACE1("SEL Start %i\n",CursorPos);
|
|
||||||
|
|
||||||
if (CursorPos==0)
|
|
||||||
{
|
|
||||||
SetBrush(GetBrush(BrushID));
|
|
||||||
SelStart=-1;
|
|
||||||
TRACE0("Selected Blank\n");
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if (!DownFlag && SelStart!=-1)
|
|
||||||
{
|
|
||||||
if (CursorPos==-1) return(SelectCancel());
|
|
||||||
|
|
||||||
SetBrush(GetBrush(BrushID));
|
|
||||||
|
|
||||||
SelStart=-1;
|
|
||||||
TRACE1("END SEL %i\n",CursorPos);
|
|
||||||
}
|
|
||||||
|
|
||||||
return(TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
void CElemStore::SetBrush(CMap &ThisBrush)
|
|
||||||
{
|
|
||||||
int BW=SetList[CurrentSet].GetBrowserWidth();
|
|
||||||
CPoint S=IDToPoint(SelStart-1,BW);
|
|
||||||
CPoint E=IDToPoint(SelEnd-1,BW);
|
|
||||||
|
|
||||||
int Width=abs(E.x-S.x)+1;
|
|
||||||
int Height=abs(E.y-S.y)+1;
|
|
||||||
|
|
||||||
sMapElem ThisElem;
|
|
||||||
int MaxElem=SetList[CurrentSet].GetCount();
|
|
||||||
|
|
||||||
// if (PointToID(End,BW)>=MaxElem) SelectCancel(); // Invalid selection
|
|
||||||
|
|
||||||
ThisElem.Set=CurrentSet;
|
|
||||||
ThisElem.Flags=0;
|
|
||||||
|
|
||||||
ThisBrush.Delete();
|
|
||||||
ThisBrush.SetSize(Width,Height);
|
|
||||||
|
|
||||||
for (int Y=0; Y<Height; Y++)
|
|
||||||
{
|
|
||||||
for (int X=0; X<Width; X++)
|
|
||||||
{
|
|
||||||
ThisElem.Elem=SelStart+X+(Y*BW);
|
|
||||||
if (!IsValid(CurrentSet,ThisElem.Elem))
|
|
||||||
{
|
|
||||||
TRACE2("Not valid %i %i\n",CurrentSet,ThisElem.Elem);
|
|
||||||
ThisElem.Elem=-1;
|
|
||||||
}
|
|
||||||
ThisBrush.Set(X,Y,ThisElem,true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
bool CElemStore::SelectCancel()
|
|
||||||
{
|
|
||||||
SelStart=-1;
|
|
||||||
TRACE0("Select Cancelled\n");
|
|
||||||
return(TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
void CElemStore::DeleteSet(CCore *Core)
|
|
||||||
{
|
|
||||||
if (Core->Question("Delete Current Elem Bank\n\nAll used Elems in current set will be set to blank\nAre you sure?"))
|
|
||||||
{
|
|
||||||
int SetCount=GetSetCount();
|
|
||||||
int i,ListSize=Core->GetLayerCount();
|
|
||||||
|
|
||||||
for (i=0;i<ListSize;i++)
|
|
||||||
{
|
|
||||||
CLayerTile *ThisLayer=(CLayerTile*)Core->GetLayer(i);
|
|
||||||
if (ThisLayer->GetType()==LAYER_TYPE_TILE)
|
|
||||||
{
|
|
||||||
ThisLayer->RemoveSet(CurrentSet);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
DeleteCurrent();
|
|
||||||
|
|
||||||
for (int Set=CurrentSet+1; Set<SetCount; Set++)
|
|
||||||
{
|
|
||||||
|
|
||||||
for (i=0;i<ListSize;i++)
|
|
||||||
{
|
|
||||||
CLayerTile *ThisLayer=(CLayerTile*)Core->GetLayer(i);
|
|
||||||
if (ThisLayer->GetType()==LAYER_TYPE_TILE)
|
|
||||||
{
|
|
||||||
ThisLayer->RemapSet(Set,Set-1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CurrentSet--;
|
|
||||||
GUIUpdate(Core);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -17,53 +17,39 @@
|
||||||
#include "Elem.h"
|
#include "Elem.h"
|
||||||
|
|
||||||
#include "MapEdit.h"
|
#include "MapEdit.h"
|
||||||
#include "LayerTileGui.h"
|
#include "GUIElemList.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
enum ElemStoreEnum
|
|
||||||
{
|
|
||||||
DefBrowserWidth=8,
|
|
||||||
};
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
class CCore;
|
class CCore;
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
class CElemStore : public CLayer, public CElemBank
|
class CElemStore : public CLayer, public CElemBank
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CElemStore();
|
CElemStore();
|
||||||
~CElemStore();
|
~CElemStore();
|
||||||
|
|
||||||
enum BrushEnum
|
|
||||||
{
|
|
||||||
LBrush=0,
|
|
||||||
RBrush,
|
|
||||||
MaxBrush
|
|
||||||
};
|
|
||||||
// Overloads
|
// Overloads
|
||||||
int GetType() {return(0);}
|
virtual int GetType() {return(0);}
|
||||||
|
|
||||||
void Render(CCore *Core,Vector3 &CamPos,bool Is3d);
|
virtual void Render(CCore *Core,Vector3 &CamPos,bool Is3d);
|
||||||
void RenderGrid(CCore *Core,Vector3 &CamPos,bool Active);
|
virtual void RenderGrid(CCore *Core,Vector3 &CamPos,bool Active){}
|
||||||
void RenderSelection(CCore *Core,Vector3 &ThisCam){};
|
virtual void RenderSelection(CCore *Core,Vector3 &ThisCam){};
|
||||||
void RenderCursor(CCore *Core,Vector3 &CamPos,bool Is3d);
|
virtual void RenderCursor(CCore *Core,Vector3 &CamPos,bool Is3d);
|
||||||
void FindCursorPos(CCore *Core,Vector3 &CamPos,CPoint &MousePos);
|
virtual void FindCursorPos(CCore *Core,Vector3 &CamPos,CPoint &MousePos){}
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
void Load(CFile *File,int Version);
|
virtual void Load(CFile *File,int Version);
|
||||||
void Save(CFile *File);
|
virtual void Save(CFile *File);
|
||||||
|
|
||||||
void Export(CCore *Core,CExport &Exp){};
|
virtual void Export(CCore *Core,CExport &Exp){};
|
||||||
|
|
||||||
bool LButtonControl(CCore *Core,UINT nFlags, CPoint &CursorPos,bool DownFlag);
|
virtual bool LButtonControl(CCore *Core,UINT nFlags, CPoint &CursorPos,bool DownFlag);
|
||||||
bool RButtonControl(CCore *Core,UINT nFlags, CPoint &CursorPos,bool DownFlag);
|
virtual bool RButtonControl(CCore *Core,UINT nFlags, CPoint &CursorPos,bool DownFlag);
|
||||||
bool MouseMove(CCore *Core,UINT nFlags, CPoint &CursorPos);
|
virtual bool MouseMove(CCore *Core,UINT nFlags, CPoint &CursorPos);
|
||||||
bool Command(int CmdMsg,CCore *Core,int Param0=0,int Param1=0);
|
virtual bool Command(int CmdMsg,CCore *Core,int Param0=0,int Param1=0);
|
||||||
|
|
||||||
// ElemSet Thruput
|
// ElemSet Thruput
|
||||||
const char *GetSetName(int Set) {return(SetList[Set].GetName());}
|
const char *GetSetName(int Set) {return(SetList[Set].GetName());}
|
||||||
|
@ -72,36 +58,13 @@ const char *GetSetFilename(int Set) {return(SetList[Set].GetFilename());
|
||||||
void RenderElem(int Set,int Elem,int Flags,bool Is3d);
|
void RenderElem(int Set,int Elem,int Flags,bool Is3d);
|
||||||
|
|
||||||
// Local
|
// Local
|
||||||
void DeleteCurrent();
|
virtual bool CanClose() {return(true);}
|
||||||
|
|
||||||
CMap &GetLBrush() {return(Brush[LBrush]);}
|
|
||||||
CMap &GetRBrush() {return(Brush[RBrush]);}
|
|
||||||
CMap &GetBrush(int i) {return(Brush[i]);}
|
|
||||||
CMap &GetActiveBrush() {return(GetBrush(ActiveBrush));}
|
|
||||||
|
|
||||||
bool CanClose() {return(SelStart==-1);}
|
|
||||||
CPoint GetElemPos(int ID,int Width);
|
|
||||||
|
|
||||||
// Functions
|
|
||||||
bool SelectCancel();
|
|
||||||
void DeleteSet(CCore *Core);
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
int CurrentSet;
|
||||||
bool Select(int BrushID,bool DownFlag);
|
bool LoadFlag;
|
||||||
void SetBrush(CMap &ThisBrush);
|
int CursorPos;
|
||||||
|
CGUIElemList GUIElemList;
|
||||||
int CurrentSet,LastSet;
|
|
||||||
CMap Brush[2];
|
|
||||||
int ActiveBrush;
|
|
||||||
int SelStart,SelEnd;
|
|
||||||
|
|
||||||
bool LoadFlag;
|
|
||||||
int LastCursorPos,CursorPos;
|
|
||||||
|
|
||||||
CLayerTileGUI ElemStoreGUI;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
65
Utils/MapEdit/GUIAddLayer.cpp
Normal file
65
Utils/MapEdit/GUIAddLayer.cpp
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
// AddLayerDlg.cpp : implementation file
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "mapedit.h"
|
||||||
|
#include "GUIAddLayer.h"
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
#define new DEBUG_NEW
|
||||||
|
#undef THIS_FILE
|
||||||
|
static char THIS_FILE[] = __FILE__;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CGUIAddLayer dialog
|
||||||
|
|
||||||
|
|
||||||
|
CGUIAddLayer::CGUIAddLayer(CWnd* pParent /*=NULL*/)
|
||||||
|
: CDialog(CGUIAddLayer::IDD, pParent)
|
||||||
|
{
|
||||||
|
//{{AFX_DATA_INIT(CGUIAddLayer)
|
||||||
|
// NOTE: the ClassWizard will add member initialization here
|
||||||
|
//}}AFX_DATA_INIT
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CGUIAddLayer::DoDataExchange(CDataExchange* pDX)
|
||||||
|
{
|
||||||
|
CDialog::DoDataExchange(pDX);
|
||||||
|
//{{AFX_DATA_MAP(CGUIAddLayer)
|
||||||
|
DDX_Control(pDX, IDC_ADDLAYER_LIST, m_List);
|
||||||
|
//}}AFX_DATA_MAP
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN_MESSAGE_MAP(CGUIAddLayer, CDialog)
|
||||||
|
//{{AFX_MSG_MAP(CGUIAddLayer)
|
||||||
|
ON_LBN_SELCHANGE(IDC_ADDLAYER_LIST, OnSelchangeAddlayerList)
|
||||||
|
//}}AFX_MSG_MAP
|
||||||
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CGUIAddLayer message handlers
|
||||||
|
|
||||||
|
BOOL CGUIAddLayer::OnInitDialog()
|
||||||
|
{
|
||||||
|
CDialog::OnInitDialog();
|
||||||
|
|
||||||
|
// TODO: Add extra initialization here
|
||||||
|
m_List.ResetContent();
|
||||||
|
for (int i=0; i<StrList.size(); i++)
|
||||||
|
{
|
||||||
|
m_List.AddString(StrList[i]);
|
||||||
|
}
|
||||||
|
m_List.SetCurSel(0);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CGUIAddLayer::OnSelchangeAddlayerList()
|
||||||
|
{
|
||||||
|
*Sel=m_List.GetCurSel();
|
||||||
|
}
|
50
Utils/MapEdit/GUIAddLayer.h
Normal file
50
Utils/MapEdit/GUIAddLayer.h
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
#if !defined(AFX_ADDLAYERDLG_H__5364908E_729B_40DA_A43C_7056FA88D6CC__INCLUDED_)
|
||||||
|
#define AFX_ADDLAYERDLG_H__5364908E_729B_40DA_A43C_7056FA88D6CC__INCLUDED_
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
#if _MSC_VER > 1000
|
||||||
|
#pragma once
|
||||||
|
#endif // _MSC_VER > 1000
|
||||||
|
// AddLayerDlg.h : header file
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CGUIAddLayer dialog
|
||||||
|
|
||||||
|
class CGUIAddLayer : public CDialog
|
||||||
|
{
|
||||||
|
// Construction
|
||||||
|
public:
|
||||||
|
CGUIAddLayer(CWnd* pParent = NULL); // standard constructor
|
||||||
|
|
||||||
|
// Dialog Data
|
||||||
|
//{{AFX_DATA(CGUIAddLayer)
|
||||||
|
enum { IDD = IDD_ADDLAYER };
|
||||||
|
CListBox m_List;
|
||||||
|
//}}AFX_DATA
|
||||||
|
std::vector<char *> StrList;
|
||||||
|
int *Sel;
|
||||||
|
|
||||||
|
|
||||||
|
// Overrides
|
||||||
|
// ClassWizard generated virtual function overrides
|
||||||
|
//{{AFX_VIRTUAL(CGUIAddLayer)
|
||||||
|
protected:
|
||||||
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||||
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Generated message map functions
|
||||||
|
//{{AFX_MSG(CGUIAddLayer)
|
||||||
|
virtual BOOL OnInitDialog();
|
||||||
|
afx_msg void OnSelchangeAddlayerList();
|
||||||
|
//}}AFX_MSG
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
};
|
||||||
|
//{{AFX_INSERT_LOCATION}}
|
||||||
|
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||||
|
|
||||||
|
#endif // !defined(AFX_ADDLAYERDLG_H__5364908E_729B_40DA_A43C_7056FA88D6CC__INCLUDED_)
|
50
Utils/MapEdit/GUIElemList.cpp
Normal file
50
Utils/MapEdit/GUIElemList.cpp
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
// GUIElemList.cpp : implementation file
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "mapedit.h"
|
||||||
|
#include "GUIElemList.h"
|
||||||
|
|
||||||
|
#include "MapEditDoc.h"
|
||||||
|
#include "MainFrm.h"
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
#define new DEBUG_NEW
|
||||||
|
#undef THIS_FILE
|
||||||
|
static char THIS_FILE[] = __FILE__;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CGUIElemList dialog
|
||||||
|
|
||||||
|
|
||||||
|
CGUIElemList::CGUIElemList(CWnd* pParent /*=NULL*/)
|
||||||
|
: CDialog(CGUIElemList::IDD, pParent)
|
||||||
|
{
|
||||||
|
//{{AFX_DATA_INIT(CGUIElemList)
|
||||||
|
// NOTE: the ClassWizard will add member initialization here
|
||||||
|
//}}AFX_DATA_INIT
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CGUIElemList::DoDataExchange(CDataExchange* pDX)
|
||||||
|
{
|
||||||
|
CDialog::DoDataExchange(pDX);
|
||||||
|
//{{AFX_DATA_MAP(CGUIElemList)
|
||||||
|
DDX_Control(pDX, IDD_ELEM_LIST, m_List);
|
||||||
|
//}}AFX_DATA_MAP
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN_MESSAGE_MAP(CGUIElemList, CDialog)
|
||||||
|
//{{AFX_MSG_MAP(CGUIElemList)
|
||||||
|
ON_CBN_CLOSEUP(IDD_ELEM_LIST, OnCloseupElemList)
|
||||||
|
ON_CBN_SELCHANGE(IDD_ELEM_LIST, OnSelchangeElemList)
|
||||||
|
//}}AFX_MSG_MAP
|
||||||
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CGUIElemList message handlers
|
||||||
|
|
||||||
|
void CGUIElemList::OnCloseupElemList() {theApp.GetCurrent()->Command(CmdMsg_SubViewSet);}
|
||||||
|
void CGUIElemList::OnSelchangeElemList() {theApp.GetCurrent()->Command(CmdMsg_SubViewSet);}
|
47
Utils/MapEdit/GUIElemList.h
Normal file
47
Utils/MapEdit/GUIElemList.h
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
#if !defined(AFX_GUIELEMLIST_H__869021D6_2A35_4EF0_A0A1_B2DD59F4534D__INCLUDED_)
|
||||||
|
#define AFX_GUIELEMLIST_H__869021D6_2A35_4EF0_A0A1_B2DD59F4534D__INCLUDED_
|
||||||
|
|
||||||
|
#if _MSC_VER > 1000
|
||||||
|
#pragma once
|
||||||
|
#endif // _MSC_VER > 1000
|
||||||
|
// GUIElemList.h : header file
|
||||||
|
//
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CGUIElemList dialog
|
||||||
|
|
||||||
|
class CGUIElemList : public CDialog
|
||||||
|
{
|
||||||
|
// Construction
|
||||||
|
public:
|
||||||
|
CGUIElemList(CWnd* pParent = NULL); // standard constructor
|
||||||
|
|
||||||
|
// Dialog Data
|
||||||
|
//{{AFX_DATA(CGUIElemList)
|
||||||
|
enum { IDD = IDD_ELEMLIST };
|
||||||
|
CComboBox m_List;
|
||||||
|
//}}AFX_DATA
|
||||||
|
|
||||||
|
|
||||||
|
// Overrides
|
||||||
|
// ClassWizard generated virtual function overrides
|
||||||
|
//{{AFX_VIRTUAL(CGUIElemList)
|
||||||
|
protected:
|
||||||
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||||
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Generated message map functions
|
||||||
|
//{{AFX_MSG(CGUIElemList)
|
||||||
|
afx_msg void OnCloseupElemList();
|
||||||
|
afx_msg void OnSelchangeElemList();
|
||||||
|
//}}AFX_MSG
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
};
|
||||||
|
|
||||||
|
//{{AFX_INSERT_LOCATION}}
|
||||||
|
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||||
|
|
||||||
|
#endif // !defined(AFX_GUIELEMLIST_H__869021D6_2A35_4EF0_A0A1_B2DD59F4534D__INCLUDED_)
|
62
Utils/MapEdit/GUILayerCollision.cpp
Normal file
62
Utils/MapEdit/GUILayerCollision.cpp
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
// GUILayerCollision.cpp : implementation file
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "mapedit.h"
|
||||||
|
#include "GUILayerCollision.h"
|
||||||
|
|
||||||
|
#include "MapEditDoc.h"
|
||||||
|
#include "MainFrm.h"
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
#define new DEBUG_NEW
|
||||||
|
#undef THIS_FILE
|
||||||
|
static char THIS_FILE[] = __FILE__;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// GUILayerCollision dialog
|
||||||
|
|
||||||
|
|
||||||
|
GUILayerCollision::GUILayerCollision(CWnd* pParent /*=NULL*/)
|
||||||
|
: CDialog(GUILayerCollision::IDD, pParent)
|
||||||
|
{
|
||||||
|
//{{AFX_DATA_INIT(GUILayerCollision)
|
||||||
|
// NOTE: the ClassWizard will add member initialization here
|
||||||
|
//}}AFX_DATA_INIT
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void GUILayerCollision::DoDataExchange(CDataExchange* pDX)
|
||||||
|
{
|
||||||
|
CDialog::DoDataExchange(pDX);
|
||||||
|
//{{AFX_DATA_MAP(GUILayerCollision)
|
||||||
|
// NOTE: the ClassWizard will add DDX and DDV calls here
|
||||||
|
//}}AFX_DATA_MAP
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN_MESSAGE_MAP(GUILayerCollision, CDialog)
|
||||||
|
//{{AFX_MSG_MAP(GUILayerCollision)
|
||||||
|
ON_BN_CLICKED(IDC_LAYERCOLLISION_NORMAL, OnLayercollisionNormal)
|
||||||
|
ON_BN_CLICKED(IDC_LAYERCOLLISION_DAMAGE, OnLayercollisionDamage)
|
||||||
|
ON_BN_CLICKED(IDC_LAYERCOLLISION_SLIPPERY, OnLayercollisionSlippery)
|
||||||
|
ON_BN_CLICKED(IDC_LAYERCOLLISION_ELECTRIC, OnLayercollisionElectric)
|
||||||
|
ON_BN_CLICKED(IDC_LAYERCOLLISION_STICKY, OnLayercollisionSticky)
|
||||||
|
ON_BN_CLICKED(IDC_LAYERCOLLISION_WATER, OnLayercollisionWater)
|
||||||
|
ON_BN_CLICKED(IDC_LAYERCOLLISION_SOLID, OnLayercollisionSolid)
|
||||||
|
ON_BN_CLICKED(IDC_LAYERCOLLISION_DEATH, OnLayercollisionDeath)
|
||||||
|
//}}AFX_MSG_MAP
|
||||||
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// GUILayerCollision message handlers
|
||||||
|
|
||||||
|
void GUILayerCollision::OnLayercollisionNormal() {theApp.GetCurrent()->Command(CmdMsg_SetColFlag,PC_TILE_COLLISION_NORMAL);}
|
||||||
|
void GUILayerCollision::OnLayercollisionDamage() {theApp.GetCurrent()->Command(CmdMsg_SetColFlag,PC_TILE_COLLISION_DAMAGE);}
|
||||||
|
void GUILayerCollision::OnLayercollisionSlippery() {theApp.GetCurrent()->Command(CmdMsg_SetColFlag,PC_TILE_COLLISION_SLIPPERY);}
|
||||||
|
void GUILayerCollision::OnLayercollisionElectric() {theApp.GetCurrent()->Command(CmdMsg_SetColFlag,PC_TILE_COLLISION_ELECTRIC);}
|
||||||
|
void GUILayerCollision::OnLayercollisionSticky() {theApp.GetCurrent()->Command(CmdMsg_SetColFlag,PC_TILE_COLLISION_STICKY);}
|
||||||
|
void GUILayerCollision::OnLayercollisionWater() {theApp.GetCurrent()->Command(CmdMsg_SetColFlag,PC_TILE_COLLISION_WATER);}
|
||||||
|
void GUILayerCollision::OnLayercollisionSolid() {theApp.GetCurrent()->Command(CmdMsg_SetColFlag,PC_TILE_COLLISION_SOLID);}
|
||||||
|
void GUILayerCollision::OnLayercollisionDeath() {theApp.GetCurrent()->Command(CmdMsg_SetColFlag,PC_TILE_COLLISION_DEATH);}
|
53
Utils/MapEdit/GUILayerCollision.h
Normal file
53
Utils/MapEdit/GUILayerCollision.h
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
#if !defined(AFX_GUILAYERCOLLISION_H__19A02D59_C518_4A7E_8F76_93EF28087F77__INCLUDED_)
|
||||||
|
#define AFX_GUILAYERCOLLISION_H__19A02D59_C518_4A7E_8F76_93EF28087F77__INCLUDED_
|
||||||
|
|
||||||
|
#if _MSC_VER > 1000
|
||||||
|
#pragma once
|
||||||
|
#endif // _MSC_VER > 1000
|
||||||
|
// GUILayerCollision.h : header file
|
||||||
|
//
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// GUILayerCollision dialog
|
||||||
|
|
||||||
|
class GUILayerCollision : public CDialog
|
||||||
|
{
|
||||||
|
// Construction
|
||||||
|
public:
|
||||||
|
GUILayerCollision(CWnd* pParent = NULL); // standard constructor
|
||||||
|
|
||||||
|
// Dialog Data
|
||||||
|
//{{AFX_DATA(GUILayerCollision)
|
||||||
|
enum { IDD = IDD_LAYER_COLLISION };
|
||||||
|
// NOTE: the ClassWizard will add data members here
|
||||||
|
//}}AFX_DATA
|
||||||
|
|
||||||
|
|
||||||
|
// Overrides
|
||||||
|
// ClassWizard generated virtual function overrides
|
||||||
|
//{{AFX_VIRTUAL(GUILayerCollision)
|
||||||
|
protected:
|
||||||
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||||
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Generated message map functions
|
||||||
|
//{{AFX_MSG(GUILayerCollision)
|
||||||
|
afx_msg void OnLayercollisionNormal();
|
||||||
|
afx_msg void OnLayercollisionDamage();
|
||||||
|
afx_msg void OnLayercollisionSlippery();
|
||||||
|
afx_msg void OnLayercollisionElectric();
|
||||||
|
afx_msg void OnLayercollisionSticky();
|
||||||
|
afx_msg void OnLayercollisionWater();
|
||||||
|
afx_msg void OnLayercollisionSolid();
|
||||||
|
afx_msg void OnLayercollisionDeath();
|
||||||
|
//}}AFX_MSG
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
};
|
||||||
|
|
||||||
|
//{{AFX_INSERT_LOCATION}}
|
||||||
|
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||||
|
|
||||||
|
#endif // !defined(AFX_GUILAYERCOLLISION_H__19A02D59_C518_4A7E_8F76_93EF28087F77__INCLUDED_)
|
52
Utils/MapEdit/GUILayerList.cpp
Normal file
52
Utils/MapEdit/GUILayerList.cpp
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
// GUILayerList.cpp : implementation file
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "mapedit.h"
|
||||||
|
#include "GUILayerList.h"
|
||||||
|
|
||||||
|
#include "MapEditDoc.h"
|
||||||
|
#include "MainFrm.h"
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
#define new DEBUG_NEW
|
||||||
|
#undef THIS_FILE
|
||||||
|
static char THIS_FILE[] = __FILE__;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CGUILayerList dialog
|
||||||
|
|
||||||
|
|
||||||
|
CGUILayerList::CGUILayerList(CWnd* pParent /*=NULL*/)
|
||||||
|
: CDialog(CGUILayerList::IDD, pParent)
|
||||||
|
{
|
||||||
|
//{{AFX_DATA_INIT(CGUILayerList)
|
||||||
|
// NOTE: the ClassWizard will add member initialization here
|
||||||
|
//}}AFX_DATA_INIT
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CGUILayerList::DoDataExchange(CDataExchange* pDX)
|
||||||
|
{
|
||||||
|
CDialog::DoDataExchange(pDX);
|
||||||
|
//{{AFX_DATA_MAP(CGUILayerList)
|
||||||
|
DDX_Control(pDX, IDC_LAYERLIST_LIST, m_List);
|
||||||
|
//}}AFX_DATA_MAP
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN_MESSAGE_MAP(CGUILayerList, CDialog)
|
||||||
|
//{{AFX_MSG_MAP(CGUILayerList)
|
||||||
|
ON_BN_CLICKED(IDC_LAYERLIST_ADD, OnLayerlistAdd)
|
||||||
|
ON_BN_CLICKED(IDC_LAYERLIST_DELETE, OnLayerlistDelete)
|
||||||
|
ON_LBN_SELCHANGE(IDC_LAYERLIST_LIST, OnSelchangeLayerlistList)
|
||||||
|
//}}AFX_MSG_MAP
|
||||||
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CGUILayerList message handlers
|
||||||
|
|
||||||
|
void CGUILayerList::OnLayerlistAdd() {theApp.GetCurrent()->Command(CmdMsg_AddLayer,m_List.GetCurSel());}
|
||||||
|
void CGUILayerList::OnLayerlistDelete() {theApp.GetCurrent()->Command(CmdMsg_DeleteLayer,m_List.GetCurSel());}
|
||||||
|
void CGUILayerList::OnSelchangeLayerlistList() {theApp.GetCurrent()->Command(CmdMsg_SetLayer,m_List.GetCurSel());}
|
48
Utils/MapEdit/GUILayerList.h
Normal file
48
Utils/MapEdit/GUILayerList.h
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
#if !defined(AFX_GUILAYERLIST_H__5D89A904_B1E5_4DF0_88E4_12560972B6DB__INCLUDED_)
|
||||||
|
#define AFX_GUILAYERLIST_H__5D89A904_B1E5_4DF0_88E4_12560972B6DB__INCLUDED_
|
||||||
|
|
||||||
|
#if _MSC_VER > 1000
|
||||||
|
#pragma once
|
||||||
|
#endif // _MSC_VER > 1000
|
||||||
|
// GUILayerList.h : header file
|
||||||
|
//
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CGUILayerList dialog
|
||||||
|
|
||||||
|
class CGUILayerList : public CDialog
|
||||||
|
{
|
||||||
|
// Construction
|
||||||
|
public:
|
||||||
|
CGUILayerList(CWnd* pParent = NULL); // standard constructor
|
||||||
|
|
||||||
|
// Dialog Data
|
||||||
|
//{{AFX_DATA(CGUILayerList)
|
||||||
|
enum { IDD = IDD_LAYER_LIST };
|
||||||
|
CCheckListBox m_List;
|
||||||
|
//}}AFX_DATA
|
||||||
|
|
||||||
|
|
||||||
|
// Overrides
|
||||||
|
// ClassWizard generated virtual function overrides
|
||||||
|
//{{AFX_VIRTUAL(CGUILayerList)
|
||||||
|
protected:
|
||||||
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||||
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Generated message map functions
|
||||||
|
//{{AFX_MSG(CGUILayerList)
|
||||||
|
afx_msg void OnLayerlistAdd();
|
||||||
|
afx_msg void OnLayerlistDelete();
|
||||||
|
afx_msg void OnSelchangeLayerlistList();
|
||||||
|
//}}AFX_MSG
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
};
|
||||||
|
|
||||||
|
//{{AFX_INSERT_LOCATION}}
|
||||||
|
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||||
|
|
||||||
|
#endif // !defined(AFX_GUILAYERLIST_H__5D89A904_B1E5_4DF0_88E4_12560972B6DB__INCLUDED_)
|
185
Utils/MapEdit/GUILayerShade.cpp
Normal file
185
Utils/MapEdit/GUILayerShade.cpp
Normal file
|
@ -0,0 +1,185 @@
|
||||||
|
// LayerShadeGUI.cpp : implementation file
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "mapedit.h"
|
||||||
|
#include "GUILayerShade.h"
|
||||||
|
|
||||||
|
#include "MapEditDoc.h"
|
||||||
|
#include "MainFrm.h"
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
#define new DEBUG_NEW
|
||||||
|
#undef THIS_FILE
|
||||||
|
static char THIS_FILE[] = __FILE__;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CGUILayerShade dialog
|
||||||
|
|
||||||
|
|
||||||
|
CGUILayerShade::CGUILayerShade(CWnd* pParent /*=NULL*/)
|
||||||
|
: CDialog(CGUILayerShade::IDD, pParent)
|
||||||
|
{
|
||||||
|
//{{AFX_DATA_INIT(CGUILayerShade)
|
||||||
|
//}}AFX_DATA_INIT
|
||||||
|
SetFlag=true;
|
||||||
|
Map[0][0]=&m_R0; Map[0][1]=&m_G0; Map[0][2]=&m_B0;
|
||||||
|
Map[1][0]=&m_R1; Map[1][1]=&m_G1; Map[1][2]=&m_B1;
|
||||||
|
Map[2][0]=&m_R2; Map[2][1]=&m_G2; Map[2][2]=&m_B2;
|
||||||
|
Map[3][0]=&m_R3; Map[3][1]=&m_G3; Map[3][2]=&m_B3;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CGUILayerShade::DoDataExchange(CDataExchange* pDX)
|
||||||
|
{
|
||||||
|
CDialog::DoDataExchange(pDX);
|
||||||
|
//{{AFX_DATA_MAP(CGUILayerShade)
|
||||||
|
DDX_Control(pDX, IDC_LAYERSHADE_EDITR0, m_R0);
|
||||||
|
DDX_Control(pDX, IDC_LAYERSHADE_EDITG0, m_G0);
|
||||||
|
DDX_Control(pDX, IDC_LAYERSHADE_EDITB0, m_B0);
|
||||||
|
DDX_Control(pDX, IDC_LAYERSHADE_EDITR1, m_R1);
|
||||||
|
DDX_Control(pDX, IDC_LAYERSHADE_EDITG1, m_G1);
|
||||||
|
DDX_Control(pDX, IDC_LAYERSHADE_EDITB1, m_B1);
|
||||||
|
DDX_Control(pDX, IDC_LAYERSHADE_EDITR2, m_R2);
|
||||||
|
DDX_Control(pDX, IDC_LAYERSHADE_EDITG2, m_G2);
|
||||||
|
DDX_Control(pDX, IDC_LAYERSHADE_EDITB2, m_B2);
|
||||||
|
DDX_Control(pDX, IDC_LAYERSHADE_EDITR3, m_R3);
|
||||||
|
DDX_Control(pDX, IDC_LAYERSHADE_EDITG3, m_G3);
|
||||||
|
DDX_Control(pDX, IDC_LAYERSHADE_EDITB3, m_B3);
|
||||||
|
DDX_Control(pDX, IDC_LAYERSHADE_COUNTEDIT, m_Count);
|
||||||
|
//}}AFX_DATA_MAP
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN_MESSAGE_MAP(CGUILayerShade, CDialog)
|
||||||
|
//{{AFX_MSG_MAP(CGUILayerShade)
|
||||||
|
ON_EN_CHANGE(IDC_LAYERSHADE_EDITB0, OnChangeLayershadeEdit)
|
||||||
|
ON_EN_CHANGE(IDC_LAYERSHADE_EDITB1, OnChangeLayershadeEdit)
|
||||||
|
ON_EN_CHANGE(IDC_LAYERSHADE_EDITG0, OnChangeLayershadeEdit)
|
||||||
|
ON_EN_CHANGE(IDC_LAYERSHADE_EDITG1, OnChangeLayershadeEdit)
|
||||||
|
ON_EN_CHANGE(IDC_LAYERSHADE_EDITR0, OnChangeLayershadeEdit)
|
||||||
|
ON_EN_CHANGE(IDC_LAYERSHADE_EDITR1, OnChangeLayershadeEdit)
|
||||||
|
ON_EN_CHANGE(IDC_LAYERSHADE_EDITB2, OnChangeLayershadeEdit)
|
||||||
|
ON_EN_CHANGE(IDC_LAYERSHADE_EDITB3, OnChangeLayershadeEdit)
|
||||||
|
ON_EN_CHANGE(IDC_LAYERSHADE_EDITG2, OnChangeLayershadeEdit)
|
||||||
|
ON_EN_CHANGE(IDC_LAYERSHADE_EDITG3, OnChangeLayershadeEdit)
|
||||||
|
ON_EN_CHANGE(IDC_LAYERSHADE_EDITR2, OnChangeLayershadeEdit)
|
||||||
|
ON_EN_CHANGE(IDC_LAYERSHADE_EDITR3, OnChangeLayershadeEdit)
|
||||||
|
ON_EN_CHANGE(IDC_LAYERSHADE_COUNTEDIT, OnChangeLayershadeEdit)
|
||||||
|
//}}AFX_MSG_MAP
|
||||||
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CGUILayerShade message handlers
|
||||||
|
void CGUILayerShade::OnOK()
|
||||||
|
{// Overide the OK close dialog (GRR)
|
||||||
|
theApp.GetCurrent()->FocusView();
|
||||||
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
void CGUILayerShade::SetVal(CEdit &Dlg,int &Val)
|
||||||
|
{
|
||||||
|
CString Str;
|
||||||
|
if (!Dlg) return;
|
||||||
|
SetFlag=true;
|
||||||
|
Str.Format("%i",Val);
|
||||||
|
Dlg.SetWindowText(Str);
|
||||||
|
SetFlag=false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
void CGUILayerShade::GetVal(CEdit &Dlg,int &Val)
|
||||||
|
{
|
||||||
|
CString Str;
|
||||||
|
if (!Dlg) return;
|
||||||
|
|
||||||
|
Dlg.GetWindowText(Str);
|
||||||
|
if (Str.GetLength())
|
||||||
|
Val=atoi(Str);
|
||||||
|
else
|
||||||
|
Val=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
void CGUILayerShade::LimitVal(int Min,int Max,CEdit &Dlg)
|
||||||
|
{
|
||||||
|
int Val;
|
||||||
|
if (!Dlg) return;
|
||||||
|
DWORD Sel=Dlg.GetSel(); // Retain cursor pos :o), Im getting good at this!
|
||||||
|
|
||||||
|
GetVal(Dlg,Val);
|
||||||
|
if (Val<Min) Val=Min;
|
||||||
|
if (Val>Max) Val=Max;
|
||||||
|
|
||||||
|
SetVal(Dlg,Val);
|
||||||
|
|
||||||
|
Dlg.SetSel(Sel);
|
||||||
|
|
||||||
|
}
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
void CGUILayerShade::SetRGB(RGBQUAD &RGB,int Set)
|
||||||
|
{
|
||||||
|
int Val;
|
||||||
|
|
||||||
|
Val=RGB.rgbRed; SetVal(*Map[Set][0],Val);
|
||||||
|
Val=RGB.rgbGreen; SetVal(*Map[Set][1],Val);
|
||||||
|
Val=RGB.rgbBlue; SetVal(*Map[Set][2],Val);
|
||||||
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
void CGUILayerShade::GetRGB(RGBQUAD &RGB,int Set)
|
||||||
|
{
|
||||||
|
int Val;
|
||||||
|
GetVal(*Map[Set][0],Val); RGB.rgbRed=Val;
|
||||||
|
GetVal(*Map[Set][1],Val); RGB.rgbGreen=Val;
|
||||||
|
GetVal(*Map[Set][2],Val); RGB.rgbBlue=Val;
|
||||||
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
void CGUILayerShade::CheckRGB(int Set)
|
||||||
|
{
|
||||||
|
LimitVal(0,255,*Map[Set][0]);
|
||||||
|
LimitVal(0,255,*Map[Set][1]);
|
||||||
|
LimitVal(0,255,*Map[Set][2]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
void CGUILayerShade::SetStatus(int Set,bool f)
|
||||||
|
{
|
||||||
|
Map[Set][0]->SetReadOnly(f);
|
||||||
|
Map[Set][1]->SetReadOnly(f);
|
||||||
|
Map[Set][2]->SetReadOnly(f);
|
||||||
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
void CGUILayerShade::CheckData()
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
int Count;
|
||||||
|
|
||||||
|
SetFlag=true;
|
||||||
|
LimitVal(2,4,m_Count);
|
||||||
|
GetCount(Count);
|
||||||
|
for (i=0; i<4; i++)
|
||||||
|
{
|
||||||
|
CheckRGB(i);
|
||||||
|
SetStatus(i,i>=Count);
|
||||||
|
}
|
||||||
|
|
||||||
|
SetFlag=false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void CGUILayerShade::OnChangeLayershadeEdit()
|
||||||
|
{
|
||||||
|
if (SetFlag) return;
|
||||||
|
|
||||||
|
if (theApp.GetCurrent() && m_R0)
|
||||||
|
{
|
||||||
|
CheckData();
|
||||||
|
theApp.GetCurrent()->GUIChanged();
|
||||||
|
}
|
||||||
|
}
|
77
Utils/MapEdit/GUILayerShade.h
Normal file
77
Utils/MapEdit/GUILayerShade.h
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
#if !defined(AFX_LAYERSHADEGUI_H__28B4764C_E86F_481B_9822_CFAE6CD32C9D__INCLUDED_)
|
||||||
|
#define AFX_LAYERSHADEGUI_H__28B4764C_E86F_481B_9822_CFAE6CD32C9D__INCLUDED_
|
||||||
|
|
||||||
|
#if _MSC_VER > 1000
|
||||||
|
#pragma once
|
||||||
|
#endif // _MSC_VER > 1000
|
||||||
|
// LayerShadeGUI.h : header file
|
||||||
|
//
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CGUILayerShade dialog
|
||||||
|
|
||||||
|
class CGUILayerShade : public CDialog
|
||||||
|
{
|
||||||
|
// Construction
|
||||||
|
public:
|
||||||
|
CGUILayerShade(CWnd* pParent = NULL); // standard constructor
|
||||||
|
|
||||||
|
void SetVal(CEdit &Dlg,int &Val);
|
||||||
|
void GetVal(CEdit &Dlg,int &Val);
|
||||||
|
void LimitVal(int Min,int Max,CEdit &Dlg);
|
||||||
|
|
||||||
|
void SetRGB(RGBQUAD &RGB,int Set);
|
||||||
|
void GetRGB(RGBQUAD &RGB,int Set);
|
||||||
|
|
||||||
|
void SetCount(int &Count) {SetVal(m_Count,Count);}
|
||||||
|
void GetCount(int &Count) {GetVal(m_Count,Count);}
|
||||||
|
|
||||||
|
void CheckData();
|
||||||
|
void CheckRGB(int Set);
|
||||||
|
|
||||||
|
void SetStatus(int Set,bool f);
|
||||||
|
|
||||||
|
// Dialog Data
|
||||||
|
//{{AFX_DATA(CGUILayerShade)
|
||||||
|
enum { IDD = IDD_LAYERSHADE_GUI };
|
||||||
|
CEdit m_R0;
|
||||||
|
CEdit m_G0;
|
||||||
|
CEdit m_B0;
|
||||||
|
CEdit m_R1;
|
||||||
|
CEdit m_G1;
|
||||||
|
CEdit m_B1;
|
||||||
|
CEdit m_R2;
|
||||||
|
CEdit m_G2;
|
||||||
|
CEdit m_B2;
|
||||||
|
CEdit m_R3;
|
||||||
|
CEdit m_G3;
|
||||||
|
CEdit m_B3;
|
||||||
|
CEdit m_Count;
|
||||||
|
//}}AFX_DATA
|
||||||
|
|
||||||
|
void OnOK();
|
||||||
|
|
||||||
|
// Overrides
|
||||||
|
// ClassWizard generated virtual function overrides
|
||||||
|
//{{AFX_VIRTUAL(CGUILayerShade)
|
||||||
|
protected:
|
||||||
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||||
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Generated message map functions
|
||||||
|
//{{AFX_MSG(CGUILayerShade)
|
||||||
|
afx_msg void OnChangeLayershadeEdit();
|
||||||
|
//}}AFX_MSG
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
bool SetFlag;
|
||||||
|
|
||||||
|
CEdit *Map[4][4];
|
||||||
|
};
|
||||||
|
|
||||||
|
//{{AFX_INSERT_LOCATION}}
|
||||||
|
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||||
|
|
||||||
|
#endif // !defined(AFX_LAYERSHADEGUI_H__28B4764C_E86F_481B_9822_CFAE6CD32C9D__INCLUDED_)
|
228
Utils/MapEdit/GUIMultibar.cpp
Normal file
228
Utils/MapEdit/GUIMultibar.cpp
Normal file
|
@ -0,0 +1,228 @@
|
||||||
|
/*****************************/
|
||||||
|
/*** MultiBar Dialog Class ***/
|
||||||
|
/*** Dave ***/
|
||||||
|
/*****************************/
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "mapedit.h"
|
||||||
|
#include "GUIMultiBar.h"
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
#define new DEBUG_NEW
|
||||||
|
#undef THIS_FILE
|
||||||
|
static char THIS_FILE[] = __FILE__;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*********************************************************************************/
|
||||||
|
|
||||||
|
CGUIMultiBar::CGUIMultiBar(CWnd* pParent /*=NULL*/)
|
||||||
|
{
|
||||||
|
//{{AFX_DATA_INIT(CGUIMultiBar)
|
||||||
|
// NOTE: the ClassWizard will add member initialization here
|
||||||
|
//}}AFX_DATA_INIT
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************************************************************************/
|
||||||
|
void CGUIMultiBar::DoDataExchange(CDataExchange* pDX)
|
||||||
|
{
|
||||||
|
CDialogBar::DoDataExchange(pDX);
|
||||||
|
//{{AFX_DATA_MAP(CGUIMultiBar)
|
||||||
|
// NOTE: the ClassWizard will add DDX and DDV calls here
|
||||||
|
//}}AFX_DATA_MAP
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN_MESSAGE_MAP(CGUIMultiBar, CDialogBar)
|
||||||
|
//{{AFX_MSG_MAP(CGUIMultiBar)
|
||||||
|
ON_WM_CREATE()
|
||||||
|
//}}AFX_MSG_MAP
|
||||||
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
/*********************************************************************************/
|
||||||
|
int CGUIMultiBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
|
||||||
|
{
|
||||||
|
if (CDialogBar::OnCreate(lpCreateStruct) == -1) return -1;
|
||||||
|
|
||||||
|
RECT R;
|
||||||
|
GetWindowRect(&R);
|
||||||
|
DefSize.cx=(R.right-R.left)+4;
|
||||||
|
DefSize.cy=(R.bottom-R.top)+4;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************************************************************************/
|
||||||
|
/*********************************************************************************/
|
||||||
|
/*********************************************************************************/
|
||||||
|
void CGUIMultiBar::Add(CDialog &Dlg,int ID,BOOL Visible,BOOL Lock)
|
||||||
|
{
|
||||||
|
//int ListSize=List.size();
|
||||||
|
|
||||||
|
if (GetDialogIdx(&Dlg)!=-1) return; // Already exists
|
||||||
|
|
||||||
|
if (!Dlg.Create(ID,this))
|
||||||
|
{
|
||||||
|
ASSERT(!"Failed to create MultiDialog");
|
||||||
|
}
|
||||||
|
|
||||||
|
sList NewDlg;
|
||||||
|
|
||||||
|
NewDlg.Dlg=&Dlg;
|
||||||
|
// NewDlg.ID=ID;
|
||||||
|
NewDlg.Visible=Visible;
|
||||||
|
NewDlg.Lock=Lock;
|
||||||
|
|
||||||
|
List.push_back(NewDlg);
|
||||||
|
|
||||||
|
SetVisible(Dlg,Visible,TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************************************************************************/
|
||||||
|
void CGUIMultiBar::RemoveDlg(int Idx,BOOL Force)
|
||||||
|
{
|
||||||
|
if (Idx==-1) return;
|
||||||
|
sList &ThisDlg=List[Idx];
|
||||||
|
int ListSize=List.size();
|
||||||
|
if (Force || !ThisDlg.Lock)
|
||||||
|
{
|
||||||
|
ThisDlg.Dlg->DestroyWindow();
|
||||||
|
List.erase(List.begin()+Idx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************************************************************************/
|
||||||
|
void CGUIMultiBar::RemoveAll(BOOL Force)
|
||||||
|
{
|
||||||
|
int ListSize=List.size();
|
||||||
|
|
||||||
|
for (int i=ListSize; i; i--)
|
||||||
|
{
|
||||||
|
RemoveDlg(i-1,Force);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************************************************************************/
|
||||||
|
/*********************************************************************************/
|
||||||
|
/*********************************************************************************/
|
||||||
|
CGUIMultiBar::sList &CGUIMultiBar::GetDialog(CDialog *Dlg)
|
||||||
|
{
|
||||||
|
int Idx=GetDialogIdx(Dlg);
|
||||||
|
|
||||||
|
return(List[Idx]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************************************************************************/
|
||||||
|
int CGUIMultiBar::GetDialogIdx(CDialog *Dlg)
|
||||||
|
{
|
||||||
|
int ListSize=List.size();
|
||||||
|
|
||||||
|
for (int i=0; i<ListSize; i++)
|
||||||
|
{
|
||||||
|
sList &ThisDlg=List[i];
|
||||||
|
|
||||||
|
if (ThisDlg.Dlg==Dlg) return(i);
|
||||||
|
}
|
||||||
|
return(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************************************************************************/
|
||||||
|
/*********************************************************************************/
|
||||||
|
/*********************************************************************************/
|
||||||
|
void CGUIMultiBar::SetVisible(CDialog *Dlg,BOOL Visible,BOOL Force)
|
||||||
|
{
|
||||||
|
sList &ThisDlg=GetDialog(Dlg);
|
||||||
|
|
||||||
|
if (Force || !ThisDlg.Lock)
|
||||||
|
{
|
||||||
|
ThisDlg.Visible=Visible;
|
||||||
|
if (Visible)
|
||||||
|
ThisDlg.Dlg->ShowWindow(SW_SHOW);
|
||||||
|
else
|
||||||
|
ThisDlg.Dlg->ShowWindow(SW_HIDE);
|
||||||
|
ShowWindow(SW_SHOW);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************************************************************************/
|
||||||
|
void CGUIMultiBar::SetVisibleAll(BOOL Visible,BOOL Force)
|
||||||
|
{
|
||||||
|
int ListSize=List.size();
|
||||||
|
|
||||||
|
for (int i=0; i<ListSize; i++)
|
||||||
|
{
|
||||||
|
SetVisible(List[i].Dlg,Visible,Force);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************************************************************************/
|
||||||
|
/*********************************************************************************/
|
||||||
|
/*********************************************************************************/
|
||||||
|
void CGUIMultiBar::SetLock(CDialog *Dlg,BOOL Lock)
|
||||||
|
{
|
||||||
|
sList &ThisDlg=GetDialog(Dlg);
|
||||||
|
ThisDlg.Lock=Lock;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************************************************************************/
|
||||||
|
void CGUIMultiBar::SetLockAll(BOOL Lock)
|
||||||
|
{
|
||||||
|
int ListSize=List.size();
|
||||||
|
|
||||||
|
for (int i=0; i<ListSize; i++)
|
||||||
|
{
|
||||||
|
SetLock(List[i].Dlg,Lock);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************************************************************************/
|
||||||
|
/*********************************************************************************/
|
||||||
|
/*********************************************************************************/
|
||||||
|
CSize CGUIMultiBar::CalcBarSize()
|
||||||
|
{
|
||||||
|
int ListSize=List.size();
|
||||||
|
CSize Size(0,MultiBarGap);;
|
||||||
|
|
||||||
|
if (!ListSize)
|
||||||
|
{
|
||||||
|
Size=DefSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i=0; i<ListSize; i++)
|
||||||
|
{
|
||||||
|
sList &ThisDlg=List[i];
|
||||||
|
|
||||||
|
if (ThisDlg.Visible)
|
||||||
|
{
|
||||||
|
CDialog *Dlg=ThisDlg.Dlg;
|
||||||
|
CRect Rect;
|
||||||
|
Dlg->GetWindowRect(&Rect);
|
||||||
|
|
||||||
|
Dlg->SetWindowPos(&wndTop,MultiBarGap,Size.cy,0,0,SWP_NOSIZE);
|
||||||
|
Size.cy+=Rect.Height()+MultiBarGap;
|
||||||
|
Size.cx=max(Rect.Width(),Size.cx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SetWindowPos(&wndTop,0,0,Size.cx,Size.cy,SWP_NOMOVE);
|
||||||
|
return(Size);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************************************************************************/
|
||||||
|
|
||||||
|
CSize CGUIMultiBar::CalcFixedLayout(BOOL bStretch, BOOL bHorz)
|
||||||
|
{
|
||||||
|
return(CalcBarSize());
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************************************************************************/
|
||||||
|
CSize CGUIMultiBar::CalcDynamicLayout( int nLength, DWORD dwMode )
|
||||||
|
{
|
||||||
|
return(CalcBarSize());
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************************************************************************/
|
||||||
|
void CGUIMultiBar::Update()
|
||||||
|
{
|
||||||
|
CalcBarSize();
|
||||||
|
}
|
||||||
|
|
109
Utils/MapEdit/GUIMultibar.h
Normal file
109
Utils/MapEdit/GUIMultibar.h
Normal file
|
@ -0,0 +1,109 @@
|
||||||
|
/*****************************/
|
||||||
|
/*** MultiBar Dialog Class ***/
|
||||||
|
/*** Dave ***/
|
||||||
|
/*****************************/
|
||||||
|
|
||||||
|
#if !defined(AFX_MULTIBAR_H__806BA89D_41A5_4499_834F_613A21999A82__INCLUDED_)
|
||||||
|
#define AFX_MULTIBAR_H__806BA89D_41A5_4499_834F_613A21999A82__INCLUDED_
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#if _MSC_VER > 1000
|
||||||
|
#pragma once
|
||||||
|
#endif // _MSC_VER > 1000
|
||||||
|
|
||||||
|
/*********************************************************************************/
|
||||||
|
class CGUIMultiBar : public CDialogBar
|
||||||
|
{
|
||||||
|
// Construction
|
||||||
|
public:
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
MultiBarGap=4,
|
||||||
|
};
|
||||||
|
|
||||||
|
struct sList
|
||||||
|
{
|
||||||
|
// int ID;
|
||||||
|
CDialog *Dlg;
|
||||||
|
BOOL Visible;
|
||||||
|
BOOL Lock;
|
||||||
|
};
|
||||||
|
|
||||||
|
CGUIMultiBar(CWnd* pParent = NULL); // standard constructor
|
||||||
|
|
||||||
|
void Add(CDialog &Dlg,int ID,BOOL Visible=FALSE,BOOL Lock=FALSE);
|
||||||
|
void Remove(CDialog &Dlg,BOOL Force=FALSE) {RemoveDlg(GetDialogIdx(&Dlg),Force);}
|
||||||
|
// void Remove(int ID,BOOL Force=FALSE) {RemoveDlg(GetDialogIdx(ID),Force);}
|
||||||
|
void RemoveAll(BOOL Force=FALSE);
|
||||||
|
|
||||||
|
void Show(CDialog &Dlg,BOOL Force=FALSE) {Show(&Dlg);}
|
||||||
|
void Show(CDialog *Dlg,BOOL Force=FALSE) {SetVisible(Dlg,TRUE,Force);}
|
||||||
|
void ShowAll(BOOL Force=FALSE) {SetVisibleAll(TRUE,Force);}
|
||||||
|
|
||||||
|
void Hide(CDialog &Dlg,BOOL Force=FALSE) {Hide(&Dlg);}
|
||||||
|
void Hide(CDialog *Dlg,BOOL Force=FALSE) {SetVisible(Dlg,FALSE,Force);}
|
||||||
|
void HideAll(BOOL Force=FALSE) {SetVisibleAll(FALSE,Force);}
|
||||||
|
|
||||||
|
void Lock(CDialog &Dlg) {Lock(&Dlg);}
|
||||||
|
void Lock(CDialog *Dlg);
|
||||||
|
void LockAll();
|
||||||
|
|
||||||
|
void Unlock(CDialog &Dlg) {Unlock(&Dlg);}
|
||||||
|
void Unlock(CDialog *Dlg);
|
||||||
|
void UnlockAll();
|
||||||
|
|
||||||
|
CDialog *GetDialog(int ID);
|
||||||
|
|
||||||
|
void Update();
|
||||||
|
|
||||||
|
virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz);
|
||||||
|
virtual CSize CalcDynamicLayout( int nLength, DWORD dwMode );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Dialog Data
|
||||||
|
//{{AFX_DATA(CGUIMultiBar)
|
||||||
|
enum { IDD = IDD_MULTIBAR };
|
||||||
|
//}}AFX_DATA
|
||||||
|
|
||||||
|
|
||||||
|
// Overrides
|
||||||
|
// ClassWizard generated virtual function overrides
|
||||||
|
//{{AFX_VIRTUAL(CGUIMultiBar)
|
||||||
|
protected:
|
||||||
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||||
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
protected:
|
||||||
|
sList &GetDialog(CDialog *Dlg);
|
||||||
|
int GetDialogIdx(CDialog *Dlg);
|
||||||
|
// int GetDialogIdx(int ID);
|
||||||
|
|
||||||
|
void SetVisible(CDialog &Dlg,BOOL Visible,BOOL Force=FALSE) {SetVisible(&Dlg,Visible,Force);}
|
||||||
|
void SetVisible(CDialog *Dlg,BOOL Visible,BOOL Force=FALSE);
|
||||||
|
void SetVisibleAll(BOOL Visible,BOOL Force);
|
||||||
|
|
||||||
|
void SetLock(CDialog &Dlg,BOOL Lock) {SetLock(&Dlg,Lock);}
|
||||||
|
void SetLock(CDialog *Dlg,BOOL Lock);
|
||||||
|
void SetLockAll(BOOL Lock);
|
||||||
|
|
||||||
|
void RemoveDlg(int Idx,BOOL Force=FALSE);
|
||||||
|
CSize CalcBarSize();
|
||||||
|
|
||||||
|
CSize DefSize;
|
||||||
|
|
||||||
|
std::vector<sList> List;
|
||||||
|
|
||||||
|
// Generated message map functions
|
||||||
|
//{{AFX_MSG(CGUIMultiBar)
|
||||||
|
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||||
|
//}}AFX_MSG
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
};
|
||||||
|
|
||||||
|
//{{AFX_INSERT_LOCATION}}
|
||||||
|
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||||
|
|
||||||
|
#endif // !defined(AFX_MULTIBAR_H__806BA89D_41A5_4499_834F_613A21999A82__INCLUDED_)
|
47
Utils/MapEdit/GUINewMap.cpp
Normal file
47
Utils/MapEdit/GUINewMap.cpp
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
// GUINewMap.cpp : implementation file
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "mapedit.h"
|
||||||
|
#include "GUINewMap.h"
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
#define new DEBUG_NEW
|
||||||
|
#undef THIS_FILE
|
||||||
|
static char THIS_FILE[] = __FILE__;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CGUINewMap dialog
|
||||||
|
|
||||||
|
|
||||||
|
CGUINewMap::CGUINewMap(CWnd* pParent /*=NULL*/)
|
||||||
|
: CDialog(CGUINewMap::IDD, pParent)
|
||||||
|
{
|
||||||
|
//{{AFX_DATA_INIT(CGUINewMap)
|
||||||
|
m_Height = 0;
|
||||||
|
m_Width = 0;
|
||||||
|
//}}AFX_DATA_INIT
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CGUINewMap::DoDataExchange(CDataExchange* pDX)
|
||||||
|
{
|
||||||
|
CDialog::DoDataExchange(pDX);
|
||||||
|
//{{AFX_DATA_MAP(CGUINewMap)
|
||||||
|
DDX_Text(pDX, IDC_MAPSIZE_HEIGHT, m_Height);
|
||||||
|
DDV_MinMaxUInt(pDX, m_Height, 34, 1024);
|
||||||
|
DDX_Text(pDX, IDC_MAPSIZE_WIDTH, m_Width);
|
||||||
|
DDV_MinMaxUInt(pDX, m_Width, 24, 1024);
|
||||||
|
//}}AFX_DATA_MAP
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN_MESSAGE_MAP(CGUINewMap, CDialog)
|
||||||
|
//{{AFX_MSG_MAP(CGUINewMap)
|
||||||
|
// NOTE: the ClassWizard will add message map macros here
|
||||||
|
//}}AFX_MSG_MAP
|
||||||
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CGUINewMap message handlers
|
47
Utils/MapEdit/GUINewMap.h
Normal file
47
Utils/MapEdit/GUINewMap.h
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
#if !defined(AFX_GUINEWMAP_H__2C6F68D1_14CE_43D5_B35A_11F9E5948CF4__INCLUDED_)
|
||||||
|
#define AFX_GUINEWMAP_H__2C6F68D1_14CE_43D5_B35A_11F9E5948CF4__INCLUDED_
|
||||||
|
|
||||||
|
#if _MSC_VER > 1000
|
||||||
|
#pragma once
|
||||||
|
#endif // _MSC_VER > 1000
|
||||||
|
// GUINewMap.h : header file
|
||||||
|
//
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CGUINewMap dialog
|
||||||
|
|
||||||
|
class CGUINewMap : public CDialog
|
||||||
|
{
|
||||||
|
// Construction
|
||||||
|
public:
|
||||||
|
CGUINewMap(CWnd* pParent = NULL); // standard constructor
|
||||||
|
|
||||||
|
// Dialog Data
|
||||||
|
//{{AFX_DATA(CGUINewMap)
|
||||||
|
enum { IDD = IDD_NEWMAP };
|
||||||
|
UINT m_Height;
|
||||||
|
UINT m_Width;
|
||||||
|
//}}AFX_DATA
|
||||||
|
|
||||||
|
|
||||||
|
// Overrides
|
||||||
|
// ClassWizard generated virtual function overrides
|
||||||
|
//{{AFX_VIRTUAL(CGUINewMap)
|
||||||
|
protected:
|
||||||
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||||
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Generated message map functions
|
||||||
|
//{{AFX_MSG(CGUINewMap)
|
||||||
|
// NOTE: the ClassWizard will add member functions here
|
||||||
|
//}}AFX_MSG
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
};
|
||||||
|
|
||||||
|
//{{AFX_INSERT_LOCATION}}
|
||||||
|
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||||
|
|
||||||
|
#endif // !defined(AFX_GUINEWMAP_H__2C6F68D1_14CE_43D5_B35A_11F9E5948CF4__INCLUDED_)
|
47
Utils/MapEdit/GUIResize.cpp
Normal file
47
Utils/MapEdit/GUIResize.cpp
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
// GUIResize.cpp : implementation file
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "mapedit.h"
|
||||||
|
#include "GUIResize.h"
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
#define new DEBUG_NEW
|
||||||
|
#undef THIS_FILE
|
||||||
|
static char THIS_FILE[] = __FILE__;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CGUIResize dialog
|
||||||
|
|
||||||
|
|
||||||
|
CGUIResize::CGUIResize(CWnd* pParent /*=NULL*/)
|
||||||
|
: CDialog(CGUIResize::IDD, pParent)
|
||||||
|
{
|
||||||
|
//{{AFX_DATA_INIT(CGUIResize)
|
||||||
|
m_Height = 0;
|
||||||
|
m_Width = 0;
|
||||||
|
//}}AFX_DATA_INIT
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CGUIResize::DoDataExchange(CDataExchange* pDX)
|
||||||
|
{
|
||||||
|
CDialog::DoDataExchange(pDX);
|
||||||
|
//{{AFX_DATA_MAP(CGUIResize)
|
||||||
|
DDX_Text(pDX, IDC_MAPSIZE_HEIGHT, m_Height);
|
||||||
|
DDV_MinMaxUInt(pDX, m_Height, 34, 1024);
|
||||||
|
DDX_Text(pDX, IDC_MAPSIZE_WIDTH, m_Width);
|
||||||
|
DDV_MinMaxUInt(pDX, m_Width, 24, 1024);
|
||||||
|
//}}AFX_DATA_MAP
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN_MESSAGE_MAP(CGUIResize, CDialog)
|
||||||
|
//{{AFX_MSG_MAP(CGUIResize)
|
||||||
|
// NOTE: the ClassWizard will add message map macros here
|
||||||
|
//}}AFX_MSG_MAP
|
||||||
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CGUIResize message handlers
|
47
Utils/MapEdit/GUIResize.h
Normal file
47
Utils/MapEdit/GUIResize.h
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
#if !defined(AFX_GUIRESIZE_H__C20CE7DA_F313_4A28_9923_794954C4DF9F__INCLUDED_)
|
||||||
|
#define AFX_GUIRESIZE_H__C20CE7DA_F313_4A28_9923_794954C4DF9F__INCLUDED_
|
||||||
|
|
||||||
|
#if _MSC_VER > 1000
|
||||||
|
#pragma once
|
||||||
|
#endif // _MSC_VER > 1000
|
||||||
|
// GUIResize.h : header file
|
||||||
|
//
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CGUIResize dialog
|
||||||
|
|
||||||
|
class CGUIResize : public CDialog
|
||||||
|
{
|
||||||
|
// Construction
|
||||||
|
public:
|
||||||
|
CGUIResize(CWnd* pParent = NULL); // standard constructor
|
||||||
|
|
||||||
|
// Dialog Data
|
||||||
|
//{{AFX_DATA(CGUIResize)
|
||||||
|
enum { IDD = IDD_RESIZE };
|
||||||
|
UINT m_Height;
|
||||||
|
UINT m_Width;
|
||||||
|
//}}AFX_DATA
|
||||||
|
|
||||||
|
|
||||||
|
// Overrides
|
||||||
|
// ClassWizard generated virtual function overrides
|
||||||
|
//{{AFX_VIRTUAL(CGUIResize)
|
||||||
|
protected:
|
||||||
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||||
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Generated message map functions
|
||||||
|
//{{AFX_MSG(CGUIResize)
|
||||||
|
// NOTE: the ClassWizard will add member functions here
|
||||||
|
//}}AFX_MSG
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
};
|
||||||
|
|
||||||
|
//{{AFX_INSERT_LOCATION}}
|
||||||
|
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||||
|
|
||||||
|
#endif // !defined(AFX_GUIRESIZE_H__C20CE7DA_F313_4A28_9923_794954C4DF9F__INCLUDED_)
|
51
Utils/MapEdit/GUITileBank.cpp
Normal file
51
Utils/MapEdit/GUITileBank.cpp
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
// GUITileBank.cpp : implementation file
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "mapedit.h"
|
||||||
|
#include "GUITileBank.h"
|
||||||
|
|
||||||
|
#include "MapEditDoc.h"
|
||||||
|
#include "MainFrm.h"
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
#define new DEBUG_NEW
|
||||||
|
#undef THIS_FILE
|
||||||
|
static char THIS_FILE[] = __FILE__;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CGUITileBank dialog
|
||||||
|
|
||||||
|
|
||||||
|
CGUITileBank::CGUITileBank(CWnd* pParent /*=NULL*/)
|
||||||
|
: CDialog(CGUITileBank::IDD, pParent)
|
||||||
|
{
|
||||||
|
//{{AFX_DATA_INIT(CGUITileBank)
|
||||||
|
// NOTE: the ClassWizard will add member initialization here
|
||||||
|
//}}AFX_DATA_INIT
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CGUITileBank::DoDataExchange(CDataExchange* pDX)
|
||||||
|
{
|
||||||
|
CDialog::DoDataExchange(pDX);
|
||||||
|
//{{AFX_DATA_MAP(CGUITileBank)
|
||||||
|
// NOTE: the ClassWizard will add DDX and DDV calls here
|
||||||
|
//}}AFX_DATA_MAP
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN_MESSAGE_MAP(CGUITileBank, CDialog)
|
||||||
|
//{{AFX_MSG_MAP(CGUITileBank)
|
||||||
|
ON_BN_CLICKED(IDD_TILEBANK_LOAD, OnTilebankLoad)
|
||||||
|
ON_BN_CLICKED(IDD_TILEBANK_DELETE, OnTilebankDelete)
|
||||||
|
ON_BN_CLICKED(IDD_TILEBANK_UPDATE, OnTilebankUpdate)
|
||||||
|
//}}AFX_MSG_MAP
|
||||||
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CGUITileBank message handlers
|
||||||
|
void CGUITileBank::OnTilebankLoad() {theApp.GetCurrent()->Command(CmdMsg_SubViewLoad);}
|
||||||
|
void CGUITileBank::OnTilebankDelete() {theApp.GetCurrent()->Command(CmdMsg_SubViewDelete);}
|
||||||
|
void CGUITileBank::OnTilebankUpdate() {theApp.GetCurrent()->Command(CmdMsg_SubViewUpdate);}
|
48
Utils/MapEdit/GUITileBank.h
Normal file
48
Utils/MapEdit/GUITileBank.h
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
#if !defined(AFX_GUITILEBANK_H__85A70565_C33B_4B2D_88AE_D10C8C9FC455__INCLUDED_)
|
||||||
|
#define AFX_GUITILEBANK_H__85A70565_C33B_4B2D_88AE_D10C8C9FC455__INCLUDED_
|
||||||
|
|
||||||
|
#if _MSC_VER > 1000
|
||||||
|
#pragma once
|
||||||
|
#endif // _MSC_VER > 1000
|
||||||
|
// GUITileBank.h : header file
|
||||||
|
//
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CGUITileBank dialog
|
||||||
|
|
||||||
|
class CGUITileBank : public CDialog
|
||||||
|
{
|
||||||
|
// Construction
|
||||||
|
public:
|
||||||
|
CGUITileBank(CWnd* pParent = NULL); // standard constructor
|
||||||
|
|
||||||
|
// Dialog Data
|
||||||
|
//{{AFX_DATA(CGUITileBank)
|
||||||
|
enum { IDD = IDD_TILEBANK };
|
||||||
|
// NOTE: the ClassWizard will add data members here
|
||||||
|
//}}AFX_DATA
|
||||||
|
|
||||||
|
|
||||||
|
// Overrides
|
||||||
|
// ClassWizard generated virtual function overrides
|
||||||
|
//{{AFX_VIRTUAL(CGUITileBank)
|
||||||
|
protected:
|
||||||
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||||
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Generated message map functions
|
||||||
|
//{{AFX_MSG(CGUITileBank)
|
||||||
|
afx_msg void OnTilebankLoad();
|
||||||
|
afx_msg void OnTilebankDelete();
|
||||||
|
afx_msg void OnTilebankUpdate();
|
||||||
|
//}}AFX_MSG
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
};
|
||||||
|
|
||||||
|
//{{AFX_INSERT_LOCATION}}
|
||||||
|
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||||
|
|
||||||
|
#endif // !defined(AFX_GUITILEBANK_H__85A70565_C33B_4B2D_88AE_D10C8C9FC455__INCLUDED_)
|
93
Utils/MapEdit/GUIToolBar.cpp
Normal file
93
Utils/MapEdit/GUIToolBar.cpp
Normal file
|
@ -0,0 +1,93 @@
|
||||||
|
// GUIToolBar.cpp : implementation file
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "mapedit.h"
|
||||||
|
#include "GUIToolBar.h"
|
||||||
|
|
||||||
|
#include "MapEditDoc.h"
|
||||||
|
#include "MainFrm.h"
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
#define new DEBUG_NEW
|
||||||
|
#undef THIS_FILE
|
||||||
|
static char THIS_FILE[] = __FILE__;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// GUIToolBar dialog
|
||||||
|
|
||||||
|
|
||||||
|
CGUIToolBar::CGUIToolBar(CWnd* pParent /*=NULL*/)
|
||||||
|
: CDialog(CGUIToolBar::IDD, pParent)
|
||||||
|
{
|
||||||
|
//{{AFX_DATA_INIT(GUIToolBar)
|
||||||
|
// NOTE: the ClassWizard will add member initialization here
|
||||||
|
//}}AFX_DATA_INIT
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CGUIToolBar::DoDataExchange(CDataExchange* pDX)
|
||||||
|
{
|
||||||
|
CDialog::DoDataExchange(pDX);
|
||||||
|
//{{AFX_DATA_MAP(GUIToolBar)
|
||||||
|
DDX_Control(pDX, IDD_LAYERTILE_BTN_SELECT, m_Select);
|
||||||
|
DDX_Control(pDX, IDD_LAYERTILE_BTN_PAINT, m_Paint);
|
||||||
|
//}}AFX_DATA_MAP
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN_MESSAGE_MAP(CGUIToolBar, CDialog)
|
||||||
|
//{{AFX_MSG_MAP(GUIToolBar)
|
||||||
|
ON_BN_CLICKED(IDD_LAYERTILE_BTN_PAINT, OnLayertileBtnPaint)
|
||||||
|
ON_BN_CLICKED(IDD_LAYERTILE_BTN_SELECT, OnLayertileBtnSelect)
|
||||||
|
//}}AFX_MSG_MAP
|
||||||
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// GUIToolBar message handlers
|
||||||
|
|
||||||
|
BOOL CGUIToolBar::OnInitDialog()
|
||||||
|
{
|
||||||
|
CDialog::OnInitDialog();
|
||||||
|
|
||||||
|
m_Paint.SetIcon( (HICON) LoadImage (AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_PAINT),IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR) );
|
||||||
|
m_Select.SetIcon( (HICON) LoadImage (AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_SELECT),IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR) );
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
void CGUIToolBar::ResetButtons()
|
||||||
|
{
|
||||||
|
m_Paint.SetState(FALSE);
|
||||||
|
m_Select.SetState(FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
void CGUIToolBar::SetButtonState(GUIToolBarButton ID,BOOL State)
|
||||||
|
{
|
||||||
|
switch(ID)
|
||||||
|
{
|
||||||
|
case PAINT:
|
||||||
|
m_Paint.SetState(State);
|
||||||
|
break;
|
||||||
|
case SELECT:
|
||||||
|
m_Select.SetState(State);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
BOOL CGUIToolBar::GetButtonState(GUIToolBarButton ID)
|
||||||
|
{
|
||||||
|
switch(ID)
|
||||||
|
{
|
||||||
|
case PAINT: return(m_Paint.GetState());
|
||||||
|
case SELECT: return(m_Select.GetState());
|
||||||
|
}
|
||||||
|
return(FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
void CGUIToolBar::OnLayertileBtnPaint() {theApp.GetCurrent()->Command(CmdMsg_SetMode,CLayerTile::MouseModePaint);}
|
||||||
|
void CGUIToolBar::OnLayertileBtnSelect() {theApp.GetCurrent()->Command(CmdMsg_SetMode,CLayerTile::MouseModeSelect);}
|
58
Utils/MapEdit/GUIToolBar.h
Normal file
58
Utils/MapEdit/GUIToolBar.h
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
#if !defined(AFX_GUITOOLBAR_H__5622CD93_4D01_455A_85DC_12A630CA8D9D__INCLUDED_)
|
||||||
|
#define AFX_GUITOOLBAR_H__5622CD93_4D01_455A_85DC_12A630CA8D9D__INCLUDED_
|
||||||
|
|
||||||
|
#if _MSC_VER > 1000
|
||||||
|
#pragma once
|
||||||
|
#endif // _MSC_VER > 1000
|
||||||
|
// GUIToolBar.h : header file
|
||||||
|
//
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// GUIToolBar dialog
|
||||||
|
|
||||||
|
class CGUIToolBar : public CDialog
|
||||||
|
{
|
||||||
|
// Construction
|
||||||
|
public:
|
||||||
|
enum GUIToolBarButton
|
||||||
|
{
|
||||||
|
PAINT=0,
|
||||||
|
SELECT,
|
||||||
|
};
|
||||||
|
|
||||||
|
CGUIToolBar(CWnd* pParent = NULL); // standard constructor
|
||||||
|
|
||||||
|
// Dialog Data
|
||||||
|
//{{AFX_DATA(GUIToolBar)
|
||||||
|
enum { IDD = IDD_LAYER_TOOLBAR };
|
||||||
|
CButton m_Select;
|
||||||
|
CButton m_Paint;
|
||||||
|
//}}AFX_DATA
|
||||||
|
|
||||||
|
void ResetButtons();
|
||||||
|
void SetButtonState(GUIToolBarButton ID,BOOL Down);
|
||||||
|
BOOL GetButtonState(GUIToolBarButton ID);
|
||||||
|
|
||||||
|
// Overrides
|
||||||
|
// ClassWizard generated virtual function overrides
|
||||||
|
//{{AFX_VIRTUAL(GUIToolBar)
|
||||||
|
protected:
|
||||||
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||||
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Generated message map functions
|
||||||
|
//{{AFX_MSG(GUIToolBar)
|
||||||
|
afx_msg void OnLayertileBtnPaint();
|
||||||
|
afx_msg void OnLayertileBtnSelect();
|
||||||
|
virtual BOOL OnInitDialog();
|
||||||
|
//}}AFX_MSG
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
};
|
||||||
|
|
||||||
|
//{{AFX_INSERT_LOCATION}}
|
||||||
|
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||||
|
|
||||||
|
#endif // !defined(AFX_GUITOOLBAR_H__5622CD93_4D01_455A_85DC_12A630CA8D9D__INCLUDED_)
|
|
@ -7,6 +7,12 @@
|
||||||
#include <Vector3.h>
|
#include <Vector3.h>
|
||||||
#include <gl\gl.h>
|
#include <gl\gl.h>
|
||||||
#include <gl\glu.h>
|
#include <gl\glu.h>
|
||||||
|
#include "GLEnabledView.h"
|
||||||
|
|
||||||
|
#include "MapEdit.h"
|
||||||
|
#include "MapEditDoc.h"
|
||||||
|
#include "MapEditView.h"
|
||||||
|
#include "MainFrm.h"
|
||||||
|
|
||||||
#include "Core.h"
|
#include "Core.h"
|
||||||
#include "Layer.h"
|
#include "Layer.h"
|
||||||
|
@ -23,6 +29,7 @@ sLayerInfoTable CLayer::InfoTable[]=
|
||||||
{LAYER_TYPE_TILE, LAYER_SUBTYPE_MID, "Mid", true, 2.0f, false, true, true, LAYER_SUBVIEW_TILEBANK,},
|
{LAYER_TYPE_TILE, LAYER_SUBTYPE_MID, "Mid", true, 2.0f, false, true, true, LAYER_SUBVIEW_TILEBANK,},
|
||||||
{LAYER_TYPE_TILE, LAYER_SUBTYPE_ACTION, "Action", false, 1.0f, true, true, true, LAYER_SUBVIEW_TILEBANK,},
|
{LAYER_TYPE_TILE, LAYER_SUBTYPE_ACTION, "Action", false, 1.0f, true, true, true, LAYER_SUBVIEW_TILEBANK,},
|
||||||
{LAYER_TYPE_COLLISION, LAYER_SUBTYPE_NONE, "Collision", true, 1.0f, false, true, true, LAYER_SUBVIEW_TILEBANK,},
|
{LAYER_TYPE_COLLISION, LAYER_SUBTYPE_NONE, "Collision", true, 1.0f, false, true, true, LAYER_SUBVIEW_TILEBANK,},
|
||||||
|
{LAYER_TYPE_ITEM, LAYER_SUBTYPE_NONE, "Item", true, 1.0f, false, true, true, LAYER_SUBVIEW_TILEBANK,},
|
||||||
};
|
};
|
||||||
|
|
||||||
int CLayer::InfoTableSize=sizeof(InfoTable)/sizeof(sLayerInfoTable);
|
int CLayer::InfoTableSize=sizeof(InfoTable)/sizeof(sLayerInfoTable);
|
||||||
|
@ -63,3 +70,142 @@ int CLayer::GetLayerIdx(int Type,int SubType)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
void CLayer::RenderGrid(CCore *Core,Vector3 &CamPos,bool Active)
|
||||||
|
{
|
||||||
|
Vector3 ThisCam=Core->OffsetCam(CamPos,GetScaleFactor());
|
||||||
|
int MapWidth=GetWidth();
|
||||||
|
int MapHeight=GetHeight();
|
||||||
|
float ZoomW=Core->GetZoomW();
|
||||||
|
float ZoomH=Core->GetZoomH();
|
||||||
|
float ScrOfsX=(ZoomW/2);
|
||||||
|
float ScrOfsY=(ZoomH/2);
|
||||||
|
Vector3 &Scale=Core->GetScaleVector();
|
||||||
|
float Col;
|
||||||
|
const float OverVal=0.1f;
|
||||||
|
|
||||||
|
glMatrixMode(GL_MODELVIEW);
|
||||||
|
glPushMatrix();
|
||||||
|
glLoadIdentity();
|
||||||
|
glScalef(Scale.x,Scale.y,Scale.z);
|
||||||
|
glTranslatef(-ThisCam.x,ThisCam.y,0);
|
||||||
|
glTranslatef(-ScrOfsX,ScrOfsY,0); // Bring to top left corner
|
||||||
|
|
||||||
|
if (Active) Col=1; else Col=0.5f;
|
||||||
|
|
||||||
|
glBegin(GL_LINES);
|
||||||
|
|
||||||
|
glColor3f(Col,Col,Col);
|
||||||
|
|
||||||
|
for (int YLoop=0; YLoop<MapHeight+1; YLoop++)
|
||||||
|
{
|
||||||
|
glVertex3f( 0-OverVal, -YLoop+1, 0);
|
||||||
|
glVertex3f( MapWidth+OverVal, -YLoop+1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int XLoop=0; XLoop<MapWidth+1; XLoop++)
|
||||||
|
{
|
||||||
|
glVertex3f( XLoop, 0+1+OverVal, 0);
|
||||||
|
glVertex3f( XLoop, -MapHeight+1-OverVal, 0);
|
||||||
|
}
|
||||||
|
glEnd();
|
||||||
|
|
||||||
|
glPopMatrix();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
void CLayer::FindCursorPos(CCore *Core,Vector3 &CamPos,CPoint &MousePos)
|
||||||
|
{
|
||||||
|
Vector3 ThisCam=Core->OffsetCam(CamPos,GetScaleFactor());
|
||||||
|
int MapWidth=GetWidth();
|
||||||
|
int MapHeight=GetHeight();
|
||||||
|
float ZoomW=Core->GetZoomW();
|
||||||
|
float ZoomH=Core->GetZoomH();
|
||||||
|
float ScrOfsX=(ZoomW/2);
|
||||||
|
float ScrOfsY=(ZoomH/2);
|
||||||
|
Vector3 &Scale=Core->GetScaleVector();
|
||||||
|
|
||||||
|
GLint Viewport[4];
|
||||||
|
GLuint SelectBuffer[SELECT_BUFFER_SIZE];
|
||||||
|
int TileID=0;
|
||||||
|
CPoint &CursorPos=Core->GetCursorPos();
|
||||||
|
|
||||||
|
int StartX=(int)ThisCam.x;
|
||||||
|
int StartY=(int)ThisCam.y;
|
||||||
|
float ShiftX=ThisCam.x - (int)ThisCam.x;
|
||||||
|
float ShiftY=ThisCam.y - (int)ThisCam.y;
|
||||||
|
|
||||||
|
if (StartX<0) StartX=0;
|
||||||
|
if (StartY<0) StartY=0;
|
||||||
|
|
||||||
|
int DrawW=ZoomW+8;
|
||||||
|
int DrawH=ZoomH+8;
|
||||||
|
|
||||||
|
if (StartX+DrawW>MapWidth) DrawW=MapWidth-StartX;
|
||||||
|
if (StartY+DrawH>MapHeight) DrawH=MapHeight-StartY;
|
||||||
|
|
||||||
|
glGetIntegerv(GL_VIEWPORT, Viewport);
|
||||||
|
glSelectBuffer (SELECT_BUFFER_SIZE, SelectBuffer );
|
||||||
|
glRenderMode (GL_SELECT);
|
||||||
|
|
||||||
|
glInitNames();
|
||||||
|
glPushName(-1);
|
||||||
|
|
||||||
|
glMatrixMode(GL_PROJECTION);
|
||||||
|
glPushMatrix();
|
||||||
|
glLoadIdentity();
|
||||||
|
gluPickMatrix( MousePos.x ,(Viewport[3]-MousePos.y),5.0,5.0,Viewport);
|
||||||
|
Core->GetView()->SetupPersMatrix();
|
||||||
|
|
||||||
|
glMatrixMode(GL_MODELVIEW);
|
||||||
|
glPushMatrix();
|
||||||
|
glLoadIdentity();
|
||||||
|
glScalef(Scale.x,Scale.y,Scale.z);
|
||||||
|
// glTranslatef(-ThisCam.x,ThisCam.y,0);
|
||||||
|
glTranslatef(-ShiftX,ShiftY,0);
|
||||||
|
glTranslatef(-ScrOfsX,ScrOfsY,0); // Bring to top left corner
|
||||||
|
|
||||||
|
bool WrapMap=GetSubType()==LAYER_SUBTYPE_BACK;
|
||||||
|
if (WrapMap)
|
||||||
|
{
|
||||||
|
DrawW=MapWidth;
|
||||||
|
DrawH=MapHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int YLoop=0; YLoop<DrawH; YLoop++)
|
||||||
|
{
|
||||||
|
for (int XLoop=0; XLoop<DrawW; XLoop++)
|
||||||
|
{
|
||||||
|
int XPos=StartX+XLoop;
|
||||||
|
int YPos=StartY+YLoop;
|
||||||
|
if (WrapMap)
|
||||||
|
{
|
||||||
|
XPos%=MapWidth;
|
||||||
|
YPos%=MapHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
TileID=(XPos)+(((YPos)*MapWidth));
|
||||||
|
glLoadName (TileID);
|
||||||
|
glBegin (GL_QUADS);
|
||||||
|
BuildGLQuad(XLoop,XLoop+1,-YLoop,-YLoop+1,0);
|
||||||
|
glEnd();
|
||||||
|
TileID++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TileID= glRenderMode (GL_RENDER);
|
||||||
|
glPopMatrix();
|
||||||
|
glMatrixMode(GL_PROJECTION);
|
||||||
|
glPopMatrix();
|
||||||
|
CursorPos.x=CursorPos.y=-1;
|
||||||
|
|
||||||
|
// Process hits
|
||||||
|
|
||||||
|
GLuint *HitPtr=SelectBuffer;
|
||||||
|
|
||||||
|
if (TileID) // Just take 1st
|
||||||
|
{
|
||||||
|
int HitID=HitPtr[3];
|
||||||
|
CursorPos=IDToPoint(HitID,MapWidth);
|
||||||
|
}
|
||||||
|
glMatrixMode(GL_MODELVIEW); // <-- Prevent arse GL assert
|
||||||
|
}
|
||||||
|
|
|
@ -67,16 +67,16 @@ virtual int GetType()=0;
|
||||||
virtual int GetSubType() {return(LAYER_SUBTYPE_NONE);}
|
virtual int GetSubType() {return(LAYER_SUBTYPE_NONE);}
|
||||||
float GetScaleFactor() {return(ScaleFactor);}
|
float GetScaleFactor() {return(ScaleFactor);}
|
||||||
|
|
||||||
virtual void Render(CCore *Core,Vector3 &CamPos,bool Is3d)=0;
|
virtual void Render(CCore *Core,Vector3 &CamPos,bool Is3d){};
|
||||||
virtual void RenderGrid(CCore *Core,Vector3 &CamPos,bool Active)=0;
|
virtual void RenderGrid(CCore *Core,Vector3 &CamPos,bool Active);
|
||||||
virtual void RenderSelection(CCore *Core,Vector3 &ThisCam)=0;
|
virtual void RenderSelection(CCore *Core,Vector3 &ThisCam){};
|
||||||
virtual void RenderCursor(CCore *Core,Vector3 &CamPos,bool Is3d)=0;
|
virtual void RenderCursor(CCore *Core,Vector3 &CamPos,bool Is3d){};
|
||||||
virtual void FindCursorPos(CCore *Core,Vector3 &CamPos,CPoint &MousePos)=0;
|
virtual void FindCursorPos(CCore *Core,Vector3 &CamPos,CPoint &MousePos);
|
||||||
|
|
||||||
virtual void GUIInit(CCore *Core)=0;
|
virtual void GUIInit(CCore *Core){};
|
||||||
virtual void GUIKill(CCore *Core)=0;
|
virtual void GUIKill(CCore *Core){};
|
||||||
virtual void GUIUpdate(CCore *Core)=0;
|
virtual void GUIUpdate(CCore *Core){};
|
||||||
virtual void GUIChanged(CCore *Core)=0;
|
virtual void GUIChanged(CCore *Core){};
|
||||||
|
|
||||||
virtual int GetWidth() {return(-1);}
|
virtual int GetWidth() {return(-1);}
|
||||||
virtual int GetHeight() {return(-1);}
|
virtual int GetHeight() {return(-1);}
|
||||||
|
|
|
@ -135,15 +135,15 @@ bool Ret=false;
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CLayerCollision::GUIInit(CCore *Core)
|
void CLayerCollision::GUIInit(CCore *Core)
|
||||||
{
|
{
|
||||||
Core->GUIAdd(ToolBarGUI,IDD_LAYERTILE_TOOLBAR);
|
Core->GUIAdd(GUIToolBar,IDD_LAYERTILE_TOOLBAR);
|
||||||
Core->GUIAdd(CollisionGUI,IDD_LAYERCOLLISION_GUI);
|
Core->GUIAdd(GUI,IDD_LAYER_COLLISION);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CLayerCollision::GUIKill(CCore *Core)
|
void CLayerCollision::GUIKill(CCore *Core)
|
||||||
{
|
{
|
||||||
Core->GUIRemove(ToolBarGUI,IDD_LAYERTILE_TOOLBAR);
|
Core->GUIRemove(GUIToolBar,IDD_LAYERTILE_TOOLBAR);
|
||||||
Core->GUIRemove(CollisionGUI,IDD_LAYERCOLLISION_GUI);
|
Core->GUIRemove(GUI,IDD_LAYER_COLLISION);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
#include "Layer.h"
|
#include "Layer.h"
|
||||||
#include "MapEdit.h"
|
#include "MapEdit.h"
|
||||||
#include "LayerCollisionGUI.h"
|
#include "GUILayerCollision.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
class CCore;
|
class CCore;
|
||||||
|
@ -41,7 +41,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
void InitTileBank();
|
void InitTileBank();
|
||||||
|
|
||||||
CLayerCollisionGUI CollisionGUI;
|
GUILayerCollision GUI;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ enum LAYER_TYPE
|
||||||
LAYER_TYPE_TILE=0,
|
LAYER_TYPE_TILE=0,
|
||||||
LAYER_TYPE_COLLISION,
|
LAYER_TYPE_COLLISION,
|
||||||
LAYER_TYPE_SHADE,
|
LAYER_TYPE_SHADE,
|
||||||
|
LAYER_TYPE_ITEM,
|
||||||
LAYER_TYPE_MAX
|
LAYER_TYPE_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -46,6 +47,8 @@ enum TILE_FLAG
|
||||||
PC_TILE_COLLISION_ELECTRIC =3,
|
PC_TILE_COLLISION_ELECTRIC =3,
|
||||||
PC_TILE_COLLISION_STICKY =4,
|
PC_TILE_COLLISION_STICKY =4,
|
||||||
PC_TILE_COLLISION_WATER =5,
|
PC_TILE_COLLISION_WATER =5,
|
||||||
|
PC_TILE_COLLISION_SOLID =6,
|
||||||
|
PC_TILE_COLLISION_DEATH =7,
|
||||||
|
|
||||||
PC_TILE_FLAG_COLLISION_SHIFT =2,
|
PC_TILE_FLAG_COLLISION_SHIFT =2,
|
||||||
PC_TILE_FLAG_COLLISION_NORMAL =PC_TILE_COLLISION_NORMAL<<PC_TILE_FLAG_COLLISION_SHIFT,
|
PC_TILE_FLAG_COLLISION_NORMAL =PC_TILE_COLLISION_NORMAL<<PC_TILE_FLAG_COLLISION_SHIFT,
|
||||||
|
@ -54,6 +57,8 @@ enum TILE_FLAG
|
||||||
PC_TILE_FLAG_COLLISION_ELECTRIC =PC_TILE_COLLISION_ELECTRIC<<PC_TILE_FLAG_COLLISION_SHIFT,
|
PC_TILE_FLAG_COLLISION_ELECTRIC =PC_TILE_COLLISION_ELECTRIC<<PC_TILE_FLAG_COLLISION_SHIFT,
|
||||||
PC_TILE_FLAG_COLLISION_STICKY =PC_TILE_COLLISION_STICKY<<PC_TILE_FLAG_COLLISION_SHIFT,
|
PC_TILE_FLAG_COLLISION_STICKY =PC_TILE_COLLISION_STICKY<<PC_TILE_FLAG_COLLISION_SHIFT,
|
||||||
PC_TILE_FLAG_COLLISION_WATER =PC_TILE_COLLISION_WATER<<PC_TILE_FLAG_COLLISION_SHIFT,
|
PC_TILE_FLAG_COLLISION_WATER =PC_TILE_COLLISION_WATER<<PC_TILE_FLAG_COLLISION_SHIFT,
|
||||||
|
PC_TILE_FLAG_COLLISION_SOLID =PC_TILE_COLLISION_SOLID<<PC_TILE_FLAG_COLLISION_SHIFT,
|
||||||
|
PC_TILE_FLAG_COLLISION_DEATH =PC_TILE_COLLISION_DEATH<<PC_TILE_FLAG_COLLISION_SHIFT,
|
||||||
|
|
||||||
PC_TILE_FLAG_COLLISION_MASK = ~PC_TILE_FLAG_MIRROR_XY,
|
PC_TILE_FLAG_COLLISION_MASK = ~PC_TILE_FLAG_MIRROR_XY,
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/******************/
|
/******************/
|
||||||
/*** Layer Tile ***/
|
/*** Layer Item ***/
|
||||||
/******************/
|
/******************/
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,160 +14,84 @@
|
||||||
#include "MapEditView.h"
|
#include "MapEditView.h"
|
||||||
#include "MainFrm.h"
|
#include "MainFrm.h"
|
||||||
|
|
||||||
#include "TileSet.h"
|
//#include "ItemSet.h"
|
||||||
|
|
||||||
#include "Core.h"
|
#include "Core.h"
|
||||||
#include "Layer.h"
|
#include "Layer.h"
|
||||||
#include "LayerTile.h"
|
#include "LayerItem.h"
|
||||||
#include "Utils.h"
|
#include "Utils.h"
|
||||||
#include "Select.h"
|
//#include "Select.h"
|
||||||
#include "Export.h"
|
#include "Export.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
// New Layer
|
// New Layer
|
||||||
CLayerTile::CLayerTile(int _SubType,int Width,int Height)
|
CLayerItem::CLayerItem(int _SubType,int _Width,int _Height)
|
||||||
{
|
{
|
||||||
SubType=_SubType;
|
|
||||||
TileBank=0;
|
|
||||||
if (SubType==LAYER_SUBTYPE_ACTION)
|
|
||||||
TileBank=new CTileBank;
|
|
||||||
else
|
|
||||||
TileBank=0;
|
|
||||||
SubView=TileBank;
|
|
||||||
|
|
||||||
SetDefaultParams();
|
SetDefaultParams();
|
||||||
|
|
||||||
Mode=MouseModePaint;
|
Mode=MouseModePaint;
|
||||||
|
|
||||||
if (ResizeFlag)
|
|
||||||
{
|
|
||||||
Width=TileLayerMinWidth+(Width-TileLayerMinWidth)/ScaleFactor;
|
|
||||||
Height=TileLayerMinHeight+(Height-TileLayerMinHeight)/ScaleFactor;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Width=32;
|
|
||||||
Height=32;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Width<TileLayerMinWidth) Width=TileLayerMinWidth;
|
|
||||||
if (Height<TileLayerMinHeight) Height=TileLayerMinHeight;
|
|
||||||
|
|
||||||
Map.SetSize(Width,Height,TRUE);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
// Load Layer
|
// Load Layer
|
||||||
CLayerTile::CLayerTile(CFile *File,int Version)
|
CLayerItem::CLayerItem(CFile *File,int Version)
|
||||||
{
|
{
|
||||||
Load(File,Version);
|
Load(File,Version);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
CLayerTile::~CLayerTile()
|
CLayerItem::~CLayerItem()
|
||||||
{
|
{
|
||||||
if (SubType==LAYER_SUBTYPE_ACTION)
|
ElemBank->CleanUp();
|
||||||
{
|
delete ElemBank;
|
||||||
TileBank->CleanUp();
|
|
||||||
delete TileBank;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CLayerTile::Load(CFile *File,int Version)
|
void CLayerItem::Load(CFile *File,int Version)
|
||||||
{
|
{
|
||||||
File->Read(&Render3dFlag,sizeof(BOOL));
|
|
||||||
File->Read(&ScaleFactor,sizeof(float));
|
|
||||||
File->Read(&ResizeFlag,sizeof(BOOL));
|
|
||||||
File->Read(&VisibleFlag,sizeof(BOOL));
|
File->Read(&VisibleFlag,sizeof(BOOL));
|
||||||
File->Read(&Mode,sizeof(MouseMode));
|
File->Read(&Mode,sizeof(MouseMode));
|
||||||
File->Read(&SubType,sizeof(int));
|
|
||||||
Map.Load(File,Version);
|
|
||||||
|
|
||||||
if (SubType==LAYER_SUBTYPE_ACTION)
|
|
||||||
TileBank=new CTileBank;
|
|
||||||
else
|
|
||||||
TileBank=0;
|
|
||||||
SubView=TileBank;
|
|
||||||
|
|
||||||
TRACE1("%s\t",GetName());
|
TRACE1("%s\t",GetName());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CLayerTile::Save(CFile *File)
|
void CLayerItem::Save(CFile *File)
|
||||||
{
|
{
|
||||||
// Always Save current version
|
// Always Save current version
|
||||||
|
|
||||||
File->Write(&Render3dFlag,sizeof(BOOL));
|
|
||||||
File->Write(&ScaleFactor,sizeof(float));
|
|
||||||
File->Write(&ResizeFlag,sizeof(BOOL));
|
|
||||||
File->Write(&VisibleFlag,sizeof(BOOL));
|
File->Write(&VisibleFlag,sizeof(BOOL));
|
||||||
File->Write(&Mode,sizeof(MouseMode));
|
File->Write(&Mode,sizeof(MouseMode));
|
||||||
File->Write(&SubType,sizeof(SubType));
|
|
||||||
Map.Save(File);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CLayerTile::InitSubView(CCore *Core)
|
void CLayerItem::InitSubView(CCore *Core)
|
||||||
{
|
{
|
||||||
// Fix up shared layers
|
ElemBank=new CElemStore;
|
||||||
if (SubType!=LAYER_SUBTYPE_ACTION)
|
SubView=ElemBank;
|
||||||
{
|
|
||||||
TileBank=Core->GetTileBank();
|
|
||||||
SubView=(CLayer*)TileBank;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
void CLayerTile::CheckLayerSize(int Width,int Height)
|
|
||||||
{
|
|
||||||
if (Resize(Width,Height))
|
|
||||||
{
|
|
||||||
CString mexstr;
|
|
||||||
mexstr.Format("%s Layer Resized to Correct Size\nPlease re-save\n", GetName());
|
|
||||||
AfxMessageBox(mexstr,MB_OK | MB_ICONEXCLAMATION);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
bool CLayerTile::Resize(int Width,int Height)
|
|
||||||
{
|
|
||||||
if (!ResizeFlag) return(FALSE); // Its a fixed size, so DONT DO IT!
|
|
||||||
|
|
||||||
int ThisWidth=Map.GetWidth();
|
|
||||||
int ThisHeight=Map.GetHeight();
|
|
||||||
Width=TileLayerMinWidth+(Width-TileLayerMinWidth)/ScaleFactor;
|
|
||||||
Height=TileLayerMinHeight+(Height-TileLayerMinHeight)/ScaleFactor;
|
|
||||||
|
|
||||||
if (ThisWidth!=Width || ThisHeight!=Height)
|
|
||||||
{
|
|
||||||
Map.Resize(Width,Height);
|
|
||||||
return(TRUE);
|
|
||||||
}
|
|
||||||
return(FALSE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CLayerTile::Render(CCore *Core,Vector3 &CamPos,bool Is3d)
|
void CLayerItem::Render(CCore *Core,Vector3 &CamPos,bool Is3d)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
Vector3 ThisCam=Core->OffsetCam(CamPos,GetScaleFactor());
|
Vector3 ThisCam=Core->OffsetCam(CamPos,GetScaleFactor());
|
||||||
|
|
||||||
Is3d&=Render3dFlag;
|
Is3d&=Render3dFlag;
|
||||||
Render(Core,ThisCam,Map,Is3d);
|
Render(Core,ThisCam,Map,Is3d);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CLayerTile::RenderCursorPaint(CCore *Core,Vector3 &CamPos,bool Is3d)
|
void CLayerItem::RenderCursorPaint(CCore *Core,Vector3 &CamPos,bool Is3d)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
Vector3 ThisCam=Core->OffsetCam(CamPos,GetScaleFactor());
|
Vector3 ThisCam=Core->OffsetCam(CamPos,GetScaleFactor());
|
||||||
CPoint &CursPos=Core->GetCursorPos();
|
CPoint &CursPos=Core->GetCursorPos();
|
||||||
CMap &Brush=TileBank->GetActiveBrush();
|
CMap &Brush=ElemBank->GetActiveBrush();
|
||||||
Vector3 Ofs;
|
Vector3 Ofs;
|
||||||
|
|
||||||
if (!Brush.IsValid()) return;
|
if (!Brush.IsValid()) return;
|
||||||
|
@ -189,11 +113,13 @@ Vector3 Ofs;
|
||||||
{
|
{
|
||||||
Render(Core,ThisCam,Brush,FALSE,0.5,&Ofs);
|
Render(Core,ThisCam,Brush,FALSE,0.5,&Ofs);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CLayerTile::Render(CCore *Core,Vector3 &ThisCam,CMap &ThisMap,bool Render3d,float Alpha,Vector3 *Ofs)
|
void CLayerItem::Render(CCore *Core,Vector3 &ThisCam,CMap &ThisMap,bool Render3d,float Alpha,Vector3 *Ofs)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
int MapWidth=ThisMap.GetWidth();
|
int MapWidth=ThisMap.GetWidth();
|
||||||
int MapHeight=ThisMap.GetHeight();
|
int MapHeight=ThisMap.GetHeight();
|
||||||
float ZoomW=Core->GetZoomW();
|
float ZoomW=Core->GetZoomW();
|
||||||
|
@ -207,7 +133,7 @@ int StartY=(int)ThisCam.y;
|
||||||
float ShiftX=ThisCam.x - (int)ThisCam.x;
|
float ShiftX=ThisCam.x - (int)ThisCam.x;
|
||||||
float ShiftY=ThisCam.y - (int)ThisCam.y;
|
float ShiftY=ThisCam.y - (int)ThisCam.y;
|
||||||
|
|
||||||
if (TileBank->NeedLoad()) TileBank->LoadAllSets(Core);
|
if (ElemBank->NeedLoad()) ElemBank->LoadAllSets(Core);
|
||||||
|
|
||||||
if (StartX<0) StartX=0;
|
if (StartX<0) StartX=0;
|
||||||
if (StartY<0) StartY=0;
|
if (StartY<0) StartY=0;
|
||||||
|
@ -249,244 +175,70 @@ int DrawH=ZoomH+8;
|
||||||
}
|
}
|
||||||
|
|
||||||
sMapElem &ThisElem=ThisMap.Get(XPos,YPos);
|
sMapElem &ThisElem=ThisMap.Get(XPos,YPos);
|
||||||
if (ThisElem.Tile>0)
|
if (ThisElem.Item>0)
|
||||||
{ // Render Non Zero and Valid Tiles
|
{ // Render Non Zero and Valid Items
|
||||||
glColor4f(1,1,1,Alpha); // Set default Color
|
glColor4f(1,1,1,Alpha); // Set default Color
|
||||||
TileBank->RenderTile(ThisElem.Set,ThisElem.Tile,ThisElem.Flags,Render3d);
|
ElemBank->RenderItem(ThisElem.Set,ThisElem.Item,ThisElem.Flags,Render3d);
|
||||||
}
|
}
|
||||||
glTranslatef(1.0f,0,0); // Next X
|
glTranslatef(1.0f,0,0); // Next X
|
||||||
}
|
}
|
||||||
glTranslatef(-DrawW,-1,0); // Next y, rewind to start X
|
glTranslatef(-DrawW,-1,0); // Next y, rewind to start X
|
||||||
}
|
}
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
}
|
*/
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
void CLayerTile::RenderSelection(CCore *Core,Vector3 &CamPos)
|
|
||||||
{
|
|
||||||
CRect Rect=Selection.GetRect();
|
|
||||||
Vector3 ThisCam=Core->OffsetCam(CamPos,GetScaleFactor());
|
|
||||||
float ZoomW=Core->GetZoomW();
|
|
||||||
float ZoomH=Core->GetZoomH();
|
|
||||||
float ScrOfsX=(ZoomW/2);
|
|
||||||
float ScrOfsY=(ZoomH/2);
|
|
||||||
Vector3 &Scale=Core->GetScaleVector();
|
|
||||||
|
|
||||||
if (!Selection.IsValid()) return;
|
|
||||||
glMatrixMode(GL_MODELVIEW);
|
|
||||||
glPushMatrix();
|
|
||||||
glLoadIdentity();
|
|
||||||
glScalef(Scale.x,Scale.y,Scale.z);
|
|
||||||
glTranslatef(-ThisCam.x,ThisCam.y,0);
|
|
||||||
glTranslatef(-ScrOfsX,ScrOfsY,0); // Bring to top left corner
|
|
||||||
|
|
||||||
glColor4f(1,0,1,0.5f);
|
|
||||||
glBegin (GL_QUADS);
|
|
||||||
float X0=Rect.left;
|
|
||||||
float X1=Rect.right;
|
|
||||||
float Y0=Rect.top-1;
|
|
||||||
float Y1=Rect.bottom-1;
|
|
||||||
glVertex3f( X0, -Y0, 0);
|
|
||||||
glVertex3f( X1, -Y0, 0);
|
|
||||||
glVertex3f( X1, -Y1, 0);
|
|
||||||
glVertex3f( X0, -Y1, 0);
|
|
||||||
glEnd();
|
|
||||||
|
|
||||||
glPopMatrix();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
void CLayerTile::RenderGrid(CCore *Core,Vector3 &CamPos,bool Active)
|
|
||||||
{
|
|
||||||
Vector3 ThisCam=Core->OffsetCam(CamPos,GetScaleFactor());
|
|
||||||
int MapWidth=Map.GetWidth();
|
|
||||||
int MapHeight=Map.GetHeight();
|
|
||||||
float ZoomW=Core->GetZoomW();
|
|
||||||
float ZoomH=Core->GetZoomH();
|
|
||||||
float ScrOfsX=(ZoomW/2);
|
|
||||||
float ScrOfsY=(ZoomH/2);
|
|
||||||
Vector3 &Scale=Core->GetScaleVector();
|
|
||||||
float Col;
|
|
||||||
const float OverVal=0.1f;
|
|
||||||
|
|
||||||
glMatrixMode(GL_MODELVIEW);
|
|
||||||
glPushMatrix();
|
|
||||||
glLoadIdentity();
|
|
||||||
glScalef(Scale.x,Scale.y,Scale.z);
|
|
||||||
glTranslatef(-ThisCam.x,ThisCam.y,0);
|
|
||||||
glTranslatef(-ScrOfsX,ScrOfsY,0); // Bring to top left corner
|
|
||||||
|
|
||||||
if (Active) Col=1; else Col=0.5f;
|
|
||||||
|
|
||||||
glBegin(GL_LINES);
|
|
||||||
|
|
||||||
glColor3f(Col,Col,Col);
|
|
||||||
|
|
||||||
for (int YLoop=0; YLoop<MapHeight+1; YLoop++)
|
|
||||||
{
|
|
||||||
glVertex3f( 0-OverVal, -YLoop+1, 0);
|
|
||||||
glVertex3f( MapWidth+OverVal, -YLoop+1, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int XLoop=0; XLoop<MapWidth+1; XLoop++)
|
|
||||||
{
|
|
||||||
glVertex3f( XLoop, 0+1+OverVal, 0);
|
|
||||||
glVertex3f( XLoop, -MapHeight+1-OverVal, 0);
|
|
||||||
}
|
|
||||||
glEnd();
|
|
||||||
|
|
||||||
glPopMatrix();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
void CLayerTile::FindCursorPos(CCore *Core,Vector3 &CamPos,CPoint &MousePos)
|
|
||||||
{
|
|
||||||
Vector3 ThisCam=Core->OffsetCam(CamPos,GetScaleFactor());
|
|
||||||
int MapWidth=Map.GetWidth();
|
|
||||||
int MapHeight=Map.GetHeight();
|
|
||||||
float ZoomW=Core->GetZoomW();
|
|
||||||
float ZoomH=Core->GetZoomH();
|
|
||||||
float ScrOfsX=(ZoomW/2);
|
|
||||||
float ScrOfsY=(ZoomH/2);
|
|
||||||
Vector3 &Scale=Core->GetScaleVector();
|
|
||||||
|
|
||||||
GLint Viewport[4];
|
|
||||||
GLuint SelectBuffer[SELECT_BUFFER_SIZE];
|
|
||||||
int TileID=0;
|
|
||||||
CPoint &CursorPos=Core->GetCursorPos();
|
|
||||||
|
|
||||||
int StartX=(int)ThisCam.x;
|
|
||||||
int StartY=(int)ThisCam.y;
|
|
||||||
float ShiftX=ThisCam.x - (int)ThisCam.x;
|
|
||||||
float ShiftY=ThisCam.y - (int)ThisCam.y;
|
|
||||||
|
|
||||||
if (StartX<0) StartX=0;
|
|
||||||
if (StartY<0) StartY=0;
|
|
||||||
|
|
||||||
int DrawW=ZoomW+8;
|
|
||||||
int DrawH=ZoomH+8;
|
|
||||||
|
|
||||||
if (StartX+DrawW>MapWidth) DrawW=MapWidth-StartX;
|
|
||||||
if (StartY+DrawH>MapHeight) DrawH=MapHeight-StartY;
|
|
||||||
|
|
||||||
glGetIntegerv(GL_VIEWPORT, Viewport);
|
|
||||||
glSelectBuffer (SELECT_BUFFER_SIZE, SelectBuffer );
|
|
||||||
glRenderMode (GL_SELECT);
|
|
||||||
|
|
||||||
glInitNames();
|
|
||||||
glPushName(-1);
|
|
||||||
|
|
||||||
glMatrixMode(GL_PROJECTION);
|
|
||||||
glPushMatrix();
|
|
||||||
glLoadIdentity();
|
|
||||||
gluPickMatrix( MousePos.x ,(Viewport[3]-MousePos.y),5.0,5.0,Viewport);
|
|
||||||
Core->GetView()->SetupPersMatrix();
|
|
||||||
|
|
||||||
glMatrixMode(GL_MODELVIEW);
|
|
||||||
glPushMatrix();
|
|
||||||
glLoadIdentity();
|
|
||||||
glScalef(Scale.x,Scale.y,Scale.z);
|
|
||||||
// glTranslatef(-ThisCam.x,ThisCam.y,0);
|
|
||||||
glTranslatef(-ShiftX,ShiftY,0);
|
|
||||||
glTranslatef(-ScrOfsX,ScrOfsY,0); // Bring to top left corner
|
|
||||||
|
|
||||||
bool WrapMap=SubType==LAYER_SUBTYPE_BACK;
|
|
||||||
if (WrapMap)
|
|
||||||
{
|
|
||||||
DrawW=MapWidth;
|
|
||||||
DrawH=MapHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int YLoop=0; YLoop<DrawH; YLoop++)
|
|
||||||
{
|
|
||||||
for (int XLoop=0; XLoop<DrawW; XLoop++)
|
|
||||||
{
|
|
||||||
int XPos=StartX+XLoop;
|
|
||||||
int YPos=StartY+YLoop;
|
|
||||||
if (WrapMap)
|
|
||||||
{
|
|
||||||
XPos%=MapWidth;
|
|
||||||
YPos%=MapHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
TileID=(XPos)+(((YPos)*MapWidth));
|
|
||||||
glLoadName (TileID);
|
|
||||||
glBegin (GL_QUADS);
|
|
||||||
BuildGLQuad(XLoop,XLoop+1,-YLoop,-YLoop+1,0);
|
|
||||||
glEnd();
|
|
||||||
TileID++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TileID= glRenderMode (GL_RENDER);
|
|
||||||
glPopMatrix();
|
|
||||||
glMatrixMode(GL_PROJECTION);
|
|
||||||
glPopMatrix();
|
|
||||||
CursorPos.x=CursorPos.y=-1;
|
|
||||||
|
|
||||||
// Process hits
|
|
||||||
|
|
||||||
GLuint *HitPtr=SelectBuffer;
|
|
||||||
|
|
||||||
if (TileID) // Just take 1st
|
|
||||||
{
|
|
||||||
int HitID=HitPtr[3];
|
|
||||||
CursorPos=IDToPoint(HitID,MapWidth);
|
|
||||||
}
|
|
||||||
glMatrixMode(GL_MODELVIEW); // <-- Prevent arse GL assert
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*** Gui *********************************************************************/
|
/*** Gui *********************************************************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CLayerTile::GUIInit(CCore *Core)
|
void CLayerItem::GUIInit(CCore *Core)
|
||||||
{
|
{
|
||||||
TileBank->GUIInit(Core);
|
ElemBank->GUIInit(Core);
|
||||||
Core->GUIAdd(ToolBarGUI,IDD_LAYERTILE_TOOLBAR);
|
Core->GUIAdd(GUIToolBar,IDD_LAYERTILE_TOOLBAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CLayerTile::GUIKill(CCore *Core)
|
void CLayerItem::GUIKill(CCore *Core)
|
||||||
{
|
{
|
||||||
TileBank->GUIKill(Core);
|
ElemBank->GUIKill(Core);
|
||||||
Core->GUIRemove(ToolBarGUI,IDD_LAYERTILE_TOOLBAR);
|
Core->GUIRemove(GUIToolBar,IDD_LAYERTILE_TOOLBAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CLayerTile::GUIUpdate(CCore *Core)
|
void CLayerItem::GUIUpdate(CCore *Core)
|
||||||
{
|
{
|
||||||
ToolBarGUI.ResetButtons();
|
GUIToolBar.ResetButtons();
|
||||||
switch(Mode)
|
switch(Mode)
|
||||||
{
|
{
|
||||||
case MouseModePaint:
|
case MouseModePaint:
|
||||||
ToolBarGUI.SetButtonState(CLayerTileToolbar::PAINT,TRUE);
|
GUIToolBar.SetButtonState(CGUIToolBar::PAINT,true);
|
||||||
break;
|
break;
|
||||||
case MouseModeSelect:
|
case MouseModeSelect:
|
||||||
ToolBarGUI.SetButtonState(CLayerTileToolbar::SELECT,TRUE);
|
GUIToolBar.SetButtonState(CGUIToolBar::SELECT,true);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
TileBank->GUIUpdate(Core);
|
ElemBank->GUIUpdate(Core);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CLayerTile::GUIChanged(CCore *Core)
|
void CLayerItem::GUIChanged(CCore *Core)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*** Functions ***************************************************************/
|
/*** Functions ***************************************************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
bool CLayerTile::LButtonControl(CCore *Core,UINT nFlags, CPoint &CursorPos,bool DownFlag)
|
bool CLayerItem::LButtonControl(CCore *Core,UINT nFlags, CPoint &CursorPos,bool DownFlag)
|
||||||
{
|
{
|
||||||
bool Ret=false;
|
bool Ret=false;
|
||||||
|
/*
|
||||||
switch(Mode)
|
switch(Mode)
|
||||||
{
|
{
|
||||||
case MouseModePaint:
|
case MouseModePaint:
|
||||||
if (DownFlag)
|
if (DownFlag)
|
||||||
Ret=Paint(TileBank->GetLBrush(),CursorPos);
|
Ret=Paint(ElemBank->GetLBrush(),CursorPos);
|
||||||
break;
|
break;
|
||||||
case MouseModeSelect:
|
case MouseModeSelect:
|
||||||
Ret=Selection.Handle(CursorPos,nFlags);
|
Ret=Selection.Handle(CursorPos,nFlags);
|
||||||
|
@ -498,19 +250,20 @@ bool Ret=false;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
return(Ret);
|
return(Ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
bool CLayerTile::RButtonControl(CCore *Core,UINT nFlags, CPoint &CursorPos,bool DownFlag)
|
bool CLayerItem::RButtonControl(CCore *Core,UINT nFlags, CPoint &CursorPos,bool DownFlag)
|
||||||
{
|
{
|
||||||
bool Ret=FALSE;
|
bool Ret=FALSE;
|
||||||
|
/*
|
||||||
switch(Mode)
|
switch(Mode)
|
||||||
{
|
{
|
||||||
case MouseModePaint:
|
case MouseModePaint:
|
||||||
if (DownFlag)
|
if (DownFlag)
|
||||||
Ret=Paint(TileBank->GetRBrush(),CursorPos);
|
Ret=Paint(ElemBank->GetRBrush(),CursorPos);
|
||||||
break;
|
break;
|
||||||
case MouseModeSelect:
|
case MouseModeSelect:
|
||||||
Ret=Selection.Handle(CursorPos,nFlags);
|
Ret=Selection.Handle(CursorPos,nFlags);
|
||||||
|
@ -522,22 +275,23 @@ bool Ret=FALSE;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
return(Ret);
|
return(Ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
bool CLayerTile::MouseMove(CCore *Core,UINT nFlags, CPoint &CursorPos)
|
bool CLayerItem::MouseMove(CCore *Core,UINT nFlags, CPoint &CursorPos)
|
||||||
{
|
{
|
||||||
bool Ret=FALSE;
|
bool Ret=FALSE;
|
||||||
|
/*
|
||||||
switch(Mode)
|
switch(Mode)
|
||||||
{
|
{
|
||||||
case MouseModePaint:
|
case MouseModePaint:
|
||||||
if (nFlags & MK_LBUTTON)
|
if (nFlags & MK_LBUTTON)
|
||||||
Ret=Paint(TileBank->GetLBrush(),CursorPos);
|
Ret=Paint(ElemBank->GetLBrush(),CursorPos);
|
||||||
else
|
else
|
||||||
if (nFlags & MK_RBUTTON)
|
if (nFlags & MK_RBUTTON)
|
||||||
Ret=Paint(TileBank->GetRBrush(),CursorPos);
|
Ret=Paint(ElemBank->GetRBrush(),CursorPos);
|
||||||
break;
|
break;
|
||||||
case MouseModeSelect:
|
case MouseModeSelect:
|
||||||
Ret=Selection.Handle(CursorPos,nFlags);
|
Ret=Selection.Handle(CursorPos,nFlags);
|
||||||
|
@ -545,228 +299,87 @@ bool Ret=FALSE;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
return(Ret);
|
return(Ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
bool CLayerTile::Command(int CmdMsg,CCore *Core,int Param0,int Param1)
|
bool CLayerItem::Command(int CmdMsg,CCore *Core,int Param0,int Param1)
|
||||||
{
|
{
|
||||||
bool Ret=false;
|
bool Ret=false;
|
||||||
|
|
||||||
switch(CmdMsg)
|
switch(CmdMsg)
|
||||||
{
|
{
|
||||||
case CmdMsg_SetMode:
|
case CmdMsg_SetMode:
|
||||||
Mode=(MouseMode)Param0;
|
Mode=(MouseMode)Param0;
|
||||||
Core->GUIUpdate();
|
Core->GUIUpdate();
|
||||||
break;
|
break;
|
||||||
case CmdMsg_Copy:
|
|
||||||
CopySelection(Core);
|
|
||||||
break;
|
|
||||||
case CmdMsg_Paste:
|
|
||||||
PasteSelection(Core);
|
|
||||||
break;
|
|
||||||
case CmdMsg_MirrorX:
|
|
||||||
Ret=MirrorX(Core);
|
|
||||||
break;
|
|
||||||
case CmdMsg_MirrorY:
|
|
||||||
Ret=MirrorY(Core);
|
|
||||||
break;
|
|
||||||
case CmdMsg_SetColFlag:
|
|
||||||
Ret=SetColFlags(Core,Param0);
|
|
||||||
break;
|
|
||||||
case CmdMsg_SubViewLoad:
|
|
||||||
case CmdMsg_SubViewDelete:
|
|
||||||
case CmdMsg_SubViewUpdate:
|
|
||||||
case CmdMsg_SubViewSet:
|
case CmdMsg_SubViewSet:
|
||||||
case CmdMsg_ActiveBrushLeft:
|
Ret=ElemBank->Command(CmdMsg,Core,Param0,Param1);
|
||||||
case CmdMsg_ActiveBrushRight:
|
|
||||||
Ret=TileBank->Command(CmdMsg,Core,Param0,Param1);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
TRACE3("LayerTile-Unhandled Command %i (%i,%i)\n",CmdMsg,Param0,Param1);
|
TRACE3("LayerItem-Unhandled Command %i (%i,%i)\n",CmdMsg,Param0,Param1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return(Ret);
|
return(Ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CLayerTile::RenderCursor(CCore *Core,Vector3 &CamPos,bool Is3d)
|
void CLayerItem::RenderCursor(CCore *Core,Vector3 &CamPos,bool Is3d)
|
||||||
{
|
{
|
||||||
switch(Mode)
|
RenderCursorPaint(Core,CamPos,Is3d);
|
||||||
{
|
|
||||||
case MouseModePaint:
|
|
||||||
RenderCursorPaint(Core,CamPos,Is3d);
|
|
||||||
break;
|
|
||||||
case MouseModeSelect:
|
|
||||||
RenderSelection(Core,CamPos);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
bool CLayerTile::MirrorX(CCore *Core)
|
bool CLayerItem::Paint(CMap &Blk,CPoint &CursorPos)
|
||||||
{
|
{
|
||||||
switch(Mode)
|
|
||||||
{
|
|
||||||
case MouseModePaint:
|
|
||||||
{
|
|
||||||
TileBank->GetLBrush().MirrorX(PC_TILE_FLAG_MIRROR_X);
|
|
||||||
TileBank->GetRBrush().MirrorX(PC_TILE_FLAG_MIRROR_X);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case MouseModeSelect:
|
|
||||||
{
|
|
||||||
if (!Selection.IsValid()) return(false); // No Selection
|
|
||||||
CRect R=Selection.GetRect();
|
|
||||||
Map.MirrorX(PC_TILE_FLAG_MIRROR_X,&R);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
Core->UpdateView();
|
|
||||||
return(TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
bool CLayerTile::MirrorY(CCore *Core)
|
|
||||||
{
|
|
||||||
switch(Mode)
|
|
||||||
{
|
|
||||||
case MouseModePaint:
|
|
||||||
{
|
|
||||||
TileBank->GetLBrush().MirrorY(PC_TILE_FLAG_MIRROR_Y);
|
|
||||||
TileBank->GetRBrush().MirrorY(PC_TILE_FLAG_MIRROR_Y);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case MouseModeSelect:
|
|
||||||
{
|
|
||||||
if (!Selection.IsValid()) return(false); // No Selection
|
|
||||||
CRect R=Selection.GetRect();
|
|
||||||
Map.MirrorY(PC_TILE_FLAG_MIRROR_Y,&R);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
Core->UpdateView();
|
|
||||||
return(TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
bool CLayerTile::SetColFlags(CCore *Core,int Flags)
|
|
||||||
{
|
|
||||||
switch(Mode)
|
|
||||||
{
|
|
||||||
case MouseModePaint:
|
|
||||||
{
|
|
||||||
TileBank->GetLBrush().SetFlags(Flags<<PC_TILE_FLAG_COLLISION_SHIFT,PC_TILE_FLAG_MIRROR_XY);
|
|
||||||
TileBank->GetRBrush().SetFlags(Flags<<PC_TILE_FLAG_COLLISION_SHIFT,PC_TILE_FLAG_MIRROR_XY);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case MouseModeSelect:
|
|
||||||
{
|
|
||||||
if (!Selection.IsValid()) return(false); // No Selection
|
|
||||||
CRect R=Selection.GetRect();
|
|
||||||
Map.SetFlags(Flags<<PC_TILE_FLAG_COLLISION_SHIFT,PC_TILE_FLAG_MIRROR_XY,&R);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return(TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
bool CLayerTile::CopySelection(CCore *Core)
|
|
||||||
{
|
|
||||||
if (Mode!=MouseModeSelect) return(false); // Not in select mode
|
|
||||||
if (!Selection.IsValid()) return(false); // No Selection
|
|
||||||
|
|
||||||
CRect Rect=Selection.GetRect();
|
|
||||||
|
|
||||||
TileBank->GetActiveBrush().Set(Map,Rect.left,Rect.top,Rect.Width(),Rect.Height());
|
|
||||||
|
|
||||||
return(true);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
bool CLayerTile::PasteSelection(CCore *Core)
|
|
||||||
{
|
|
||||||
if (Mode!=MouseModeSelect) return(false); // Not in select mode
|
|
||||||
if (!Selection.IsValid()) return(false); // No Selection
|
|
||||||
|
|
||||||
CRect Rect=Selection.GetRect();
|
|
||||||
|
|
||||||
Map.Paste(TileBank->GetActiveBrush(),&Rect);
|
|
||||||
return(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
bool CLayerTile::Paint(CMap &Blk,CPoint &CursorPos)
|
|
||||||
{
|
|
||||||
if (CursorPos.x==-1 || CursorPos.y==-1) return(FALSE); // Off Map?
|
|
||||||
if (!Blk.IsValid()) return(FALSE); // Invalid tile?
|
|
||||||
|
|
||||||
|
if (CursorPos.x==-1 || CursorPos.y==-1) return(false); // Off Map?
|
||||||
|
if (!Blk.IsValid()) return(false); // Invalid Item?
|
||||||
|
/*
|
||||||
Map.Set(CursorPos.x,CursorPos.y,Blk);
|
Map.Set(CursorPos.x,CursorPos.y,Blk);
|
||||||
|
*/
|
||||||
return(TRUE);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CLayerTile::Export(CCore *Core,CExport &Exp)
|
void CLayerItem::Export(CCore *Core,CExport &Exp)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
int Width=Map.GetWidth();
|
int Width=Map.GetWidth();
|
||||||
int Height=Map.GetHeight();
|
int Height=Map.GetHeight();
|
||||||
|
|
||||||
Exp.ExportLayerHeader(LAYER_TYPE_TILE,SubType,Width,Height);
|
Exp.ExportLayerHeader(LAYER_TYPE_Item,SubType,Width,Height);
|
||||||
|
|
||||||
for (int Y=0; Y<Height; Y++)
|
for (int Y=0; Y<Height; Y++)
|
||||||
{
|
{
|
||||||
for (int X=0; X<Width; X++)
|
for (int X=0; X<Width; X++)
|
||||||
{
|
{
|
||||||
sMapElem &MapElem=Map.Get(X,Y);
|
sMapElem &MapElem=Map.Get(X,Y);
|
||||||
sExpLayerTile OutElem;
|
sExpLayerItem OutElem;
|
||||||
|
|
||||||
if (MapElem.Set==0 && MapElem.Tile==0)
|
if (MapElem.Set==0 && MapElem.Item==0)
|
||||||
{ // Blank
|
{ // Blank
|
||||||
OutElem.Tile=0;
|
OutElem.Item=0;
|
||||||
OutElem.Flags=0;
|
OutElem.Flags=0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sExpTile OutTile;
|
sExpItem OutItem;
|
||||||
CElem &ThisTile=TileBank->GetTile(MapElem.Set,MapElem.Tile);
|
CElem &ThisItem=ElemBank->GetItem(MapElem.Set,MapElem.Item);
|
||||||
|
|
||||||
OutTile.Set=MapElem.Set;
|
OutItem.Set=MapElem.Set;
|
||||||
OutTile.Tile=MapElem.Tile;
|
OutItem.Item=MapElem.Item;
|
||||||
OutTile.TriStart=0;
|
OutItem.TriStart=0;
|
||||||
OutTile.TriCount=0;
|
OutItem.TriCount=0;
|
||||||
OutTile.XOfs=ThisTile.GetTexXOfs();
|
OutItem.XOfs=ThisItem.GetTexXOfs();
|
||||||
OutTile.YOfs=ThisTile.GetTexYOfs();
|
OutItem.YOfs=ThisItem.GetTexYOfs();
|
||||||
OutElem.Tile=Exp.AddTile(OutTile);
|
OutElem.Item=Exp.AddItem(OutItem);
|
||||||
OutElem.Flags=MapElem.Flags;
|
OutElem.Flags=MapElem.Flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
Exp.Write(&OutElem,sizeof(sExpLayerTile));
|
Exp.Write(&OutElem,sizeof(sExpLayerItem));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
*/
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
void CLayerTile::RemoveSet(int Set)
|
|
||||||
{
|
|
||||||
Map.RemoveSet(Set);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
void CLayerTile::RemapSet(int OrigSet,int NewSet)
|
|
||||||
{
|
|
||||||
Map.RemapSet(OrigSet,NewSet);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,20 +1,19 @@
|
||||||
/******************/
|
/******************/
|
||||||
/*** Layer Tile ***/
|
/*** Layer Item ***/
|
||||||
/******************/
|
/******************/
|
||||||
|
|
||||||
#ifndef __LAYER_TILE_HEADER__
|
#ifndef __LAYER_ITEM_HEADER__
|
||||||
#define __LAYER_TILE_HEADER__
|
#define __LAYER_ITEM_HEADER__
|
||||||
|
|
||||||
#include "Layer.h"
|
#include "Layer.h"
|
||||||
#include "MapEdit.h"
|
#include "MapEdit.h"
|
||||||
#include "LayerTileToolbar.h"
|
#include "GUIToolbar.h"
|
||||||
|
#include "ElemStore.h"
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
class CCore;
|
class CLayerItem : public CLayer
|
||||||
class CTileBank;
|
|
||||||
class CLayerTile : public CLayer
|
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum MouseMode
|
enum MouseMode
|
||||||
{
|
{
|
||||||
|
@ -22,54 +21,35 @@ public:
|
||||||
MouseModeSelect,
|
MouseModeSelect,
|
||||||
};
|
};
|
||||||
|
|
||||||
CLayerTile(){};
|
CLayerItem(){};
|
||||||
CLayerTile(int SubType,int Width,int Height); // New Layer
|
CLayerItem(int SubType,int Width,int Height); // New Layer
|
||||||
CLayerTile(CFile *File,int Version); // Load Layer
|
CLayerItem(CFile *File,int Version); // Load Layer
|
||||||
~CLayerTile();
|
~CLayerItem();
|
||||||
|
|
||||||
int GetType() {return(LAYER_TYPE_TILE);}
|
int GetType() {return(LAYER_TYPE_ITEM);}
|
||||||
int GetSubType() {return(SubType);}
|
|
||||||
void InitSubView(CCore *Core);
|
void InitSubView(CCore *Core);
|
||||||
|
|
||||||
virtual void Render(CCore *Core,Vector3 &CamPos,bool Is3d);
|
void Render(CCore *Core,Vector3 &CamPos,bool Is3d);
|
||||||
virtual void RenderGrid(CCore *Core,Vector3 &CamPos,bool Active);
|
|
||||||
virtual void RenderSelection(CCore *Core,Vector3 &ThisCam);
|
|
||||||
|
|
||||||
void FindCursorPos(CCore *Core,Vector3 &CamPos,CPoint &MousePos);
|
|
||||||
void RenderCursor(CCore *Core,Vector3 &CamPos,bool Is3d);
|
void RenderCursor(CCore *Core,Vector3 &CamPos,bool Is3d);
|
||||||
|
|
||||||
virtual void GUIInit(CCore *Core);
|
void GUIInit(CCore *Core);
|
||||||
virtual void GUIKill(CCore *Core);
|
void GUIKill(CCore *Core);
|
||||||
virtual void GUIUpdate(CCore *Core);
|
void GUIUpdate(CCore *Core);
|
||||||
virtual void GUIChanged(CCore *Core);
|
void GUIChanged(CCore *Core);
|
||||||
|
|
||||||
int GetWidth() {return(Map.GetWidth());}
|
|
||||||
int GetHeight() {return(Map.GetHeight());}
|
|
||||||
bool Resize(int Width,int Height);
|
|
||||||
|
|
||||||
void Load(CFile *File,int Version);
|
void Load(CFile *File,int Version);
|
||||||
void Save(CFile *File);
|
void Save(CFile *File);
|
||||||
void CheckLayerSize(int Width,int Height);
|
|
||||||
|
|
||||||
void Export(CCore *Core,CExport &Exp);
|
void Export(CCore *Core,CExport &Exp);
|
||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
virtual bool LButtonControl(CCore *Core,UINT nFlags, CPoint &point,bool DownFlag);
|
bool LButtonControl(CCore *Core,UINT nFlags, CPoint &point,bool DownFlag);
|
||||||
virtual bool RButtonControl(CCore *Core,UINT nFlags, CPoint &point,bool DownFlag);
|
bool RButtonControl(CCore *Core,UINT nFlags, CPoint &point,bool DownFlag);
|
||||||
virtual bool MouseMove(CCore *Core,UINT nFlags, CPoint &point);
|
bool MouseMove(CCore *Core,UINT nFlags, CPoint &point);
|
||||||
virtual bool Command(int CmdMsg,CCore *Core,int Param0=0,int Param1=0);
|
bool Command(int CmdMsg,CCore *Core,int Param0=0,int Param1=0);
|
||||||
|
|
||||||
bool MirrorX(CCore *Core);
|
|
||||||
bool MirrorY(CCore *Core);
|
|
||||||
bool SetColFlags(CCore *Core,int Flags);
|
|
||||||
|
|
||||||
bool CopySelection(CCore *Core);
|
|
||||||
bool PasteSelection(CCore *Core);
|
|
||||||
|
|
||||||
// Local
|
// Local
|
||||||
CTileBank *GetTileBank() {return(TileBank);}
|
CElemBank *GetElemBank() {return(ElemBank);}
|
||||||
void RemoveSet(int Set);
|
|
||||||
void RemapSet(int OrigSet,int NewSet);
|
|
||||||
|
|
||||||
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);
|
||||||
|
@ -77,13 +57,10 @@ protected:
|
||||||
|
|
||||||
bool Paint(CMap &Blk,CPoint &CursorPos);
|
bool Paint(CMap &Blk,CPoint &CursorPos);
|
||||||
|
|
||||||
CMap Map;
|
CElemStore *ElemBank;
|
||||||
int SubType;
|
|
||||||
MouseMode Mode;
|
MouseMode Mode;
|
||||||
|
|
||||||
CTileBank *TileBank;
|
CGUIToolBar GUIToolBar;
|
||||||
|
|
||||||
CLayerTileToolbar ToolBarGUI;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#include "Utils.h"
|
#include "Utils.h"
|
||||||
#include "Select.h"
|
#include "Select.h"
|
||||||
#include "Export.h"
|
#include "Export.h"
|
||||||
#include "LayerShadeGUI.h"
|
#include "GUILayerShade.h"
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -165,24 +165,24 @@ bool CLayerShade::Resize(int _Width,int _Height)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CLayerShade::GUIInit(CCore *Core)
|
void CLayerShade::GUIInit(CCore *Core)
|
||||||
{
|
{
|
||||||
Core->GUIAdd(ShadeDlg,IDD_LAYERSHADE_GUI);
|
Core->GUIAdd(GUI,IDD_LAYER_SHADE);
|
||||||
for (int i=0; i<LAYER_SHADE_MAX; i++)
|
for (int i=0; i<LAYER_SHADE_MAX; i++)
|
||||||
{
|
{
|
||||||
ShadeDlg.SetRGB(RGB[i],i);
|
GUI.SetRGB(RGB[i],i);
|
||||||
}
|
}
|
||||||
ShadeDlg.SetCount(Count);
|
GUI.SetCount(Count);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CLayerShade::GUIKill(CCore *Core)
|
void CLayerShade::GUIKill(CCore *Core)
|
||||||
{
|
{
|
||||||
Core->GUIRemove(ShadeDlg,IDD_LAYERSHADE_GUI);
|
Core->GUIRemove(GUI,IDD_LAYER_SHADE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CLayerShade::GUIUpdate(CCore *Core)
|
void CLayerShade::GUIUpdate(CCore *Core)
|
||||||
{
|
{
|
||||||
ShadeDlg.CheckData();
|
GUI.CheckData();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -190,9 +190,9 @@ void CLayerShade::GUIChanged(CCore *Core)
|
||||||
{
|
{
|
||||||
for (int i=0; i<LAYER_SHADE_MAX; i++)
|
for (int i=0; i<LAYER_SHADE_MAX; i++)
|
||||||
{
|
{
|
||||||
ShadeDlg.GetRGB(RGB[i],i);
|
GUI.GetRGB(RGB[i],i);
|
||||||
}
|
}
|
||||||
ShadeDlg.GetCount(Count);
|
GUI.GetCount(Count);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
#include "Layer.h"
|
#include "Layer.h"
|
||||||
#include "MapEdit.h"
|
#include "MapEdit.h"
|
||||||
#include "LayerShadeGui.h"
|
#include "GUILayerShade.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
class CCore;
|
class CCore;
|
||||||
|
@ -31,7 +31,6 @@ 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,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,10 +48,6 @@ public:
|
||||||
void Export(CCore *Core,CExport &Exp);
|
void Export(CCore *Core,CExport &Exp);
|
||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
// bool LButtonControl(CCore *Core,UINT nFlags, CPoint &CursorPos,bool DownFlag) {return(false);}
|
|
||||||
// bool RButtonControl(CCore *Core,UINT nFlags, CPoint &CursorPos,bool DownFlag) {return(false);}
|
|
||||||
// bool MouseMove(CCore *Core,UINT nFlags, CPoint &CursorPos) {return(false);}
|
|
||||||
// bool Command(int CmdMsg,CCore *Core,int Param0=0,int Param1=0){};
|
|
||||||
|
|
||||||
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);
|
||||||
|
@ -60,7 +55,7 @@ protected:
|
||||||
int Width,Height;
|
int Width,Height;
|
||||||
int SubType;
|
int SubType;
|
||||||
|
|
||||||
CLayerShadeGUI ShadeDlg;
|
CGUILayerShade GUI;
|
||||||
|
|
||||||
int Count;
|
int Count;
|
||||||
int Pos[LAYER_SHADE_RGB_MAX];
|
int Pos[LAYER_SHADE_RGB_MAX];
|
||||||
|
|
|
@ -295,146 +295,6 @@ float Y1=Rect.bottom-1;
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
void CLayerTile::RenderGrid(CCore *Core,Vector3 &CamPos,bool Active)
|
|
||||||
{
|
|
||||||
Vector3 ThisCam=Core->OffsetCam(CamPos,GetScaleFactor());
|
|
||||||
int MapWidth=Map.GetWidth();
|
|
||||||
int MapHeight=Map.GetHeight();
|
|
||||||
float ZoomW=Core->GetZoomW();
|
|
||||||
float ZoomH=Core->GetZoomH();
|
|
||||||
float ScrOfsX=(ZoomW/2);
|
|
||||||
float ScrOfsY=(ZoomH/2);
|
|
||||||
Vector3 &Scale=Core->GetScaleVector();
|
|
||||||
float Col;
|
|
||||||
const float OverVal=0.1f;
|
|
||||||
|
|
||||||
glMatrixMode(GL_MODELVIEW);
|
|
||||||
glPushMatrix();
|
|
||||||
glLoadIdentity();
|
|
||||||
glScalef(Scale.x,Scale.y,Scale.z);
|
|
||||||
glTranslatef(-ThisCam.x,ThisCam.y,0);
|
|
||||||
glTranslatef(-ScrOfsX,ScrOfsY,0); // Bring to top left corner
|
|
||||||
|
|
||||||
if (Active) Col=1; else Col=0.5f;
|
|
||||||
|
|
||||||
glBegin(GL_LINES);
|
|
||||||
|
|
||||||
glColor3f(Col,Col,Col);
|
|
||||||
|
|
||||||
for (int YLoop=0; YLoop<MapHeight+1; YLoop++)
|
|
||||||
{
|
|
||||||
glVertex3f( 0-OverVal, -YLoop+1, 0);
|
|
||||||
glVertex3f( MapWidth+OverVal, -YLoop+1, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int XLoop=0; XLoop<MapWidth+1; XLoop++)
|
|
||||||
{
|
|
||||||
glVertex3f( XLoop, 0+1+OverVal, 0);
|
|
||||||
glVertex3f( XLoop, -MapHeight+1-OverVal, 0);
|
|
||||||
}
|
|
||||||
glEnd();
|
|
||||||
|
|
||||||
glPopMatrix();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
void CLayerTile::FindCursorPos(CCore *Core,Vector3 &CamPos,CPoint &MousePos)
|
|
||||||
{
|
|
||||||
Vector3 ThisCam=Core->OffsetCam(CamPos,GetScaleFactor());
|
|
||||||
int MapWidth=Map.GetWidth();
|
|
||||||
int MapHeight=Map.GetHeight();
|
|
||||||
float ZoomW=Core->GetZoomW();
|
|
||||||
float ZoomH=Core->GetZoomH();
|
|
||||||
float ScrOfsX=(ZoomW/2);
|
|
||||||
float ScrOfsY=(ZoomH/2);
|
|
||||||
Vector3 &Scale=Core->GetScaleVector();
|
|
||||||
|
|
||||||
GLint Viewport[4];
|
|
||||||
GLuint SelectBuffer[SELECT_BUFFER_SIZE];
|
|
||||||
int TileID=0;
|
|
||||||
CPoint &CursorPos=Core->GetCursorPos();
|
|
||||||
|
|
||||||
int StartX=(int)ThisCam.x;
|
|
||||||
int StartY=(int)ThisCam.y;
|
|
||||||
float ShiftX=ThisCam.x - (int)ThisCam.x;
|
|
||||||
float ShiftY=ThisCam.y - (int)ThisCam.y;
|
|
||||||
|
|
||||||
if (StartX<0) StartX=0;
|
|
||||||
if (StartY<0) StartY=0;
|
|
||||||
|
|
||||||
int DrawW=ZoomW+8;
|
|
||||||
int DrawH=ZoomH+8;
|
|
||||||
|
|
||||||
if (StartX+DrawW>MapWidth) DrawW=MapWidth-StartX;
|
|
||||||
if (StartY+DrawH>MapHeight) DrawH=MapHeight-StartY;
|
|
||||||
|
|
||||||
glGetIntegerv(GL_VIEWPORT, Viewport);
|
|
||||||
glSelectBuffer (SELECT_BUFFER_SIZE, SelectBuffer );
|
|
||||||
glRenderMode (GL_SELECT);
|
|
||||||
|
|
||||||
glInitNames();
|
|
||||||
glPushName(-1);
|
|
||||||
|
|
||||||
glMatrixMode(GL_PROJECTION);
|
|
||||||
glPushMatrix();
|
|
||||||
glLoadIdentity();
|
|
||||||
gluPickMatrix( MousePos.x ,(Viewport[3]-MousePos.y),5.0,5.0,Viewport);
|
|
||||||
Core->GetView()->SetupPersMatrix();
|
|
||||||
|
|
||||||
glMatrixMode(GL_MODELVIEW);
|
|
||||||
glPushMatrix();
|
|
||||||
glLoadIdentity();
|
|
||||||
glScalef(Scale.x,Scale.y,Scale.z);
|
|
||||||
// glTranslatef(-ThisCam.x,ThisCam.y,0);
|
|
||||||
glTranslatef(-ShiftX,ShiftY,0);
|
|
||||||
glTranslatef(-ScrOfsX,ScrOfsY,0); // Bring to top left corner
|
|
||||||
|
|
||||||
bool WrapMap=SubType==LAYER_SUBTYPE_BACK;
|
|
||||||
if (WrapMap)
|
|
||||||
{
|
|
||||||
DrawW=MapWidth;
|
|
||||||
DrawH=MapHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int YLoop=0; YLoop<DrawH; YLoop++)
|
|
||||||
{
|
|
||||||
for (int XLoop=0; XLoop<DrawW; XLoop++)
|
|
||||||
{
|
|
||||||
int XPos=StartX+XLoop;
|
|
||||||
int YPos=StartY+YLoop;
|
|
||||||
if (WrapMap)
|
|
||||||
{
|
|
||||||
XPos%=MapWidth;
|
|
||||||
YPos%=MapHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
TileID=(XPos)+(((YPos)*MapWidth));
|
|
||||||
glLoadName (TileID);
|
|
||||||
glBegin (GL_QUADS);
|
|
||||||
BuildGLQuad(XLoop,XLoop+1,-YLoop,-YLoop+1,0);
|
|
||||||
glEnd();
|
|
||||||
TileID++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TileID= glRenderMode (GL_RENDER);
|
|
||||||
glPopMatrix();
|
|
||||||
glMatrixMode(GL_PROJECTION);
|
|
||||||
glPopMatrix();
|
|
||||||
CursorPos.x=CursorPos.y=-1;
|
|
||||||
|
|
||||||
// Process hits
|
|
||||||
|
|
||||||
GLuint *HitPtr=SelectBuffer;
|
|
||||||
|
|
||||||
if (TileID) // Just take 1st
|
|
||||||
{
|
|
||||||
int HitID=HitPtr[3];
|
|
||||||
CursorPos=IDToPoint(HitID,MapWidth);
|
|
||||||
}
|
|
||||||
glMatrixMode(GL_MODELVIEW); // <-- Prevent arse GL assert
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*** Gui *********************************************************************/
|
/*** Gui *********************************************************************/
|
||||||
|
@ -442,27 +302,27 @@ GLuint *HitPtr=SelectBuffer;
|
||||||
void CLayerTile::GUIInit(CCore *Core)
|
void CLayerTile::GUIInit(CCore *Core)
|
||||||
{
|
{
|
||||||
TileBank->GUIInit(Core);
|
TileBank->GUIInit(Core);
|
||||||
Core->GUIAdd(ToolBarGUI,IDD_LAYERTILE_TOOLBAR);
|
Core->GUIAdd(GUIToolBar,IDD_LAYERTILE_TOOLBAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CLayerTile::GUIKill(CCore *Core)
|
void CLayerTile::GUIKill(CCore *Core)
|
||||||
{
|
{
|
||||||
TileBank->GUIKill(Core);
|
TileBank->GUIKill(Core);
|
||||||
Core->GUIRemove(ToolBarGUI,IDD_LAYERTILE_TOOLBAR);
|
Core->GUIRemove(GUIToolBar,IDD_LAYERTILE_TOOLBAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CLayerTile::GUIUpdate(CCore *Core)
|
void CLayerTile::GUIUpdate(CCore *Core)
|
||||||
{
|
{
|
||||||
ToolBarGUI.ResetButtons();
|
GUIToolBar.ResetButtons();
|
||||||
switch(Mode)
|
switch(Mode)
|
||||||
{
|
{
|
||||||
case MouseModePaint:
|
case MouseModePaint:
|
||||||
ToolBarGUI.SetButtonState(CLayerTileToolbar::PAINT,TRUE);
|
GUIToolBar.SetButtonState(CGUIToolBar::PAINT,TRUE);
|
||||||
break;
|
break;
|
||||||
case MouseModeSelect:
|
case MouseModeSelect:
|
||||||
ToolBarGUI.SetButtonState(CLayerTileToolbar::SELECT,TRUE);
|
GUIToolBar.SetButtonState(CGUIToolBar::SELECT,TRUE);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
#include "Layer.h"
|
#include "Layer.h"
|
||||||
#include "MapEdit.h"
|
#include "MapEdit.h"
|
||||||
#include "LayerTileToolbar.h"
|
#include "GUIToolbar.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
class CCore;
|
class CCore;
|
||||||
|
@ -32,10 +32,7 @@ public:
|
||||||
void InitSubView(CCore *Core);
|
void InitSubView(CCore *Core);
|
||||||
|
|
||||||
virtual void Render(CCore *Core,Vector3 &CamPos,bool Is3d);
|
virtual void Render(CCore *Core,Vector3 &CamPos,bool Is3d);
|
||||||
virtual void RenderGrid(CCore *Core,Vector3 &CamPos,bool Active);
|
|
||||||
virtual void RenderSelection(CCore *Core,Vector3 &ThisCam);
|
virtual void RenderSelection(CCore *Core,Vector3 &ThisCam);
|
||||||
|
|
||||||
void FindCursorPos(CCore *Core,Vector3 &CamPos,CPoint &MousePos);
|
|
||||||
void RenderCursor(CCore *Core,Vector3 &CamPos,bool Is3d);
|
void RenderCursor(CCore *Core,Vector3 &CamPos,bool Is3d);
|
||||||
|
|
||||||
virtual void GUIInit(CCore *Core);
|
virtual void GUIInit(CCore *Core);
|
||||||
|
@ -83,7 +80,7 @@ protected:
|
||||||
|
|
||||||
CTileBank *TileBank;
|
CTileBank *TileBank;
|
||||||
|
|
||||||
CLayerTileToolbar ToolBarGUI;
|
CGUIToolBar GUIToolBar;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -5,11 +5,7 @@
|
||||||
#if !defined(AFX_MAINFRM_H__CEC14D79_A1F2_4281_AA53_544F0924E7D8__INCLUDED_)
|
#if !defined(AFX_MAINFRM_H__CEC14D79_A1F2_4281_AA53_544F0924E7D8__INCLUDED_)
|
||||||
#define AFX_MAINFRM_H__CEC14D79_A1F2_4281_AA53_544F0924E7D8__INCLUDED_
|
#define AFX_MAINFRM_H__CEC14D79_A1F2_4281_AA53_544F0924E7D8__INCLUDED_
|
||||||
|
|
||||||
#include "MultiBar.h"
|
#include "GUIMultiBar.h"
|
||||||
//#include "LayerList.h"
|
|
||||||
//#include "LayerTileGUI.h"
|
|
||||||
//#include "LayerTileToolbar.h"
|
|
||||||
//#include "LayerShadeGUI.h"
|
|
||||||
|
|
||||||
#if _MSC_VER > 1000
|
#if _MSC_VER > 1000
|
||||||
#pragma once
|
#pragma once
|
||||||
|
@ -35,15 +31,9 @@ public:
|
||||||
public:
|
public:
|
||||||
CStatusBar *GetStatusBar() {return(&StatusBar);}
|
CStatusBar *GetStatusBar() {return(&StatusBar);}
|
||||||
CMainToolBar *GetToolBar() {return(&ToolBar);}
|
CMainToolBar *GetToolBar() {return(&ToolBar);}
|
||||||
// CDialog *GetDialog(int ID) {return(ParamBar.GetDialog(ID));}
|
|
||||||
|
|
||||||
// Param Bar
|
// Param Bar
|
||||||
CMultiBar *GetParamBar() {return(&ParamBar);}
|
CGUIMultiBar *GetParamBar() {return(&ParamBar);}
|
||||||
// CDialog &GetLayerList() {return(LayerList);}
|
|
||||||
// CDialog &GetLayerTileGUI() {return(LayerTileGUI);}
|
|
||||||
// CDialog &GetLayerTileToolbar() {return(LayerTileToolBar);}
|
|
||||||
// CDialog &GetLayerShadeGUI() {return(LayerShadeGUI);}
|
|
||||||
|
|
||||||
// Operations
|
// Operations
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -65,12 +55,7 @@ protected: // control bar embedded members
|
||||||
CStatusBar StatusBar;
|
CStatusBar StatusBar;
|
||||||
CMainToolBar ToolBar;
|
CMainToolBar ToolBar;
|
||||||
|
|
||||||
CMultiBar ParamBar;
|
CGUIMultiBar ParamBar;
|
||||||
// Sub Dialogs
|
|
||||||
// CLayerList LayerList;
|
|
||||||
// CLayerTileGUI LayerTileGUI;
|
|
||||||
// CLayerTileToolbar LayerTileToolBar;
|
|
||||||
// CLayerShadeGUI LayerShadeGUI;
|
|
||||||
|
|
||||||
// Generated message map functions
|
// Generated message map functions
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -2,50 +2,47 @@
|
||||||
|
|
||||||
[General Info]
|
[General Info]
|
||||||
Version=1
|
Version=1
|
||||||
LastClass=CLayerCollisionGUI
|
LastClass=CAboutDlg
|
||||||
LastTemplate=CDialog
|
LastTemplate=CDialog
|
||||||
NewFileInclude1=#include "stdafx.h"
|
NewFileInclude1=#include "stdafx.h"
|
||||||
NewFileInclude2=#include "mapedit.h"
|
NewFileInclude2=#include "mapedit.h"
|
||||||
LastPage=0
|
LastPage=0
|
||||||
|
|
||||||
ClassCount=16
|
ClassCount=18
|
||||||
Class1=CAddLayerDlg
|
Class1=CChildFrame
|
||||||
Class2=CChildFrame
|
Class2=CGLEnabledView
|
||||||
Class3=CGLEnabledView
|
Class3=CGUIAddLayer
|
||||||
Class4=CLayerList
|
Class4=CGUIElemList
|
||||||
Class5=CLayerShadeGUI
|
Class5=GUILayerCollision
|
||||||
Class6=CLayerTileGUI
|
Class6=CGUILayerList
|
||||||
Class7=CLayerTileToolbar
|
Class7=CGUIMultiBar
|
||||||
Class8=CMainFrame
|
Class8=CGUINewMap
|
||||||
Class9=CMapEditApp
|
Class9=CGUIResize
|
||||||
Class10=CAboutDlg
|
Class10=CGUITileBank
|
||||||
Class11=CMapEditDoc
|
Class11=GUIToolBar
|
||||||
Class12=CMapEditView
|
Class12=CLayerShadeGUI
|
||||||
Class13=CMapSizeDlg
|
Class13=CLayerTileCollision
|
||||||
Class14=CMultiBar
|
Class14=CMainFrame
|
||||||
Class15=CNewMapGUI
|
Class15=CMapEditApp
|
||||||
|
Class16=CAboutDlg
|
||||||
|
Class17=CMapEditDoc
|
||||||
|
Class18=CMapEditView
|
||||||
|
|
||||||
ResourceCount=13
|
ResourceCount=14
|
||||||
Resource1=IDD_NEWMAP
|
Resource1=IDD_LAYER_TOOLBAR
|
||||||
Resource2=IDD_LAYER_LIST_DIALOG
|
Resource2=IDR_MAPEDITYPE (English (U.S.))
|
||||||
Resource3=IDR_MAPEDITYPE (English (U.S.))
|
Resource3=IDD_LAYER_SHADE
|
||||||
Resource4=IDD_MAPSIZE
|
Resource4=IDD_LAYER_COLLISION
|
||||||
Resource5=IDD_ADDLAYER
|
Resource5=IDR_TOOLBAR (English (U.S.))
|
||||||
Resource6=IDD_LAYERSHADE_GUI
|
Resource6=IDR_MAINFRAME (English (U.S.))
|
||||||
Resource7=IDD_LAYERTILE_TOOLBAR
|
Resource7=IDD_ABOUTBOX (English (U.S.))
|
||||||
Resource8=IDR_TOOLBAR (English (U.S.))
|
Resource8=IDD_MULTIBAR (English (U.S.))
|
||||||
Resource9=IDR_MAINFRAME (English (U.S.))
|
Resource9=IDD_LAYER_LIST
|
||||||
Resource10=IDD_ABOUTBOX (English (U.S.))
|
Resource10=IDD_RESIZE
|
||||||
Resource11=IDD_MULTIBAR (English (U.S.))
|
Resource11=IDD_NEWMAP
|
||||||
Resource12=IDD_LAYERTILE_GUI
|
Resource12=IDD_ADDLAYER
|
||||||
Class16=CLayerCollisionGUI
|
Resource13=IDD_TILEBANK
|
||||||
Resource13=IDD_LAYERCOLLISION_GUI
|
Resource14=IDD_ELEMLIST
|
||||||
|
|
||||||
[CLS:CAddLayerDlg]
|
|
||||||
Type=0
|
|
||||||
BaseClass=CDialog
|
|
||||||
HeaderFile=AddLayerDlg.h
|
|
||||||
ImplementationFile=AddLayerDlg.cpp
|
|
||||||
|
|
||||||
[CLS:CChildFrame]
|
[CLS:CChildFrame]
|
||||||
Type=0
|
Type=0
|
||||||
|
@ -59,49 +56,82 @@ BaseClass=CView
|
||||||
HeaderFile=GLEnabledView.h
|
HeaderFile=GLEnabledView.h
|
||||||
ImplementationFile=GLEnabledView.cpp
|
ImplementationFile=GLEnabledView.cpp
|
||||||
|
|
||||||
[CLS:CLayerList]
|
[CLS:CGUIAddLayer]
|
||||||
Type=0
|
Type=0
|
||||||
HeaderFile=LayerList.h
|
BaseClass=CDialog
|
||||||
ImplementationFile=LayerList.cpp
|
HeaderFile=GUIAddLayer.h
|
||||||
|
ImplementationFile=GUIAddLayer.cpp
|
||||||
|
|
||||||
|
[CLS:CGUIElemList]
|
||||||
|
Type=0
|
||||||
|
BaseClass=CDialog
|
||||||
|
HeaderFile=GUIElemList.h
|
||||||
|
ImplementationFile=GUIElemList.cpp
|
||||||
|
|
||||||
|
[CLS:GUILayerCollision]
|
||||||
|
Type=0
|
||||||
|
BaseClass=CDialog
|
||||||
|
HeaderFile=GUILayerCollision.h
|
||||||
|
ImplementationFile=GUILayerCollision.cpp
|
||||||
|
|
||||||
|
[CLS:CGUILayerList]
|
||||||
|
Type=0
|
||||||
|
BaseClass=CDialog
|
||||||
|
HeaderFile=GUILayerList.h
|
||||||
|
ImplementationFile=GUILayerList.cpp
|
||||||
|
|
||||||
|
[CLS:CGUIMultiBar]
|
||||||
|
Type=0
|
||||||
|
BaseClass=CDialogBar
|
||||||
|
HeaderFile=GUIMultibar.h
|
||||||
|
ImplementationFile=GUIMultibar.cpp
|
||||||
|
|
||||||
|
[CLS:CGUINewMap]
|
||||||
|
Type=0
|
||||||
|
BaseClass=CDialog
|
||||||
|
HeaderFile=GUINewMap.h
|
||||||
|
ImplementationFile=GUINewMap.cpp
|
||||||
|
|
||||||
|
[CLS:CGUIResize]
|
||||||
|
Type=0
|
||||||
|
BaseClass=CDialog
|
||||||
|
HeaderFile=GUIResize.h
|
||||||
|
ImplementationFile=GUIResize.cpp
|
||||||
|
|
||||||
|
[CLS:CGUITileBank]
|
||||||
|
Type=0
|
||||||
|
BaseClass=CDialog
|
||||||
|
HeaderFile=GUITileBank.h
|
||||||
|
ImplementationFile=GUITileBank.cpp
|
||||||
|
|
||||||
|
[CLS:GUIToolBar]
|
||||||
|
Type=0
|
||||||
|
HeaderFile=GUIToolBar.h
|
||||||
|
ImplementationFile=GUIToolBar.cpp
|
||||||
|
|
||||||
[CLS:CLayerShadeGUI]
|
[CLS:CLayerShadeGUI]
|
||||||
Type=0
|
Type=0
|
||||||
BaseClass=CDialog
|
BaseClass=CDialog
|
||||||
HeaderFile=LayerShadeGUI.h
|
HeaderFile=LayerShadeGUI.h
|
||||||
ImplementationFile=LayerShadeGUI.cpp
|
ImplementationFile=LayerShadeGUI.cpp
|
||||||
LastObject=IDC_LAYERSHADE_COUNTTEXT
|
|
||||||
Filter=D
|
|
||||||
VirtualFilter=dWC
|
|
||||||
|
|
||||||
[CLS:CLayerTileGUI]
|
[CLS:CLayerTileCollision]
|
||||||
Type=0
|
Type=0
|
||||||
BaseClass=CDialog
|
BaseClass=CDialog
|
||||||
HeaderFile=LayerTileGUI.h
|
HeaderFile=LayerTileCollision.h
|
||||||
ImplementationFile=LayerTileGUI.cpp
|
ImplementationFile=LayerTileCollision.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
|
|
||||||
Filter=T
|
|
||||||
VirtualFilter=fWC
|
|
||||||
|
|
||||||
[CLS:CMapEditApp]
|
[CLS:CMapEditApp]
|
||||||
Type=0
|
Type=0
|
||||||
BaseClass=CWinApp
|
BaseClass=CWinApp
|
||||||
HeaderFile=MapEdit.h
|
HeaderFile=MapEdit.h
|
||||||
ImplementationFile=MapEdit.cpp
|
ImplementationFile=MapEdit.cpp
|
||||||
LastObject=CMapEditApp
|
|
||||||
Filter=N
|
|
||||||
VirtualFilter=AC
|
|
||||||
|
|
||||||
[CLS:CAboutDlg]
|
[CLS:CAboutDlg]
|
||||||
Type=0
|
Type=0
|
||||||
|
@ -115,97 +145,66 @@ Type=0
|
||||||
BaseClass=CDocument
|
BaseClass=CDocument
|
||||||
HeaderFile=MapEditDoc.h
|
HeaderFile=MapEditDoc.h
|
||||||
ImplementationFile=MapEditDoc.cpp
|
ImplementationFile=MapEditDoc.cpp
|
||||||
LastObject=ID_MAP_SETSIZE
|
|
||||||
Filter=N
|
|
||||||
VirtualFilter=DC
|
|
||||||
|
|
||||||
[CLS:CMapEditView]
|
[CLS:CMapEditView]
|
||||||
Type=0
|
Type=0
|
||||||
BaseClass=CGLEnabledView
|
BaseClass=CGLEnabledView
|
||||||
HeaderFile=MapEditView.h
|
HeaderFile=MapEditView.h
|
||||||
ImplementationFile=MapEditView.cpp
|
ImplementationFile=MapEditView.cpp
|
||||||
LastObject=CMapEditView
|
|
||||||
Filter=C
|
|
||||||
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]
|
[DLG:IDD_ADDLAYER]
|
||||||
Type=1
|
Type=1
|
||||||
Class=CAddLayerDlg
|
Class=CGUIAddLayer
|
||||||
ControlCount=3
|
ControlCount=3
|
||||||
Control1=IDOK,button,1342242817
|
Control1=IDOK,button,1342242817
|
||||||
Control2=IDCANCEL,button,1342242816
|
Control2=IDCANCEL,button,1342242816
|
||||||
Control3=IDC_ADDLAYER_LIST,listbox,1352728833
|
Control3=IDC_ADDLAYER_LIST,listbox,1352728833
|
||||||
|
|
||||||
[DLG:IDD_LAYER_LIST_DIALOG]
|
[DLG:IDD_ELEMLIST]
|
||||||
Type=1
|
Type=1
|
||||||
Class=CLayerList
|
Class=CGUIElemList
|
||||||
|
ControlCount=1
|
||||||
|
Control1=IDD_ELEM_LIST,combobox,1342242819
|
||||||
|
|
||||||
|
[DLG:IDD_LAYER_COLLISION]
|
||||||
|
Type=1
|
||||||
|
Class=GUILayerCollision
|
||||||
|
ControlCount=8
|
||||||
|
Control1=IDC_LAYERCOLLISION_NORMAL,button,1342242816
|
||||||
|
Control2=IDC_LAYERCOLLISION_DAMAGE,button,1342242816
|
||||||
|
Control3=IDC_LAYERCOLLISION_SLIPPERY,button,1342242816
|
||||||
|
Control4=IDC_LAYERCOLLISION_ELECTRIC,button,1342242816
|
||||||
|
Control5=IDC_LAYERCOLLISION_STICKY,button,1342242816
|
||||||
|
Control6=IDC_LAYERCOLLISION_WATER,button,1342242816
|
||||||
|
Control7=IDC_LAYERCOLLISION_SOLID,button,1342242816
|
||||||
|
Control8=IDC_LAYERCOLLISION_DEATH,button,1342242816
|
||||||
|
|
||||||
|
[DLG:IDD_LAYER_LIST]
|
||||||
|
Type=1
|
||||||
|
Class=CGUILayerList
|
||||||
ControlCount=3
|
ControlCount=3
|
||||||
Control1=IDC_LAYER_LIST,listbox,1352728913
|
Control1=IDC_LAYERLIST_LIST,listbox,1352728913
|
||||||
Control2=IDC_LAYERLIST_ADD,button,1342242816
|
Control2=IDC_LAYERLIST_ADD,button,1342242816
|
||||||
Control3=IDC_LAYERLIST_DELETE,button,1342242816
|
Control3=IDC_LAYERLIST_DELETE,button,1342242816
|
||||||
|
|
||||||
[DLG:IDD_LAYERSHADE_GUI]
|
[DLG:IDD_MULTIBAR]
|
||||||
Type=1
|
Type=1
|
||||||
Class=CLayerShadeGUI
|
Class=CGUIMultiBar
|
||||||
ControlCount=16
|
|
||||||
Control1=IDC_LAYERSHADE_EDITR0,edit,1350770688
|
|
||||||
Control2=IDC_LAYERSHADE_EDITG0,edit,1350770816
|
|
||||||
Control3=IDC_LAYERSHADE_EDITB0,edit,1350770816
|
|
||||||
Control4=IDC_LAYERSHADE_COUNTTEXT,static,1342312449
|
|
||||||
Control5=IDC_LAYERSHADE_EDITR1,edit,1350770688
|
|
||||||
Control6=IDC_LAYERSHADE_EDITG1,edit,1350770816
|
|
||||||
Control7=IDC_LAYERSHADE_EDITB1,edit,1350770816
|
|
||||||
Control8=IDC_LAYERSHADE_EDITR2,edit,1350770688
|
|
||||||
Control9=IDC_LAYERSHADE_EDITG2,edit,1350770816
|
|
||||||
Control10=IDC_LAYERSHADE_EDITB2,edit,1350770816
|
|
||||||
Control11=IDC_LAYERSHADE_TEXT7,static,1342312449
|
|
||||||
Control12=IDC_LAYERSHADE_EDITR3,edit,1350770688
|
|
||||||
Control13=IDC_LAYERSHADE_EDITG3,edit,1350770816
|
|
||||||
Control14=IDC_LAYERSHADE_EDITB3,edit,1350770816
|
|
||||||
Control15=IDC_LAYERSHADE_COUNTEDIT,edit,1350576256
|
|
||||||
Control16=IDC_SPIN2,msctls_updown32,1342177302
|
|
||||||
|
|
||||||
[DLG:IDD_LAYERTILE_GUI]
|
[DLG:IDD_NEWMAP]
|
||||||
Type=1
|
Type=1
|
||||||
Class=CLayerTileGUI
|
Class=CGUINewMap
|
||||||
ControlCount=4
|
ControlCount=6
|
||||||
Control1=IDD_LAYERTILE_LIST,combobox,1342242819
|
Control1=IDOK,button,1342177281
|
||||||
Control2=IDD_LAYERTILE_BTN_UPDATE,button,1342242816
|
Control2=IDCANCEL,button,1342177280
|
||||||
Control3=IDD_LAYERTILE_BTN_LOAD,button,1342242816
|
Control3=IDC_MAPSIZE_WIDTH_TEXT,static,1342308866
|
||||||
Control4=IDD_LAYERTILE_BTN_DELETE,button,1342242816
|
Control4=IDC_MAPSIZE_WIDTH,edit,1350639744
|
||||||
|
Control5=IDC_MAPSIZE_HEIGHT_TEXT,static,1342308866
|
||||||
|
Control6=IDC_MAPSIZE_HEIGHT,edit,1350639744
|
||||||
|
|
||||||
[DLG:IDD_LAYERTILE_TOOLBAR]
|
[DLG:IDD_RESIZE]
|
||||||
Type=1
|
Type=1
|
||||||
Class=CLayerTileToolbar
|
Class=CGUIResize
|
||||||
ControlCount=2
|
|
||||||
Control1=IDD_LAYERTILE_BTN_PAINT,button,1342177344
|
|
||||||
Control2=IDD_LAYERTILE_BTN_SELECT,button,1342177344
|
|
||||||
|
|
||||||
[DLG:IDD_ABOUTBOX]
|
|
||||||
Type=1
|
|
||||||
Class=CAboutDlg
|
|
||||||
|
|
||||||
[DLG:IDD_MAPSIZE]
|
|
||||||
Type=1
|
|
||||||
Class=CMapSizeDlg
|
|
||||||
ControlCount=7
|
ControlCount=7
|
||||||
Control1=IDOK,button,1342177281
|
Control1=IDOK,button,1342177281
|
||||||
Control2=IDCANCEL,button,1342177280
|
Control2=IDCANCEL,button,1342177280
|
||||||
|
@ -215,20 +214,32 @@ Control5=IDC_MAPSIZE_HEIGHT_TEXT,static,1342308866
|
||||||
Control6=IDC_MAPSIZE_HEIGHT,edit,1350639744
|
Control6=IDC_MAPSIZE_HEIGHT,edit,1350639744
|
||||||
Control7=IDC_MAPSIZE_WARNING,static,1342308352
|
Control7=IDC_MAPSIZE_WARNING,static,1342308352
|
||||||
|
|
||||||
[DLG:IDD_MULTIBAR]
|
[DLG:IDD_TILEBANK]
|
||||||
Type=1
|
Type=1
|
||||||
Class=CMultiBar
|
Class=CGUITileBank
|
||||||
|
ControlCount=3
|
||||||
|
Control1=IDD_TILEBANK_UPDATE,button,1342242816
|
||||||
|
Control2=IDD_TILEBANK_LOAD,button,1342242816
|
||||||
|
Control3=IDD_TILEBANK_DELETE,button,1342242816
|
||||||
|
|
||||||
[DLG:IDD_NEWMAP]
|
[DLG:IDD_LAYER_TOOLBAR]
|
||||||
Type=1
|
Type=1
|
||||||
Class=CNewMapGUI
|
Class=GUIToolBar
|
||||||
ControlCount=6
|
ControlCount=2
|
||||||
Control1=IDOK,button,1342177281
|
Control1=IDD_LAYERTILE_BTN_PAINT,button,1342177344
|
||||||
Control2=IDCANCEL,button,1342177280
|
Control2=IDD_LAYERTILE_BTN_SELECT,button,1342177344
|
||||||
Control3=IDC_MAPSIZE_WIDTH_TEXT,static,1342308866
|
|
||||||
Control4=IDC_MAPSIZE_WIDTH,edit,1350639744
|
[DLG:IDD_LAYERSHADE_GUI]
|
||||||
Control5=IDC_MAPSIZE_HEIGHT_TEXT,static,1342308866
|
Type=1
|
||||||
Control6=IDC_MAPSIZE_HEIGHT,edit,1350639744
|
Class=CLayerShadeGUI
|
||||||
|
|
||||||
|
[DLG:IDD_LAYERCOLLISION_GUI]
|
||||||
|
Type=1
|
||||||
|
Class=CLayerTileCollision
|
||||||
|
|
||||||
|
[DLG:IDD_ABOUTBOX]
|
||||||
|
Type=1
|
||||||
|
Class=CAboutDlg
|
||||||
|
|
||||||
[TB:IDR_TOOLBAR (English (U.S.))]
|
[TB:IDR_TOOLBAR (English (U.S.))]
|
||||||
Type=1
|
Type=1
|
||||||
|
@ -331,23 +342,24 @@ Type=1
|
||||||
Class=?
|
Class=?
|
||||||
ControlCount=0
|
ControlCount=0
|
||||||
|
|
||||||
[DLG:IDD_LAYERCOLLISION_GUI]
|
[DLG:IDD_LAYER_SHADE]
|
||||||
Type=1
|
Type=1
|
||||||
Class=CLayerCollisionGUI
|
Class=?
|
||||||
ControlCount=6
|
ControlCount=16
|
||||||
Control1=IDC_LAYERCOLLISION_NORMAL,button,1342242816
|
Control1=IDC_LAYERSHADE_EDITR0,edit,1350770688
|
||||||
Control2=IDC_LAYERCOLLISION_DAMAGE,button,1342242816
|
Control2=IDC_LAYERSHADE_EDITG0,edit,1350770816
|
||||||
Control3=IDC_LAYERCOLLISION_SLIPPERY,button,1342242816
|
Control3=IDC_LAYERSHADE_EDITB0,edit,1350770816
|
||||||
Control4=IDC_LAYERCOLLISION_ELECTRIC,button,1342242816
|
Control4=IDC_LAYERSHADE_COUNTTEXT,static,1342312449
|
||||||
Control5=IDC_LAYERCOLLISION_STICKY,button,1342242816
|
Control5=IDC_LAYERSHADE_EDITR1,edit,1350770688
|
||||||
Control6=IDC_LAYERCOLLISION_WATER,button,1342242816
|
Control6=IDC_LAYERSHADE_EDITG1,edit,1350770816
|
||||||
|
Control7=IDC_LAYERSHADE_EDITB1,edit,1350770816
|
||||||
[CLS:CLayerCollisionGUI]
|
Control8=IDC_LAYERSHADE_EDITR2,edit,1350770688
|
||||||
Type=0
|
Control9=IDC_LAYERSHADE_EDITG2,edit,1350770816
|
||||||
HeaderFile=layercollisiongui.h
|
Control10=IDC_LAYERSHADE_EDITB2,edit,1350770816
|
||||||
ImplementationFile=layercollisiongui.cpp
|
Control11=IDC_LAYERSHADE_TEXT7,static,1342312449
|
||||||
BaseClass=CDialog
|
Control12=IDC_LAYERSHADE_EDITR3,edit,1350770688
|
||||||
Filter=D
|
Control13=IDC_LAYERSHADE_EDITG3,edit,1350770816
|
||||||
VirtualFilter=dWC
|
Control14=IDC_LAYERSHADE_EDITB3,edit,1350770816
|
||||||
LastObject=CLayerCollisionGUI
|
Control15=IDC_LAYERSHADE_COUNTEDIT,edit,1350576256
|
||||||
|
Control16=IDC_SPIN2,msctls_updown32,1342177302
|
||||||
|
|
||||||
|
|
|
@ -115,6 +115,14 @@ SOURCE=.\LayerDef.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\LayerItem.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\LayerItem.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\LayerShade.cpp
|
SOURCE=.\LayerShade.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
@ -168,6 +176,14 @@ SOURCE=.\Elem.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\ElemStore.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\ElemStore.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\Map.cpp
|
SOURCE=.\Map.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
@ -202,83 +218,6 @@ SOURCE=.\utils.h
|
||||||
# Begin Group "Shell"
|
# Begin Group "Shell"
|
||||||
|
|
||||||
# PROP Default_Filter ""
|
# PROP Default_Filter ""
|
||||||
# Begin Group "Source Files"
|
|
||||||
|
|
||||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\ChildFrm.cpp
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\GLEnabledView.cpp
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\MainFrm.cpp
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\MapEdit.cpp
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\MapEditDoc.cpp
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\MapEditView.cpp
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\Select.cpp
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\StdAfx.cpp
|
|
||||||
# ADD CPP /Yc"stdafx.h"
|
|
||||||
# End Source File
|
|
||||||
# End Group
|
|
||||||
# Begin Group "Header Files"
|
|
||||||
|
|
||||||
# PROP Default_Filter "*.h"
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\ChildFrm.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\GLEnabledView.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\MainFrm.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\MapEdit.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\MapEditDoc.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\MapEditView.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\Resource.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\Select.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\StdAfx.h
|
|
||||||
# End Source File
|
|
||||||
# End Group
|
|
||||||
# Begin Group "Resource Files"
|
# Begin Group "Resource Files"
|
||||||
|
|
||||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||||
|
@ -339,9 +278,99 @@ SOURCE=.\res\select.ico
|
||||||
SOURCE=.\res\Toolbar.bmp
|
SOURCE=.\res\Toolbar.bmp
|
||||||
# End Source File
|
# End Source File
|
||||||
# End Group
|
# End Group
|
||||||
# Begin Group "Dlg"
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\ChildFrm.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\ChildFrm.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\GLEnabledView.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\GLEnabledView.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\MainFrm.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\MainFrm.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\MapEdit.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\MapEdit.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\MapEditDoc.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\MapEditDoc.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\MapEditView.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\MapEditView.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\Resource.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\Select.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\Select.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\StdAfx.cpp
|
||||||
|
# ADD CPP /Yc"stdafx.h"
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\StdAfx.h
|
||||||
|
# End Source File
|
||||||
|
# End Group
|
||||||
|
# Begin Group "GUI"
|
||||||
|
|
||||||
# PROP Default_Filter ""
|
# PROP Default_Filter ""
|
||||||
|
# Begin Group "New"
|
||||||
|
|
||||||
|
# PROP Default_Filter ""
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\GUIElemList.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\GUIElemList.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\GUITileBank.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\GUITileBank.h
|
||||||
|
# End Source File
|
||||||
|
# End Group
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\AddLayerDlg.cpp
|
SOURCE=.\AddLayerDlg.cpp
|
||||||
|
@ -376,14 +405,6 @@ SOURCE=.\LayerShadeGUI.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\LayerTileGUI.cpp
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\LayerTileGUI.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\LayerTileToolbar.cpp
|
SOURCE=.\LayerTileToolbar.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
@ -415,6 +436,5 @@ SOURCE=.\NewMapGUI.cpp
|
||||||
SOURCE=.\NewMapGUI.h
|
SOURCE=.\NewMapGUI.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# End Group
|
# End Group
|
||||||
# End Group
|
|
||||||
# End Target
|
# End Target
|
||||||
# End Project
|
# End Project
|
||||||
|
|
|
@ -132,7 +132,7 @@ BEGIN
|
||||||
MENUITEM "View Left Brush", ID_ACTIVEBRUSH_LEFT
|
MENUITEM "View Left Brush", ID_ACTIVEBRUSH_LEFT
|
||||||
MENUITEM "View Right Brush", ID_ACTIVEBRUSH_RIGHT
|
MENUITEM "View Right Brush", ID_ACTIVEBRUSH_RIGHT
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "&Toggle SubView", ID_TOGGLE_SUBVIEW
|
MENUITEM "&Toggle SubView", ID_TOGGLE_SUBVIEW
|
||||||
END
|
END
|
||||||
POPUP "Misc"
|
POPUP "Misc"
|
||||||
BEGIN
|
BEGIN
|
||||||
|
@ -176,7 +176,7 @@ BEGIN
|
||||||
VK_DELETE, ID_EDIT_CUT, VIRTKEY, SHIFT, NOINVERT
|
VK_DELETE, ID_EDIT_CUT, VIRTKEY, SHIFT, NOINVERT
|
||||||
VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT
|
VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT
|
||||||
VK_INSERT, ID_EDIT_PASTE, VIRTKEY, SHIFT, NOINVERT
|
VK_INSERT, ID_EDIT_PASTE, VIRTKEY, SHIFT, NOINVERT
|
||||||
VK_SPACE, ID_TOGGLE_SUBVIEW, VIRTKEY, NOINVERT
|
VK_SPACE, ID_TOGGLE_SUBVIEW, VIRTKEY, NOINVERT
|
||||||
VK_SUBTRACT, ID_ZOOM_OUT, VIRTKEY, NOINVERT
|
VK_SUBTRACT, ID_ZOOM_OUT, VIRTKEY, NOINVERT
|
||||||
VK_TAB, ID_NEXT_PANE, VIRTKEY, CONTROL, NOINVERT
|
VK_TAB, ID_NEXT_PANE, VIRTKEY, CONTROL, NOINVERT
|
||||||
VK_TAB, ID_PREV_PANE, VIRTKEY, SHIFT, CONTROL,
|
VK_TAB, ID_PREV_PANE, VIRTKEY, SHIFT, CONTROL,
|
||||||
|
@ -425,7 +425,7 @@ END
|
||||||
|
|
||||||
STRINGTABLE DISCARDABLE
|
STRINGTABLE DISCARDABLE
|
||||||
BEGIN
|
BEGIN
|
||||||
ID_TOGGLE_SUBVIEW "Toggle SubView"
|
ID_TOGGLE_SUBVIEW "Toggle SubView"
|
||||||
ID_MAP_TOGGLEGRID "Toggle Grid On and Off"
|
ID_MAP_TOGGLEGRID "Toggle Grid On and Off"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
@ -457,18 +457,18 @@ IDI_SELECT ICON DISCARDABLE "res\\select.ico"
|
||||||
// Dialog
|
// Dialog
|
||||||
//
|
//
|
||||||
|
|
||||||
IDD_LAYER_LIST_DIALOG DIALOG DISCARDABLE 0, 0, 156, 115
|
IDD_LAYER_LIST DIALOG DISCARDABLE 0, 0, 156, 115
|
||||||
STYLE WS_CHILD | WS_BORDER
|
STYLE WS_CHILD | WS_BORDER
|
||||||
FONT 8, "MS Sans Serif"
|
FONT 8, "MS Sans Serif"
|
||||||
BEGIN
|
BEGIN
|
||||||
LISTBOX IDC_LAYER_LIST,5,5,145,85,LBS_OWNERDRAWFIXED |
|
LISTBOX IDC_LAYERLIST_LIST,5,5,145,85,LBS_OWNERDRAWFIXED |
|
||||||
LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL |
|
LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL |
|
||||||
WS_TABSTOP
|
WS_TABSTOP
|
||||||
PUSHBUTTON "Add",IDC_LAYERLIST_ADD,5,95,70,15
|
PUSHBUTTON "Add",IDC_LAYERLIST_ADD,5,95,70,15
|
||||||
PUSHBUTTON "Delete",IDC_LAYERLIST_DELETE,80,95,70,15
|
PUSHBUTTON "Delete",IDC_LAYERLIST_DELETE,80,95,70,15
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_MAPSIZE DIALOG DISCARDABLE 0, 0, 127, 61
|
IDD_RESIZE DIALOG DISCARDABLE 0, 0, 127, 61
|
||||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION
|
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION
|
||||||
CAPTION "Enter New Size"
|
CAPTION "Enter New Size"
|
||||||
FONT 8, "MS Sans Serif"
|
FONT 8, "MS Sans Serif"
|
||||||
|
@ -511,18 +511,16 @@ BEGIN
|
||||||
WS_VSCROLL | WS_TABSTOP,WS_EX_DLGMODALFRAME
|
WS_VSCROLL | WS_TABSTOP,WS_EX_DLGMODALFRAME
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_LAYERTILE_GUI DIALOG DISCARDABLE 0, 0, 156, 47
|
IDD_TILEBANK DIALOG DISCARDABLE 0, 0, 156, 26
|
||||||
STYLE WS_CHILD
|
STYLE WS_CHILD
|
||||||
FONT 8, "MS Sans Serif"
|
FONT 8, "MS Sans Serif"
|
||||||
BEGIN
|
BEGIN
|
||||||
COMBOBOX IDD_LAYERTILE_LIST,7,7,138,322,CBS_DROPDOWNLIST |
|
PUSHBUTTON "Update",IDD_TILEBANK_UPDATE,95,5,50,15
|
||||||
WS_TABSTOP
|
PUSHBUTTON "Load",IDD_TILEBANK_LOAD,5,5,45,15
|
||||||
PUSHBUTTON "Update",IDD_LAYERTILE_BTN_UPDATE,95,25,50,15
|
PUSHBUTTON "Delete",IDD_TILEBANK_DELETE,50,5,45,15
|
||||||
PUSHBUTTON "Load",IDD_LAYERTILE_BTN_LOAD,5,25,45,15
|
|
||||||
PUSHBUTTON "Delete",IDD_LAYERTILE_BTN_DELETE,50,25,45,15
|
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_LAYERTILE_TOOLBAR DIALOG DISCARDABLE 0, 0, 156, 16
|
IDD_LAYER_TOOLBAR DIALOG DISCARDABLE 0, 0, 156, 16
|
||||||
STYLE WS_CHILD
|
STYLE WS_CHILD
|
||||||
FONT 8, "MS Sans Serif"
|
FONT 8, "MS Sans Serif"
|
||||||
BEGIN
|
BEGIN
|
||||||
|
@ -532,7 +530,7 @@ BEGIN
|
||||||
WS_TABSTOP
|
WS_TABSTOP
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_LAYERSHADE_GUI DIALOG DISCARDABLE 0, 0, 156, 76
|
IDD_LAYER_SHADE DIALOG DISCARDABLE 0, 0, 156, 76
|
||||||
STYLE WS_CHILD
|
STYLE WS_CHILD
|
||||||
FONT 8, "MS Sans Serif"
|
FONT 8, "MS Sans Serif"
|
||||||
BEGIN
|
BEGIN
|
||||||
|
@ -564,7 +562,7 @@ BEGIN
|
||||||
UDS_ALIGNRIGHT | UDS_AUTOBUDDY,31,10,11,20
|
UDS_ALIGNRIGHT | UDS_AUTOBUDDY,31,10,11,20
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_LAYERCOLLISION_GUI DIALOG DISCARDABLE 0, 0, 156, 36
|
IDD_LAYER_COLLISION DIALOG DISCARDABLE 0, 0, 156, 41
|
||||||
STYLE WS_CHILD
|
STYLE WS_CHILD
|
||||||
FONT 8, "MS Sans Serif"
|
FONT 8, "MS Sans Serif"
|
||||||
BEGIN
|
BEGIN
|
||||||
|
@ -574,6 +572,15 @@ BEGIN
|
||||||
PUSHBUTTON "Electric",IDC_LAYERCOLLISION_ELECTRIC,0,15,50,10
|
PUSHBUTTON "Electric",IDC_LAYERCOLLISION_ELECTRIC,0,15,50,10
|
||||||
PUSHBUTTON "Sticky",IDC_LAYERCOLLISION_STICKY,50,15,50,10
|
PUSHBUTTON "Sticky",IDC_LAYERCOLLISION_STICKY,50,15,50,10
|
||||||
PUSHBUTTON "Water",IDC_LAYERCOLLISION_WATER,100,15,50,10
|
PUSHBUTTON "Water",IDC_LAYERCOLLISION_WATER,100,15,50,10
|
||||||
|
PUSHBUTTON "Solid",IDC_LAYERCOLLISION_SOLID,0,25,50,10
|
||||||
|
PUSHBUTTON "Death",IDC_LAYERCOLLISION_DEATH,50,25,50,10
|
||||||
|
END
|
||||||
|
|
||||||
|
IDD_ELEMLIST DIALOG DISCARDABLE 0, 0, 156, 26
|
||||||
|
STYLE WS_CHILD
|
||||||
|
FONT 8, "MS Sans Serif"
|
||||||
|
BEGIN
|
||||||
|
COMBOBOX IDD_ELEM_LIST,7,7,138,322,CBS_DROPDOWNLIST | WS_TABSTOP
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
|
@ -585,7 +592,7 @@ END
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
GUIDELINES DESIGNINFO DISCARDABLE
|
GUIDELINES DESIGNINFO DISCARDABLE
|
||||||
BEGIN
|
BEGIN
|
||||||
IDD_LAYER_LIST_DIALOG, DIALOG
|
IDD_LAYER_LIST, DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
LEFTMARGIN, 7
|
LEFTMARGIN, 7
|
||||||
RIGHTMARGIN, 149
|
RIGHTMARGIN, 149
|
||||||
|
@ -593,7 +600,7 @@ BEGIN
|
||||||
BOTTOMMARGIN, 108
|
BOTTOMMARGIN, 108
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_MAPSIZE, DIALOG
|
IDD_RESIZE, DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
LEFTMARGIN, 7
|
LEFTMARGIN, 7
|
||||||
RIGHTMARGIN, 120
|
RIGHTMARGIN, 120
|
||||||
|
@ -617,15 +624,15 @@ BEGIN
|
||||||
BOTTOMMARGIN, 83
|
BOTTOMMARGIN, 83
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_LAYERTILE_GUI, DIALOG
|
IDD_TILEBANK, DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
LEFTMARGIN, 7
|
LEFTMARGIN, 7
|
||||||
RIGHTMARGIN, 149
|
RIGHTMARGIN, 149
|
||||||
TOPMARGIN, 7
|
TOPMARGIN, 7
|
||||||
BOTTOMMARGIN, 40
|
BOTTOMMARGIN, 19
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_LAYERTILE_TOOLBAR, DIALOG
|
IDD_LAYER_TOOLBAR, DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
LEFTMARGIN, 7
|
LEFTMARGIN, 7
|
||||||
RIGHTMARGIN, 149
|
RIGHTMARGIN, 149
|
||||||
|
@ -633,7 +640,7 @@ BEGIN
|
||||||
BOTTOMMARGIN, 9
|
BOTTOMMARGIN, 9
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_LAYERSHADE_GUI, DIALOG
|
IDD_LAYER_SHADE, DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
LEFTMARGIN, 7
|
LEFTMARGIN, 7
|
||||||
RIGHTMARGIN, 149
|
RIGHTMARGIN, 149
|
||||||
|
@ -641,12 +648,20 @@ BEGIN
|
||||||
BOTTOMMARGIN, 69
|
BOTTOMMARGIN, 69
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_LAYERCOLLISION_GUI, DIALOG
|
IDD_LAYER_COLLISION, DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
LEFTMARGIN, 7
|
LEFTMARGIN, 7
|
||||||
RIGHTMARGIN, 149
|
RIGHTMARGIN, 149
|
||||||
TOPMARGIN, 7
|
TOPMARGIN, 7
|
||||||
BOTTOMMARGIN, 29
|
BOTTOMMARGIN, 34
|
||||||
|
END
|
||||||
|
|
||||||
|
IDD_ELEMLIST, DIALOG
|
||||||
|
BEGIN
|
||||||
|
LEFTMARGIN, 7
|
||||||
|
RIGHTMARGIN, 149
|
||||||
|
TOPMARGIN, 7
|
||||||
|
BOTTOMMARGIN, 19
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
#endif // APSTUDIO_INVOKED
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include "MapEdit.h"
|
#include "MapEdit.h"
|
||||||
|
|
||||||
#include "MapEditDoc.h"
|
#include "MapEditDoc.h"
|
||||||
#include "MapSizeDlg.h"
|
#include "GUIResize.h"
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
#define new DEBUG_NEW
|
#define new DEBUG_NEW
|
||||||
|
@ -261,7 +261,7 @@ void CMapEditDoc::TileBankSet()
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
void CMapEditDoc::OnMapSetSize()
|
void CMapEditDoc::OnMapSetSize()
|
||||||
{
|
{
|
||||||
CMapSizeDlg Dlg;
|
CGUIResize Dlg;
|
||||||
|
|
||||||
Dlg.m_Width=Core.GetMapWidth();
|
Dlg.m_Width=Core.GetMapWidth();
|
||||||
Dlg.m_Height=Core.GetMapHeight();
|
Dlg.m_Height=Core.GetMapHeight();
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#include "MapEditDoc.h"
|
#include "MapEditDoc.h"
|
||||||
#include "MapEditView.h"
|
#include "MapEditView.h"
|
||||||
#include "MainFrm.h"
|
#include "MainFrm.h"
|
||||||
#include "LayerTileGui.h"
|
#include "GUITileBank.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*** TileBank ****************************************************************/
|
/*** TileBank ****************************************************************/
|
||||||
|
@ -468,7 +468,7 @@ bool CTileBank::Command(int CmdMsg,CCore *Core,int Param0,int Param1)
|
||||||
GUIUpdate(Core);
|
GUIUpdate(Core);
|
||||||
break;
|
break;
|
||||||
case CmdMsg_SubViewSet:
|
case CmdMsg_SubViewSet:
|
||||||
CurrentSet=TileBankGUI.m_List.GetCurSel();
|
CurrentSet=GUIElemList.m_List.GetCurSel();
|
||||||
GUIUpdate(Core);
|
GUIUpdate(Core);
|
||||||
break;
|
break;
|
||||||
case CmdMsg_ActiveBrushLeft:
|
case CmdMsg_ActiveBrushLeft:
|
||||||
|
@ -487,13 +487,15 @@ bool CTileBank::Command(int CmdMsg,CCore *Core,int Param0,int Param1)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CTileBank::GUIInit(CCore *Core)
|
void CTileBank::GUIInit(CCore *Core)
|
||||||
{
|
{
|
||||||
Core->GUIAdd(TileBankGUI,IDD_LAYERTILE_GUI);
|
Core->GUIAdd(GUIElemList,IDD_ELEMLIST);
|
||||||
|
Core->GUIAdd(GUITileBank,IDD_TILEBANK);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CTileBank::GUIKill(CCore *Core)
|
void CTileBank::GUIKill(CCore *Core)
|
||||||
{
|
{
|
||||||
Core->GUIRemove(TileBankGUI,IDD_LAYERTILE_GUI);
|
Core->GUIRemove(GUIElemList,IDD_ELEMLIST);
|
||||||
|
Core->GUIRemove(GUITileBank,IDD_TILEBANK);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -502,22 +504,22 @@ void CTileBank::GUIUpdate(CCore *Core)
|
||||||
int ListSize=GetSetCount();
|
int ListSize=GetSetCount();
|
||||||
bool IsSubView=Core->IsSubView();
|
bool IsSubView=Core->IsSubView();
|
||||||
|
|
||||||
if (TileBankGUI.m_List)
|
if (GUIElemList.m_List)
|
||||||
{
|
{
|
||||||
TileBankGUI.m_List.ResetContent();
|
GUIElemList.m_List.ResetContent();
|
||||||
if (ListSize)
|
if (ListSize)
|
||||||
{
|
{
|
||||||
for (int i=0; i<ListSize; i++)
|
for (int i=0; i<ListSize; i++)
|
||||||
{
|
{
|
||||||
TileBankGUI.m_List.AddString(GetSetName(i));
|
GUIElemList.m_List.AddString(GetSetName(i));
|
||||||
}
|
}
|
||||||
TileBankGUI.m_List.SetCurSel(CurrentSet);
|
GUIElemList.m_List.SetCurSel(CurrentSet);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
IsSubView=FALSE;
|
IsSubView=FALSE;
|
||||||
}
|
}
|
||||||
TileBankGUI.m_List.EnableWindow(IsSubView);
|
GUIElemList.m_List.EnableWindow(IsSubView);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,8 @@
|
||||||
#include "Elem.h"
|
#include "Elem.h"
|
||||||
|
|
||||||
#include "MapEdit.h"
|
#include "MapEdit.h"
|
||||||
#include "LayerTileGui.h"
|
#include "GUITilebank.h"
|
||||||
|
#include "GUIElemList.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
enum TileSetEnum
|
enum TileSetEnum
|
||||||
|
@ -92,17 +93,16 @@ protected:
|
||||||
bool Select(int BrushID,bool DownFlag);
|
bool Select(int BrushID,bool DownFlag);
|
||||||
void SetBrush(CMap &ThisBrush);
|
void SetBrush(CMap &ThisBrush);
|
||||||
|
|
||||||
//!! CList<CTileSet> TileSet;
|
int CurrentSet,LastSet;
|
||||||
int CurrentSet,LastSet;
|
CMap Brush[2];
|
||||||
CMap Brush[2];
|
int ActiveBrush;
|
||||||
int ActiveBrush;
|
int SelStart,SelEnd;
|
||||||
int SelStart,SelEnd;
|
|
||||||
|
|
||||||
bool LoadFlag;
|
bool LoadFlag;
|
||||||
int LastCursorPos,CursorPos;
|
int LastCursorPos,CursorPos;
|
||||||
|
|
||||||
CLayerTileGUI TileBankGUI;
|
|
||||||
|
|
||||||
|
CGUIElemList GUIElemList;
|
||||||
|
CGUITileBank GUITileBank;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -3,28 +3,27 @@
|
||||||
// Used by MapEdit.rc
|
// Used by MapEdit.rc
|
||||||
//
|
//
|
||||||
#define IDD_ABOUTBOX 100
|
#define IDD_ABOUTBOX 100
|
||||||
#define IDD_PARAMBAR 103
|
|
||||||
#define IDD_MULTIBAR 103
|
#define IDD_MULTIBAR 103
|
||||||
#define IDR_MAINFRAME 128
|
#define IDR_MAINFRAME 128
|
||||||
#define IDR_TOOLBAR 128
|
#define IDR_TOOLBAR 128
|
||||||
#define IDR_MAPEDITYPE 129
|
#define IDR_MAPEDITYPE 129
|
||||||
#define IDD_LAYER_LIST_DIALOG 147
|
#define IDD_LAYER_LIST 147
|
||||||
#define IDI_PAINT 152
|
#define IDI_PAINT 152
|
||||||
#define IDI_SELECT 153
|
#define IDI_SELECT 153
|
||||||
#define IDD_MAPSIZE 167
|
#define IDD_RESIZE 167
|
||||||
#define IDD_NEWMAP 169
|
#define IDD_NEWMAP 169
|
||||||
#define IDD_ADDLAYER 172
|
#define IDD_ADDLAYER 172
|
||||||
#define IDD_LAYERTILE_GUI 173
|
#define IDD_TILEBANK 173
|
||||||
#define IDD_LAYERTILE_TOOLBAR 174
|
#define IDD_LAYER_TOOLBAR 174
|
||||||
#define IDD_LAYERSHADE_GUI 175
|
#define IDD_LAYER_SHADE 175
|
||||||
#define IDD_LAYERCOLLISION_GUI 177
|
#define IDD_LAYER_COLLISION 177
|
||||||
|
#define IDD_ELEMLIST 178
|
||||||
#define IDC_TOOLBAR_COMBO 1018
|
#define IDC_TOOLBAR_COMBO 1018
|
||||||
#define IDC_LAYER_LIST 1019
|
#define IDC_LAYERLIST_LIST 1019
|
||||||
#define IDD_LAYERTILE_BTN_UPDATE 1029
|
#define IDD_TILEBANK_UPDATE 1029
|
||||||
#define IDD_LAYERTILE_LIST 1030
|
#define IDD_TILEBANK_LOAD 1031
|
||||||
#define IDD_LAYERTILE_BTN_LOAD 1031
|
|
||||||
#define IDD_LAYERTILE_BTN_SELECT 1032
|
#define IDD_LAYERTILE_BTN_SELECT 1032
|
||||||
#define IDD_LAYERTILE_BTN_DELETE 1033
|
#define IDD_TILEBANK_DELETE 1033
|
||||||
#define IDD_LAYERTILE_BTN_PAINT 1034
|
#define IDD_LAYERTILE_BTN_PAINT 1034
|
||||||
#define IDC_MAPSIZE_WIDTH 1037
|
#define IDC_MAPSIZE_WIDTH 1037
|
||||||
#define IDC_MAPSIZE_WIDTH_TEXT 1038
|
#define IDC_MAPSIZE_WIDTH_TEXT 1038
|
||||||
|
@ -34,11 +33,9 @@
|
||||||
#define IDC_LAYERLIST_ADD 1056
|
#define IDC_LAYERLIST_ADD 1056
|
||||||
#define IDC_LAYERLIST_DELETE 1057
|
#define IDC_LAYERLIST_DELETE 1057
|
||||||
#define IDC_ADDLAYER_LIST 1058
|
#define IDC_ADDLAYER_LIST 1058
|
||||||
#define IDC_LAYERSHADE_TEXT0 1059
|
|
||||||
#define IDC_LAYERSHADE_EDITR0 1060
|
#define IDC_LAYERSHADE_EDITR0 1060
|
||||||
#define IDC_LAYERSHADE_EDITG0 1061
|
#define IDC_LAYERSHADE_EDITG0 1061
|
||||||
#define IDC_LAYERSHADE_EDITB0 1062
|
#define IDC_LAYERSHADE_EDITB0 1062
|
||||||
#define IDC_LAYERSHADE_TEXT1 1063
|
|
||||||
#define IDC_LAYERSHADE_EDITR1 1064
|
#define IDC_LAYERSHADE_EDITR1 1064
|
||||||
#define IDC_LAYERSHADE_EDITG1 1065
|
#define IDC_LAYERSHADE_EDITG1 1065
|
||||||
#define IDC_LAYERSHADE_EDITB1 1066
|
#define IDC_LAYERSHADE_EDITB1 1066
|
||||||
|
@ -46,6 +43,7 @@
|
||||||
#define IDC_LAYERSHADE_COUNTTEXT 1075
|
#define IDC_LAYERSHADE_COUNTTEXT 1075
|
||||||
#define IDC_SPIN2 1076
|
#define IDC_SPIN2 1076
|
||||||
#define IDC_LAYERCOLLISION_NORMAL 1078
|
#define IDC_LAYERCOLLISION_NORMAL 1078
|
||||||
|
#define IDD_ELEM_LIST 1080
|
||||||
#define IDC_LAYERSHADE_EDITR2 1081
|
#define IDC_LAYERSHADE_EDITR2 1081
|
||||||
#define IDC_LAYERSHADE_EDITG2 1082
|
#define IDC_LAYERSHADE_EDITG2 1082
|
||||||
#define IDC_LAYERCOLLISION_DAMAGE 1082
|
#define IDC_LAYERCOLLISION_DAMAGE 1082
|
||||||
|
@ -56,13 +54,12 @@
|
||||||
#define IDC_LAYERSHADE_TEXT7 1086
|
#define IDC_LAYERSHADE_TEXT7 1086
|
||||||
#define IDC_LAYERCOLLISION_WATER 1086
|
#define IDC_LAYERCOLLISION_WATER 1086
|
||||||
#define IDC_LAYERSHADE_EDITR3 1087
|
#define IDC_LAYERSHADE_EDITR3 1087
|
||||||
|
#define IDC_LAYERCOLLISION_SOLID 1087
|
||||||
#define IDC_LAYERSHADE_EDITG3 1088
|
#define IDC_LAYERSHADE_EDITG3 1088
|
||||||
|
#define IDC_LAYERCOLLISION_DEATH 1088
|
||||||
#define IDC_LAYERSHADE_EDITB3 1089
|
#define IDC_LAYERSHADE_EDITB3 1089
|
||||||
#define ID_TOOLBAR_LAYERBAR 32773
|
|
||||||
#define ID_TOOLBAR_TILEPALETTE 32774
|
#define ID_TOOLBAR_TILEPALETTE 32774
|
||||||
#define ID_TOOLBAR_COMBO 32777
|
|
||||||
#define ID_TOOLBAR_PARAMBAR 32783
|
#define ID_TOOLBAR_PARAMBAR 32783
|
||||||
#define ID_TOOLBAR_GRID 32784
|
|
||||||
#define ID_TOGGLE_SUBVIEW 32785
|
#define ID_TOGGLE_SUBVIEW 32785
|
||||||
#define ID_MAP_TOGGLEGRID 32786
|
#define ID_MAP_TOGGLEGRID 32786
|
||||||
#define ID_TOGGLE_GRID 32787
|
#define ID_TOGGLE_GRID 32787
|
||||||
|
@ -85,7 +82,7 @@
|
||||||
#define _APS_3D_CONTROLS 1
|
#define _APS_3D_CONTROLS 1
|
||||||
#define _APS_NEXT_RESOURCE_VALUE 178
|
#define _APS_NEXT_RESOURCE_VALUE 178
|
||||||
#define _APS_NEXT_COMMAND_VALUE 32800
|
#define _APS_NEXT_COMMAND_VALUE 32800
|
||||||
#define _APS_NEXT_CONTROL_VALUE 1080
|
#define _APS_NEXT_CONTROL_VALUE 1081
|
||||||
#define _APS_NEXT_SYMED_VALUE 101
|
#define _APS_NEXT_SYMED_VALUE 101
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue