This commit is contained in:
parent
2702a1bfc4
commit
e95a2bec41
8 changed files with 70 additions and 67 deletions
|
@ -39,7 +39,9 @@ public:
|
|||
void RenderTileView(CMapEditView *View);
|
||||
void Export(char *Filename);
|
||||
|
||||
|
||||
// View Stuff
|
||||
void SetView(CMapEditView *View) {CurrentView=View;}
|
||||
CMapEditView *GetView() {return(CurrentView);}
|
||||
// Control
|
||||
void SetMode(int NewMode);
|
||||
void LButtonControl(CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag);
|
||||
|
@ -119,6 +121,7 @@ public:
|
|||
GString GetCurrentPath();
|
||||
|
||||
private:
|
||||
CMapEditView *CurrentView;
|
||||
CPoint CurrentMousePos,LastMousePos;
|
||||
CPoint CursorPos,LastCursorPos;
|
||||
Vector3 MapCam,TileCam;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
[General Info]
|
||||
Version=1
|
||||
LastClass=CMapEditView
|
||||
LastClass=CMapEditDoc
|
||||
LastTemplate=CDialog
|
||||
NewFileInclude1=#include "stdafx.h"
|
||||
NewFileInclude2=#include "mapedit.h"
|
||||
|
@ -20,26 +20,26 @@ Class7=CMapEditView
|
|||
ResourceCount=14
|
||||
Resource1=IDD_NEW_LAYER
|
||||
Resource2=IDR_MAPEDITYPE (English (U.S.))
|
||||
Resource3=IDD_ADDLAYER
|
||||
Resource3=IDD_MAPSIZE
|
||||
Resource4=IDD_DIALOGBAR (English (U.S.))
|
||||
Resource5=IDR_MAINFRAME (English (U.S.))
|
||||
Resource5=IDD_LAYERTILE_TOOLBAR
|
||||
Class8=CMultiBar
|
||||
Resource6=IDD_LAYER_LIST_DIALOG
|
||||
Resource7=IDD_MULTIBAR (English (U.S.))
|
||||
Resource6=IDD_ABOUTBOX (English (U.S.))
|
||||
Resource7=IDR_MAINFRAME (English (U.S.))
|
||||
Class9=CLayerList
|
||||
Class10=CMapSizeDlg
|
||||
Resource8=IDD_NEWMAP
|
||||
Resource8=IDD_LAYER_LIST_DIALOG
|
||||
Class11=CGfxToolBar
|
||||
Class12=CLayerTileGUI
|
||||
Resource9=IDD_LAYERTILE_TOOLBAR
|
||||
Resource10=IDR_TOOLBAR (English (U.S.))
|
||||
Resource9=IDD_ADDLAYER
|
||||
Resource10=IDD_LAYERTILE_GUI
|
||||
Class13=CNewMapGUI
|
||||
Class14=CProgressDlg
|
||||
Resource11=IDD_LAYERTILE_GUI
|
||||
Resource11=IDD_NEWMAP
|
||||
Class15=CAddLayerDlg
|
||||
Resource12=IDD_MAPSIZE
|
||||
Resource12=IDD_MULTIBAR (English (U.S.))
|
||||
Class16=CLayerTileToolbar
|
||||
Resource13=IDD_ABOUTBOX (English (U.S.))
|
||||
Resource13=IDR_TOOLBAR (English (U.S.))
|
||||
Class17=CLayerShadeGUI
|
||||
Resource14=IDD_LAYERSHADE_GUI
|
||||
|
||||
|
@ -93,7 +93,7 @@ Type=0
|
|||
BaseClass=CGLEnabledView
|
||||
HeaderFile=MapEditView.h
|
||||
ImplementationFile=MapEditView.cpp
|
||||
LastObject=ID_TOGGLE_GRID
|
||||
LastObject=CMapEditView
|
||||
Filter=C
|
||||
VirtualFilter=VWC
|
||||
|
||||
|
|
|
@ -88,6 +88,18 @@ void CMapEditDoc::Dump(CDumpContext& dc) const
|
|||
/*********************************************************************************/
|
||||
/*********************************************************************************/
|
||||
/*********************************************************************************/
|
||||
/*********************************************************************************/
|
||||
void CMapEditDoc::SetView(CMapEditView *View)
|
||||
{
|
||||
Core.SetView(View);
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
CMapEditView *CMapEditDoc::GetView()
|
||||
{
|
||||
return(Core.GetView());
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
void CMapEditDoc::UpdateView(CMapEditView *View)
|
||||
{
|
||||
|
@ -98,18 +110,15 @@ CView *V=(CView*)View;
|
|||
/*********************************************************************************/
|
||||
void CMapEditDoc::Render(CMapEditView *View)
|
||||
{
|
||||
|
||||
if (View)
|
||||
// if (View)
|
||||
Core.Render(View);
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
void CMapEditDoc::UpdateAll(CMapEditView *View)
|
||||
{
|
||||
|
||||
if (View)
|
||||
// if (View)
|
||||
Core.UpdateAll();
|
||||
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
|
|
|
@ -19,6 +19,8 @@ protected: // create from serialization only
|
|||
|
||||
// Attributes
|
||||
public:
|
||||
void SetView(CMapEditView *View);
|
||||
CMapEditView *GetView();
|
||||
void UpdateView(CMapEditView *View);
|
||||
void Render(CMapEditView *View);
|
||||
void UpdateAll(CMapEditView *View);
|
||||
|
|
|
@ -168,6 +168,7 @@ void CMapEditView::OnActivateView(BOOL bActivate, CView* pActivateView, CView* p
|
|||
{
|
||||
CMapEditDoc *CurDoc=GetDocument();
|
||||
theApp.SetCurrent(CurDoc);
|
||||
CurDoc->SetView(this);
|
||||
CurDoc->UpdateAll(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ GFName FName=Filename;
|
|||
int Idx=GetTexIdx(NewTex); // Is already loaded?
|
||||
if (Idx!=-1) return(Idx);
|
||||
|
||||
// TRACE1("Loading Texture %s\n",NewTex.Filename);
|
||||
TRACE1("Loading Texture %s\n",NewTex.Filename);
|
||||
|
||||
if (!LoadBMP(NewTex.Filename,ThisRGB))
|
||||
{
|
||||
|
@ -133,6 +133,7 @@ u8 *Src,*Dst;
|
|||
Buffer=(u8*)malloc(GLWidth*GLHeight*4);
|
||||
Src=TexData->RGB;
|
||||
Dst=&Buffer[0];
|
||||
|
||||
for (int Y=0; Y<TexHeight; Y++)
|
||||
{
|
||||
for (int X=0; X<TexWidth; X++)
|
||||
|
|
|
@ -161,27 +161,10 @@ GString SavePath;
|
|||
void CTileBank::AddTileSet(const char *Filename)
|
||||
{
|
||||
int ListSize=TileSet.size();
|
||||
CTileSet NewSet(Filename,ListSize);
|
||||
|
||||
if (FindTileSet(Filename) ==-1)
|
||||
{
|
||||
TileSet.push_back(CTileSet(Filename,ListSize));
|
||||
LoadFlag=TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
int CTileBank::FindTileSet(const char *Filename)
|
||||
{
|
||||
int ListSize=TileSet.size();
|
||||
CTileSet FindSet(Filename,ListSize);
|
||||
|
||||
for (int i=0; i<ListSize; i++)
|
||||
{
|
||||
CTileSet &ThisSet=TileSet[i];
|
||||
|
||||
if (IsStrSame((char*)FindSet.GetName(),(char*)ThisSet.GetName(),-1)) return(i);
|
||||
}
|
||||
return(-1);
|
||||
TileSet.Add(NewSet);
|
||||
if (TileSet.size()!=ListSize) LoadFlag=TRUE;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -214,7 +197,8 @@ int ListSize=TileSet.size();
|
|||
Brush[i].RemapSet(Set,Set);
|
||||
}
|
||||
}
|
||||
TileSet.erase(TileSet.begin()+CurrentSet);
|
||||
// TileSet.erase(TileSet.begin()+CurrentSet);
|
||||
TileSet.erase(CurrentSet);
|
||||
CurrentSet=0;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,6 @@ public:
|
|||
MaxBrush
|
||||
};
|
||||
|
||||
int FindTileSet(const char *Filename);
|
||||
void AddTileSet(const char *Filename);
|
||||
int NeedLoad() {return(LoadFlag);}
|
||||
void Delete();
|
||||
|
@ -88,7 +87,8 @@ protected:
|
|||
BOOL Select(int BrushID,BOOL DownFlag);
|
||||
void SetBrush(CMap &ThisBrush);
|
||||
|
||||
std::vector<CTileSet> TileSet;
|
||||
// std::vector<CTileSet> TileSet;
|
||||
CList<CTileSet> TileSet;
|
||||
int CurrentSet,LastSet;
|
||||
CMap Brush[2];
|
||||
int ActiveBrush;
|
||||
|
@ -115,8 +115,8 @@ public:
|
|||
void Load2d(CCore *Core);
|
||||
void Load3d(CCore *Core);
|
||||
|
||||
const char *GetFilename() {return(Filename);}
|
||||
const char *GetName() {return(Name);}
|
||||
const char *GetFilename() {return(Filename);}
|
||||
const char *GetName() {return(Name);}
|
||||
|
||||
CTile &GetTile(int No) {return(Tile[No]);}
|
||||
void Purge();
|
||||
|
@ -128,6 +128,9 @@ public:
|
|||
int GetTileBrowserWidth() {return(TileBrowserWidth);}
|
||||
BOOL IsTileValid(int No);
|
||||
|
||||
bool operator==(CTileSet const &v1) {return (Name==v1.Name);}
|
||||
|
||||
// if (IsStrSame((char*)Name,(char*)v1.Name) return(i);
|
||||
|
||||
private:
|
||||
BOOL Create16x16Tile(sRGBData &Src,u8 *Dst,int XOfs,int YOfs);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue