This commit is contained in:
parent
81c8d618c9
commit
c94e338dd7
10 changed files with 139 additions and 179 deletions
|
@ -56,10 +56,7 @@ CMultiBar *ParamBar=Frm->GetParamBar();
|
||||||
ParamBar->RemoveAll();
|
ParamBar->RemoveAll();
|
||||||
// Add default parram bar items
|
// Add default parram bar items
|
||||||
ParamBar->Add(Frm->GetLayerList(),IDD_LAYER_LIST_DIALOG,TRUE,TRUE);
|
ParamBar->Add(Frm->GetLayerList(),IDD_LAYER_LIST_DIALOG,TRUE,TRUE);
|
||||||
ParamBar->Add(Frm->GetTileSetDlg(),IDD_TILESET_DIALOG,TRUE,TRUE);
|
|
||||||
UpdateParamBar();
|
UpdateParamBar();
|
||||||
// Layer[ActiveLayer]->InitGUI(this);
|
|
||||||
// ParamBar->Update();
|
|
||||||
UpdateAll(NULL);
|
UpdateAll(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -338,16 +335,9 @@ CToolBar *ToolBar=Frm->GetToolBar();
|
||||||
CMultiBar *ParamBar=Frm->GetParamBar();
|
CMultiBar *ParamBar=Frm->GetParamBar();
|
||||||
|
|
||||||
ParamBar->RemoveAll();
|
ParamBar->RemoveAll();
|
||||||
// Add default parram bar items
|
Layer[ActiveLayer]->InitGUI(this);
|
||||||
if (TileViewFlag)
|
Layer[ActiveLayer]->UpdateGUI(this);
|
||||||
{
|
|
||||||
// TileBank.InitGUI(this);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Layer[ActiveLayer]->InitGUI(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
ParamBar->Update();
|
ParamBar->Update();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -439,10 +429,10 @@ void CCore::TileBankReload()
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CCore::TileBankSet()
|
void CCore::TileBankSet()
|
||||||
{
|
{
|
||||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||||
CTileSetDlg *TileSetDlg=(CTileSetDlg*)Frm->GetDialog(IDD_TILESET_DIALOG);
|
CLayerTileGUI *Dlg=(CLayerTileGUI*)Frm->GetDialog(IDD_LAYERTILE_GUI);
|
||||||
|
|
||||||
TileBank.SetCurrent(TileSetDlg->TileSetList.GetCurSel());
|
TileBank.SetCurrent(Dlg->m_List.GetCurSel());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -507,7 +497,6 @@ void CCore::UpdateGUI(CMapEditView *View)
|
||||||
UpdateLayerGUI(View);
|
UpdateLayerGUI(View);
|
||||||
UpdateGrid(View);
|
UpdateGrid(View);
|
||||||
|
|
||||||
TileBank.UpdateGUI(this,TileViewFlag);
|
|
||||||
Layer[ActiveLayer]->UpdateGUI(this);
|
Layer[ActiveLayer]->UpdateGUI(this);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,6 +54,8 @@ public:
|
||||||
// TileBank
|
// TileBank
|
||||||
void UpdateTileView(CMapEditView *View,BOOL Toggle=FALSE);
|
void UpdateTileView(CMapEditView *View,BOOL Toggle=FALSE);
|
||||||
|
|
||||||
|
void UpdateTileViewGUI() {TileBank.UpdateGUI(this,TileViewFlag);}
|
||||||
|
|
||||||
CTileBank &GetTileBank() {return(TileBank);}
|
CTileBank &GetTileBank() {return(TileBank);}
|
||||||
CTile &GetTile(int Bank,int TileNo) {return(TileBank.GetTile(Bank,TileNo));}
|
CTile &GetTile(int Bank,int TileNo) {return(TileBank.GetTile(Bank,TileNo));}
|
||||||
void TileBankLoad(char *Filename);
|
void TileBankLoad(char *Filename);
|
||||||
|
|
|
@ -36,7 +36,14 @@ CLayerTile::CLayerTile(char *_Name,int Width,int Height,float MapDiv,float ZDiv,
|
||||||
VisibleFlag=TRUE;
|
VisibleFlag=TRUE;
|
||||||
Mode=MouseModePaint;
|
Mode=MouseModePaint;
|
||||||
|
|
||||||
Map.SetSize(Width/MapDiv,Height/MapDiv,TRUE);
|
if (ResizeFlag)
|
||||||
|
{
|
||||||
|
Map.SetSize(Width/MapDiv,Height/MapDiv,TRUE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Map.SetSize(Width,Height,TRUE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -284,34 +291,31 @@ void CLayerTile::InitGUI(CCore *Core)
|
||||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||||
CMultiBar *ParamBar=Frm->GetParamBar();
|
CMultiBar *ParamBar=Frm->GetParamBar();
|
||||||
|
|
||||||
ParamBar->Add(Frm->GetGfxToolBar(),IDD_GFXTOOLBAR,TRUE);
|
ParamBar->Add(Frm->GetLayerTileGUI(),IDD_LAYERTILE_GUI,TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CLayerTile::UpdateGUI(CCore *Core)
|
void CLayerTile::UpdateGUI(CCore *Core)
|
||||||
{
|
{
|
||||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||||
CGfxToolBar *GfxDlg=(CGfxToolBar *)Frm->GetDialog(IDD_GFXTOOLBAR);
|
CLayerTileGUI *Dlg=(CLayerTileGUI *)Frm->GetDialog(IDD_LAYERTILE_GUI);
|
||||||
|
|
||||||
if (GfxDlg)
|
if (Dlg)
|
||||||
{
|
{
|
||||||
GfxDlg->ResetButtons();
|
Dlg->ResetButtons();
|
||||||
switch(Mode)
|
switch(Mode)
|
||||||
{
|
{
|
||||||
case MouseModePaint:
|
case MouseModePaint:
|
||||||
GfxDlg->SetButtonState(CGfxToolBar::PAINT,TRUE);
|
Dlg->SetButtonState(CLayerTileGUI::PAINT,TRUE);
|
||||||
break;
|
break;
|
||||||
case MouseModeSelect:
|
case MouseModeSelect:
|
||||||
GfxDlg->SetButtonState(CGfxToolBar::SELECT,TRUE);
|
Dlg->SetButtonState(CLayerTileGUI::SELECT,TRUE);
|
||||||
break;
|
|
||||||
case MouseModePicker:
|
|
||||||
GfxDlg->SetButtonState(CGfxToolBar::PICKER,TRUE);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Core->UpdateTileViewGUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -337,8 +341,6 @@ BOOL CLayerTile::InitMode()
|
||||||
break;
|
break;
|
||||||
case MouseModeSelect:
|
case MouseModeSelect:
|
||||||
break;
|
break;
|
||||||
case MouseModePicker:
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -354,8 +356,6 @@ BOOL CLayerTile::ExitMode()
|
||||||
break;
|
break;
|
||||||
case MouseModeSelect:
|
case MouseModeSelect:
|
||||||
break;
|
break;
|
||||||
case MouseModePicker:
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -376,8 +376,6 @@ CTileBank &TileBank=Core->GetTileBank();
|
||||||
break;
|
break;
|
||||||
case MouseModeSelect:
|
case MouseModeSelect:
|
||||||
break;
|
break;
|
||||||
case MouseModePicker:
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -398,8 +396,6 @@ CTileBank &TileBank=Core->GetTileBank();
|
||||||
break;
|
break;
|
||||||
case MouseModeSelect:
|
case MouseModeSelect:
|
||||||
break;
|
break;
|
||||||
case MouseModePicker:
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -423,8 +419,6 @@ CTileBank &TileBank=Core->GetTileBank();
|
||||||
break;
|
break;
|
||||||
case MouseModeSelect:
|
case MouseModeSelect:
|
||||||
break;
|
break;
|
||||||
case MouseModePicker:
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -441,8 +435,6 @@ void CLayerTile::RenderCursor(CCore *Core,Vec &CamPos,BOOL Is3d)
|
||||||
break;
|
break;
|
||||||
case MouseModeSelect:
|
case MouseModeSelect:
|
||||||
break;
|
break;
|
||||||
case MouseModePicker:
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,8 +7,7 @@
|
||||||
|
|
||||||
#include "MultiBar.h"
|
#include "MultiBar.h"
|
||||||
#include "LayerList.h"
|
#include "LayerList.h"
|
||||||
#include "TileSetDlg.h"
|
#include "LayerTileGUI.h"
|
||||||
#include "GfxToolBar.h"
|
|
||||||
|
|
||||||
#if _MSC_VER > 1000
|
#if _MSC_VER > 1000
|
||||||
#pragma once
|
#pragma once
|
||||||
|
@ -39,8 +38,8 @@ public:
|
||||||
// Param Bar
|
// Param Bar
|
||||||
CMultiBar *GetParamBar() {return(&ParamBar);}
|
CMultiBar *GetParamBar() {return(&ParamBar);}
|
||||||
CDialog &GetLayerList() {return(LayerList);}
|
CDialog &GetLayerList() {return(LayerList);}
|
||||||
CDialog &GetTileSetDlg() {return(TileSetDlg);}
|
CDialog &GetLayerTileGUI() {return(LayerTileGUI);}
|
||||||
CDialog &GetGfxToolBar() {return(GfxToolBar);}
|
|
||||||
// Operations
|
// Operations
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -65,8 +64,8 @@ protected: // control bar embedded members
|
||||||
CMultiBar ParamBar;
|
CMultiBar ParamBar;
|
||||||
// Sub Dialogs
|
// Sub Dialogs
|
||||||
CLayerList LayerList;
|
CLayerList LayerList;
|
||||||
CTileSetDlg TileSetDlg;
|
CLayerTileGUI LayerTileGUI;
|
||||||
CGfxToolBar GfxToolBar;
|
|
||||||
// Generated message map functions
|
// Generated message map functions
|
||||||
protected:
|
protected:
|
||||||
//{{AFX_MSG(CMainFrame)
|
//{{AFX_MSG(CMainFrame)
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
[General Info]
|
[General Info]
|
||||||
Version=1
|
Version=1
|
||||||
LastClass=CMapEditView
|
LastClass=CLayerTileGUI
|
||||||
LastTemplate=CDialog
|
LastTemplate=CDialog
|
||||||
NewFileInclude1=#include "stdafx.h"
|
NewFileInclude1=#include "stdafx.h"
|
||||||
NewFileInclude2=#include "mapedit.h"
|
NewFileInclude2=#include "mapedit.h"
|
||||||
|
@ -17,22 +17,21 @@ Class5=CAboutDlg
|
||||||
Class6=CMapEditDoc
|
Class6=CMapEditDoc
|
||||||
Class7=CMapEditView
|
Class7=CMapEditView
|
||||||
|
|
||||||
ResourceCount=10
|
ResourceCount=9
|
||||||
Resource1=IDR_MAINFRAME (English (U.S.))
|
Resource1=IDR_MAINFRAME (English (U.S.))
|
||||||
Resource2=IDD_MULTIBAR (English (U.S.))
|
Resource2=IDD_ABOUTBOX (English (U.S.))
|
||||||
Resource3=IDD_GFXTOOLBAR
|
Resource3=IDD_MULTIBAR (English (U.S.))
|
||||||
Resource4=IDD_DIALOGBAR (English (U.S.))
|
Resource4=IDD_DIALOGBAR (English (U.S.))
|
||||||
Resource5=IDD_LAYER_LIST_DIALOG
|
Resource5=IDR_TOOLBAR (English (U.S.))
|
||||||
Class8=CMultiBar
|
Class8=CMultiBar
|
||||||
Resource6=IDD_ABOUTBOX (English (U.S.))
|
Resource6=IDD_LAYER_LIST_DIALOG
|
||||||
Resource7=IDR_MAPEDITYPE (English (U.S.))
|
Resource7=IDR_MAPEDITYPE (English (U.S.))
|
||||||
Class9=CLayerList
|
Class9=CLayerList
|
||||||
Class10=CTileSetDlg
|
Class10=CMapSizeDlg
|
||||||
Resource8=IDD_TILESET_DIALOG
|
Resource8=IDD_LAYERTILE_GUI
|
||||||
Class11=CGfxToolBar
|
Class11=CGfxToolBar
|
||||||
Resource9=IDR_TOOLBAR (English (U.S.))
|
Class12=CLayerTileGUI
|
||||||
Class12=CMapSizeDlg
|
Resource9=IDD_MAPSIZE
|
||||||
Resource10=IDD_MAPSIZE
|
|
||||||
|
|
||||||
[CLS:CChildFrame]
|
[CLS:CChildFrame]
|
||||||
Type=0
|
Type=0
|
||||||
|
@ -217,23 +216,6 @@ Filter=D
|
||||||
VirtualFilter=dWC
|
VirtualFilter=dWC
|
||||||
LastObject=CLayerList
|
LastObject=CLayerList
|
||||||
|
|
||||||
[DLG:IDD_TILESET_DIALOG]
|
|
||||||
Type=1
|
|
||||||
Class=CTileSetDlg
|
|
||||||
ControlCount=3
|
|
||||||
Control1=IDC_TILESETDLG_COMBO,combobox,1342242819
|
|
||||||
Control2=IDC_TILESETDLG_BTN_UPDATE,button,1342242816
|
|
||||||
Control3=IDC_TILESETDLG_BTN_LOAD,button,1342242816
|
|
||||||
|
|
||||||
[CLS:CTileSetDlg]
|
|
||||||
Type=0
|
|
||||||
HeaderFile=TileSetDlg.h
|
|
||||||
ImplementationFile=TileSetDlg.cpp
|
|
||||||
BaseClass=CDialog
|
|
||||||
Filter=D
|
|
||||||
VirtualFilter=dWC
|
|
||||||
LastObject=IDC_TILESETDLG_COMBO
|
|
||||||
|
|
||||||
[CLS:CGfxToolBar]
|
[CLS:CGfxToolBar]
|
||||||
Type=0
|
Type=0
|
||||||
HeaderFile=GfxToolBar.h
|
HeaderFile=GfxToolBar.h
|
||||||
|
@ -243,14 +225,6 @@ Filter=D
|
||||||
LastObject=CGfxToolBar
|
LastObject=CGfxToolBar
|
||||||
VirtualFilter=dWC
|
VirtualFilter=dWC
|
||||||
|
|
||||||
[DLG:IDD_GFXTOOLBAR]
|
|
||||||
Type=1
|
|
||||||
Class=CGfxToolBar
|
|
||||||
ControlCount=3
|
|
||||||
Control1=IDD_GFXTOOLBAR_PAINT,button,1342177344
|
|
||||||
Control2=IDD_GFXTOOLBAR_SELECT,button,1476395072
|
|
||||||
Control3=IDD_GFXTOOLBAR_PICKER,button,1476395072
|
|
||||||
|
|
||||||
[DLG:IDD_MAPSIZE]
|
[DLG:IDD_MAPSIZE]
|
||||||
Type=1
|
Type=1
|
||||||
Class=CMapSizeDlg
|
Class=CMapSizeDlg
|
||||||
|
@ -271,3 +245,22 @@ BaseClass=CDialog
|
||||||
Filter=D
|
Filter=D
|
||||||
VirtualFilter=dWC
|
VirtualFilter=dWC
|
||||||
|
|
||||||
|
[DLG:IDD_LAYERTILE_GUI]
|
||||||
|
Type=1
|
||||||
|
Class=CLayerTileGUI
|
||||||
|
ControlCount=5
|
||||||
|
Control1=IDD_LAYERTILE_LIST,combobox,1342242819
|
||||||
|
Control2=IDD_LAYERTILE_BTN_UPDATE,button,1342242816
|
||||||
|
Control3=IDD_LAYERTILE_BTN_LOAD,button,1342242816
|
||||||
|
Control4=IDD_LAYERTILE_BTN_PAINT,button,1342177344
|
||||||
|
Control5=IDD_LAYERTILE_BTN_SELECT,button,1476395072
|
||||||
|
|
||||||
|
[CLS:CLayerTileGUI]
|
||||||
|
Type=0
|
||||||
|
HeaderFile=LayerTileGUI.h
|
||||||
|
ImplementationFile=LayerTileGUI.cpp
|
||||||
|
BaseClass=CDialog
|
||||||
|
Filter=D
|
||||||
|
VirtualFilter=dWC
|
||||||
|
LastObject=IDD_LAYERTILE_LIST
|
||||||
|
|
||||||
|
|
|
@ -444,9 +444,6 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
|
||||||
// remains consistent on all systems.
|
// remains consistent on all systems.
|
||||||
IDI_PAINT ICON DISCARDABLE "res\\paint.ico"
|
IDI_PAINT ICON DISCARDABLE "res\\paint.ico"
|
||||||
IDI_SELECT ICON DISCARDABLE "res\\select.ico"
|
IDI_SELECT ICON DISCARDABLE "res\\select.ico"
|
||||||
IDI_PICKER ICON DISCARDABLE "res\\picker.ico"
|
|
||||||
IDI_MIRRORY ICON DISCARDABLE "res\\mirrory.ico"
|
|
||||||
IDI_MIRRORX ICON DISCARDABLE "res\\mirrorx.ico"
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
|
@ -462,25 +459,17 @@ BEGIN
|
||||||
WS_TABSTOP
|
WS_TABSTOP
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_TILESET_DIALOG DIALOG DISCARDABLE 0, 0, 151, 46
|
IDD_LAYERTILE_GUI DIALOG DISCARDABLE 0, 0, 151, 81
|
||||||
STYLE WS_CHILD
|
STYLE WS_CHILD
|
||||||
FONT 8, "MS Sans Serif"
|
FONT 8, "MS Sans Serif"
|
||||||
BEGIN
|
BEGIN
|
||||||
COMBOBOX IDC_TILESETDLG_COMBO,7,7,138,322,CBS_DROPDOWNLIST |
|
COMBOBOX IDD_LAYERTILE_LIST,7,7,138,322,CBS_DROPDOWNLIST |
|
||||||
WS_TABSTOP
|
WS_TABSTOP
|
||||||
PUSHBUTTON "Update",IDC_TILESETDLG_BTN_UPDATE,80,25,65,15
|
PUSHBUTTON "Update",IDD_LAYERTILE_BTN_UPDATE,80,25,65,15
|
||||||
PUSHBUTTON "Load",IDC_TILESETDLG_BTN_LOAD,5,25,70,15
|
PUSHBUTTON "Load",IDD_LAYERTILE_BTN_LOAD,5,25,70,15
|
||||||
END
|
PUSHBUTTON "P",IDD_LAYERTILE_BTN_PAINT,5,45,15,15,BS_ICON | NOT
|
||||||
|
|
||||||
IDD_GFXTOOLBAR DIALOG DISCARDABLE 0, 0, 156, 26
|
|
||||||
STYLE DS_CONTROL | WS_CHILD
|
|
||||||
FONT 8, "MS Sans Serif"
|
|
||||||
BEGIN
|
|
||||||
PUSHBUTTON "P",IDD_GFXTOOLBAR_PAINT,5,5,15,15,BS_ICON | NOT
|
|
||||||
WS_TABSTOP
|
WS_TABSTOP
|
||||||
PUSHBUTTON "S",IDD_GFXTOOLBAR_SELECT,20,5,15,15,BS_ICON |
|
PUSHBUTTON "S",IDD_LAYERTILE_BTN_SELECT,20,45,15,15,BS_ICON |
|
||||||
WS_DISABLED | NOT WS_TABSTOP
|
|
||||||
PUSHBUTTON "Pk",IDD_GFXTOOLBAR_PICKER,35,5,15,15,BS_ICON |
|
|
||||||
WS_DISABLED | NOT WS_TABSTOP
|
WS_DISABLED | NOT WS_TABSTOP
|
||||||
END
|
END
|
||||||
|
|
||||||
|
@ -518,20 +507,12 @@ BEGIN
|
||||||
BOTTOMMARGIN, 87
|
BOTTOMMARGIN, 87
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_TILESET_DIALOG, DIALOG
|
IDD_LAYERTILE_GUI, DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
LEFTMARGIN, 7
|
LEFTMARGIN, 7
|
||||||
RIGHTMARGIN, 144
|
RIGHTMARGIN, 144
|
||||||
TOPMARGIN, 7
|
TOPMARGIN, 7
|
||||||
BOTTOMMARGIN, 39
|
BOTTOMMARGIN, 74
|
||||||
END
|
|
||||||
|
|
||||||
IDD_GFXTOOLBAR, DIALOG
|
|
||||||
BEGIN
|
|
||||||
LEFTMARGIN, 7
|
|
||||||
RIGHTMARGIN, 149
|
|
||||||
TOPMARGIN, 7
|
|
||||||
BOTTOMMARGIN, 19
|
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_MAPSIZE, DIALOG
|
IDD_MAPSIZE, DIALOG
|
||||||
|
|
|
@ -157,42 +157,42 @@ void CMapEditDoc::ToggleTileView(CMapEditView *View)
|
||||||
{
|
{
|
||||||
Core.UpdateTileView(View,TRUE);
|
Core.UpdateTileView(View,TRUE);
|
||||||
Core.UpdateAll(View);
|
Core.UpdateAll(View);
|
||||||
theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o)
|
FocusView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
void CMapEditDoc::ToggleGrid(CMapEditView *View)
|
void CMapEditDoc::ToggleGrid(CMapEditView *View)
|
||||||
{
|
{
|
||||||
Core.UpdateGrid(View,TRUE);
|
Core.UpdateGrid(View,TRUE);
|
||||||
theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o)
|
FocusView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
void CMapEditDoc::MirrorX(CMapEditView *View)
|
void CMapEditDoc::MirrorX(CMapEditView *View)
|
||||||
{
|
{
|
||||||
Core.MirrorX(View);
|
Core.MirrorX(View);
|
||||||
theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o)
|
FocusView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
void CMapEditDoc::MirrorY(CMapEditView *View)
|
void CMapEditDoc::MirrorY(CMapEditView *View)
|
||||||
{
|
{
|
||||||
Core.MirrorY(View);
|
Core.MirrorY(View);
|
||||||
theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o)
|
FocusView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
void CMapEditDoc::SetMode(int NewMode)
|
void CMapEditDoc::SetMode(int NewMode)
|
||||||
{
|
{
|
||||||
Core.SetMode(NewMode);
|
Core.SetMode(NewMode);
|
||||||
theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o)
|
FocusView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
void CMapEditDoc::SetLayer(int Layer)
|
void CMapEditDoc::SetLayer(int Layer)
|
||||||
{
|
{
|
||||||
Core.SetLayer(Layer);
|
Core.SetLayer(Layer);
|
||||||
theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o)
|
FocusView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
|
@ -201,7 +201,7 @@ void CMapEditDoc::SetLayer(int Layer)
|
||||||
void CMapEditDoc::OnExportAgb()
|
void CMapEditDoc::OnExportAgb()
|
||||||
{
|
{
|
||||||
char BASED_CODE AGBFilter[]= "AGB Data Type (*.c)|*.c|All Files (*.*)|*.*||";
|
char BASED_CODE AGBFilter[]= "AGB Data Type (*.c)|*.c|All Files (*.*)|*.*||";
|
||||||
CFileDialog Dlg(TRUE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,AGBFilter);
|
CFileDialog Dlg(FALSE,"*.c",NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,AGBFilter);
|
||||||
|
|
||||||
if (Dlg.DoModal()!=IDOK) return;
|
if (Dlg.DoModal()!=IDOK) return;
|
||||||
|
|
||||||
|
@ -232,7 +232,7 @@ char Filename[256];
|
||||||
sprintf(Filename,"%s",Dlg.GetPathName());
|
sprintf(Filename,"%s",Dlg.GetPathName());
|
||||||
Core.TileBankLoad(Filename);
|
Core.TileBankLoad(Filename);
|
||||||
UpdateAllViews(NULL);
|
UpdateAllViews(NULL);
|
||||||
theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o)
|
FocusView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
|
@ -240,7 +240,7 @@ void CMapEditDoc::TileBankReload()
|
||||||
{
|
{
|
||||||
Core.TileBankReload();
|
Core.TileBankReload();
|
||||||
UpdateAllViews(NULL);
|
UpdateAllViews(NULL);
|
||||||
theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o)
|
FocusView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
|
@ -248,7 +248,7 @@ void CMapEditDoc::TileBankSet()
|
||||||
{
|
{
|
||||||
Core.TileBankSet();
|
Core.TileBankSet();
|
||||||
UpdateAllViews(NULL);
|
UpdateAllViews(NULL);
|
||||||
theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o)
|
FocusView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
|
@ -281,3 +281,10 @@ void CMapEditDoc::Toggle2d3d(CMapEditView *View)
|
||||||
{
|
{
|
||||||
Core.Toggle2d3d(View);
|
Core.Toggle2d3d(View);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*********************************************************************************/
|
||||||
|
void CMapEditDoc::FocusView()
|
||||||
|
{
|
||||||
|
theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o)
|
||||||
|
|
||||||
|
}
|
|
@ -22,6 +22,7 @@ public:
|
||||||
void UpdateView(CMapEditView *View);
|
void UpdateView(CMapEditView *View);
|
||||||
void Render(CMapEditView *View);
|
void Render(CMapEditView *View);
|
||||||
void UpdateAll(CMapEditView *View);
|
void UpdateAll(CMapEditView *View);
|
||||||
|
void FocusView();
|
||||||
|
|
||||||
// Windows Messages Thru Point
|
// Windows Messages Thru Point
|
||||||
void LButtonControl(CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag);
|
void LButtonControl(CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag);
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#include "MapEditDoc.h"
|
#include "MapEditDoc.h"
|
||||||
#include "MapEditView.h"
|
#include "MapEditView.h"
|
||||||
#include "MainFrm.h"
|
#include "MainFrm.h"
|
||||||
#include "TileSetDlg.h"
|
#include "LayerTileGui.h"
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -100,63 +100,64 @@ void CTileBank::Save(CFile *File)
|
||||||
{
|
{
|
||||||
int ListSize=TileSet.size();
|
int ListSize=TileSet.size();
|
||||||
|
|
||||||
File->Write(&ListSize,sizeof(int));
|
File->Write(&ListSize,sizeof(int));
|
||||||
File->Write(&CurrentSet,sizeof(int));
|
File->Write(&CurrentSet,sizeof(int));
|
||||||
File->Write(&ActiveBrush,sizeof(int));
|
File->Write(&ActiveBrush,sizeof(int));
|
||||||
Brush[0].Save(File);
|
Brush[0].Save(File);
|
||||||
Brush[1].Save(File);
|
Brush[1].Save(File);
|
||||||
|
|
||||||
for (int i=0;i<ListSize;i++)
|
for (int i=0;i<ListSize;i++)
|
||||||
{
|
{
|
||||||
CTileSet &ThisSet=TileSet[i];
|
CTileSet &ThisSet=TileSet[i];
|
||||||
char Filename[256+64];
|
char Filename[256+64];
|
||||||
|
|
||||||
sprintf(Filename,"%s%s.%s",ThisSet.GetPath(),ThisSet.GetName(),"Gin");
|
sprintf(Filename,"%s%s%s",ThisSet.GetPath(),ThisSet.GetName(),ThisSet.GetExt());
|
||||||
File->Write(Filename,256+64);
|
File->Write(Filename,256+64);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CTileBank::AddTileSet(char *Filename)
|
void CTileBank::AddTileSet(char *Filename)
|
||||||
{
|
{
|
||||||
int ListSize=TileSet.size();
|
int ListSize=TileSet.size();
|
||||||
TileSet.push_back(CTileSet(Filename,ListSize));
|
|
||||||
LoadFlag=TRUE;
|
TileSet.push_back(CTileSet(Filename,ListSize));
|
||||||
|
LoadFlag=TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CTileBank::LoadTileSets(CCore *Core)
|
void CTileBank::LoadTileSets(CCore *Core)
|
||||||
{
|
{
|
||||||
int ListSize=TileSet.size();
|
int ListSize=TileSet.size();
|
||||||
|
|
||||||
for (int i=0;i<ListSize;i++)
|
for (int i=0;i<ListSize;i++)
|
||||||
{
|
{
|
||||||
CTileSet &ThisSet=TileSet[i];
|
CTileSet &ThisSet=TileSet[i];
|
||||||
|
|
||||||
if (!ThisSet.IsLoaded()) ThisSet.Load(Core);
|
if (!ThisSet.IsLoaded()) ThisSet.Load(Core);
|
||||||
}
|
}
|
||||||
LoadFlag=FALSE;
|
LoadFlag=FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CTileBank::Reload()
|
void CTileBank::Reload()
|
||||||
{
|
{
|
||||||
int ListSize=TileSet.size();
|
int ListSize=TileSet.size();
|
||||||
|
|
||||||
for (int i=0; i<ListSize; i++)
|
for (int i=0; i<ListSize; i++)
|
||||||
{
|
{
|
||||||
TileSet[i].Purge();
|
TileSet[i].Purge();
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadFlag=TRUE;
|
LoadFlag=TRUE;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
CTile &CTileBank::GetTile(int Bank,int Tile)
|
CTile &CTileBank::GetTile(int Bank,int Tile)
|
||||||
{
|
{
|
||||||
return(TileSet[Bank].GetTile(Tile));
|
return(TileSet[Bank].GetTile(Tile));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -193,26 +194,27 @@ void CTileBank::FindCursorPos(CCore *Core,CMapEditView *View,Vec &CamPos,CPoint
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CTileBank::UpdateGUI(CCore *Core,BOOL IsTileView)
|
void CTileBank::UpdateGUI(CCore *Core,BOOL IsTileView)
|
||||||
{
|
{
|
||||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||||
CTileSetDlg *TileSetDlg=(CTileSetDlg*)Frm->GetDialog(IDD_TILESET_DIALOG);
|
CLayerTileGUI *Dlg=(CLayerTileGUI*)Frm->GetDialog(IDD_LAYERTILE_GUI);
|
||||||
int ListSize=TileSet.size();
|
int ListSize=TileSet.size();
|
||||||
|
|
||||||
ASSERT(TileSetDlg);
|
if (Dlg)
|
||||||
|
|
||||||
TileSetDlg->TileSetList.ResetContent();
|
|
||||||
if (ListSize)
|
|
||||||
{
|
|
||||||
for (int i=0; i<ListSize; i++)
|
|
||||||
{
|
{
|
||||||
TileSetDlg->TileSetList.AddString(TileSet[i].GetName());
|
Dlg->m_List.ResetContent();
|
||||||
|
if (ListSize)
|
||||||
|
{
|
||||||
|
for (int i=0; i<ListSize; i++)
|
||||||
|
{
|
||||||
|
Dlg->m_List.AddString(TileSet[i].GetName());
|
||||||
|
}
|
||||||
|
Dlg->m_List.SetCurSel(CurrentSet);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
IsTileView=FALSE;
|
||||||
|
}
|
||||||
|
Dlg->m_List.EnableWindow(IsTileView);
|
||||||
}
|
}
|
||||||
TileSetDlg->TileSetList.SetCurSel(CurrentSet);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
IsTileView=FALSE;
|
|
||||||
}
|
|
||||||
TileSetDlg->TileSetList.EnableWindow(IsTileView);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -334,7 +336,6 @@ int Width=ThisBmp.Width/16;
|
||||||
int Height=ThisBmp.Height/16;
|
int Height=ThisBmp.Height/16;
|
||||||
u8 Buffer[16*16*3];
|
u8 Buffer[16*16*3];
|
||||||
|
|
||||||
|
|
||||||
NewTex.Width=16;
|
NewTex.Width=16;
|
||||||
NewTex.Height=16;
|
NewTex.Height=16;
|
||||||
NewTex.RGB=Buffer;
|
NewTex.RGB=Buffer;
|
||||||
|
|
|
@ -9,22 +9,17 @@
|
||||||
#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_DIALOG 147
|
||||||
#define IDD_TILESET_DIALOG 148
|
#define IDD_LAYERTILE_GUI 148
|
||||||
#define IDD_GFXTOOLBAR 151
|
|
||||||
#define IDI_PAINT 152
|
#define IDI_PAINT 152
|
||||||
#define IDI_SELECT 153
|
#define IDI_SELECT 153
|
||||||
#define IDI_PICKER 154
|
|
||||||
#define IDI_MIRRORY 165
|
|
||||||
#define IDI_MIRRORX 166
|
|
||||||
#define IDD_MAPSIZE 167
|
#define IDD_MAPSIZE 167
|
||||||
#define IDC_TOOLBAR_COMBO 1018
|
#define IDC_TOOLBAR_COMBO 1018
|
||||||
#define IDC_LAYER_LIST 1019
|
#define IDC_LAYER_LIST 1019
|
||||||
#define IDC_TILESETDLG_BTN_UPDATE 1029
|
#define IDD_LAYERTILE_BTN_UPDATE 1029
|
||||||
#define IDC_TILESETDLG_COMBO 1030
|
#define IDD_LAYERTILE_LIST 1030
|
||||||
#define IDD_GFXTOOLBAR_PAINT 1031
|
#define IDD_LAYERTILE_BTN_LOAD 1031
|
||||||
#define IDC_TILESETDLG_BTN_LOAD 1031
|
#define IDD_LAYERTILE_BTN_SELECT 1032
|
||||||
#define IDD_GFXTOOLBAR_SELECT 1032
|
#define IDD_LAYERTILE_BTN_PAINT 1034
|
||||||
#define IDD_GFXTOOLBAR_PICKER 1033
|
|
||||||
#define IDC_MAPSIZE_WIDTH 1037
|
#define IDC_MAPSIZE_WIDTH 1037
|
||||||
#define IDC_MAPSIZE_WIDTH_TEXT 1038
|
#define IDC_MAPSIZE_WIDTH_TEXT 1038
|
||||||
#define IDC_MAPSIZE_HEIGHT_TEXT 1039
|
#define IDC_MAPSIZE_HEIGHT_TEXT 1039
|
||||||
|
|
Loading…
Add table
Reference in a new issue