This commit is contained in:
parent
ebdcf944fb
commit
d5b2bbdf40
23 changed files with 714 additions and 312 deletions
|
@ -21,41 +21,30 @@
|
|||
#include "Layer.h"
|
||||
#include "LayerTile.h"
|
||||
#include "LayerCollision.h"
|
||||
#include "LayerShade.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "Export.h"
|
||||
|
||||
#include "LayerList.h"
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
CCore::CCore()
|
||||
{
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CMultiBar *ParamBar=Frm->GetParamBar();
|
||||
|
||||
CurrentMousePos=CPoint(0,0);
|
||||
|
||||
// Add default param bar items
|
||||
ParamBar->RemoveAll();
|
||||
ParamBar->Add(Frm->GetLayerList(),IDD_LAYER_LIST_DIALOG,TRUE,TRUE);
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
CCore::~CCore()
|
||||
{
|
||||
GUIRemoveAll();
|
||||
int ListSize=Layer.size();
|
||||
for (int i=0; i<ListSize; i++) delete Layer[i];
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::Init()
|
||||
{
|
||||
// UpdateParamBar();
|
||||
// UpdateAll(NULL);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
BOOL CCore::New()
|
||||
{
|
||||
|
@ -71,8 +60,8 @@ int Width,Height;
|
|||
Height=Dlg.m_Height;
|
||||
|
||||
// Create Tile Layers
|
||||
AddLayer(LAYER_TYPE_TILE,LAYERTILE_ACTION, Width, Height);
|
||||
AddLayer(LAYER_TYPE_TILE,LAYERTILE_SCRATCH, Width, Height);
|
||||
AddLayer(LAYER_TYPE_TILE,LAYER_SUBTYPE_ACTION, Width, Height);
|
||||
AddLayer(LAYER_TYPE_TILE,LAYER_SUBTYPE_SCRATCH, Width, Height);
|
||||
// AddLayer(LAYER_TYPE_COLLISION,-1, Width, Height);
|
||||
|
||||
ActiveLayer=FindActionLayer();
|
||||
|
@ -81,7 +70,6 @@ int Width,Height;
|
|||
TileViewFlag=FALSE;
|
||||
GridFlag=TRUE;
|
||||
Is3dFlag=TRUE;
|
||||
Init();
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
|
@ -130,7 +118,11 @@ int LayerCount;
|
|||
case LAYER_TYPE_COLLISION:
|
||||
AddLayer(new CLayerCollision(File,Version));
|
||||
break;
|
||||
|
||||
case LAYER_TYPE_SHADE:
|
||||
AddLayer(new CLayerShade(File,Version));
|
||||
break;
|
||||
default:
|
||||
ASSERT(!"poos");
|
||||
}
|
||||
}
|
||||
TileBank.Load(File,Version);
|
||||
|
@ -143,9 +135,6 @@ int MapHeight=Layer[FindActionLayer()]->GetHeight();
|
|||
{
|
||||
Layer[i]->CheckLayerSize(MapWidth,MapHeight);
|
||||
}
|
||||
|
||||
Init();
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -278,7 +267,7 @@ BOOL RedrawFlag=FALSE;
|
|||
}
|
||||
GetTileBank().SetActiveBrushL();
|
||||
|
||||
if (RedrawFlag) View->Invalidate();
|
||||
if (RedrawFlag) RedrawView();//View->Invalidate();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -307,16 +296,16 @@ BOOL RedrawFlag=FALSE;
|
|||
}
|
||||
GetTileBank().SetActiveBrushR();
|
||||
|
||||
if (RedrawFlag) View->Invalidate();
|
||||
if (RedrawFlag) RedrawView();//View->Invalidate();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::Zoom(CMapEditView *View,float Dst)
|
||||
void CCore::Zoom(float Dst)
|
||||
{
|
||||
Vector3 Ofs;
|
||||
Ofs.Zero();
|
||||
Ofs.z=Dst;
|
||||
UpdateView(View,Ofs);
|
||||
UpdateView(&Ofs);
|
||||
}
|
||||
|
||||
|
||||
|
@ -324,9 +313,9 @@ Vector3 Ofs;
|
|||
void CCore::MouseWheel(CMapEditView *View,UINT nFlags, short zDelta, CPoint &pt)
|
||||
{
|
||||
if (zDelta>0)
|
||||
Zoom(View,-0.1f);
|
||||
Zoom(-0.1f);
|
||||
else
|
||||
Zoom(View,+0.1f);
|
||||
Zoom(+0.1f);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -338,7 +327,6 @@ Vector3 &ThisCam=GetCam();
|
|||
Ofs.Zero();
|
||||
if (theApp.GetCurrent()!=View->GetDocument()) return;
|
||||
|
||||
|
||||
CurrentMousePos=point;
|
||||
|
||||
// Handle Drag Movement
|
||||
|
@ -363,7 +351,7 @@ Vector3 &ThisCam=GetCam();
|
|||
|
||||
Ofs.x*=XS;
|
||||
Ofs.y*=YS;
|
||||
UpdateView(View,Ofs);
|
||||
UpdateView(&Ofs);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -377,7 +365,8 @@ Vector3 &ThisCam=GetCam();
|
|||
Layer[ActiveLayer]->MouseMove(this,View,nFlags,CursorPos);
|
||||
}
|
||||
}
|
||||
View->Invalidate(); // Mouse still moved, so need to redraw windows, to get CursorPos (And pos render)
|
||||
// Mouse still moved, so need to redraw windows, to get CursorPos (And pos render)
|
||||
RedrawView();
|
||||
}
|
||||
LastMousePos=CurrentMousePos;
|
||||
}
|
||||
|
@ -389,61 +378,56 @@ Vector3 &ThisCam=GetCam();
|
|||
void CCore::UpdateParamBar()
|
||||
{
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CToolBar *ToolBar=Frm->GetToolBar();
|
||||
CMultiBar *ParamBar=Frm->GetParamBar();
|
||||
|
||||
ParamBar->RemoveAll();
|
||||
Layer[ActiveLayer]->InitGUI(this);
|
||||
Layer[ActiveLayer]->UpdateGUI(this);
|
||||
|
||||
ParamBar->Update();
|
||||
|
||||
GUIRemoveAll();
|
||||
GUIAdd(LayerList,IDD_LAYER_LIST_DIALOG);
|
||||
Layer[ActiveLayer]->GUIInit(this);
|
||||
// Layer[ActiveLayer]->GUIUpdate(this);
|
||||
GUIUpdate();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::UpdateLayerGUI(CMapEditView *View)
|
||||
void CCore::UpdateLayerGUI()
|
||||
{
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CMultiBar *ParamBar=Frm->GetParamBar();
|
||||
CLayerList *List=(CLayerList*)Frm->GetDialog(IDD_LAYER_LIST_DIALOG);
|
||||
int ListSize=Layer.size();
|
||||
|
||||
List->ListBox.ResetContent();
|
||||
if (LayerList.ListBox)
|
||||
{
|
||||
LayerList.ListBox.ResetContent();
|
||||
|
||||
for (int i=0; i<ListSize; i++)
|
||||
{
|
||||
List->ListBox.AddString(Layer[i]->GetName());
|
||||
LayerList.ListBox.AddString(Layer[i]->GetName());
|
||||
}
|
||||
// Now sets checks (silly MSoft bug!!)
|
||||
for (i=0; i<ListSize; i++)
|
||||
{
|
||||
List->ListBox.SetCheck(i,Layer[i]->IsVisible());
|
||||
LayerList.ListBox.SetCheck(i,Layer[i]->IsVisible());
|
||||
}
|
||||
LayerList.ListBox.SetCurSel(ActiveLayer);
|
||||
}
|
||||
List->ListBox.SetCurSel(ActiveLayer);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::SetLayer(int NewLayer)
|
||||
{
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CMultiBar *ParamBar=Frm->GetParamBar();
|
||||
CLayerList *List=(CLayerList*)Frm->GetDialog(IDD_LAYER_LIST_DIALOG);
|
||||
|
||||
if (NewLayer<0) NewLayer=0;
|
||||
|
||||
// If toggling layer, dont change the layer
|
||||
if ((int)List->ListBox.GetCheck(NewLayer)!=(int)Layer[NewLayer]->IsVisible())
|
||||
if ((int)LayerList.ListBox.GetCheck(NewLayer)!=(int)Layer[NewLayer]->IsVisible())
|
||||
{
|
||||
Layer[NewLayer]->SetVisible(List->ListBox.GetCheck(NewLayer));
|
||||
List->ListBox.SetCurSel(ActiveLayer);
|
||||
Layer[NewLayer]->SetVisible(LayerList.ListBox.GetCheck(NewLayer));
|
||||
LayerList.ListBox.SetCurSel(ActiveLayer);
|
||||
}
|
||||
else
|
||||
{
|
||||
bool IsCol=Layer[NewLayer]->GetType()==LAYER_TYPE_COLLISION;
|
||||
TileBank.SetCollision(IsCol);
|
||||
ActiveLayer=NewLayer;
|
||||
UpdateParamBar();
|
||||
}
|
||||
|
||||
UpdateParamBar();
|
||||
RedrawView();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -479,6 +463,9 @@ CLayer *Layer;
|
|||
case LAYER_TYPE_COLLISION:
|
||||
Layer=AddLayer(new CLayerCollision(SubType, Width,Height));
|
||||
break;
|
||||
case LAYER_TYPE_SHADE:
|
||||
Layer=AddLayer(new CLayerShade(SubType, Width,Height));
|
||||
break;
|
||||
default:
|
||||
ASSERT(!"AddLayer - Invalid Layer Type");
|
||||
break;
|
||||
|
@ -514,8 +501,7 @@ int Width=Layer[FindActionLayer()]->GetWidth();
|
|||
int Height=Layer[FindActionLayer()]->GetHeight();
|
||||
|
||||
AddLayer(CLayer::InfoTable[NewLayerId].Type,CLayer::InfoTable[NewLayerId].SubType,Width,Height);
|
||||
|
||||
|
||||
UpdateAll();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -523,10 +509,11 @@ void CCore::DeleteLayer(int CurrentLayer)
|
|||
{
|
||||
if (Layer[CurrentLayer]->CanDelete())
|
||||
{
|
||||
Layer[CurrentLayer]->GUIKill(this);
|
||||
delete Layer[CurrentLayer];
|
||||
Layer.erase(Layer.begin() + CurrentLayer);
|
||||
SetLayer(CurrentLayer-1);
|
||||
UpdateAll(NULL);
|
||||
UpdateAll();
|
||||
TRACE1("Deleted Layer %i\n",CurrentLayer);
|
||||
}
|
||||
else
|
||||
|
@ -538,39 +525,29 @@ void CCore::DeleteLayer(int CurrentLayer)
|
|||
/*****************************************************************************/
|
||||
/*** Grid ********************************************************************/
|
||||
/*****************************************************************************/
|
||||
void CCore::UpdateGrid(CMapEditView *View,BOOL Toggle)
|
||||
void CCore::UpdateGrid(BOOL Toggle)
|
||||
{
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CToolBar *ToolBar=Frm->GetToolBar();
|
||||
|
||||
if (Toggle) GridFlag=!GridFlag;
|
||||
|
||||
ToolBar->GetToolBarCtrl().PressButton(ID_TOOLBAR_GRID,GridFlag);
|
||||
UpdateView(View);
|
||||
UpdateView();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*** TileBank ****************************************************************/
|
||||
/*****************************************************************************/
|
||||
void CCore::UpdateTileView(CMapEditView *View,BOOL Toggle)
|
||||
void CCore::UpdateTileView(BOOL Toggle)
|
||||
{
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CToolBar *ToolBar=Frm->GetToolBar();
|
||||
CMultiBar *ParamBar=Frm->GetParamBar();
|
||||
|
||||
if (Toggle) TileViewFlag=!TileViewFlag;
|
||||
ParamBar->RemoveAll();
|
||||
ToolBar->GetToolBarCtrl().PressButton(ID_TOOLBAR_TILEPALETTE,TileViewFlag);
|
||||
GUIRemoveAll();
|
||||
UpdateParamBar();
|
||||
UpdateView(View);
|
||||
UpdateView();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::TileBankLoad(char *Filename)
|
||||
{
|
||||
TileBank.AddTileSet(Filename);
|
||||
TileBank.UpdateGUI(this,TileViewFlag);
|
||||
UpdateView(NULL);
|
||||
TileBank.GUIUpdate(this);
|
||||
UpdateView();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -596,7 +573,7 @@ void CCore::TileBankDelete()
|
|||
Layer[i]->RemapSet(Set,Set-1);
|
||||
}
|
||||
}
|
||||
UpdateView(NULL);
|
||||
UpdateView();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -605,50 +582,43 @@ void CCore::TileBankReload()
|
|||
{
|
||||
TileBank.Reload();
|
||||
TexCache.Purge();
|
||||
UpdateView(NULL);
|
||||
UpdateView();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::TileBankSet()
|
||||
{
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CLayerTileGUI *Dlg=(CLayerTileGUI*)Frm->GetDialog(IDD_LAYERTILE_GUI);
|
||||
|
||||
TileBank.SetCurrent(Dlg->m_List.GetCurSel());
|
||||
TileBank.SetCurrent();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::MirrorX(CMapEditView *View)
|
||||
{
|
||||
if (!TileViewFlag)
|
||||
void CCore::MirrorX()
|
||||
{
|
||||
if (TileViewFlag) return;
|
||||
Layer[ActiveLayer]->MirrorX(this);
|
||||
UpdateView(View);
|
||||
}
|
||||
UpdateView();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::MirrorY(CMapEditView *View)
|
||||
{
|
||||
if (!TileViewFlag)
|
||||
void CCore::MirrorY()
|
||||
{
|
||||
if (TileViewFlag) return;
|
||||
Layer[ActiveLayer]->MirrorY(this);
|
||||
UpdateView(View);
|
||||
}
|
||||
UpdateView();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::ActiveBrushLeft(CMapEditView *View)
|
||||
void CCore::ActiveBrushLeft()
|
||||
{
|
||||
GetTileBank().SetActiveBrushL();
|
||||
UpdateView(View);
|
||||
UpdateView();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::ActiveBrushRight(CMapEditView *View)
|
||||
void CCore::ActiveBrushRight()
|
||||
{
|
||||
GetTileBank().SetActiveBrushR();
|
||||
UpdateView(View);
|
||||
UpdateView();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -658,17 +628,17 @@ BOOL CCore::IsTileValid(int Set,int Tile)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::CopySelection(CMapEditView *View)
|
||||
void CCore::CopySelection()
|
||||
{
|
||||
Layer[ActiveLayer]->CopySelection(this);
|
||||
UpdateView(View);
|
||||
UpdateView();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::PasteSelection(CMapEditView *View)
|
||||
void CCore::PasteSelection()
|
||||
{
|
||||
Layer[ActiveLayer]->PasteSelection(this);
|
||||
UpdateView(View);
|
||||
UpdateView();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -712,50 +682,94 @@ Vector3 &ThisCam=GetCam();
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::UpdateGUI(CMapEditView *View)
|
||||
/*** GUI *********************************************************************/
|
||||
/*****************************************************************************/
|
||||
void CCore::GUIAdd(CDialog &Dlg,int ID,bool Visible,bool Lock)
|
||||
{
|
||||
UpdateLayerGUI(View);
|
||||
UpdateGrid(View);
|
||||
|
||||
Layer[ActiveLayer]->UpdateGUI(this);
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CMultiBar *ParamBar=Frm->GetParamBar();
|
||||
|
||||
ParamBar->Add(Dlg,ID,Visible,Lock);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::UpdateAll(CMapEditView *View)
|
||||
void CCore::GUIRemove(CDialog &Dlg,int ID,bool Force)
|
||||
{
|
||||
UpdateGUI(View);
|
||||
UpdateView(View);
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CMultiBar *ParamBar=Frm->GetParamBar();
|
||||
|
||||
ParamBar->Remove(Dlg,Force);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::UpdateView(CMapEditView *View)
|
||||
void CCore::GUIRemoveAll(bool Force)
|
||||
{
|
||||
SetScale();
|
||||
if (View) View->Invalidate();
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CMultiBar *ParamBar=Frm->GetParamBar();
|
||||
|
||||
ParamBar->RemoveAll(Force);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::UpdateView(CMapEditView *View,Vector3 &Ofs)
|
||||
void CCore::GUIUpdate()
|
||||
{
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CMultiBar *ParamBar=Frm->GetParamBar();
|
||||
|
||||
UpdateLayerGUI();
|
||||
UpdateGrid();
|
||||
Layer[ActiveLayer]->GUIUpdate(this);
|
||||
ParamBar->Update();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::GUIChanged()
|
||||
{
|
||||
// UpdateLayerGUI();
|
||||
Layer[ActiveLayer]->GUIChanged(this);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::UpdateAll()
|
||||
{
|
||||
UpdateParamBar();
|
||||
GUIUpdate();
|
||||
UpdateView();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::RedrawView()
|
||||
{
|
||||
if (theApp.GetCurrent())
|
||||
{
|
||||
theApp.GetCurrent()->UpdateAllViews(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::UpdateView(Vector3 *Ofs)
|
||||
{
|
||||
if (Ofs)
|
||||
{
|
||||
Vector3 &ThisCam=GetCam();
|
||||
|
||||
ThisCam.x+=Ofs.x;
|
||||
ThisCam.y+=Ofs.y;
|
||||
ThisCam.z-=Ofs.z;
|
||||
ThisCam.x+=Ofs->x;
|
||||
ThisCam.y+=Ofs->y;
|
||||
ThisCam.z-=Ofs->z;
|
||||
if (!TileViewFlag)
|
||||
{
|
||||
if (ThisCam.x<0) ThisCam.x=0;
|
||||
if (ThisCam.y<0) ThisCam.y=0;
|
||||
}
|
||||
if (ThisCam.z<0.1) ThisCam.z=0.1f;
|
||||
// TRACE1("ZoomVal %f\n",ThisCam.z);
|
||||
}
|
||||
|
||||
UpdateView(View);
|
||||
SetScale();
|
||||
RedrawView();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::SetMapSize(CMapEditView *View,int Width,int Height)
|
||||
void CCore::SetMapSize(int Width,int Height)
|
||||
{
|
||||
if (Width==GetMapWidth() && Height==GetMapHeight()) return;
|
||||
|
||||
|
@ -766,14 +780,14 @@ int ListSize=Layer.size();
|
|||
Layer[i]->Resize(Width,Height);
|
||||
}
|
||||
|
||||
UpdateView(View);
|
||||
UpdateView();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::Toggle2d3d(CMapEditView *View)
|
||||
void CCore::Toggle2d3d()
|
||||
{
|
||||
Is3dFlag=!Is3dFlag;
|
||||
UpdateView(View);
|
||||
UpdateView();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -793,7 +807,7 @@ int ListSize=Layer.size();
|
|||
/*****************************************************************************/
|
||||
int CCore::FindActionLayer()
|
||||
{
|
||||
int Idx=FindLayer(LAYER_TYPE_TILE,LAYERTILE_ACTION);
|
||||
int Idx=FindLayer(LAYER_TYPE_TILE,LAYER_SUBTYPE_ACTION);
|
||||
|
||||
return(Idx);
|
||||
}
|
||||
|
@ -843,5 +857,3 @@ GString Path=FullPath.Dir();
|
|||
return(Path);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -12,6 +12,10 @@
|
|||
#include "TexCache.h"
|
||||
#include "TileSet.h"
|
||||
|
||||
#include "MApEdit.h"
|
||||
#include "LayerList.h"
|
||||
#include "LayerTileGUI.h"
|
||||
|
||||
const s32 FileVersion=2;
|
||||
|
||||
#define SCREEN_MAP_WIDTH 30
|
||||
|
@ -43,27 +47,33 @@ public:
|
|||
void RButtonControl(CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag);
|
||||
void MouseWheel(CMapEditView *View,UINT nFlags, short zDelta, CPoint &pt);
|
||||
void MouseMove(CMapEditView *View,UINT nFlags, CPoint &point);
|
||||
void Zoom(CMapEditView *View,float Dst);
|
||||
void Zoom(float Dst);
|
||||
|
||||
// TileBank
|
||||
CTileBank &GetTileBank() {return(TileBank);}
|
||||
void UpdateTileView(CMapEditView *View,BOOL Toggle=FALSE);
|
||||
|
||||
void UpdateTileViewGUI() {TileBank.UpdateGUI(this,TileViewFlag);}
|
||||
void UpdateTileView(BOOL Toggle=FALSE);
|
||||
|
||||
CTile &GetTile(int Bank,int TileNo) {return(TileBank.GetTile(Bank,TileNo));}
|
||||
void TileBankLoad(char *Filename);
|
||||
void TileBankDelete();
|
||||
void TileBankReload();
|
||||
void TileBankSet();
|
||||
void MirrorX(CMapEditView *View);
|
||||
void MirrorY(CMapEditView *View);
|
||||
void ActiveBrushLeft(CMapEditView *View);
|
||||
void ActiveBrushRight(CMapEditView *View);
|
||||
void MirrorX();
|
||||
void MirrorY();
|
||||
void ActiveBrushLeft();
|
||||
void ActiveBrushRight();
|
||||
BOOL IsTileValid(int Set,int Tile);
|
||||
BOOL IsTileView() {return(TileViewFlag);}
|
||||
void TileBankGUIInit() {TileBank.GUIInit(this);}
|
||||
void TileBankGUIUpdate() {TileBank.GUIUpdate(this);}
|
||||
|
||||
// Param Bar
|
||||
// GUI
|
||||
void UpdateParamBar();
|
||||
void GUIAdd(CDialog &Dlg,int ID,bool Visible=true,bool Lock=false);
|
||||
void GUIRemove(CDialog &Dlg,int ID,bool Force=false);
|
||||
void GUIRemoveAll(bool Force=false);
|
||||
void GUIUpdate();
|
||||
void GUIChanged();
|
||||
|
||||
// Layers
|
||||
void AddLayer(int Type, int SubType, int Width, int Height);
|
||||
|
@ -71,31 +81,30 @@ public:
|
|||
void SetLayer(int Layer);
|
||||
void AddLayer(int Layer);
|
||||
void DeleteLayer(int Layer);
|
||||
void UpdateLayerGUI(CMapEditView *View);
|
||||
void UpdateLayerGUI();
|
||||
|
||||
// Grid
|
||||
void UpdateGrid(CMapEditView *View,BOOL Toggle=FALSE);
|
||||
void UpdateGrid(BOOL Toggle=FALSE);
|
||||
BOOL IsGridOn() {return(GridFlag);}
|
||||
|
||||
// Tex Cache
|
||||
CTexCache &GetTexCache() {return(TexCache);}
|
||||
|
||||
// Misc
|
||||
void UpdateGUI(CMapEditView *View);
|
||||
void UpdateAll(CMapEditView *View);
|
||||
void UpdateView(CMapEditView *View);
|
||||
void UpdateView(CMapEditView *View,Vector3 &Ofs);
|
||||
void UpdateAll();
|
||||
void RedrawView();
|
||||
void UpdateView(Vector3 *Ofs=NULL);
|
||||
|
||||
Vector3 &GetCam();
|
||||
Vector3 OffsetCam(Vector3 &Cam,float DivVal);
|
||||
void SetCursorPos(CPoint &Pos) {CursorPos=Pos;}
|
||||
CPoint &GetCursorPos() {return(CursorPos);}
|
||||
|
||||
void SetMapSize(CMapEditView *View,int Width,int Height);
|
||||
void SetMapSize(int Width,int Height);
|
||||
int GetMapWidth() {return(Layer[FindActionLayer()]->GetWidth());}
|
||||
int GetMapHeight() {return(Layer[FindActionLayer()]->GetHeight());}
|
||||
|
||||
void Toggle2d3d(CMapEditView *View);
|
||||
void Toggle2d3d();
|
||||
int FindLayer(int Type,int SubType=-1);
|
||||
int FindActionLayer();
|
||||
|
||||
|
@ -104,10 +113,11 @@ public:
|
|||
float GetZoomW();
|
||||
float GetZoomH();
|
||||
|
||||
void CopySelection(CMapEditView *View);
|
||||
void PasteSelection(CMapEditView *View);
|
||||
void CopySelection();
|
||||
void PasteSelection();
|
||||
|
||||
GString GetCurrentPath();
|
||||
|
||||
private:
|
||||
CPoint CurrentMousePos,LastMousePos;
|
||||
CPoint CursorPos,LastCursorPos;
|
||||
|
@ -119,9 +129,9 @@ private:
|
|||
int ActiveLayer;
|
||||
|
||||
CTileBank TileBank;
|
||||
|
||||
CTexCache TexCache;
|
||||
|
||||
CLayerListGUI LayerList;
|
||||
|
||||
BOOL TileViewFlag;
|
||||
BOOL GridFlag;
|
||||
|
|
|
@ -17,10 +17,11 @@
|
|||
sLayerInfoTable CLayer::InfoTable[]=
|
||||
{
|
||||
//Type SubType Name delete? Scale 3d Resizable Export
|
||||
{LAYER_TYPE_TILE, LAYERTILE_SCRATCH, "WorkPad", false, 1.0f, true, false, false,},
|
||||
{LAYER_TYPE_TILE, LAYERTILE_BACK, "Back", true, 4.0f, false, false, true,},
|
||||
{LAYER_TYPE_TILE, LAYERTILE_MID, "Mid", true, 2.0f, false, true, true,},
|
||||
{LAYER_TYPE_TILE, LAYERTILE_ACTION, "Action", false, 1.0f, true, true, true,},
|
||||
{LAYER_TYPE_TILE, LAYER_SUBTYPE_SCRATCH, "WorkPad", false, 1.0f, true, false, false,},
|
||||
{LAYER_TYPE_SHADE, LAYER_SUBTYPE_BACK, "Back Shade", true, 4.0f, false, true, true,},
|
||||
{LAYER_TYPE_TILE, LAYER_SUBTYPE_BACK, "Back", true, 4.0f, false, false, true,},
|
||||
{LAYER_TYPE_TILE, LAYER_SUBTYPE_MID, "Mid", true, 2.0f, false, true, true,},
|
||||
{LAYER_TYPE_TILE, LAYER_SUBTYPE_ACTION, "Action", false, 1.0f, true, true, true,},
|
||||
{LAYER_TYPE_COLLISION, LAYER_SUBTYPE_NONE, "Collision", true, 1.0f, false, true, true,},
|
||||
};
|
||||
|
||||
|
|
|
@ -30,6 +30,8 @@ struct sLayerInfoTable
|
|||
enum LAYER_ENUMS
|
||||
{
|
||||
SELECT_BUFFER_SIZE=16,
|
||||
TileLayerMinWidth=32,
|
||||
TileLayerMinHeight=22,
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -69,8 +71,10 @@ virtual void RenderSelection(CCore *Core,Vector3 &ThisCam)=0;
|
|||
virtual void FindCursorPos(CCore *Core,CMapEditView *View,Vector3 &CamPos,CPoint &MousePos)=0;
|
||||
virtual void RenderCursor(CCore *Core,Vector3 &CamPos,BOOL Is3d)=0;
|
||||
|
||||
virtual void InitGUI(CCore *Core)=0;
|
||||
virtual void UpdateGUI(CCore *Core)=0;
|
||||
virtual void GUIInit(CCore *Core)=0;
|
||||
virtual void GUIKill(CCore *Core)=0;
|
||||
virtual void GUIUpdate(CCore *Core)=0;
|
||||
virtual void GUIChanged(CCore *Core)=0;
|
||||
|
||||
virtual int GetWidth()=0;
|
||||
virtual int GetHeight()=0;
|
||||
|
|
|
@ -82,18 +82,27 @@ void CLayerCollision::Save(CFile *File)
|
|||
/*****************************************************************************/
|
||||
/*** Gui *********************************************************************/
|
||||
/*****************************************************************************/
|
||||
void CLayerCollision::InitGUI(CCore *Core)
|
||||
void CLayerCollision::GUIInit(CCore *Core)
|
||||
{
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CMultiBar *ParamBar=Frm->GetParamBar();
|
||||
|
||||
ParamBar->Add(Frm->GetLayerTileToolbar(),IDD_LAYERTILE_TOOLBAR,TRUE);
|
||||
Core->GUIAdd(ToolBarGUI,IDD_LAYERTILE_TOOLBAR);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CLayerCollision::UpdateGUI(CCore *Core)
|
||||
void CLayerCollision::GUIKill(CCore *Core)
|
||||
{
|
||||
CLayerTile::UpdateGUI(Core);
|
||||
Core->GUIRemove(ToolBarGUI,IDD_LAYERTILE_TOOLBAR);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CLayerCollision::GUIUpdate(CCore *Core)
|
||||
{
|
||||
CLayerTile::GUIUpdate(Core);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CLayerCollision::GUIChanged(CCore *Core)
|
||||
{
|
||||
CLayerTile::GUIChanged(Core);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -20,8 +20,10 @@ public:
|
|||
|
||||
int GetType() {return(LAYER_TYPE_COLLISION);}
|
||||
|
||||
void InitGUI(CCore *Core);
|
||||
void UpdateGUI(CCore *Core);
|
||||
void GUIInit(CCore *Core);
|
||||
void GUIKill(CCore *Core);
|
||||
void GUIUpdate(CCore *Core);
|
||||
void GUIChanged(CCore *Core);
|
||||
|
||||
void Load(CFile *File,int Version);
|
||||
void Save(CFile *File);
|
||||
|
@ -33,6 +35,8 @@ public:
|
|||
void RemapSet(int OrigSet,int NewSet);
|
||||
protected:
|
||||
|
||||
// CLayerTileToolbar ToolBarGUI;
|
||||
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -12,6 +12,7 @@ enum LAYER_TYPE
|
|||
{
|
||||
LAYER_TYPE_TILE=0,
|
||||
LAYER_TYPE_COLLISION,
|
||||
LAYER_TYPE_SHADE,
|
||||
LAYER_TYPE_MAX
|
||||
};
|
||||
|
||||
|
@ -19,11 +20,11 @@ enum LAYER_SUBTYPE
|
|||
{
|
||||
LAYER_SUBTYPE_NONE=-1,
|
||||
|
||||
LAYERTILE_BACK=0,
|
||||
LAYERTILE_MID,
|
||||
LAYERTILE_ACTION,
|
||||
LAYERTILE_FORE,
|
||||
LAYERTILE_SCRATCH,
|
||||
LAYER_SUBTYPE_BACK=0,
|
||||
LAYER_SUBTYPE_MID,
|
||||
LAYER_SUBTYPE_ACTION,
|
||||
LAYER_SUBTYPE_FORE,
|
||||
LAYER_SUBTYPE_SCRATCH,
|
||||
};
|
||||
|
||||
enum TILE_FLAG
|
||||
|
|
179
Utils/MapEdit/LayerShade.cpp
Normal file
179
Utils/MapEdit/LayerShade.cpp
Normal file
|
@ -0,0 +1,179 @@
|
|||
/*******************/
|
||||
/*** Layer Shade ***/
|
||||
/*******************/
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
#include <Vector3.h>
|
||||
#include <gl\gl.h>
|
||||
#include <gl\glu.h>
|
||||
#include "GLEnabledView.h"
|
||||
|
||||
#include "MapEdit.h"
|
||||
#include "MapEditDoc.h"
|
||||
#include "MapEditView.h"
|
||||
#include "MainFrm.h"
|
||||
|
||||
#include "Core.h"
|
||||
#include "Layer.h"
|
||||
#include "LayerShade.h"
|
||||
#include "Utils.h"
|
||||
#include "Select.h"
|
||||
#include "Export.h"
|
||||
#include "LayerShadeGUI.h"
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
// New Layer
|
||||
CLayerShade::CLayerShade(int _SubType,int _Width,int _Height)
|
||||
{
|
||||
SubType=_SubType;
|
||||
|
||||
SetDefaultParams();
|
||||
|
||||
Width=TileLayerMinWidth+(_Width-TileLayerMinWidth)/ScaleFactor;
|
||||
Height=TileLayerMinHeight+(_Height-TileLayerMinHeight)/ScaleFactor;
|
||||
|
||||
RGB[0].rgbRed=255; RGB[0].rgbGreen=255; RGB[0].rgbBlue=255;
|
||||
RGB[1].rgbRed=255; RGB[1].rgbGreen=0; RGB[1].rgbBlue=0;
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
// Load Layer
|
||||
CLayerShade::CLayerShade(CFile *File,int Version)
|
||||
{
|
||||
Load(File,Version);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
CLayerShade::~CLayerShade()
|
||||
{
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CLayerShade::Load(CFile *File,int Version)
|
||||
{
|
||||
File->Read(&Render3dFlag,sizeof(BOOL));
|
||||
File->Read(&ScaleFactor,sizeof(float));
|
||||
File->Read(&ResizeFlag,sizeof(BOOL));
|
||||
File->Read(&VisibleFlag,sizeof(BOOL));
|
||||
File->Read(&SubType,sizeof(int));
|
||||
File->Read(&Width,sizeof(int));
|
||||
File->Read(&Height,sizeof(int));
|
||||
|
||||
File->Read(&RGB[0],sizeof(RGBQUAD));
|
||||
File->Read(&RGB[1],sizeof(RGBQUAD));
|
||||
|
||||
TRACE1("%s\t",GetName());
|
||||
TRACE1("Scl:%g\t",ScaleFactor);
|
||||
TRACE1("%i\n",VisibleFlag);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CLayerShade::Save(CFile *File)
|
||||
{
|
||||
// Always Save current version
|
||||
|
||||
File->Write(&Render3dFlag,sizeof(BOOL));
|
||||
File->Write(&ScaleFactor,sizeof(float));
|
||||
File->Write(&ResizeFlag,sizeof(BOOL));
|
||||
File->Write(&VisibleFlag,sizeof(BOOL));
|
||||
File->Write(&SubType,sizeof(SubType));
|
||||
File->Write(&Width,sizeof(int));
|
||||
File->Write(&Height,sizeof(int));
|
||||
|
||||
File->Write(&RGB[0],sizeof(RGBQUAD));
|
||||
File->Write(&RGB[1],sizeof(RGBQUAD));
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
void CLayerShade::Render(CCore *Core,Vector3 &CamPos,BOOL Is3d)
|
||||
{
|
||||
Vector3 ThisCam=Core->OffsetCam(CamPos,GetScaleFactor());
|
||||
float ZoomW=Core->GetZoomW();
|
||||
float ZoomH=Core->GetZoomH();
|
||||
float ScrOfsX=(ZoomW/2);
|
||||
float ScrOfsY=(ZoomH/2);
|
||||
Vector3 &Scale=Core->GetScaleVector();
|
||||
|
||||
float x0=0;
|
||||
float x1=x0+Width;
|
||||
float y0=(0+1);
|
||||
float y1=y0-Height;
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
glScalef(Scale.x,Scale.y,Scale.z);
|
||||
glTranslatef(-ThisCam.x,ThisCam.y,0); // Set scroll offset
|
||||
glTranslatef(-ScrOfsX,ScrOfsY,0); // Bring to top left corner
|
||||
|
||||
glBegin (GL_QUADS);
|
||||
glColor3ub(RGB[0].rgbRed,RGB[0].rgbGreen,RGB[0].rgbBlue);
|
||||
glVertex3f( x0,y0,0.0f);
|
||||
glVertex3f( x1,y0,0.0f);
|
||||
|
||||
glColor3ub(RGB[1].rgbRed,RGB[1].rgbGreen,RGB[1].rgbBlue);
|
||||
glVertex3f( x1,y1,0.0f);
|
||||
glVertex3f( x0,y1,0.0f);
|
||||
|
||||
glEnd();
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
BOOL CLayerShade::Resize(int Width,int Height)
|
||||
{
|
||||
Width=TileLayerMinWidth+(Width-TileLayerMinWidth)/ScaleFactor;
|
||||
Height=TileLayerMinHeight+(Height-TileLayerMinHeight)/ScaleFactor;
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*** Gui *********************************************************************/
|
||||
/*****************************************************************************/
|
||||
void CLayerShade::GUIInit(CCore *Core)
|
||||
{
|
||||
Core->GUIAdd(ShadeDlg,IDD_LAYERSHADE_GUI);
|
||||
ShadeDlg.SetRGB0(RGB[0]);
|
||||
ShadeDlg.SetRGB1(RGB[1]);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CLayerShade::GUIKill(CCore *Core)
|
||||
{
|
||||
ShadeDlg.GetRGB0(RGB[0]);
|
||||
ShadeDlg.GetRGB1(RGB[1]);
|
||||
Core->GUIRemove(ShadeDlg,IDD_LAYERSHADE_GUI);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CLayerShade::GUIUpdate(CCore *Core)
|
||||
{
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CLayerShade::GUIChanged(CCore *Core)
|
||||
{
|
||||
ShadeDlg.GetRGB0(RGB[0]);
|
||||
ShadeDlg.GetRGB1(RGB[1]);
|
||||
|
||||
TRACE3("RGB0 is %i,%i,%i\n",RGB[0].rgbRed,RGB[0].rgbGreen,RGB[0].rgbBlue);
|
||||
TRACE3("RGB1 is %i,%i,%i\n",RGB[1].rgbRed,RGB[1].rgbGreen,RGB[1].rgbBlue);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*** Functions ***************************************************************/
|
||||
/*****************************************************************************/
|
||||
void CLayerShade::Export(CCore *Core,CExport &Exp)
|
||||
{
|
||||
// Exp.ExportLayerTile(Core,GetName(),SubType,Map);
|
||||
}
|
||||
|
68
Utils/MapEdit/LayerShade.h
Normal file
68
Utils/MapEdit/LayerShade.h
Normal file
|
@ -0,0 +1,68 @@
|
|||
/*******************/
|
||||
/*** Layer Shade ***/
|
||||
/*******************/
|
||||
|
||||
#ifndef __LAYER_SHADE_HEADER__
|
||||
#define __LAYER_SHADE_HEADER__
|
||||
|
||||
#include "Layer.h"
|
||||
#include "MapEdit.h"
|
||||
#include "LayerShadeGui.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
class CCore;
|
||||
class CMapEditView;
|
||||
class CLayerShade : public CLayer
|
||||
{
|
||||
|
||||
public:
|
||||
CLayerShade(){};
|
||||
CLayerShade(int SubType,int Width,int Height); // New Layer
|
||||
CLayerShade(CFile *File,int Version); // Load Layer
|
||||
~CLayerShade();
|
||||
|
||||
int GetType() {return(LAYER_TYPE_SHADE);}
|
||||
int GetSubType() {return(SubType);}
|
||||
|
||||
void Render(CCore *Core,Vector3 &CamPos,BOOL Is3d);
|
||||
void RenderGrid(CCore *Core,Vector3 &CamPos,BOOL Active){};
|
||||
void RenderSelection(CCore *Core,Vector3 &ThisCam){};
|
||||
|
||||
void FindCursorPos(CCore *Core,CMapEditView *View,Vector3 &CamPos,CPoint &MousePos){};
|
||||
void RenderCursor(CCore *Core,Vector3 &CamPos,BOOL Is3d){};
|
||||
|
||||
void GUIInit(CCore *Core);
|
||||
void GUIKill(CCore *Core);
|
||||
void GUIUpdate(CCore *Core);
|
||||
void GUIChanged(CCore *Core);
|
||||
|
||||
int GetWidth() {return(Width);}
|
||||
int GetHeight() {return(Height);}
|
||||
BOOL Resize(int _Width,int _Height);
|
||||
|
||||
void Load(CFile *File,int Version);
|
||||
void Save(CFile *File);
|
||||
|
||||
void Export(CCore *Core,CExport &Exp);
|
||||
|
||||
// Functions
|
||||
BOOL SetMode(int NewMode) {return(false);}
|
||||
BOOL InitMode() {return(false);}
|
||||
BOOL ExitMode() {return(false);}
|
||||
BOOL LButtonControl(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &CursorPos,BOOL DownFlag) {return(false);}
|
||||
BOOL RButtonControl(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &CursorPos,BOOL DownFlag) {return(false);}
|
||||
BOOL MouseMove(CCore *Core,CMapEditView *View,UINT nFlags, CPoint &CursorPos) {return(false);}
|
||||
|
||||
protected:
|
||||
void Render(CCore *Core,Vector3 &CamPos,CMap &ThisMap,BOOL Render3d,float Alpha=1.0f,Vector3 *Ofs=0);
|
||||
|
||||
int Width,Height;
|
||||
int SubType;
|
||||
|
||||
CLayerShadeGUI ShadeDlg;
|
||||
|
||||
RGBQUAD RGB[2];
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
#endif
|
|
@ -391,38 +391,40 @@ GLuint *HitPtr=SelectBuffer;
|
|||
/*****************************************************************************/
|
||||
/*** Gui *********************************************************************/
|
||||
/*****************************************************************************/
|
||||
void CLayerTile::InitGUI(CCore *Core)
|
||||
void CLayerTile::GUIInit(CCore *Core)
|
||||
{
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CMultiBar *ParamBar=Frm->GetParamBar();
|
||||
|
||||
ParamBar->Add(Frm->GetLayerTileToolbar(),IDD_LAYERTILE_TOOLBAR,TRUE);
|
||||
ParamBar->Add(Frm->GetLayerTileGUI(),IDD_LAYERTILE_GUI,TRUE);
|
||||
Core->GUIAdd(ToolBarGUI,IDD_LAYERTILE_TOOLBAR);
|
||||
Core->TileBankGUIInit();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CLayerTile::UpdateGUI(CCore *Core)
|
||||
void CLayerTile::GUIKill(CCore *Core)
|
||||
{
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CLayerTileToolbar *Bar=(CLayerTileToolbar *)Frm->GetDialog(IDD_LAYERTILE_TOOLBAR);
|
||||
Core->GUIRemove(ToolBarGUI,IDD_LAYERTILE_TOOLBAR);
|
||||
}
|
||||
|
||||
if (Bar)
|
||||
/*****************************************************************************/
|
||||
void CLayerTile::GUIUpdate(CCore *Core)
|
||||
{
|
||||
Bar->ResetButtons();
|
||||
ToolBarGUI.ResetButtons();
|
||||
switch(Mode)
|
||||
{
|
||||
case MouseModePaint:
|
||||
Bar->SetButtonState(CLayerTileToolbar::PAINT,TRUE);
|
||||
ToolBarGUI.SetButtonState(CLayerTileToolbar::PAINT,TRUE);
|
||||
break;
|
||||
case MouseModeSelect:
|
||||
Bar->SetButtonState(CLayerTileToolbar::SELECT,TRUE);
|
||||
ToolBarGUI.SetButtonState(CLayerTileToolbar::SELECT,TRUE);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Core->TileBankGUIUpdate();
|
||||
}
|
||||
|
||||
Core->UpdateTileViewGUI();
|
||||
/*****************************************************************************/
|
||||
void CLayerTile::GUIChanged(CCore *Core)
|
||||
{
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -6,13 +6,8 @@
|
|||
#define __LAYER_TILE_HEADER__
|
||||
|
||||
#include "Layer.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
enum TileLayerEnum
|
||||
{
|
||||
TileLayerMinWidth=32,
|
||||
TileLayerMinHeight=22,
|
||||
};
|
||||
#include "MapEdit.h"
|
||||
#include "LayerTileToolbar.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
class CCore;
|
||||
|
@ -42,8 +37,10 @@ public:
|
|||
void FindCursorPos(CCore *Core,CMapEditView *View,Vector3 &CamPos,CPoint &MousePos);
|
||||
void RenderCursor(CCore *Core,Vector3 &CamPos,BOOL Is3d);
|
||||
|
||||
void InitGUI(CCore *Core);
|
||||
void UpdateGUI(CCore *Core);
|
||||
void GUIInit(CCore *Core);
|
||||
void GUIKill(CCore *Core);
|
||||
void GUIUpdate(CCore *Core);
|
||||
void GUIChanged(CCore *Core);
|
||||
|
||||
int GetWidth() {return(Map.GetWidth());}
|
||||
int GetHeight() {return(Map.GetHeight());}
|
||||
|
@ -84,7 +81,7 @@ protected:
|
|||
int SubType;
|
||||
MouseMode Mode;
|
||||
|
||||
//static char *LayerName[];
|
||||
CLayerTileToolbar ToolBarGUI;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -6,9 +6,10 @@
|
|||
#define AFX_MAINFRM_H__CEC14D79_A1F2_4281_AA53_544F0924E7D8__INCLUDED_
|
||||
|
||||
#include "MultiBar.h"
|
||||
#include "LayerList.h"
|
||||
#include "LayerTileGUI.h"
|
||||
#include "LayerTileToolbar.h"
|
||||
//#include "LayerList.h"
|
||||
//#include "LayerTileGUI.h"
|
||||
//#include "LayerTileToolbar.h"
|
||||
//#include "LayerShadeGUI.h"
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
|
@ -34,13 +35,14 @@ public:
|
|||
public:
|
||||
CStatusBar *GetStatusBar() {return(&StatusBar);}
|
||||
CMainToolBar *GetToolBar() {return(&ToolBar);}
|
||||
CDialog *GetDialog(int ID) {return(ParamBar.GetDialog(ID));}
|
||||
// CDialog *GetDialog(int ID) {return(ParamBar.GetDialog(ID));}
|
||||
|
||||
// Param Bar
|
||||
CMultiBar *GetParamBar() {return(&ParamBar);}
|
||||
CDialog &GetLayerList() {return(LayerList);}
|
||||
CDialog &GetLayerTileGUI() {return(LayerTileGUI);}
|
||||
CDialog &GetLayerTileToolbar() {return(LayerTileToolBar);}
|
||||
// CDialog &GetLayerList() {return(LayerList);}
|
||||
// CDialog &GetLayerTileGUI() {return(LayerTileGUI);}
|
||||
// CDialog &GetLayerTileToolbar() {return(LayerTileToolBar);}
|
||||
// CDialog &GetLayerShadeGUI() {return(LayerShadeGUI);}
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
@ -65,9 +67,10 @@ protected: // control bar embedded members
|
|||
|
||||
CMultiBar ParamBar;
|
||||
// Sub Dialogs
|
||||
CLayerList LayerList;
|
||||
CLayerTileGUI LayerTileGUI;
|
||||
CLayerTileToolbar LayerTileToolBar;
|
||||
// CLayerList LayerList;
|
||||
// CLayerTileGUI LayerTileGUI;
|
||||
// CLayerTileToolbar LayerTileToolBar;
|
||||
// CLayerShadeGUI LayerShadeGUI;
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
|
|
|
@ -8,7 +8,7 @@ NewFileInclude1=#include "stdafx.h"
|
|||
NewFileInclude2=#include "mapedit.h"
|
||||
LastPage=0
|
||||
|
||||
ClassCount=16
|
||||
ClassCount=17
|
||||
Class1=CChildFrame
|
||||
Class2=CGLEnabledView
|
||||
Class3=CMainFrame
|
||||
|
@ -17,29 +17,31 @@ Class5=CAboutDlg
|
|||
Class6=CMapEditDoc
|
||||
Class7=CMapEditView
|
||||
|
||||
ResourceCount=13
|
||||
ResourceCount=14
|
||||
Resource1=IDD_NEW_LAYER
|
||||
Resource2=IDR_MAPEDITYPE (English (U.S.))
|
||||
Resource3=IDR_MAINFRAME (English (U.S.))
|
||||
Resource3=IDD_ADDLAYER
|
||||
Resource4=IDD_DIALOGBAR (English (U.S.))
|
||||
Resource5=IDD_LAYER_LIST_DIALOG
|
||||
Resource5=IDR_MAINFRAME (English (U.S.))
|
||||
Class8=CMultiBar
|
||||
Resource6=IDD_ADDLAYER
|
||||
Resource7=IDD_NEWMAP
|
||||
Resource6=IDD_LAYER_LIST_DIALOG
|
||||
Resource7=IDD_MULTIBAR (English (U.S.))
|
||||
Class9=CLayerList
|
||||
Class10=CMapSizeDlg
|
||||
Resource8=IDD_LAYERTILE_TOOLBAR
|
||||
Resource8=IDD_NEWMAP
|
||||
Class11=CGfxToolBar
|
||||
Class12=CLayerTileGUI
|
||||
Resource9=IDD_MULTIBAR (English (U.S.))
|
||||
Resource10=IDD_MAPSIZE
|
||||
Resource9=IDD_LAYERTILE_TOOLBAR
|
||||
Resource10=IDR_TOOLBAR (English (U.S.))
|
||||
Class13=CNewMapGUI
|
||||
Class14=CProgressDlg
|
||||
Resource11=IDD_ABOUTBOX (English (U.S.))
|
||||
Resource11=IDD_LAYERTILE_GUI
|
||||
Class15=CAddLayerDlg
|
||||
Resource12=IDD_LAYERTILE_GUI
|
||||
Resource12=IDD_MAPSIZE
|
||||
Class16=CLayerTileToolbar
|
||||
Resource13=IDR_TOOLBAR (English (U.S.))
|
||||
Resource13=IDD_ABOUTBOX (English (U.S.))
|
||||
Class17=CLayerShadeGUI
|
||||
Resource14=IDD_LAYERSHADE_GUI
|
||||
|
||||
[CLS:CChildFrame]
|
||||
Type=0
|
||||
|
@ -91,7 +93,7 @@ Type=0
|
|||
BaseClass=CGLEnabledView
|
||||
HeaderFile=MapEditView.h
|
||||
ImplementationFile=MapEditView.cpp
|
||||
LastObject=ID_EXPORT
|
||||
LastObject=ID_TOGGLE_GRID
|
||||
Filter=C
|
||||
VirtualFilter=VWC
|
||||
|
||||
|
@ -108,9 +110,7 @@ Command3=ID_FILE_SAVE
|
|||
Command4=ID_EDIT_CUT
|
||||
Command5=ID_EDIT_COPY
|
||||
Command6=ID_EDIT_PASTE
|
||||
Command7=ID_TOOLBAR_TILEPALETTE
|
||||
Command8=ID_TOOLBAR_GRID
|
||||
CommandCount=8
|
||||
CommandCount=6
|
||||
|
||||
[MNU:IDR_MAINFRAME (English (U.S.))]
|
||||
Type=1
|
||||
|
@ -262,6 +262,7 @@ ImplementationFile=MapSizeDlg.cpp
|
|||
BaseClass=CDialog
|
||||
Filter=D
|
||||
VirtualFilter=dWC
|
||||
LastObject=CMapSizeDlg
|
||||
|
||||
[DLG:IDD_LAYERTILE_GUI]
|
||||
Type=1
|
||||
|
@ -279,7 +280,7 @@ ImplementationFile=LayerTileGUI.cpp
|
|||
BaseClass=CDialog
|
||||
Filter=D
|
||||
VirtualFilter=dWC
|
||||
LastObject=IDD_LAYERTILE_BTN_UPDATE
|
||||
LastObject=CLayerTileGUI
|
||||
|
||||
[DLG:IDD_NEW_LAYER]
|
||||
Type=1
|
||||
|
@ -333,7 +334,7 @@ HeaderFile=AddLayerDlg.h
|
|||
ImplementationFile=AddLayerDlg.cpp
|
||||
BaseClass=CDialog
|
||||
Filter=D
|
||||
LastObject=IDC_ADDLAYER_LIST
|
||||
LastObject=CAddLayerDlg
|
||||
VirtualFilter=dWC
|
||||
|
||||
[DLG:IDD_ADDLAYER]
|
||||
|
@ -360,3 +361,25 @@ Filter=D
|
|||
LastObject=CLayerTileToolbar
|
||||
VirtualFilter=dWC
|
||||
|
||||
[DLG:IDD_LAYERSHADE_GUI]
|
||||
Type=1
|
||||
Class=CLayerShadeGUI
|
||||
ControlCount=8
|
||||
Control1=IDC_LAYERSHADE_TEXT0,static,1342308352
|
||||
Control2=IDC_LAYERSHADE_EDITR0,edit,1350770688
|
||||
Control3=IDC_LAYERSHADE_EDITG0,edit,1350770816
|
||||
Control4=IDC_LAYERSHADE_EDITB0,edit,1350770816
|
||||
Control5=IDC_LAYERSHADE_TEXT1,static,1342308352
|
||||
Control6=IDC_LAYERSHADE_EDITR1,edit,1350639744
|
||||
Control7=IDC_LAYERSHADE_EDITG1,edit,1350639744
|
||||
Control8=IDC_LAYERSHADE_EDITB1,edit,1350639744
|
||||
|
||||
[CLS:CLayerShadeGUI]
|
||||
Type=0
|
||||
HeaderFile=LayerShadeGUI.h
|
||||
ImplementationFile=LayerShadeGUI.cpp
|
||||
BaseClass=CDialog
|
||||
Filter=D
|
||||
VirtualFilter=dWC
|
||||
LastObject=CLayerShadeGUI
|
||||
|
||||
|
|
|
@ -115,6 +115,28 @@ SOURCE=.\LayerDef.h
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\LayerShade.cpp
|
||||
|
||||
!IF "$(CFG)" == "MapEdit - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "MapEdit - Win32 Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\LayerShade.h
|
||||
|
||||
!IF "$(CFG)" == "MapEdit - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "MapEdit - Win32 Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\LayerTile.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
@ -348,6 +370,14 @@ SOURCE=.\LayerList.h
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\LayerShadeGUI.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\LayerShadeGUI.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\LayerTileGUI.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
|
@ -52,9 +52,6 @@ BEGIN
|
|||
BUTTON ID_EDIT_CUT
|
||||
BUTTON ID_EDIT_COPY
|
||||
BUTTON ID_EDIT_PASTE
|
||||
SEPARATOR
|
||||
BUTTON ID_TOOLBAR_TILEPALETTE
|
||||
BUTTON ID_TOOLBAR_GRID
|
||||
END
|
||||
|
||||
|
||||
|
@ -532,6 +529,25 @@ BEGIN
|
|||
WS_TABSTOP
|
||||
END
|
||||
|
||||
IDD_LAYERSHADE_GUI DIALOG DISCARDABLE 0, 0, 186, 36
|
||||
STYLE WS_CHILD
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "RGB0",IDC_LAYERSHADE_TEXT0,5,7,24,8
|
||||
EDITTEXT IDC_LAYERSHADE_EDITR0,5,15,20,12,ES_NUMBER | WS_GROUP
|
||||
EDITTEXT IDC_LAYERSHADE_EDITG0,25,15,20,12,ES_AUTOHSCROLL |
|
||||
ES_NUMBER | WS_GROUP
|
||||
EDITTEXT IDC_LAYERSHADE_EDITB0,45,15,20,12,ES_AUTOHSCROLL |
|
||||
ES_NUMBER | WS_GROUP
|
||||
LTEXT "RGB1",IDC_LAYERSHADE_TEXT1,85,5,24,8
|
||||
EDITTEXT IDC_LAYERSHADE_EDITR1,85,15,20,12,ES_AUTOHSCROLL |
|
||||
ES_NUMBER
|
||||
EDITTEXT IDC_LAYERSHADE_EDITG1,105,15,20,12,ES_AUTOHSCROLL |
|
||||
ES_NUMBER
|
||||
EDITTEXT IDC_LAYERSHADE_EDITB1,125,15,20,12,ES_AUTOHSCROLL |
|
||||
ES_NUMBER
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
@ -588,6 +604,14 @@ BEGIN
|
|||
TOPMARGIN, 4
|
||||
BOTTOMMARGIN, 9
|
||||
END
|
||||
|
||||
IDD_LAYERSHADE_GUI, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 179
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 29
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
|
|
@ -91,19 +91,22 @@ void CMapEditDoc::Dump(CDumpContext& dc) const
|
|||
/*********************************************************************************/
|
||||
void CMapEditDoc::UpdateView(CMapEditView *View)
|
||||
{
|
||||
Core.UpdateView(View);
|
||||
CView *V=(CView*)View;
|
||||
V->Invalidate();
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
void CMapEditDoc::Render(CMapEditView *View)
|
||||
{
|
||||
if (View)
|
||||
Core.Render(View);
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
void CMapEditDoc::UpdateAll(CMapEditView *View)
|
||||
{
|
||||
Core.UpdateAll(View);
|
||||
if (View)
|
||||
Core.UpdateAll();
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
|
@ -128,6 +131,22 @@ int Ret=AfxMessageBox(Str,MB_YESNO , MB_ICONQUESTION);
|
|||
return(false);
|
||||
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
void CMapEditDoc::GUIUpdate()
|
||||
{
|
||||
Core.GUIUpdate();
|
||||
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
void CMapEditDoc::GUIChanged()
|
||||
{
|
||||
Core.GUIChanged();
|
||||
UpdateAllViews(NULL);
|
||||
// theApp.GetMainWnd()->Invalidate();
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
/*********************************************************************************/
|
||||
/*** Windows Message Handlers ****************************************************/
|
||||
|
@ -165,43 +184,43 @@ void CMapEditDoc::MouseMove(CMapEditView *View,UINT nFlags, CPoint &point)
|
|||
/*********************************************************************************/
|
||||
void CMapEditDoc::ToggleTileView(CMapEditView *View)
|
||||
{
|
||||
Core.UpdateTileView(View,TRUE);
|
||||
Core.UpdateAll(View);
|
||||
Core.UpdateTileView(true);
|
||||
Core.UpdateAll();
|
||||
FocusView();
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
void CMapEditDoc::ToggleGrid(CMapEditView *View)
|
||||
{
|
||||
Core.UpdateGrid(View,TRUE);
|
||||
Core.UpdateGrid(TRUE);
|
||||
FocusView();
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
void CMapEditDoc::MirrorX(CMapEditView *View)
|
||||
{
|
||||
Core.MirrorX(View);
|
||||
Core.MirrorX();
|
||||
FocusView();
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
void CMapEditDoc::MirrorY(CMapEditView *View)
|
||||
{
|
||||
Core.MirrorY(View);
|
||||
Core.MirrorY();
|
||||
FocusView();
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
void CMapEditDoc::CopySelection(CMapEditView *View)
|
||||
{
|
||||
Core.CopySelection(View);
|
||||
Core.CopySelection();
|
||||
FocusView();
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
void CMapEditDoc::PasteSelection(CMapEditView *View)
|
||||
{
|
||||
Core.PasteSelection(View);
|
||||
Core.PasteSelection();
|
||||
FocusView();
|
||||
}
|
||||
|
||||
|
@ -292,13 +311,13 @@ void CMapEditDoc::TileBankSet()
|
|||
/*********************************************************************************/
|
||||
void CMapEditDoc::ActiveBrushLeft(CMapEditView *View)
|
||||
{
|
||||
Core.ActiveBrushLeft(View);
|
||||
Core.ActiveBrushLeft();
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
void CMapEditDoc::ActiveBrushRight(CMapEditView *View)
|
||||
{
|
||||
Core.ActiveBrushRight(View);
|
||||
Core.ActiveBrushRight();
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
|
@ -311,27 +330,27 @@ CMapSizeDlg Dlg;
|
|||
|
||||
if (Dlg.DoModal()!=IDOK) return;
|
||||
|
||||
Core.SetMapSize(View,Dlg.m_Width,Dlg.m_Height);
|
||||
Core.SetMapSize(Dlg.m_Width,Dlg.m_Height);
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
void CMapEditDoc::OnZoomIn()
|
||||
{
|
||||
Core.Zoom(NULL,-0.1f);
|
||||
Core.Zoom(-0.1f);
|
||||
UpdateAllViews(NULL);
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
void CMapEditDoc::OnZoomOut()
|
||||
{
|
||||
Core.Zoom(NULL,+0.1f);
|
||||
Core.Zoom(+0.1f);
|
||||
UpdateAllViews(NULL);
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
void CMapEditDoc::Toggle2d3d(CMapEditView *View)
|
||||
{
|
||||
Core.Toggle2d3d(View);
|
||||
Core.Toggle2d3d();
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
|
|
|
@ -24,6 +24,8 @@ public:
|
|||
void UpdateAll(CMapEditView *View);
|
||||
void FocusView();
|
||||
bool Question(char *Txt);
|
||||
void GUIUpdate();
|
||||
void GUIChanged();
|
||||
|
||||
// Windows Messages Thru Point
|
||||
void LButtonControl(CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag);
|
||||
|
|
|
@ -25,7 +25,6 @@ IMPLEMENT_DYNCREATE(CMapEditView, CGLEnabledView)
|
|||
|
||||
BEGIN_MESSAGE_MAP(CMapEditView, CGLEnabledView)
|
||||
//{{AFX_MSG_MAP(CMapEditView)
|
||||
ON_WM_SETFOCUS()
|
||||
ON_WM_LBUTTONUP()
|
||||
ON_WM_LBUTTONDOWN()
|
||||
ON_WM_MBUTTONDOWN()
|
||||
|
@ -42,10 +41,10 @@ BEGIN_MESSAGE_MAP(CMapEditView, CGLEnabledView)
|
|||
ON_COMMAND(ID_ACTIVEBRUSH_RIGHT, OnActivebrushRight)
|
||||
ON_COMMAND(ID_MAP_SETSIZE, OnMapSetSize)
|
||||
ON_COMMAND(ID_2D_3D_TOGGLE, On2d3dToggle)
|
||||
ON_COMMAND(ID_TOOLBAR_TILEPALETTE, OnToggleTileview)
|
||||
ON_COMMAND(ID_TOGGLE_GRID, OnToggleGrid)
|
||||
ON_COMMAND(ID_EDIT_COPY, OnEditCopy)
|
||||
ON_COMMAND(ID_EDIT_PASTE, OnEditPaste)
|
||||
ON_COMMAND(ID_TOOLBAR_TILEPALETTE, OnToggleTileview)
|
||||
ON_COMMAND(ID_TOGGLE_GRID, OnToggleGrid)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
@ -137,14 +136,6 @@ CMapEditDoc* CMapEditView::GetDocument() // non-debug version is inline
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMapEditView message handlers
|
||||
|
||||
void CMapEditView::OnSetFocus(CWnd* pOldWnd)
|
||||
{
|
||||
CMapEditDoc *CurDoc=GetDocument();
|
||||
CGLEnabledView::OnSetFocus(pOldWnd);
|
||||
theApp.SetCurrent(CurDoc);
|
||||
CurDoc->UpdateAll(this);
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
/*********************************************************************************/
|
||||
/*********************************************************************************/
|
||||
|
@ -169,3 +160,14 @@ void CMapEditView::OnActivebrushRight() {GetDocument()->ActiveBrushRight
|
|||
void CMapEditView::OnMapSetSize() {GetDocument()->MapSetSize(this);}
|
||||
|
||||
void CMapEditView::On2d3dToggle() {GetDocument()->Toggle2d3d(this);}
|
||||
|
||||
void CMapEditView::OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView)
|
||||
{
|
||||
CGLEnabledView::OnActivateView(bActivate, pActivateView, pDeactiveView);
|
||||
if (bActivate)
|
||||
{
|
||||
CMapEditDoc *CurDoc=GetDocument();
|
||||
theApp.SetCurrent(CurDoc);
|
||||
CurDoc->UpdateAll(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,6 +30,8 @@ public:
|
|||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CMapEditView)
|
||||
protected:
|
||||
virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
|
@ -46,7 +48,6 @@ protected:
|
|||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CMapEditView)
|
||||
afx_msg void OnSetFocus(CWnd* pOldWnd);
|
||||
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnMButtonDown(UINT nFlags, CPoint point);
|
||||
|
|
|
@ -73,9 +73,9 @@ CTileBank::~CTileBank()
|
|||
/*****************************************************************************/
|
||||
void CTileBank::SetCollision(bool f)
|
||||
{
|
||||
LastSet=CurrentSet;
|
||||
if (f)
|
||||
{ // Is collision
|
||||
LastSet=CurrentSet;
|
||||
CurrentSet=0;
|
||||
}
|
||||
else
|
||||
|
@ -84,7 +84,6 @@ void CTileBank::SetCollision(bool f)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
void CTileBank::Load(CFile *File,int Version)
|
||||
{
|
||||
|
@ -267,30 +266,34 @@ void CTileBank::FindCursorPos(CCore *Core,CMapEditView *View,Vector3 &CamPos,CPo
|
|||
/*****************************************************************************/
|
||||
/*** Gui *********************************************************************/
|
||||
/*****************************************************************************/
|
||||
void CTileBank::UpdateGUI(CCore *Core,BOOL IsTileView)
|
||||
void CTileBank::GUIInit(CCore *Core)
|
||||
{
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CLayerTileGUI *Dlg=(CLayerTileGUI*)Frm->GetDialog(IDD_LAYERTILE_GUI);
|
||||
int ListSize=TileSet.size();
|
||||
Core->GUIAdd(TileBankGUI,IDD_LAYERTILE_GUI);
|
||||
}
|
||||
|
||||
if (Dlg)
|
||||
/*****************************************************************************/
|
||||
void CTileBank::GUIUpdate(CCore *Core)
|
||||
{
|
||||
Dlg->m_List.ResetContent();
|
||||
int ListSize=TileSet.size();
|
||||
BOOL IsTileView=Core->IsTileView();
|
||||
|
||||
if (TileBankGUI.m_List)
|
||||
{
|
||||
TileBankGUI.m_List.ResetContent();
|
||||
if (ListSize-1)
|
||||
{
|
||||
for (int i=1; i<ListSize; i++)
|
||||
{
|
||||
Dlg->m_List.AddString(TileSet[i].GetName());
|
||||
TileBankGUI.m_List.AddString(TileSet[i].GetName());
|
||||
}
|
||||
Dlg->m_List.SetCurSel(CurrentSet-1);
|
||||
TileBankGUI.m_List.SetCurSel(CurrentSet-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
IsTileView=FALSE;
|
||||
}
|
||||
Dlg->m_List.EnableWindow(IsTileView);
|
||||
TileBankGUI.m_List.EnableWindow(IsTileView);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
#include "TexCache.h"
|
||||
#include "Tile.h"
|
||||
|
||||
#include "MapEdit.h"
|
||||
#include "LayerTileGui.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
enum TileSetEnum
|
||||
{
|
||||
|
@ -48,7 +51,7 @@ public:
|
|||
void LoadTileSets(CCore *Core);
|
||||
CTile &GetTile(int Bank,int Tile);
|
||||
|
||||
void SetCurrent(int Set) {CurrentSet=Set+1;}
|
||||
void SetCurrent() {CurrentSet=TileBankGUI.m_List.GetCurSel()+1;}
|
||||
int GetCurrent() {return(CurrentSet);}
|
||||
int GetSetCount() {return(TileSet.size());}
|
||||
|
||||
|
@ -61,10 +64,10 @@ public:
|
|||
void FindCursorPos(CCore *Core,CMapEditView *View,Vector3 &CamPos,CPoint &MousePos);
|
||||
void RenderCursor(CCore *Core,Vector3 &CamPos,BOOL Is3d);
|
||||
|
||||
void UpdateGUI(CCore *Core,BOOL IsTileView);
|
||||
void GUIInit(CCore *Core);
|
||||
void GUIUpdate(CCore *Core);
|
||||
|
||||
BOOL IsTileValid(int Set,int Tile);
|
||||
// BOOL IsTileValidGB(int Set,int Tile);
|
||||
|
||||
void SetCollision(bool f);
|
||||
CTileSet &GetSet(int Set) {return(TileSet[Set]);}
|
||||
|
@ -81,7 +84,7 @@ public:
|
|||
void Save(CFile *File);
|
||||
|
||||
|
||||
private:
|
||||
protected:
|
||||
BOOL Select(int BrushID,BOOL DownFlag);
|
||||
void SetBrush(CMap &ThisBrush);
|
||||
|
||||
|
@ -93,6 +96,9 @@ private:
|
|||
|
||||
BOOL LoadFlag;
|
||||
int LastCursorPos,CursorPos;
|
||||
|
||||
CLayerTileGUI TileBankGUI;
|
||||
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -109,12 +115,6 @@ public:
|
|||
void Load2d(CCore *Core);
|
||||
void Load3d(CCore *Core);
|
||||
|
||||
// const char *GetDrive() {return(Filename.Drive());}
|
||||
// const char *GetPath() {return(Filename.Dir());}
|
||||
// const char *GetName() {return(Filename.File());}
|
||||
// const char *GetExt() {return(Filename.Ext());}
|
||||
// const char *GetFilename() {return(Filename.FullName());}
|
||||
|
||||
const char *GetFilename() {return(Filename);}
|
||||
const char *GetName() {return(Name);}
|
||||
|
||||
|
@ -127,7 +127,6 @@ public:
|
|||
void RenderGrid(Vector3 &CamPos);
|
||||
int GetTileBrowserWidth() {return(TileBrowserWidth);}
|
||||
BOOL IsTileValid(int No);
|
||||
// BOOL IsTileValidGB(int No);
|
||||
|
||||
|
||||
private:
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#define IDD_ADDLAYER 172
|
||||
#define IDD_LAYERTILE_GUI 173
|
||||
#define IDD_LAYERTILE_TOOLBAR 174
|
||||
#define IDD_LAYERSHADE_GUI 175
|
||||
#define IDC_TOOLBAR_COMBO 1018
|
||||
#define IDC_LAYER_LIST 1019
|
||||
#define IDD_LAYERTILE_BTN_UPDATE 1029
|
||||
|
@ -32,6 +33,14 @@
|
|||
#define IDC_LAYERLIST_ADD 1056
|
||||
#define IDC_LAYERLIST_DELETE 1057
|
||||
#define IDC_ADDLAYER_LIST 1058
|
||||
#define IDC_LAYERSHADE_TEXT0 1059
|
||||
#define IDC_LAYERSHADE_EDITR0 1060
|
||||
#define IDC_LAYERSHADE_EDITG0 1061
|
||||
#define IDC_LAYERSHADE_EDITB0 1062
|
||||
#define IDC_LAYERSHADE_TEXT1 1063
|
||||
#define IDC_LAYERSHADE_EDITR1 1064
|
||||
#define IDC_LAYERSHADE_EDITG1 1065
|
||||
#define IDC_LAYERSHADE_EDITB1 1066
|
||||
#define ID_TOOLBAR_LAYERBAR 32773
|
||||
#define ID_TOOLBAR_TILEPALETTE 32774
|
||||
#define ID_TOOLBAR_COMBO 32777
|
||||
|
@ -56,9 +65,9 @@
|
|||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_3D_CONTROLS 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 173
|
||||
#define _APS_NEXT_RESOURCE_VALUE 177
|
||||
#define _APS_NEXT_COMMAND_VALUE 32799
|
||||
#define _APS_NEXT_CONTROL_VALUE 1059
|
||||
#define _APS_NEXT_CONTROL_VALUE 1070
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
|
|
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue