This commit is contained in:
Daveo 2000-11-20 16:21:43 +00:00
parent 073550f4c7
commit 5bfc9fdcda
14 changed files with 220 additions and 73 deletions

View File

@ -60,11 +60,12 @@ CMultiBar *ParamBar=Frm->GetParamBar();
/*****************************************************************************/ /*****************************************************************************/
void CCore::NewMap() void CCore::NewMap()
{ {
// To be loaded/created // Create Gfx Layers
Layers[LAYER_TYPE_BACK]= new CLayerTile("Back", 32, 32, 4.0f, FALSE); // Name Width Height SizeDiv ViewDiv 3d? Resizable?
Layers[LAYER_TYPE_MID]= new CLayerTile("Mid", TileLayerDefaultWidth/2.0f, TileLayerDefaultHeight/2.0f, 2.0f, FALSE); Layers[LAYER_TYPE_BACK]= new CLayerTile( "Back", 32, 32, 1.0f, 4.0f, FALSE, FALSE);
Layers[LAYER_TYPE_ACTION]= new CLayerTile("Action",TileLayerDefaultWidth/1.0f, TileLayerDefaultHeight/1.0f, 1.0f, TRUE); Layers[LAYER_TYPE_MID]= new CLayerTile( "Mid", TileLayerDefaultWidth, TileLayerDefaultHeight, 2.0f, 2.0f, FALSE, TRUE);
Layers[LAYER_TYPE_FORE]= new CLayerTile("Fore", TileLayerDefaultWidth/0.5f, TileLayerDefaultHeight/0.5f, 0.5f, FALSE); Layers[LAYER_TYPE_ACTION]= new CLayerTile( "Action",TileLayerDefaultWidth, TileLayerDefaultHeight, 1.0f, 1.0f, TRUE, TRUE);
Layers[LAYER_TYPE_FORE]= new CLayerTile( "Fore", TileLayerDefaultWidth, TileLayerDefaultHeight, 0.5f, 0.5f, FALSE, TRUE);
ActiveLayer=LAYER_TYPE_ACTION; ActiveLayer=LAYER_TYPE_ACTION;
MapCam=Vec(0,0,0); MapCam=Vec(0,0,0);
@ -327,15 +328,37 @@ CTileSetDlg *TileSetDlg=(CTileSetDlg*)Frm->GetDialog(IDD_TILESET_DIALOG);
} }
/*****************************************************************************/ /*****************************************************************************/
void CCore::MirrorX() void CCore::MirrorX(CMapEditView *View)
{ {
if (!TileViewFlag) Layers[ActiveLayer]->MirrorX(this); if (!TileViewFlag)
{
Layers[ActiveLayer]->MirrorX(this);
UpdateView(View);
}
} }
/*****************************************************************************/ /*****************************************************************************/
void CCore::MirrorY() void CCore::MirrorY(CMapEditView *View)
{ {
if (!TileViewFlag) Layers[ActiveLayer]->MirrorY(this); if (!TileViewFlag)
{
Layers[ActiveLayer]->MirrorY(this);
UpdateView(View);
}
}
/*****************************************************************************/
void CCore::ActiveBrushLeft(CMapEditView *View)
{
TileBank.SetActiveBrushL();
UpdateView(View);
}
/*****************************************************************************/
void CCore::ActiveBrushRight(CMapEditView *View)
{
TileBank.SetActiveBrushR();
UpdateView(View);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -371,3 +394,17 @@ Vec &ThisCam=GetCam();
if (ThisCam.z>-1) ThisCam.z=-1; if (ThisCam.z>-1) ThisCam.z=-1;
if (View) View->Invalidate(); if (View) View->Invalidate();
} }
/*****************************************************************************/
void CCore::SetMapSize(CMapEditView *View,int Width,int Height)
{
if (Width==GetMapWidth() && Height==GetMapHeight()) return;
for (int i=0; i<LAYER_TYPE_MAX; i++)
{
// Layers[i]->Resize(Width,Height);
}
Layers[LAYER_TYPE_ACTION]->Resize(Width,Height);
UpdateView(View);
}

View File

@ -45,10 +45,10 @@ public:
void TileBankLoad(char *Filename); void TileBankLoad(char *Filename);
void TileBankReload(); void TileBankReload();
void TileBankSet(); void TileBankSet();
void MirrorX(); void MirrorX(CMapEditView *View);
void MirrorY(); void MirrorY(CMapEditView *View);
void ActiveBrushLeft() {TileBank.SetActiveBrushL();} void ActiveBrushLeft(CMapEditView *View);
void ActiveBrushRight() {TileBank.SetActiveBrushR();} void ActiveBrushRight(CMapEditView *View);
// Param Bar // Param Bar
void UpdateParamBar(); void UpdateParamBar();
@ -72,6 +72,10 @@ public:
void SetCursorPos(CPoint &Pos) {CursorPos=Pos;} void SetCursorPos(CPoint &Pos) {CursorPos=Pos;}
CPoint &GetCursorPos() {return(CursorPos);} CPoint &GetCursorPos() {return(CursorPos);}
void SetMapSize(CMapEditView *View,int Width,int Height);
int GetMapWidth() {return(Layers[LAYER_TYPE_ACTION]->GetWidth());}
int GetMapHeight() {return(Layers[LAYER_TYPE_ACTION]->GetHeight());}
private: private:
CPoint CurrentMousePos,LastMousePos; CPoint CurrentMousePos,LastMousePos;
CPoint CursorPos,LastCursorPos; CPoint CursorPos,LastCursorPos;

View File

@ -50,6 +50,9 @@ virtual void RenderCursor(CCore *Core,Vec &CamPos,BOOL Is3d)=0;
virtual void InitGUI(CCore *Core)=0; virtual void InitGUI(CCore *Core)=0;
virtual void UpdateGUI(CCore *Core)=0; virtual void UpdateGUI(CCore *Core)=0;
virtual int GetWidth()=0;
virtual int GetHeight()=0;
virtual void Resize(int Width,int Height)=0;
// Functions // Functions
virtual BOOL SetMode(int NewMode)=0; virtual BOOL SetMode(int NewMode)=0;
@ -66,7 +69,9 @@ protected:
char Name[256]; char Name[256];
BOOL Render3dFlag; BOOL Render3dFlag;
float ZPosDiv; float ZPosDiv,MapSizeDiv;
BOOL ResizeFlag;
}; };

View File

@ -25,13 +25,16 @@
/*****************************************************************************/ /*****************************************************************************/
/*****************************************************************************/ /*****************************************************************************/
// New Layer // New Layer
CLayerTile::CLayerTile(char *_Name,int Width,int Height,float ZDiv,BOOL Is3d) CLayerTile::CLayerTile(char *_Name,int Width,int Height,float MapDiv,float ZDiv,BOOL Is3d,BOOL Resizable)
{ {
SetName(_Name); SetName(_Name);
Map.SetSize(Width,Height,TRUE);
ZPosDiv=ZDiv; ZPosDiv=ZDiv;
MapSizeDiv=MapDiv;
ResizeFlag=Resizable;
Render3dFlag=Is3d; Render3dFlag=Is3d;
Mode=MouseModePaint; Mode=MouseModePaint;
Map.SetSize(Width/MapDiv,Height/MapDiv,TRUE);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -46,6 +49,14 @@ CLayerTile::~CLayerTile()
{ {
} }
/*****************************************************************************/
void CLayerTile::Resize(int Width,int Height)
{
if (!ResizeFlag) return; // Its a fixed size, so DONT DO IT!
Map.Resize(Width/MapSizeDiv,Height/MapSizeDiv);
}
/*****************************************************************************/ /*****************************************************************************/
/*****************************************************************************/ /*****************************************************************************/
/*****************************************************************************/ /*****************************************************************************/
@ -476,8 +487,6 @@ BOOL CLayerTile::Paint(CMap &Blk,CPoint &CursorPos)
if (CursorPos.y==-1 || CursorPos.y==-1) return(FALSE); // Off Map? if (CursorPos.y==-1 || CursorPos.y==-1) return(FALSE); // Off Map?
if (!Blk.IsValid()) return(FALSE); // Invalid tile? if (!Blk.IsValid()) return(FALSE); // Invalid tile?
// Tile.Flags=Flag;
Map.Set(CursorPos.x,CursorPos.y,Blk); Map.Set(CursorPos.x,CursorPos.y,Blk);
return(TRUE); return(TRUE);

View File

@ -12,8 +12,8 @@
/*****************************************************************************/ /*****************************************************************************/
enum TileLayerEnum enum TileLayerEnum
{ {
TileLayerDefaultWidth=30, TileLayerDefaultWidth=3,
TileLayerDefaultHeight=20, TileLayerDefaultHeight=2,
}; };
/*****************************************************************************/ /*****************************************************************************/
@ -35,8 +35,8 @@ public:
MouseFlagMirrorY=1<<1, MouseFlagMirrorY=1<<1,
}; };
CLayerTile(char *_Name,int Width,int Height,float ZDiv,BOOL Is3d); // New Layer CLayerTile(char *_Name,int Width,int Height,float MapDiv,float ZDiv,BOOL Is3d,BOOL Resizable); // New Layer
CLayerTile(char *_Name); // Load Layer CLayerTile(char *_Name); // Load Layer
~CLayerTile(); ~CLayerTile();
void Render(CCore *Core,Vec &CamPos,BOOL Is3d); void Render(CCore *Core,Vec &CamPos,BOOL Is3d);
@ -48,6 +48,10 @@ public:
void InitGUI(CCore *Core); void InitGUI(CCore *Core);
void UpdateGUI(CCore *Core); void UpdateGUI(CCore *Core);
int GetWidth() {return(Map.GetWidth());}
int GetHeight() {return(Map.GetHeight());}
void Resize(int Width,int Height);
// Functions // Functions
BOOL SetMode(int NewMode); BOOL SetMode(int NewMode);

View File

@ -186,4 +186,22 @@ int Height=GetHeight();
} }
/*****************************************************************************/ /*****************************************************************************/
void CMap::Resize(int Width,int Height)
{
CMap Old=*this;
int OldWidth=Old.GetWidth();
int OldHeight=Old.GetHeight();
int MinW=min(Width,OldWidth);
int MinH=min(Height,OldHeight);
Delete();
SetSize(Width,Height,TRUE);
for (int Y=0; Y<MinH; Y++)
{
for (int X=0; X<MinW; X++)
{
Set(X,Y,Old.Get(X,Y));
}
}
}

View File

@ -44,6 +44,8 @@ public:
void Set(int X,int Y,CMap &Blk); void Set(int X,int Y,CMap &Blk);
void Set(CMap &Src,int StartX,int StartY,int Width,int Height); void Set(CMap &Src,int StartX,int StartY,int Width,int Height);
void Resize(int Width,int Height);
BOOL DoesContainTile(sMapElem &Tile); BOOL DoesContainTile(sMapElem &Tile);
inline void operator=(CMap &Src) inline void operator=(CMap &Src)

View File

@ -2,13 +2,13 @@
[General Info] [General Info]
Version=1 Version=1
LastClass=CMapEditDoc LastClass=CMapSizeDlg
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=11 ClassCount=12
Class1=CChildFrame Class1=CChildFrame
Class2=CGLEnabledView Class2=CGLEnabledView
Class3=CMainFrame Class3=CMainFrame
@ -17,20 +17,22 @@ Class5=CAboutDlg
Class6=CMapEditDoc Class6=CMapEditDoc
Class7=CMapEditView Class7=CMapEditView
ResourceCount=9 ResourceCount=10
Resource1=IDD_ABOUTBOX (English (U.S.)) Resource1=IDR_MAINFRAME (English (U.S.))
Resource2=IDR_TOOLBAR (English (U.S.)) Resource2=IDD_TILESET_DIALOG
Resource3=IDD_TILESET_DIALOG Resource3=IDD_LAYER_LIST_DIALOG
Resource4=IDD_DIALOGBAR (English (U.S.)) Resource4=IDD_DIALOGBAR (English (U.S.))
Resource5=IDR_MAPEDITYPE (English (U.S.)) Resource5=IDR_MAPEDITYPE (English (U.S.))
Class8=CMultiBar Class8=CMultiBar
Resource6=IDD_LAYER_LIST_DIALOG Resource6=IDD_ABOUTBOX (English (U.S.))
Resource7=IDR_MAINFRAME (English (U.S.)) Resource7=IDR_TOOLBAR (English (U.S.))
Class9=CLayerList Class9=CLayerList
Class10=CTileSetDlg Class10=CTileSetDlg
Resource8=IDD_MULTIBAR (English (U.S.)) Resource8=IDD_MULTIBAR (English (U.S.))
Class11=CGfxToolBar Class11=CGfxToolBar
Resource9=IDD_GFXTOOLBAR Resource9=IDD_GFXTOOLBAR
Class12=CMapSizeDlg
Resource10=IDD_MAPSIZE
[CLS:CChildFrame] [CLS:CChildFrame]
Type=0 Type=0
@ -70,14 +72,14 @@ Type=0
BaseClass=CDocument BaseClass=CDocument
HeaderFile=MapEditDoc.h HeaderFile=MapEditDoc.h
ImplementationFile=MapEditDoc.cpp ImplementationFile=MapEditDoc.cpp
LastObject=CMapEditDoc LastObject=ID_MIRRORX
[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=ID_ACTIVEBRUSH_RIGHT LastObject=CMapEditView
Filter=C Filter=C
VirtualFilter=VWC VirtualFilter=VWC
@ -126,18 +128,19 @@ Command10=ID_EDIT_COPY
Command11=ID_EDIT_PASTE Command11=ID_EDIT_PASTE
Command12=ID_VIEW_TOOLBAR Command12=ID_VIEW_TOOLBAR
Command13=ID_VIEW_STATUS_BAR Command13=ID_VIEW_STATUS_BAR
Command14=ID_TOGGLE_GRID Command14=ID_MAP_SETSIZE
Command15=ID_TOGGLE_TILEVIEW Command15=ID_TOGGLE_GRID
Command16=ID_MIRRORX Command16=ID_MIRRORX
Command17=ID_MIRRORY Command17=ID_MIRRORY
Command18=ID_ACTIVEBRUSH_LEFT Command18=ID_ACTIVEBRUSH_LEFT
Command19=ID_ACTIVEBRUSH_RIGHT Command19=ID_ACTIVEBRUSH_RIGHT
Command20=ID_WINDOW_NEW Command20=ID_TOGGLE_TILEVIEW
Command21=ID_WINDOW_CASCADE Command21=ID_WINDOW_NEW
Command22=ID_WINDOW_TILE_HORZ Command22=ID_WINDOW_CASCADE
Command23=ID_WINDOW_ARRANGE Command23=ID_WINDOW_TILE_HORZ
Command24=ID_APP_ABOUT Command24=ID_WINDOW_ARRANGE
CommandCount=24 Command25=ID_APP_ABOUT
CommandCount=25
[ACL:IDR_MAINFRAME (English (U.S.))] [ACL:IDR_MAINFRAME (English (U.S.))]
Type=1 Type=1
@ -242,3 +245,23 @@ Control1=IDD_GFXTOOLBAR_PAINT,button,1342177344
Control2=IDD_GFXTOOLBAR_SELECT,button,1476395072 Control2=IDD_GFXTOOLBAR_SELECT,button,1476395072
Control3=IDD_GFXTOOLBAR_PICKER,button,1476395072 Control3=IDD_GFXTOOLBAR_PICKER,button,1476395072
[DLG:IDD_MAPSIZE]
Type=1
Class=CMapSizeDlg
ControlCount=7
Control1=IDOK,button,1342177281
Control2=IDCANCEL,button,1342177280
Control3=IDC_MAPSIZE_WIDTH_TEXT,static,1342308866
Control4=IDC_MAPSIZE_WIDTH,edit,1350639744
Control5=IDC_MAPSIZE_HEIGHT_TEXT,static,1342308866
Control6=IDC_MAPSIZE_HEIGHT,edit,1350639744
Control7=IDC_MAPSIZE_WARNING,static,1342308352
[CLS:CMapSizeDlg]
Type=0
HeaderFile=MapSizeDlg.h
ImplementationFile=MapSizeDlg.cpp
BaseClass=CDialog
Filter=D
VirtualFilter=dWC

View File

@ -114,17 +114,20 @@ BEGIN
END END
POPUP "&Map" POPUP "&Map"
BEGIN BEGIN
MENUITEM "Set Size", ID_MAP_SETSIZE
MENUITEM SEPARATOR
MENUITEM "&Toggle Grid", ID_TOGGLE_GRID MENUITEM "&Toggle Grid", ID_TOGGLE_GRID
END END
POPUP "&TileBank" POPUP "&TileBank"
BEGIN BEGIN
MENUITEM "&Toggle TileView", ID_TOGGLE_TILEVIEW
MENUITEM SEPARATOR MENUITEM SEPARATOR
MENUITEM "Mirror &X", ID_MIRRORX MENUITEM "Mirror &X", ID_MIRRORX
MENUITEM "Mirror &Y", ID_MIRRORY MENUITEM "Mirror &Y", ID_MIRRORY
MENUITEM SEPARATOR MENUITEM SEPARATOR
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 "&Toggle TileView", ID_TOGGLE_TILEVIEW
END END
POPUP "&Window" POPUP "&Window"
BEGIN BEGIN
@ -473,6 +476,23 @@ BEGIN
WS_DISABLED | NOT WS_TABSTOP WS_DISABLED | NOT WS_TABSTOP
END END
IDD_MAPSIZE DIALOG DISCARDABLE 0, 0, 127, 61
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION
CAPTION "Enter New Size"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,75,5,50,14,NOT WS_TABSTOP
PUSHBUTTON "Cancel",IDCANCEL,75,20,50,14,NOT WS_TABSTOP
RTEXT "Width",IDC_MAPSIZE_WIDTH_TEXT,5,5,20,10,SS_CENTERIMAGE
EDITTEXT IDC_MAPSIZE_WIDTH,30,5,35,12,ES_AUTOHSCROLL | ES_NUMBER
RTEXT "Height",IDC_MAPSIZE_HEIGHT_TEXT,5,20,20,10,
SS_CENTERIMAGE
EDITTEXT IDC_MAPSIZE_HEIGHT,30,20,35,12,ES_AUTOHSCROLL |
ES_NUMBER
LTEXT "Resize can destroy data.\nYou have been warned",
IDC_MAPSIZE_WARNING,5,40,110,20
END
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
@ -505,6 +525,14 @@ BEGIN
TOPMARGIN, 7 TOPMARGIN, 7
BOTTOMMARGIN, 19 BOTTOMMARGIN, 19
END END
IDD_MAPSIZE, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 120
TOPMARGIN, 7
BOTTOMMARGIN, 54
END
END END
#endif // APSTUDIO_INVOKED #endif // APSTUDIO_INVOKED

View File

@ -5,6 +5,7 @@
#include "MapEdit.h" #include "MapEdit.h"
#include "MapEditDoc.h" #include "MapEditDoc.h"
#include "MapSizeDlg.h"
#ifdef _DEBUG #ifdef _DEBUG
#define new DEBUG_NEW #define new DEBUG_NEW
@ -99,16 +100,9 @@ void CMapEditDoc::Render(CMapEditView *View)
Core.Render(View); Core.Render(View);
} }
/*********************************************************************************/
void CMapEditDoc::UpdateAll(CMapEditView *View)
{
Core.UpdateAll(View);
}
/*********************************************************************************/ /*********************************************************************************/
void CMapEditDoc::OnStatusCursorXY(CCmdUI *pCmdUI) void CMapEditDoc::OnStatusCursorXY(CCmdUI *pCmdUI)
{ {
CPoint &XY=Core.GetCursorPos(); CPoint &XY=Core.GetCursorPos();
CString XYStr; CString XYStr;
pCmdUI->Enable(); pCmdUI->Enable();
@ -167,16 +161,16 @@ void CMapEditDoc::ToggleGrid(CMapEditView *View)
} }
/*********************************************************************************/ /*********************************************************************************/
void CMapEditDoc::MirrorX() void CMapEditDoc::MirrorX(CMapEditView *View)
{ {
Core.MirrorX(); Core.MirrorX(View);
theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o) theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o)
} }
/*********************************************************************************/ /*********************************************************************************/
void CMapEditDoc::MirrorY() void CMapEditDoc::MirrorY(CMapEditView *View)
{ {
Core.MirrorY(); Core.MirrorY(View);
theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o) theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o)
} }
@ -221,16 +215,26 @@ void CMapEditDoc::TileBankSet()
} }
/*********************************************************************************/ /*********************************************************************************/
void CMapEditDoc::ActiveBrushLeft() void CMapEditDoc::ActiveBrushLeft(CMapEditView *View)
{ {
Core.ActiveBrushLeft(); Core.ActiveBrushLeft(View);
UpdateAllViews(NULL);
} }
/*********************************************************************************/ /*********************************************************************************/
void CMapEditDoc::ActiveBrushRight() void CMapEditDoc::ActiveBrushRight(CMapEditView *View)
{ {
Core.ActiveBrushRight(); Core.ActiveBrushRight(View);
UpdateAllViews(NULL); }
/*********************************************************************************/
void CMapEditDoc::MapSetSize(CMapEditView *View)
{
CMapSizeDlg Dlg;
Dlg.m_Width=Core.GetMapWidth();
Dlg.m_Height=Core.GetMapHeight();
if (Dlg.DoModal()!=IDOK) return;
Core.SetMapSize(View,Dlg.m_Width,Dlg.m_Height);
} }

View File

@ -31,10 +31,11 @@ public:
void MouseMove(CMapEditView *View,UINT nFlags, CPoint &point); void MouseMove(CMapEditView *View,UINT nFlags, CPoint &point);
void ToggleTileView(CMapEditView *View); void ToggleTileView(CMapEditView *View);
void ToggleGrid(CMapEditView *View); void ToggleGrid(CMapEditView *View);
void MirrorX(); void MirrorX(CMapEditView *View);
void MirrorY(); void MirrorY(CMapEditView *View);
void ActiveBrushLeft(); void ActiveBrushLeft(CMapEditView *View);
void ActiveBrushRight(); void ActiveBrushRight(CMapEditView *View);
void MapSetSize(CMapEditView *View);
void TileBankLoad(); void TileBankLoad();
void TileBankReload(); void TileBankReload();

View File

@ -39,10 +39,11 @@ BEGIN_MESSAGE_MAP(CMapEditView, CGLEnabledView)
ON_COMMAND(ID_TOOLBAR_GRID, OnToggleGrid) ON_COMMAND(ID_TOOLBAR_GRID, OnToggleGrid)
ON_COMMAND(ID_MIRRORX, OnMirrorx) ON_COMMAND(ID_MIRRORX, OnMirrorx)
ON_COMMAND(ID_MIRRORY, OnMirrory) ON_COMMAND(ID_MIRRORY, OnMirrory)
ON_COMMAND(ID_TOOLBAR_TILEPALETTE, OnToggleTileview)
ON_COMMAND(ID_TOGGLE_GRID, OnToggleGrid)
ON_COMMAND(ID_ACTIVEBRUSH_LEFT, OnActivebrushLeft) ON_COMMAND(ID_ACTIVEBRUSH_LEFT, OnActivebrushLeft)
ON_COMMAND(ID_ACTIVEBRUSH_RIGHT, OnActivebrushRight) ON_COMMAND(ID_ACTIVEBRUSH_RIGHT, OnActivebrushRight)
ON_COMMAND(ID_TOOLBAR_TILEPALETTE, OnToggleTileview)
ON_COMMAND(ID_TOGGLE_GRID, OnToggleGrid)
ON_COMMAND(ID_MAP_SETSIZE, OnMapSetSize)
//}}AFX_MSG_MAP //}}AFX_MSG_MAP
END_MESSAGE_MAP() END_MESSAGE_MAP()
@ -142,7 +143,8 @@ void CMapEditView::OnSetFocus(CWnd* pOldWnd)
CMapEditDoc *CurDoc=GetDocument(); CMapEditDoc *CurDoc=GetDocument();
CGLEnabledView::OnSetFocus(pOldWnd); CGLEnabledView::OnSetFocus(pOldWnd);
theApp.SetCurrent(CurDoc); theApp.SetCurrent(CurDoc);
CurDoc->UpdateAll(this); // CurDoc->UpdateAll(this);
CurDoc->UpdateAllViews(this);
} }
/*********************************************************************************/ /*********************************************************************************/
@ -158,8 +160,10 @@ void CMapEditView::OnRButtonUp(UINT nFlags, CPoint point) {GetDocument()->RBu
void CMapEditView::OnMouseMove(UINT nFlags, CPoint point) {GetDocument()->MouseMove(this,nFlags, point);} void CMapEditView::OnMouseMove(UINT nFlags, CPoint point) {GetDocument()->MouseMove(this,nFlags, point);}
void CMapEditView::OnToggleTileview() {GetDocument()->ToggleTileView(this);} void CMapEditView::OnToggleTileview() {GetDocument()->ToggleTileView(this);}
void CMapEditView::OnToggleGrid() {GetDocument()->ToggleGrid(this);} void CMapEditView::OnToggleGrid() {GetDocument()->ToggleGrid(this);}
void CMapEditView::OnMirrorx() {GetDocument()->MirrorX();} void CMapEditView::OnMirrorx() {GetDocument()->MirrorX(this);}
void CMapEditView::OnMirrory() {GetDocument()->MirrorY();} void CMapEditView::OnMirrory() {GetDocument()->MirrorY(this);}
void CMapEditView::OnActivebrushLeft() {GetDocument()->ActiveBrushLeft();} void CMapEditView::OnActivebrushLeft() {GetDocument()->ActiveBrushLeft(this);}
void CMapEditView::OnActivebrushRight() {GetDocument()->ActiveBrushRight();} void CMapEditView::OnActivebrushRight() {GetDocument()->ActiveBrushRight(this);}
void CMapEditView::OnMapSetSize() {GetDocument()->MapSetSize(this);}

View File

@ -61,6 +61,7 @@ protected:
afx_msg void OnMirrory(); afx_msg void OnMirrory();
afx_msg void OnActivebrushLeft(); afx_msg void OnActivebrushLeft();
afx_msg void OnActivebrushRight(); afx_msg void OnActivebrushRight();
afx_msg void OnMapSetSize();
//}}AFX_MSG //}}AFX_MSG
DECLARE_MESSAGE_MAP() DECLARE_MESSAGE_MAP()
}; };

View File

@ -16,6 +16,7 @@
#define IDI_PICKER 154 #define IDI_PICKER 154
#define IDI_MIRRORY 165 #define IDI_MIRRORY 165
#define IDI_MIRRORX 166 #define IDI_MIRRORX 166
#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 IDC_TILESETDLG_BTN_UPDATE 1029
@ -24,6 +25,11 @@
#define IDC_TILESETDLG_BTN_LOAD 1031 #define IDC_TILESETDLG_BTN_LOAD 1031
#define IDD_GFXTOOLBAR_SELECT 1032 #define IDD_GFXTOOLBAR_SELECT 1032
#define IDD_GFXTOOLBAR_PICKER 1033 #define IDD_GFXTOOLBAR_PICKER 1033
#define IDC_MAPSIZE_WIDTH 1037
#define IDC_MAPSIZE_WIDTH_TEXT 1038
#define IDC_MAPSIZE_HEIGHT_TEXT 1039
#define IDC_MAPSIZE_HEIGHT 1040
#define IDC_MAPSIZE_WARNING 1041
#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
@ -36,6 +42,7 @@
#define ID_MIRRORY 32789 #define ID_MIRRORY 32789
#define ID_ACTIVEBRUSH_LEFT 32790 #define ID_ACTIVEBRUSH_LEFT 32790
#define ID_ACTIVEBRUSH_RIGHT 32791 #define ID_ACTIVEBRUSH_RIGHT 32791
#define ID_MAP_SETSIZE 32792
#define ID_INDICATOR_CURSORXY 59142 #define ID_INDICATOR_CURSORXY 59142
// Next default values for new objects // Next default values for new objects
@ -43,9 +50,9 @@
#ifdef APSTUDIO_INVOKED #ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS #ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1 #define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 167 #define _APS_NEXT_RESOURCE_VALUE 168
#define _APS_NEXT_COMMAND_VALUE 32792 #define _APS_NEXT_COMMAND_VALUE 32794
#define _APS_NEXT_CONTROL_VALUE 1037 #define _APS_NEXT_CONTROL_VALUE 1042
#define _APS_NEXT_SYMED_VALUE 101 #define _APS_NEXT_SYMED_VALUE 101
#endif #endif
#endif #endif