|
@ -52,8 +52,9 @@ CMultiBar *ParamBar=Frm->GetParamBar();
|
||||||
// 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);
|
ParamBar->Add(Frm->GetTileSetDlg(),IDD_TILESET_DIALOG,TRUE,TRUE);
|
||||||
Layers[ActiveLayer]->InitGUI(this);
|
UpdateParamBar();
|
||||||
ParamBar->Update();
|
// Layers[ActiveLayer]->InitGUI(this);
|
||||||
|
// ParamBar->Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -134,7 +135,6 @@ void CCore::SetMode(int NewMode)
|
||||||
BOOL RedrawFlag=FALSE;
|
BOOL RedrawFlag=FALSE;
|
||||||
|
|
||||||
RedrawFlag=Layers[ActiveLayer]->SetMode(NewMode);
|
RedrawFlag=Layers[ActiveLayer]->SetMode(NewMode);
|
||||||
|
|
||||||
//if (RedrawFlag) View->Invalidate();
|
//if (RedrawFlag) View->Invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,12 +231,25 @@ Vec &ThisCam=GetCam();
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*** Layers ******************************************************************/
|
/*** Layers ******************************************************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CCore::UpdateParamBar(CMapEditView *View,BOOL ViewFlag)
|
void CCore::UpdateParamBar()
|
||||||
{
|
{
|
||||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||||
CToolBar *ToolBar=Frm->GetToolBar();
|
CToolBar *ToolBar=Frm->GetToolBar();
|
||||||
CMultiBar *ParamBar=Frm->GetParamBar();
|
CMultiBar *ParamBar=Frm->GetParamBar();
|
||||||
|
|
||||||
|
ParamBar->RemoveAll();
|
||||||
|
// Add default parram bar items
|
||||||
|
if (TileViewFlag)
|
||||||
|
{
|
||||||
|
// TileBank.InitGUI(this);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Layers[ActiveLayer]->InitGUI(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
ParamBar->Update();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -271,6 +284,7 @@ CMultiBar *ParamBar=Frm->GetParamBar();
|
||||||
if (Toggle) TileViewFlag=!TileViewFlag;
|
if (Toggle) TileViewFlag=!TileViewFlag;
|
||||||
ParamBar->RemoveAll();
|
ParamBar->RemoveAll();
|
||||||
ToolBar->GetToolBarCtrl().PressButton(ID_TOOLBAR_TILEPALETTE,TileViewFlag);
|
ToolBar->GetToolBarCtrl().PressButton(ID_TOOLBAR_TILEPALETTE,TileViewFlag);
|
||||||
|
UpdateParamBar();
|
||||||
UpdateView(View);
|
UpdateView(View);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -289,6 +303,7 @@ void CCore::TileBankReload()
|
||||||
TexCache.Purge();
|
TexCache.Purge();
|
||||||
UpdateView(NULL);
|
UpdateView(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CCore::TileBankSet()
|
void CCore::TileBankSet()
|
||||||
{
|
{
|
||||||
|
@ -298,6 +313,18 @@ CTileSetDlg *TileSetDlg=(CTileSetDlg*)Frm->GetDialog(IDD_TILESET_DIALOG);
|
||||||
TileBank.SetCurrent(TileSetDlg->TileSetList.GetCurSel());
|
TileBank.SetCurrent(TileSetDlg->TileSetList.GetCurSel());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
void CCore::MirrorX()
|
||||||
|
{
|
||||||
|
if (!TileViewFlag) Layers[ActiveLayer]->MirrorX();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
void CCore::MirrorY()
|
||||||
|
{
|
||||||
|
if (!TileViewFlag) Layers[ActiveLayer]->MirrorY();
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*** Misc ********************************************************************/
|
/*** Misc ********************************************************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -45,9 +45,11 @@ public:
|
||||||
void TileBankLoad(char *Filename);
|
void TileBankLoad(char *Filename);
|
||||||
void TileBankReload();
|
void TileBankReload();
|
||||||
void TileBankSet();
|
void TileBankSet();
|
||||||
|
void MirrorX();
|
||||||
|
void MirrorY();
|
||||||
|
|
||||||
// Param Bar
|
// Param Bar
|
||||||
void UpdateParamBar(CMapEditView *View,BOOL ViewFlag);
|
void UpdateParamBar();
|
||||||
|
|
||||||
// Layers
|
// Layers
|
||||||
void SetActiveLayer(int Layer);
|
void SetActiveLayer(int Layer);
|
||||||
|
|
|
@ -57,6 +57,9 @@ virtual BOOL LButtonControl(CCore *Core,CMapEditView *View,UINT nFlags, CPoint
|
||||||
virtual BOOL RButtonControl(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &CursorPos,BOOL DownFlag)=0;
|
virtual BOOL RButtonControl(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &CursorPos,BOOL DownFlag)=0;
|
||||||
virtual BOOL MouseMove(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &CursorPos)=0;
|
virtual BOOL MouseMove(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &CursorPos)=0;
|
||||||
|
|
||||||
|
virtual BOOL MirrorX(){return(FALSE);};
|
||||||
|
virtual BOOL MirrorY(){return(FALSE);};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
char Name[256];
|
char Name[256];
|
||||||
|
|
|
@ -32,7 +32,7 @@ CLayerTile::CLayerTile(char *_Name,int Width,int Height,float ZDiv,BOOL Is3d)
|
||||||
ZPosDiv=ZDiv;
|
ZPosDiv=ZDiv;
|
||||||
Render3dFlag=Is3d;
|
Render3dFlag=Is3d;
|
||||||
Mode=MouseModePaint;
|
Mode=MouseModePaint;
|
||||||
Flag=MouseFlagNone;
|
Flag=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -107,7 +107,7 @@ int MapH=Map.GetHeight();
|
||||||
float StartX=CamPos.x/XYDiv;
|
float StartX=CamPos.x/XYDiv;
|
||||||
float StartY=CamPos.y/XYDiv;
|
float StartY=CamPos.y/XYDiv;
|
||||||
CTexCache &TexCache=Core->GetTexCache();
|
CTexCache &TexCache=Core->GetTexCache();
|
||||||
|
|
||||||
glColor3f(0.5,0.5,0.5);
|
glColor3f(0.5,0.5,0.5);
|
||||||
glMatrixMode(GL_MODELVIEW);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ CTexCache &TexCache=Core->GetTexCache();
|
||||||
|
|
||||||
glLoadIdentity(); // Slow way, but good to go for the mo
|
glLoadIdentity(); // Slow way, but good to go for the mo
|
||||||
glTranslatef(StartX+XLoop,StartY-YLoop,CamPos.z);
|
glTranslatef(StartX+XLoop,StartY-YLoop,CamPos.z);
|
||||||
ThisTile.Render();
|
ThisTile.Render(ThisElem.Flags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -243,6 +243,32 @@ CMultiBar *ParamBar=Frm->GetParamBar();
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CLayerTile::UpdateGUI(CCore *Core)
|
void CLayerTile::UpdateGUI(CCore *Core)
|
||||||
{
|
{
|
||||||
|
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||||
|
CGfxToolBar *GfxDlg=(CGfxToolBar *)Frm->GetDialog(IDD_GFXTOOLBAR);
|
||||||
|
|
||||||
|
if (GfxDlg)
|
||||||
|
{
|
||||||
|
GfxDlg->ResetButtons();
|
||||||
|
switch(Mode)
|
||||||
|
{
|
||||||
|
case MouseModeNone:
|
||||||
|
break;
|
||||||
|
case MouseModePaint:
|
||||||
|
GfxDlg->SetButtonState(CGfxToolBar::PAINT,TRUE);
|
||||||
|
break;
|
||||||
|
case MouseModeSelect:
|
||||||
|
GfxDlg->SetButtonState(CGfxToolBar::SELECT,TRUE);
|
||||||
|
break;
|
||||||
|
case MouseModePicker:
|
||||||
|
GfxDlg->SetButtonState(CGfxToolBar::PICKER,TRUE);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
GfxDlg->SetButtonState(CGfxToolBar::MIRRORX,Flag & MouseFlagMirrorX);
|
||||||
|
GfxDlg->SetButtonState(CGfxToolBar::MIRRORY,Flag & MouseFlagMirrorY);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -251,53 +277,57 @@ void CLayerTile::UpdateGUI(CCore *Core)
|
||||||
BOOL CLayerTile::SetMode(int NewMode)
|
BOOL CLayerTile::SetMode(int NewMode)
|
||||||
{
|
{
|
||||||
BOOL Ret=FALSE;
|
BOOL Ret=FALSE;
|
||||||
|
|
||||||
// Clean up last mode
|
// Clean up last mode
|
||||||
Ret|=ExitMode();
|
Ret|=ExitMode();
|
||||||
Mode=(MouseMode)NewMode;
|
Mode=(MouseMode)NewMode;
|
||||||
Ret|=InitMode();
|
Ret|=InitMode();
|
||||||
return(Ret);
|
return(Ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
BOOL CLayerTile::InitMode()
|
BOOL CLayerTile::InitMode()
|
||||||
{
|
{
|
||||||
switch(Mode)
|
switch(Mode)
|
||||||
{
|
{
|
||||||
case MouseModeNone:
|
case MouseModeNone:
|
||||||
break;
|
break;
|
||||||
case MouseModePaint:
|
case MouseModePaint:
|
||||||
break;
|
break;
|
||||||
case MouseModeSelect:
|
case MouseModeSelect:
|
||||||
break;
|
break;
|
||||||
case MouseModeBlockSelect:
|
case MouseModePicker:
|
||||||
break;
|
break;
|
||||||
case MouseModePicker:
|
default:
|
||||||
break;
|
break;
|
||||||
default:
|
}
|
||||||
break;
|
return(FALSE);
|
||||||
}
|
|
||||||
return(FALSE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
BOOL CLayerTile::ExitMode()
|
BOOL CLayerTile::ExitMode()
|
||||||
{
|
{
|
||||||
switch(Mode)
|
switch(Mode)
|
||||||
{
|
{
|
||||||
case MouseModeNone:
|
case MouseModeNone:
|
||||||
break;
|
break;
|
||||||
case MouseModePaint:
|
case MouseModePaint:
|
||||||
break;
|
break;
|
||||||
case MouseModeSelect:
|
case MouseModeSelect:
|
||||||
break;
|
break;
|
||||||
case MouseModeBlockSelect:
|
case MouseModePicker:
|
||||||
break;
|
break;
|
||||||
case MouseModePicker:
|
default:
|
||||||
break;
|
break;
|
||||||
default:
|
}
|
||||||
break;
|
return(FALSE);
|
||||||
}
|
}
|
||||||
return(FALSE);
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
BOOL CLayerTile::SetFlag(int NewFlag)
|
||||||
|
{
|
||||||
|
Flag^=NewFlag;
|
||||||
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -306,24 +336,22 @@ BOOL CLayerTile::LButtonControl(CCore *Core,CMapEditView *View,UINT nFlags, CPoi
|
||||||
BOOL Ret=FALSE;
|
BOOL Ret=FALSE;
|
||||||
CTileBank &TileBank=Core->GetTileBank();
|
CTileBank &TileBank=Core->GetTileBank();
|
||||||
|
|
||||||
switch(Mode)
|
switch(Mode)
|
||||||
{
|
{
|
||||||
case MouseModeNone:
|
case MouseModeNone:
|
||||||
break;
|
break;
|
||||||
case MouseModePaint:
|
case MouseModePaint:
|
||||||
if (DownFlag)
|
if (DownFlag)
|
||||||
Ret=Paint(TileBank.GetLTile(),CursorPos);
|
Ret=Paint(TileBank.GetLTile(),CursorPos);
|
||||||
break;
|
break;
|
||||||
case MouseModeSelect:
|
case MouseModeSelect:
|
||||||
break;
|
break;
|
||||||
case MouseModeBlockSelect:
|
case MouseModePicker:
|
||||||
break;
|
break;
|
||||||
case MouseModePicker:
|
default:
|
||||||
break;
|
break;
|
||||||
default:
|
}
|
||||||
break;
|
return(Ret);
|
||||||
}
|
|
||||||
return(Ret);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -332,24 +360,22 @@ BOOL CLayerTile::RButtonControl(CCore *Core,CMapEditView *View,UINT nFlags, CPoi
|
||||||
BOOL Ret=FALSE;
|
BOOL Ret=FALSE;
|
||||||
CTileBank &TileBank=Core->GetTileBank();
|
CTileBank &TileBank=Core->GetTileBank();
|
||||||
|
|
||||||
switch(Mode)
|
switch(Mode)
|
||||||
{
|
{
|
||||||
case MouseModeNone:
|
case MouseModeNone:
|
||||||
break;
|
break;
|
||||||
case MouseModePaint:
|
case MouseModePaint:
|
||||||
if (DownFlag)
|
if (DownFlag)
|
||||||
Ret=Paint(TileBank.GetRTile(),CursorPos);
|
Ret=Paint(TileBank.GetRTile(),CursorPos);
|
||||||
break;
|
break;
|
||||||
case MouseModeSelect:
|
case MouseModeSelect:
|
||||||
break;
|
break;
|
||||||
case MouseModeBlockSelect:
|
case MouseModePicker:
|
||||||
break;
|
break;
|
||||||
case MouseModePicker:
|
default:
|
||||||
break;
|
break;
|
||||||
default:
|
}
|
||||||
break;
|
return(Ret);
|
||||||
}
|
|
||||||
return(Ret);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -358,35 +384,51 @@ BOOL CLayerTile::MouseMove(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &C
|
||||||
BOOL Ret=FALSE;
|
BOOL Ret=FALSE;
|
||||||
CTileBank &TileBank=Core->GetTileBank();
|
CTileBank &TileBank=Core->GetTileBank();
|
||||||
|
|
||||||
switch(Mode)
|
switch(Mode)
|
||||||
{
|
{
|
||||||
case MouseModeNone:
|
case MouseModeNone:
|
||||||
break;
|
break;
|
||||||
case MouseModePaint:
|
case MouseModePaint:
|
||||||
if (nFlags & MK_LBUTTON)
|
if (nFlags & MK_LBUTTON)
|
||||||
Ret=Paint(TileBank.GetLTile(),CursorPos);
|
Ret=Paint(TileBank.GetLTile(),CursorPos);
|
||||||
else
|
else
|
||||||
if (nFlags & MK_RBUTTON)
|
if (nFlags & MK_RBUTTON)
|
||||||
Ret=Paint(TileBank.GetRTile(),CursorPos);
|
Ret=Paint(TileBank.GetRTile(),CursorPos);
|
||||||
break;
|
break;
|
||||||
case MouseModeSelect:
|
case MouseModeSelect:
|
||||||
break;
|
break;
|
||||||
case MouseModeBlockSelect:
|
case MouseModePicker:
|
||||||
break;
|
break;
|
||||||
case MouseModePicker:
|
default:
|
||||||
break;
|
break;
|
||||||
default:
|
}
|
||||||
break;
|
return(Ret);
|
||||||
}
|
|
||||||
return(Ret);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
BOOL CLayerTile::MirrorX()
|
||||||
|
{
|
||||||
|
SetFlag(MouseFlagMirrorX);
|
||||||
|
return(TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
BOOL CLayerTile::MirrorY()
|
||||||
|
{
|
||||||
|
SetFlag(MouseFlagMirrorY);
|
||||||
|
return(TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
BOOL CLayerTile::Paint(sMapElem &Tile,CPoint &CursorPos)
|
BOOL CLayerTile::Paint(sMapElem &Tile,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 (Tile.Set==-1 || Tile.Tile==-1) return(FALSE); // Invalid tile?
|
if (Tile.Set==-1 || Tile.Tile==-1) return(FALSE); // Invalid tile?
|
||||||
|
|
||||||
|
Tile.Flags=Flag;
|
||||||
Map.SetTile(CursorPos.x,CursorPos.y,Tile);
|
Map.SetTile(CursorPos.x,CursorPos.y,Tile);
|
||||||
|
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
|
|
|
@ -28,16 +28,14 @@ public:
|
||||||
MouseModeNone=0,
|
MouseModeNone=0,
|
||||||
MouseModePaint,
|
MouseModePaint,
|
||||||
MouseModeSelect,
|
MouseModeSelect,
|
||||||
MouseModeBlockSelect,
|
|
||||||
MouseModePicker,
|
MouseModePicker,
|
||||||
MouseModeMirrorX,
|
// MouseModeMirrorX,
|
||||||
MouseModeMirrorY,
|
// MouseModeMirrorY,
|
||||||
};
|
};
|
||||||
enum MouseFlag
|
enum MouseFlag
|
||||||
{
|
{
|
||||||
MouseFlagNone=1<<0,
|
MouseFlagMirrorX=1<<0,
|
||||||
MouseFlagMirrorX=1<<1,
|
MouseFlagMirrorY=1<<1,
|
||||||
MouseFlagMirrorY=1<<2,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
CLayerTile(char *_Name,int Width,int Height,float ZDiv,BOOL Is3d); // New Layer
|
CLayerTile(char *_Name,int Width,int Height,float ZDiv,BOOL Is3d); // New Layer
|
||||||
|
@ -55,10 +53,15 @@ public:
|
||||||
BOOL SetMode(int NewMode);
|
BOOL SetMode(int NewMode);
|
||||||
BOOL InitMode();
|
BOOL InitMode();
|
||||||
BOOL ExitMode();
|
BOOL ExitMode();
|
||||||
|
|
||||||
|
BOOL SetFlag(int Flag);
|
||||||
|
|
||||||
BOOL LButtonControl(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag);
|
BOOL LButtonControl(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag);
|
||||||
BOOL RButtonControl(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag);
|
BOOL RButtonControl(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag);
|
||||||
BOOL MouseMove(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &point);
|
BOOL MouseMove(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &point);
|
||||||
|
|
||||||
|
BOOL MirrorX();
|
||||||
|
BOOL MirrorY();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void Render2d(CCore *Core,Vec &CamPos);
|
void Render2d(CCore *Core,Vec &CamPos);
|
||||||
|
|
|
@ -76,42 +76,6 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
|
||||||
ToolBar.SetWindowText("ToolBar");
|
ToolBar.SetWindowText("ToolBar");
|
||||||
ToolBar.EnableDocking(CBRS_ALIGN_ANY);
|
ToolBar.EnableDocking(CBRS_ALIGN_ANY);
|
||||||
DockControlBar(&ToolBar);
|
DockControlBar(&ToolBar);
|
||||||
/*
|
|
||||||
#define SNAP_WIDTH 80 //the width of the combo box
|
|
||||||
|
|
||||||
//set up the ComboBox control as a snap mode select box
|
|
||||||
//
|
|
||||||
//First get the index of the placeholder's position in the toolbar
|
|
||||||
int index = 0;
|
|
||||||
RECT rect;
|
|
||||||
while (ToolBar.GetItemID(index)!=ID_TOOLBAR_COMBO) index++;
|
|
||||||
|
|
||||||
//next convert that button to a seperator and get its position
|
|
||||||
ToolBar.SetButtonInfo(index, ID_TOOLBAR_COMBO, TBBS_SEPARATOR, SNAP_WIDTH);
|
|
||||||
ToolBar.GetItemRect(index, &rect);
|
|
||||||
|
|
||||||
//expand the rectangle to allow the combo box room to drop down
|
|
||||||
rect.top+=2;
|
|
||||||
rect.bottom += 200;
|
|
||||||
|
|
||||||
// then .Create the combo box and show it
|
|
||||||
|
|
||||||
if (!ToolBar.m_Combo.Create(WS_CHILD|WS_VISIBLE | CBS_AUTOHSCROLL | CBS_DROPDOWNLIST | CBS_HASSTRINGS ,rect, &ToolBar, IDC_TOOLBAR_COMBO))
|
|
||||||
{
|
|
||||||
TRACE0("Failed to create combo-box\n");
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
ToolBar.m_Combo.SetFont(ToolBar.GetFont()); // Set to nice font (not playskool font!!)
|
|
||||||
ToolBar.m_Combo.ShowWindow(SW_SHOW);
|
|
||||||
|
|
||||||
//fill the combo box
|
|
||||||
ToolBar.m_Combo.AddString("SNAP OFF");
|
|
||||||
ToolBar.m_Combo.AddString("SNAP GRID");
|
|
||||||
ToolBar.m_Combo.AddString("SNAP RASTER");
|
|
||||||
ToolBar.m_Combo.AddString("SNAP VERTEX");
|
|
||||||
ToolBar.m_Combo.AddString("SNAP LINE");
|
|
||||||
ToolBar.m_Combo.SetCurSel(0);
|
|
||||||
*/
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,12 +24,14 @@ void CMap::SetSize(int Width,int Height,BOOL Clear)
|
||||||
if (Clear)
|
if (Clear)
|
||||||
{
|
{
|
||||||
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++)
|
||||||
{
|
{
|
||||||
Map[X][Y].Set=0;
|
Map[X][Y].Set=0;
|
||||||
// Map[X][Y].Tile=(X+Y)%9;
|
Map[X][Y].Flags=0;
|
||||||
Map[X][Y].Tile=0;
|
Map[X][Y].Tile=0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,12 @@ struct sMapElem
|
||||||
int Flags;
|
int Flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
MapElemFlagMirrorX= 1<<0,
|
||||||
|
MapElemFlagMirrorY= 1<<1,
|
||||||
|
};
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
class CMap
|
class CMap
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
[General Info]
|
[General Info]
|
||||||
Version=1
|
Version=1
|
||||||
LastClass=CTileSetDlg
|
LastClass=CMapEditView
|
||||||
LastTemplate=CDialog
|
LastTemplate=CDialog
|
||||||
NewFileInclude1=#include "stdafx.h"
|
NewFileInclude1=#include "stdafx.h"
|
||||||
NewFileInclude2=#include "mapedit.h"
|
NewFileInclude2=#include "mapedit.h"
|
||||||
|
@ -19,16 +19,16 @@ Class7=CMapEditView
|
||||||
|
|
||||||
ResourceCount=9
|
ResourceCount=9
|
||||||
Resource1=IDD_TILESET_DIALOG
|
Resource1=IDD_TILESET_DIALOG
|
||||||
Resource2=IDR_MAINFRAME (English (U.S.))
|
Resource2=IDD_LAYER_LIST_DIALOG
|
||||||
Resource3=IDR_MAPEDITYPE (English (U.S.))
|
Resource3=IDD_MULTIBAR (English (U.S.))
|
||||||
Resource4=IDD_DIALOGBAR (English (U.S.))
|
Resource4=IDD_DIALOGBAR (English (U.S.))
|
||||||
Resource5=IDD_ABOUTBOX (English (U.S.))
|
Resource5=IDR_TOOLBAR (English (U.S.))
|
||||||
Class8=CMultiBar
|
Class8=CMultiBar
|
||||||
Resource6=IDD_LAYER_LIST_DIALOG
|
Resource6=IDD_ABOUTBOX (English (U.S.))
|
||||||
Resource7=IDD_MULTIBAR (English (U.S.))
|
Resource7=IDR_MAPEDITYPE (English (U.S.))
|
||||||
Class9=CLayerList
|
Class9=CLayerList
|
||||||
Class10=CTileSetDlg
|
Class10=CTileSetDlg
|
||||||
Resource8=IDR_TOOLBAR (English (U.S.))
|
Resource8=IDR_MAINFRAME (English (U.S.))
|
||||||
Class11=CGfxToolBar
|
Class11=CGfxToolBar
|
||||||
Resource9=IDD_GFXTOOLBAR
|
Resource9=IDD_GFXTOOLBAR
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ Type=0
|
||||||
BaseClass=CGLEnabledView
|
BaseClass=CGLEnabledView
|
||||||
HeaderFile=MapEditView.h
|
HeaderFile=MapEditView.h
|
||||||
ImplementationFile=MapEditView.cpp
|
ImplementationFile=MapEditView.cpp
|
||||||
LastObject=ID_TOOLBAR_GRID
|
LastObject=ID_MIRRORY
|
||||||
Filter=C
|
Filter=C
|
||||||
VirtualFilter=VWC
|
VirtualFilter=VWC
|
||||||
|
|
||||||
|
@ -126,31 +126,38 @@ 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_WINDOW_NEW
|
Command14=ID_TOGGLE_GRID
|
||||||
Command15=ID_WINDOW_CASCADE
|
Command15=ID_TOGGLE_TILEVIEW
|
||||||
Command16=ID_WINDOW_TILE_HORZ
|
Command16=ID_MIRRORX
|
||||||
Command17=ID_WINDOW_ARRANGE
|
Command17=ID_MIRRORY
|
||||||
Command18=ID_APP_ABOUT
|
Command18=ID_WINDOW_NEW
|
||||||
CommandCount=18
|
Command19=ID_WINDOW_CASCADE
|
||||||
|
Command20=ID_WINDOW_TILE_HORZ
|
||||||
|
Command21=ID_WINDOW_ARRANGE
|
||||||
|
Command22=ID_APP_ABOUT
|
||||||
|
CommandCount=22
|
||||||
|
|
||||||
[ACL:IDR_MAINFRAME (English (U.S.))]
|
[ACL:IDR_MAINFRAME (English (U.S.))]
|
||||||
Type=1
|
Type=1
|
||||||
Class=?
|
Class=?
|
||||||
Command1=ID_FILE_NEW
|
Command1=ID_EDIT_COPY
|
||||||
Command2=ID_FILE_OPEN
|
Command2=ID_TOGGLE_GRID
|
||||||
Command3=ID_FILE_SAVE
|
Command3=ID_FILE_NEW
|
||||||
Command4=ID_FILE_PRINT
|
Command4=ID_FILE_OPEN
|
||||||
Command5=ID_EDIT_UNDO
|
Command5=ID_FILE_SAVE
|
||||||
Command6=ID_EDIT_CUT
|
Command6=ID_EDIT_PASTE
|
||||||
Command7=ID_EDIT_COPY
|
Command7=ID_EDIT_UNDO
|
||||||
Command8=ID_EDIT_PASTE
|
Command8=ID_EDIT_CUT
|
||||||
Command9=ID_EDIT_UNDO
|
Command9=ID_EDIT_COPY
|
||||||
Command10=ID_EDIT_CUT
|
Command10=ID_EDIT_PASTE
|
||||||
Command11=ID_EDIT_COPY
|
Command11=ID_TOGGLE_TILEVIEW
|
||||||
Command12=ID_EDIT_PASTE
|
Command12=ID_NEXT_PANE
|
||||||
Command13=ID_NEXT_PANE
|
Command13=ID_PREV_PANE
|
||||||
Command14=ID_PREV_PANE
|
Command14=ID_MIRRORX
|
||||||
CommandCount=14
|
Command15=ID_EDIT_CUT
|
||||||
|
Command16=ID_MIRRORY
|
||||||
|
Command17=ID_EDIT_UNDO
|
||||||
|
CommandCount=17
|
||||||
|
|
||||||
[DLG:IDD_ABOUTBOX (English (U.S.))]
|
[DLG:IDD_ABOUTBOX (English (U.S.))]
|
||||||
Type=1
|
Type=1
|
||||||
|
@ -212,7 +219,7 @@ ImplementationFile=TileSetDlg.cpp
|
||||||
BaseClass=CDialog
|
BaseClass=CDialog
|
||||||
Filter=D
|
Filter=D
|
||||||
VirtualFilter=dWC
|
VirtualFilter=dWC
|
||||||
LastObject=IDC_TILESETDLG_BTN_LOAD
|
LastObject=IDC_TILESETDLG_COMBO
|
||||||
|
|
||||||
[CLS:CGfxToolBar]
|
[CLS:CGfxToolBar]
|
||||||
Type=0
|
Type=0
|
||||||
|
@ -220,16 +227,16 @@ HeaderFile=GfxToolBar.h
|
||||||
ImplementationFile=GfxToolBar.cpp
|
ImplementationFile=GfxToolBar.cpp
|
||||||
BaseClass=CDialog
|
BaseClass=CDialog
|
||||||
Filter=D
|
Filter=D
|
||||||
LastObject=IDD_GFXTOOLBAR_MIRRORX
|
LastObject=CGfxToolBar
|
||||||
VirtualFilter=dWC
|
VirtualFilter=dWC
|
||||||
|
|
||||||
[DLG:IDD_GFXTOOLBAR]
|
[DLG:IDD_GFXTOOLBAR]
|
||||||
Type=1
|
Type=1
|
||||||
Class=CGfxToolBar
|
Class=CGfxToolBar
|
||||||
ControlCount=5
|
ControlCount=5
|
||||||
Control1=IDD_GFXTOOLBAR_PAINT,button,1342242816
|
Control1=IDD_GFXTOOLBAR_PAINT,button,1342177344
|
||||||
Control2=IDD_GFXTOOLBAR_SELECT,button,1342242816
|
Control2=IDD_GFXTOOLBAR_SELECT,button,1342177344
|
||||||
Control3=IDD_GFXTOOLBAR_PICKER,button,1342242816
|
Control3=IDD_GFXTOOLBAR_PICKER,button,1342177344
|
||||||
Control4=IDD_GFXTOOLBAR_MIRRORX,button,1342242816
|
Control4=IDD_GFXTOOLBAR_MIRRORX,button,1342177344
|
||||||
Control5=IDD_GFXTOOLBAR_MIRRORY,button,1342242816
|
Control5=IDD_GFXTOOLBAR_MIRRORY,button,1342177344
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,7 @@ BOOL CMapEditApp::InitInstance()
|
||||||
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
|
#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
|
#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;
|
||||||
|
|
|
@ -112,6 +112,16 @@ BEGIN
|
||||||
MENUITEM "&Toolbar", ID_VIEW_TOOLBAR
|
MENUITEM "&Toolbar", ID_VIEW_TOOLBAR
|
||||||
MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR
|
MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR
|
||||||
END
|
END
|
||||||
|
POPUP "&Map"
|
||||||
|
BEGIN
|
||||||
|
MENUITEM "&Toggle Grid", ID_TOGGLE_GRID
|
||||||
|
END
|
||||||
|
POPUP "&TileBank"
|
||||||
|
BEGIN
|
||||||
|
MENUITEM "&Toggle TileView", ID_TOGGLE_TILEVIEW
|
||||||
|
MENUITEM "Mirror &X", ID_MIRRORX
|
||||||
|
MENUITEM "Mirror &Y", ID_MIRRORY
|
||||||
|
END
|
||||||
POPUP "&Window"
|
POPUP "&Window"
|
||||||
BEGIN
|
BEGIN
|
||||||
MENUITEM "&New Window", ID_WINDOW_NEW
|
MENUITEM "&New Window", ID_WINDOW_NEW
|
||||||
|
@ -133,20 +143,24 @@ END
|
||||||
|
|
||||||
IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE
|
IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE
|
||||||
BEGIN
|
BEGIN
|
||||||
"N", ID_FILE_NEW, VIRTKEY, CONTROL
|
"C", ID_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT
|
||||||
"O", ID_FILE_OPEN, VIRTKEY, CONTROL
|
"G", ID_TOGGLE_GRID, VIRTKEY, NOINVERT
|
||||||
"S", ID_FILE_SAVE, VIRTKEY, CONTROL
|
"N", ID_FILE_NEW, VIRTKEY, CONTROL, NOINVERT
|
||||||
"P", ID_FILE_PRINT, VIRTKEY, CONTROL
|
"O", ID_FILE_OPEN, VIRTKEY, CONTROL, NOINVERT
|
||||||
"Z", ID_EDIT_UNDO, VIRTKEY, CONTROL
|
"S", ID_FILE_SAVE, VIRTKEY, CONTROL, NOINVERT
|
||||||
"X", ID_EDIT_CUT, VIRTKEY, CONTROL
|
"V", ID_EDIT_PASTE, VIRTKEY, CONTROL, NOINVERT
|
||||||
"C", ID_EDIT_COPY, VIRTKEY, CONTROL
|
VK_BACK, ID_EDIT_UNDO, VIRTKEY, ALT, NOINVERT
|
||||||
"V", ID_EDIT_PASTE, VIRTKEY, CONTROL
|
VK_DELETE, ID_EDIT_CUT, VIRTKEY, SHIFT, NOINVERT
|
||||||
VK_BACK, ID_EDIT_UNDO, VIRTKEY, ALT
|
VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT
|
||||||
VK_DELETE, ID_EDIT_CUT, VIRTKEY, SHIFT
|
VK_INSERT, ID_EDIT_PASTE, VIRTKEY, SHIFT, NOINVERT
|
||||||
VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL
|
VK_SPACE, ID_TOGGLE_TILEVIEW, VIRTKEY, NOINVERT
|
||||||
VK_INSERT, ID_EDIT_PASTE, VIRTKEY, SHIFT
|
VK_TAB, ID_NEXT_PANE, VIRTKEY, CONTROL, NOINVERT
|
||||||
VK_F6, ID_NEXT_PANE, VIRTKEY
|
VK_TAB, ID_PREV_PANE, VIRTKEY, SHIFT, CONTROL,
|
||||||
VK_F6, ID_PREV_PANE, VIRTKEY, SHIFT
|
NOINVERT
|
||||||
|
"X", ID_MIRRORX, VIRTKEY, NOINVERT
|
||||||
|
"X", ID_EDIT_CUT, VIRTKEY, CONTROL, NOINVERT
|
||||||
|
"Y", ID_MIRRORY, VIRTKEY, NOINVERT
|
||||||
|
"Z", ID_EDIT_UNDO, VIRTKEY, CONTROL, NOINVERT
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
|
@ -385,6 +399,12 @@ BEGIN
|
||||||
IDC_TOOLBAR_COMBO "TileSet Chooser\nWee Wee Wee"
|
IDC_TOOLBAR_COMBO "TileSet Chooser\nWee Wee Wee"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
STRINGTABLE DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
ID_TOGGLE_TILEVIEW "Toggle TileView"
|
||||||
|
ID_MAP_TOGGLEGRID "Toggle Grid On and Off"
|
||||||
|
END
|
||||||
|
|
||||||
#endif // English (U.S.) resources
|
#endif // English (U.S.) resources
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@ -408,8 +428,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
|
||||||
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_PICKER ICON DISCARDABLE "res\\picker.ico"
|
||||||
IDI_MIRRORX ICON DISCARDABLE "res\\mirrorx.ico"
|
|
||||||
IDI_MIRRORY ICON DISCARDABLE "res\\mirrory.ico"
|
IDI_MIRRORY ICON DISCARDABLE "res\\mirrory.ico"
|
||||||
|
IDI_MIRRORX ICON DISCARDABLE "res\\mirrorx.ico"
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
|
@ -436,14 +456,19 @@ BEGIN
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_GFXTOOLBAR DIALOG DISCARDABLE 0, 0, 156, 26
|
IDD_GFXTOOLBAR DIALOG DISCARDABLE 0, 0, 156, 26
|
||||||
STYLE WS_CHILD
|
STYLE DS_CONTROL | WS_CHILD
|
||||||
FONT 8, "MS Sans Serif"
|
FONT 8, "MS Sans Serif"
|
||||||
BEGIN
|
BEGIN
|
||||||
PUSHBUTTON "P",IDD_GFXTOOLBAR_PAINT,5,5,15,15
|
PUSHBUTTON "P",IDD_GFXTOOLBAR_PAINT,5,5,15,15,BS_ICON | NOT
|
||||||
PUSHBUTTON "S",IDD_GFXTOOLBAR_SELECT,20,5,15,15
|
WS_TABSTOP
|
||||||
PUSHBUTTON "Pk",IDD_GFXTOOLBAR_PICKER,35,5,15,15
|
PUSHBUTTON "S",IDD_GFXTOOLBAR_SELECT,20,5,15,15,BS_ICON | NOT
|
||||||
PUSHBUTTON "X",IDD_GFXTOOLBAR_MIRRORX,50,5,15,15
|
WS_TABSTOP
|
||||||
PUSHBUTTON "Y",IDD_GFXTOOLBAR_MIRRORY,65,5,15,15
|
PUSHBUTTON "Pk",IDD_GFXTOOLBAR_PICKER,35,5,15,15,BS_ICON | NOT
|
||||||
|
WS_TABSTOP
|
||||||
|
PUSHBUTTON "X",IDD_GFXTOOLBAR_MIRRORX,50,5,15,15,BS_ICON | NOT
|
||||||
|
WS_TABSTOP
|
||||||
|
PUSHBUTTON "Y",IDD_GFXTOOLBAR_MIRRORY,65,5,15,15,BS_ICON | NOT
|
||||||
|
WS_TABSTOP
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -156,18 +156,35 @@ 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)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
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)
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************************************************************************/
|
||||||
|
void CMapEditDoc::MirrorX()
|
||||||
|
{
|
||||||
|
Core.MirrorX();
|
||||||
|
theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o)
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************************************************************************/
|
||||||
|
void CMapEditDoc::MirrorY()
|
||||||
|
{
|
||||||
|
Core.MirrorY();
|
||||||
|
theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
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)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
|
@ -184,6 +201,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)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
|
@ -191,7 +209,7 @@ void CMapEditDoc::TileBankReload()
|
||||||
{
|
{
|
||||||
Core.TileBankReload();
|
Core.TileBankReload();
|
||||||
UpdateAllViews(NULL);
|
UpdateAllViews(NULL);
|
||||||
|
theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
|
@ -199,5 +217,6 @@ void CMapEditDoc::TileBankSet()
|
||||||
{
|
{
|
||||||
Core.TileBankSet();
|
Core.TileBankSet();
|
||||||
UpdateAllViews(NULL);
|
UpdateAllViews(NULL);
|
||||||
|
theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,8 @@ 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 MirrorY();
|
||||||
|
|
||||||
void TileBankLoad();
|
void TileBankLoad();
|
||||||
void TileBankReload();
|
void TileBankReload();
|
||||||
|
|
|
@ -35,8 +35,12 @@ BEGIN_MESSAGE_MAP(CMapEditView, CGLEnabledView)
|
||||||
ON_WM_RBUTTONDOWN()
|
ON_WM_RBUTTONDOWN()
|
||||||
ON_WM_RBUTTONUP()
|
ON_WM_RBUTTONUP()
|
||||||
ON_WM_MOUSEMOVE()
|
ON_WM_MOUSEMOVE()
|
||||||
ON_COMMAND(ID_TOOLBAR_TILEPALETTE, OnToolbarTilepalette)
|
ON_COMMAND(ID_TOGGLE_TILEVIEW, OnToggleTileview)
|
||||||
ON_COMMAND(ID_TOOLBAR_GRID, OnToolbarGrid)
|
ON_COMMAND(ID_TOOLBAR_GRID, OnToggleGrid)
|
||||||
|
ON_COMMAND(ID_TOOLBAR_TILEPALETTE, OnToggleTileview)
|
||||||
|
ON_COMMAND(ID_TOGGLE_GRID, OnToggleGrid)
|
||||||
|
ON_COMMAND(ID_MIRRORX, OnMirrorx)
|
||||||
|
ON_COMMAND(ID_MIRRORY, OnMirrory)
|
||||||
//}}AFX_MSG_MAP
|
//}}AFX_MSG_MAP
|
||||||
END_MESSAGE_MAP()
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
@ -147,5 +151,7 @@ BOOL CMapEditView::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt) {GetDocume
|
||||||
void CMapEditView::OnRButtonDown(UINT nFlags, CPoint point) {GetDocument()->RButtonControl(this,nFlags,point,TRUE);}
|
void CMapEditView::OnRButtonDown(UINT nFlags, CPoint point) {GetDocument()->RButtonControl(this,nFlags,point,TRUE);}
|
||||||
void CMapEditView::OnRButtonUp(UINT nFlags, CPoint point) {GetDocument()->RButtonControl(this,nFlags,point,FALSE);}
|
void CMapEditView::OnRButtonUp(UINT nFlags, CPoint point) {GetDocument()->RButtonControl(this,nFlags,point,FALSE);}
|
||||||
void CMapEditView::OnMouseMove(UINT nFlags, CPoint point) {GetDocument()->MouseMove(this,nFlags, point);}
|
void CMapEditView::OnMouseMove(UINT nFlags, CPoint point) {GetDocument()->MouseMove(this,nFlags, point);}
|
||||||
void CMapEditView::OnToolbarTilepalette() {GetDocument()->ToggleTileView(this);}
|
void CMapEditView::OnToggleTileview() {GetDocument()->ToggleTileView(this);}
|
||||||
void CMapEditView::OnToolbarGrid() {GetDocument()->ToggleGrid(this);}
|
void CMapEditView::OnToggleGrid() {GetDocument()->ToggleGrid(this);}
|
||||||
|
void CMapEditView::OnMirrorx() {GetDocument()->MirrorX();}
|
||||||
|
void CMapEditView::OnMirrory() {GetDocument()->MirrorY();}
|
||||||
|
|
|
@ -55,8 +55,10 @@ protected:
|
||||||
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
|
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
|
||||||
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
|
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
|
||||||
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
||||||
afx_msg void OnToolbarTilepalette();
|
afx_msg void OnToggleTileview();
|
||||||
afx_msg void OnToolbarGrid();
|
afx_msg void OnToggleGrid();
|
||||||
|
afx_msg void OnMirrorx();
|
||||||
|
afx_msg void OnMirrory();
|
||||||
//}}AFX_MSG
|
//}}AFX_MSG
|
||||||
DECLARE_MESSAGE_MAP()
|
DECLARE_MESSAGE_MAP()
|
||||||
};
|
};
|
||||||
|
|
|
@ -134,6 +134,8 @@ CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||||
CTileSetDlg *TileSetDlg=(CTileSetDlg*)Frm->GetDialog(IDD_TILESET_DIALOG);
|
CTileSetDlg *TileSetDlg=(CTileSetDlg*)Frm->GetDialog(IDD_TILESET_DIALOG);
|
||||||
int ListSize=TileSet.size();
|
int ListSize=TileSet.size();
|
||||||
|
|
||||||
|
ASSERT(TileSetDlg);
|
||||||
|
|
||||||
TileSetDlg->TileSetList.ResetContent();
|
TileSetDlg->TileSetList.ResetContent();
|
||||||
if (ListSize)
|
if (ListSize)
|
||||||
{
|
{
|
||||||
|
@ -244,7 +246,6 @@ int TileID=0;
|
||||||
|
|
||||||
while(TileID!=ListSize)
|
while(TileID!=ListSize)
|
||||||
{
|
{
|
||||||
CTile &ThisTile=Tile[TileID];
|
|
||||||
int XPos=TileID%TileBrowserWidth;
|
int XPos=TileID%TileBrowserWidth;
|
||||||
int YPos=TileID/TileBrowserWidth;
|
int YPos=TileID/TileBrowserWidth;
|
||||||
|
|
||||||
|
@ -254,8 +255,7 @@ int TileID=0;
|
||||||
RenderMisc(TileID==LTile,TileID==RTile,TileID==CursorPos,GridFlag);
|
RenderMisc(TileID==LTile,TileID==RTile,TileID==CursorPos,GridFlag);
|
||||||
|
|
||||||
glColor3f(0.5,0.5,0.5);
|
glColor3f(0.5,0.5,0.5);
|
||||||
ThisTile.Render();
|
if (TileID) Tile[TileID].Render(0);
|
||||||
|
|
||||||
|
|
||||||
TileID++;
|
TileID++;
|
||||||
}
|
}
|
||||||
|
|
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 318 B |
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 318 B |
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 318 B |
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 318 B |
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 1.1 KiB |
|
@ -14,8 +14,8 @@
|
||||||
#define IDI_PAINT 152
|
#define IDI_PAINT 152
|
||||||
#define IDI_SELECT 153
|
#define IDI_SELECT 153
|
||||||
#define IDI_PICKER 154
|
#define IDI_PICKER 154
|
||||||
#define IDI_MIRRORX 155
|
#define IDI_MIRRORY 165
|
||||||
#define IDI_MIRRORY 156
|
#define IDI_MIRRORX 166
|
||||||
#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
|
||||||
|
@ -31,6 +31,11 @@
|
||||||
#define ID_TOOLBAR_COMBO 32777
|
#define ID_TOOLBAR_COMBO 32777
|
||||||
#define ID_TOOLBAR_PARAMBAR 32783
|
#define ID_TOOLBAR_PARAMBAR 32783
|
||||||
#define ID_TOOLBAR_GRID 32784
|
#define ID_TOOLBAR_GRID 32784
|
||||||
|
#define ID_TOGGLE_TILEVIEW 32785
|
||||||
|
#define ID_MAP_TOGGLEGRID 32786
|
||||||
|
#define ID_TOGGLE_GRID 32787
|
||||||
|
#define ID_MIRRORX 32788
|
||||||
|
#define ID_MIRRORY 32789
|
||||||
#define ID_INDICATOR_CURSORXY 59142
|
#define ID_INDICATOR_CURSORXY 59142
|
||||||
|
|
||||||
// Next default values for new objects
|
// Next default values for new objects
|
||||||
|
@ -38,9 +43,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 163
|
#define _APS_NEXT_RESOURCE_VALUE 167
|
||||||
#define _APS_NEXT_COMMAND_VALUE 32785
|
#define _APS_NEXT_COMMAND_VALUE 32790
|
||||||
#define _APS_NEXT_CONTROL_VALUE 1032
|
#define _APS_NEXT_CONTROL_VALUE 1037
|
||||||
#define _APS_NEXT_SYMED_VALUE 101
|
#define _APS_NEXT_SYMED_VALUE 101
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -193,6 +193,7 @@ int Status=FALSE;
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage[0]->sizeX, TextureImage[0]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[0]->data);
|
glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage[0]->sizeX, TextureImage[0]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[0]->data);
|
||||||
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
|
||||||
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
|
||||||
|
glBindTexture(GL_TEXTURE_2D, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TextureImage[0]) // If Texture Exists
|
if (TextureImage[0]) // If Texture Exists
|
||||||
|
|