This commit is contained in:
parent
302b1cb2e9
commit
2cc37a2eab
11 changed files with 76 additions and 21 deletions
|
@ -65,7 +65,9 @@ int Width,Height;
|
||||||
Dlg.m_Mid=TRUE;
|
Dlg.m_Mid=TRUE;
|
||||||
Dlg.m_Fore=FALSE;
|
Dlg.m_Fore=FALSE;
|
||||||
|
|
||||||
|
#ifndef _DEBUG
|
||||||
if (Dlg.DoModal()!=IDOK) return FALSE;
|
if (Dlg.DoModal()!=IDOK) return FALSE;
|
||||||
|
#endif
|
||||||
Width=Dlg.m_Width;
|
Width=Dlg.m_Width;
|
||||||
Height=Dlg.m_Height;
|
Height=Dlg.m_Height;
|
||||||
|
|
||||||
|
@ -418,6 +420,7 @@ CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||||
CMultiBar *ParamBar=Frm->GetParamBar();
|
CMultiBar *ParamBar=Frm->GetParamBar();
|
||||||
CLayerList *List=(CLayerList*)Frm->GetDialog(IDD_LAYER_LIST_DIALOG);
|
CLayerList *List=(CLayerList*)Frm->GetDialog(IDD_LAYER_LIST_DIALOG);
|
||||||
|
|
||||||
|
if (NewLayer<0) NewLayer=0;
|
||||||
// If toggling layer, dont change the layer
|
// If toggling layer, dont change the layer
|
||||||
if ((int)List->ListBox.GetCheck(NewLayer)!=(int)Layer[NewLayer]->IsVisible())
|
if ((int)List->ListBox.GetCheck(NewLayer)!=(int)Layer[NewLayer]->IsVisible())
|
||||||
{
|
{
|
||||||
|
@ -431,6 +434,34 @@ CLayerList *List=(CLayerList*)Frm->GetDialog(IDD_LAYER_LIST_DIALOG);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
void CCore::AddLayer(int CurrentLayer)
|
||||||
|
{
|
||||||
|
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||||
|
CMultiBar *ParamBar=Frm->GetParamBar();
|
||||||
|
CLayerList *List=(CLayerList*)Frm->GetDialog(IDD_LAYER_LIST_DIALOG);
|
||||||
|
|
||||||
|
TRACE1("Add Layer %i\n",CurrentLayer);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
void CCore::DeleteLayer(int CurrentLayer)
|
||||||
|
{
|
||||||
|
if (Layer[CurrentLayer]->CanDelete())
|
||||||
|
{
|
||||||
|
delete Layer[CurrentLayer];
|
||||||
|
Layer.erase(Layer.begin() + CurrentLayer);
|
||||||
|
SetLayer(CurrentLayer-1);
|
||||||
|
UpdateAll(NULL);
|
||||||
|
TRACE1("Deleted Layer %i\n",CurrentLayer);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TRACE1("Cant Delete Layer %i\n",CurrentLayer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*** Grid ********************************************************************/
|
/*** Grid ********************************************************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -69,6 +69,8 @@ public:
|
||||||
|
|
||||||
// Layers
|
// Layers
|
||||||
void SetLayer(int Layer);
|
void SetLayer(int Layer);
|
||||||
|
void AddLayer(int Layer);
|
||||||
|
void DeleteLayer(int Layer);
|
||||||
void UpdateLayerGUI(CMapEditView *View);
|
void UpdateLayerGUI(CMapEditView *View);
|
||||||
|
|
||||||
// Grid
|
// Grid
|
||||||
|
|
|
@ -62,6 +62,8 @@ virtual void Save(CFile *File)=0;
|
||||||
|
|
||||||
virtual void Export(CCore *Core,CExport &Exp)=0;
|
virtual void Export(CCore *Core,CExport &Exp)=0;
|
||||||
|
|
||||||
|
virtual bool CanDelete()=0;
|
||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
virtual BOOL SetMode(int NewMode)=0;
|
virtual BOOL SetMode(int NewMode)=0;
|
||||||
virtual BOOL InitMode()=0;
|
virtual BOOL InitMode()=0;
|
||||||
|
|
|
@ -54,6 +54,7 @@ public:
|
||||||
void CheckLayerSize(int Width,int Height);
|
void CheckLayerSize(int Width,int Height);
|
||||||
|
|
||||||
void Export(CCore *Core,CExport &Exp);
|
void Export(CCore *Core,CExport &Exp);
|
||||||
|
bool CanDelete() {if (SubType==LAYERTILE_FORE) return(true); else return(false);}
|
||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
BOOL SetMode(int NewMode);
|
BOOL SetMode(int NewMode);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
[General Info]
|
[General Info]
|
||||||
Version=1
|
Version=1
|
||||||
LastClass=CMapEditView
|
LastClass=CLayerList
|
||||||
LastTemplate=CDialog
|
LastTemplate=CDialog
|
||||||
NewFileInclude1=#include "stdafx.h"
|
NewFileInclude1=#include "stdafx.h"
|
||||||
NewFileInclude2=#include "mapedit.h"
|
NewFileInclude2=#include "mapedit.h"
|
||||||
|
@ -18,24 +18,24 @@ Class6=CMapEditDoc
|
||||||
Class7=CMapEditView
|
Class7=CMapEditView
|
||||||
|
|
||||||
ResourceCount=11
|
ResourceCount=11
|
||||||
Resource1=IDD_LAYER_LIST_DIALOG
|
Resource1=IDD_NEW_LAYER
|
||||||
Resource2=IDR_MAPEDITYPE (English (U.S.))
|
Resource2=IDR_MAPEDITYPE (English (U.S.))
|
||||||
Resource3=IDD_NEW_LAYER
|
Resource3=IDD_ABOUTBOX (English (U.S.))
|
||||||
Resource4=IDD_DIALOGBAR (English (U.S.))
|
Resource4=IDD_DIALOGBAR (English (U.S.))
|
||||||
Resource5=IDR_MAINFRAME (English (U.S.))
|
Resource5=IDD_LAYER_LIST_DIALOG
|
||||||
Class8=CMultiBar
|
Class8=CMultiBar
|
||||||
Resource6=IDD_MAPSIZE
|
Resource6=IDD_LAYERTILE_GUI
|
||||||
Resource7=IDD_NEWMAP
|
Resource7=IDD_MULTIBAR (English (U.S.))
|
||||||
Class9=CLayerList
|
Class9=CLayerList
|
||||||
Class10=CMapSizeDlg
|
Class10=CMapSizeDlg
|
||||||
Resource8=IDD_ABOUTBOX (English (U.S.))
|
Resource8=IDR_MAINFRAME (English (U.S.))
|
||||||
Class11=CGfxToolBar
|
Class11=CGfxToolBar
|
||||||
Class12=CLayerTileGUI
|
Class12=CLayerTileGUI
|
||||||
Resource9=IDD_LAYERTILE_GUI
|
Resource9=IDR_TOOLBAR (English (U.S.))
|
||||||
Resource10=IDD_MULTIBAR (English (U.S.))
|
Resource10=IDD_MAPSIZE
|
||||||
Class13=CNewMapGUI
|
Class13=CNewMapGUI
|
||||||
Class14=CProgressDlg
|
Class14=CProgressDlg
|
||||||
Resource11=IDR_TOOLBAR (English (U.S.))
|
Resource11=IDD_NEWMAP
|
||||||
|
|
||||||
[CLS:CChildFrame]
|
[CLS:CChildFrame]
|
||||||
Type=0
|
Type=0
|
||||||
|
@ -216,8 +216,10 @@ ControlCount=0
|
||||||
[DLG:IDD_LAYER_LIST_DIALOG]
|
[DLG:IDD_LAYER_LIST_DIALOG]
|
||||||
Type=1
|
Type=1
|
||||||
Class=CLayerList
|
Class=CLayerList
|
||||||
ControlCount=1
|
ControlCount=3
|
||||||
Control1=IDC_LAYER_LIST,listbox,1352728913
|
Control1=IDC_LAYER_LIST,listbox,1352728913
|
||||||
|
Control2=IDC_LAYERLIST_ADD,button,1342242816
|
||||||
|
Control3=IDC_LAYERLIST_DELETE,button,1342242816
|
||||||
|
|
||||||
[CLS:CLayerList]
|
[CLS:CLayerList]
|
||||||
Type=0
|
Type=0
|
||||||
|
@ -226,7 +228,7 @@ ImplementationFile=LayerList.cpp
|
||||||
BaseClass=CDialog
|
BaseClass=CDialog
|
||||||
Filter=D
|
Filter=D
|
||||||
VirtualFilter=dWC
|
VirtualFilter=dWC
|
||||||
LastObject=CLayerList
|
LastObject=IDC_LAYERLIST_ADD
|
||||||
|
|
||||||
[CLS:CGfxToolBar]
|
[CLS:CGfxToolBar]
|
||||||
Type=0
|
Type=0
|
||||||
|
|
|
@ -95,8 +95,9 @@ BOOL CMapEditApp::InitInstance()
|
||||||
CCommandLineInfo cmdInfo;
|
CCommandLineInfo cmdInfo;
|
||||||
ParseCommandLine(cmdInfo);
|
ParseCommandLine(cmdInfo);
|
||||||
// Prevent creating new doc on startup (should still open cmd line file tho)
|
// Prevent creating new doc on startup (should still open cmd line file tho)
|
||||||
|
#ifndef _DEBUG
|
||||||
if (cmdInfo.m_nShellCommand==CCommandLineInfo::FileNew) cmdInfo.m_nShellCommand=CCommandLineInfo::FileNothing;
|
if (cmdInfo.m_nShellCommand==CCommandLineInfo::FileNew) cmdInfo.m_nShellCommand=CCommandLineInfo::FileNothing;
|
||||||
|
#endif
|
||||||
// Dispatch commands specified on the command line
|
// Dispatch commands specified on the command line
|
||||||
if (!ProcessShellCommand(cmdInfo)) return FALSE;
|
if (!ProcessShellCommand(cmdInfo)) return FALSE;
|
||||||
|
|
||||||
|
|
|
@ -458,13 +458,15 @@ IDI_SELECT ICON DISCARDABLE "res\\select.ico"
|
||||||
// Dialog
|
// Dialog
|
||||||
//
|
//
|
||||||
|
|
||||||
IDD_LAYER_LIST_DIALOG DIALOG DISCARDABLE 0, 0, 155, 94
|
IDD_LAYER_LIST_DIALOG 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_LAYER_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 "Delete",IDC_LAYERLIST_DELETE,80,95,70,15
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_LAYERTILE_GUI DIALOG DISCARDABLE 0, 0, 151, 81
|
IDD_LAYERTILE_GUI DIALOG DISCARDABLE 0, 0, 151, 81
|
||||||
|
@ -552,9 +554,9 @@ BEGIN
|
||||||
IDD_LAYER_LIST_DIALOG, DIALOG
|
IDD_LAYER_LIST_DIALOG, DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
LEFTMARGIN, 7
|
LEFTMARGIN, 7
|
||||||
RIGHTMARGIN, 148
|
RIGHTMARGIN, 149
|
||||||
TOPMARGIN, 7
|
TOPMARGIN, 7
|
||||||
BOTTOMMARGIN, 87
|
BOTTOMMARGIN, 108
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_LAYERTILE_GUI, DIALOG
|
IDD_LAYERTILE_GUI, DIALOG
|
||||||
|
|
|
@ -220,6 +220,20 @@ void CMapEditDoc::SetLayer(int Layer)
|
||||||
FocusView();
|
FocusView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*********************************************************************************/
|
||||||
|
void CMapEditDoc::AddLayer(int Layer)
|
||||||
|
{
|
||||||
|
Core.AddLayer(Layer);
|
||||||
|
FocusView();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************************************************************************/
|
||||||
|
void CMapEditDoc::DeleteLayer(int Layer)
|
||||||
|
{
|
||||||
|
Core.DeleteLayer(Layer);
|
||||||
|
FocusView();
|
||||||
|
}
|
||||||
|
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
|
|
|
@ -49,6 +49,8 @@ public:
|
||||||
|
|
||||||
void SetMode(int NewMode);
|
void SetMode(int NewMode);
|
||||||
void SetLayer(int Layer);
|
void SetLayer(int Layer);
|
||||||
|
void AddLayer(int Layer);
|
||||||
|
void DeleteLayer(int Layer);
|
||||||
|
|
||||||
// Operations
|
// Operations
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -41,6 +41,8 @@
|
||||||
#define IDC_NEWMAP_FORE_CHECK 1051
|
#define IDC_NEWMAP_FORE_CHECK 1051
|
||||||
#define IDC_NEW_LAYER_WIDTH_NAME2 1052
|
#define IDC_NEW_LAYER_WIDTH_NAME2 1052
|
||||||
#define IDC_NEW_LAYER_WIDTH_EDIT2 1053
|
#define IDC_NEW_LAYER_WIDTH_EDIT2 1053
|
||||||
|
#define IDC_LAYERLIST_ADD 1056
|
||||||
|
#define IDC_LAYERLIST_DELETE 1057
|
||||||
#define ID_TOOLBAR_LAYERBAR 32773
|
#define ID_TOOLBAR_LAYERBAR 32773
|
||||||
#define ID_TOOLBAR_TILEPALETTE 32774
|
#define ID_TOOLBAR_TILEPALETTE 32774
|
||||||
#define ID_TOOLBAR_COMBO 32777
|
#define ID_TOOLBAR_COMBO 32777
|
||||||
|
@ -68,7 +70,7 @@
|
||||||
#define _APS_3D_CONTROLS 1
|
#define _APS_3D_CONTROLS 1
|
||||||
#define _APS_NEXT_RESOURCE_VALUE 172
|
#define _APS_NEXT_RESOURCE_VALUE 172
|
||||||
#define _APS_NEXT_COMMAND_VALUE 32799
|
#define _APS_NEXT_COMMAND_VALUE 32799
|
||||||
#define _APS_NEXT_CONTROL_VALUE 1056
|
#define _APS_NEXT_CONTROL_VALUE 1057
|
||||||
#define _APS_NEXT_SYMED_VALUE 101
|
#define _APS_NEXT_SYMED_VALUE 101
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -128,8 +128,6 @@ int ID;
|
||||||
|
|
||||||
/**************************************************************************************/
|
/**************************************************************************************/
|
||||||
/**************************************************************************************/
|
/**************************************************************************************/
|
||||||
/**************************************************************************************/
|
|
||||||
|
|
||||||
/**************************************************************************************/
|
/**************************************************************************************/
|
||||||
struct sTgaHdr
|
struct sTgaHdr
|
||||||
{
|
{
|
||||||
|
@ -168,8 +166,6 @@ sTgaHdr FileHdr;
|
||||||
fwrite(Data,W*H*3,1,File);
|
fwrite(Data,W*H*3,1,File);
|
||||||
|
|
||||||
fclose(File);
|
fclose(File);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************************/
|
/**************************************************************************************/
|
||||||
|
|
Loading…
Add table
Reference in a new issue