This commit is contained in:
parent
84eb6ded52
commit
17b863e4be
7 changed files with 50 additions and 39 deletions
|
@ -30,6 +30,7 @@ BOOL Test3dFlag=TRUE;
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
CCore::CCore()
|
CCore::CCore()
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
Layers[LAYER_TYPE_BACK]= new CLayerBack(this);
|
Layers[LAYER_TYPE_BACK]= new CLayerBack(this);
|
||||||
Layers[LAYER_TYPE_MID]= new CLayerMid(this);
|
Layers[LAYER_TYPE_MID]= new CLayerMid(this);
|
||||||
Layers[LAYER_TYPE_ACTION]= new CLayerAction(this);
|
Layers[LAYER_TYPE_ACTION]= new CLayerAction(this);
|
||||||
|
@ -37,6 +38,7 @@ CCore::CCore()
|
||||||
|
|
||||||
TileViewFlag=0;
|
TileViewFlag=0;
|
||||||
LayerViewFlag=1;
|
LayerViewFlag=1;
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -50,12 +52,22 @@ int i;
|
||||||
void CCore::Init(CMapEditView *Wnd)
|
void CCore::Init(CMapEditView *Wnd)
|
||||||
{
|
{
|
||||||
ParentWindow=Wnd;
|
ParentWindow=Wnd;
|
||||||
|
|
||||||
|
RenderFlag=TRUE;
|
||||||
|
UpdateView();
|
||||||
|
|
||||||
|
// To be loaded/created
|
||||||
|
Layers[LAYER_TYPE_BACK]= new CLayerBack(this);
|
||||||
|
Layers[LAYER_TYPE_MID]= new CLayerMid(this);
|
||||||
|
Layers[LAYER_TYPE_ACTION]= new CLayerAction(this);
|
||||||
|
Layers[LAYER_TYPE_FORE]= new CLayerFore(this);
|
||||||
|
|
||||||
|
TileViewFlag=0;
|
||||||
|
LayerViewFlag=1;
|
||||||
|
|
||||||
ActiveLayer=LAYER_TYPE_ACTION;
|
ActiveLayer=LAYER_TYPE_ACTION;
|
||||||
MapCam=Vec(0,0,0);
|
MapCam=Vec(0,0,0);
|
||||||
TileCam=Vec(0,0,0);
|
TileCam=Vec(0,0,0);
|
||||||
UpdateView();
|
|
||||||
RenderFlag=TRUE;
|
|
||||||
|
|
||||||
TileSet.push_back(CTileSet("c:/temp/3/test.gin",this));
|
TileSet.push_back(CTileSet("c:/temp/3/test.gin",this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -176,25 +176,20 @@ float StartY=MapPos.y/XYDiv;
|
||||||
HitCount= glRenderMode (GL_RENDER);
|
HitCount= glRenderMode (GL_RENDER);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
glMatrixMode(GL_MODELVIEW);
|
|
||||||
CursorPos.x=CursorPos.y=-1;
|
CursorPos.x=CursorPos.y=-1;
|
||||||
// TRACE1("Hits %i\n",HitCount);
|
|
||||||
|
|
||||||
// Process hits
|
// Process hits
|
||||||
|
|
||||||
GLuint *Ptr=SelectBuffer,*BestHit=0;
|
GLuint *HitPtr=SelectBuffer;
|
||||||
|
|
||||||
for (int H=0;H<HitCount;H++)
|
if (HitCount) // Just take 1st
|
||||||
{
|
|
||||||
BestHit=Ptr; // Fakeness for the mo
|
|
||||||
}
|
|
||||||
|
|
||||||
if (BestHit)
|
|
||||||
{
|
{
|
||||||
int HitID=BestHit[3];
|
int HitID=HitPtr[3];
|
||||||
CursorPos.x=HitID%MapH;
|
CursorPos.x=HitID%MapW;
|
||||||
CursorPos.y=HitID/MapW;
|
CursorPos.y=HitID/MapW;
|
||||||
}
|
}
|
||||||
|
glMatrixMode(GL_MODELVIEW); // <-- Prevent arse GL assert
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
[General Info]
|
[General Info]
|
||||||
Version=1
|
Version=1
|
||||||
LastClass=CMapEditView
|
LastClass=CMapEditDoc
|
||||||
LastTemplate=CFrameWnd
|
LastTemplate=CFrameWnd
|
||||||
NewFileInclude1=#include "stdafx.h"
|
NewFileInclude1=#include "stdafx.h"
|
||||||
NewFileInclude2=#include "mapedit.h"
|
NewFileInclude2=#include "mapedit.h"
|
||||||
LastPage=0
|
LastPage=0
|
||||||
|
|
||||||
ClassCount=9
|
ClassCount=8
|
||||||
Class1=CChildFrame
|
Class1=CChildFrame
|
||||||
Class2=CGLEnabledView
|
Class2=CGLEnabledView
|
||||||
Class3=CListBoxEx
|
Class3=CListBoxEx
|
||||||
|
@ -20,11 +20,10 @@ Class8=CMapEditView
|
||||||
|
|
||||||
ResourceCount=6
|
ResourceCount=6
|
||||||
Resource1=IDR_MAPEDITYPE (English (U.S.))
|
Resource1=IDR_MAPEDITYPE (English (U.S.))
|
||||||
Resource2=IDD_LAYERBAR (English (U.S.))
|
Resource2=IDR_MAINFRAME (English (U.S.))
|
||||||
Resource3=IDD_LAYERBAR1 (English (U.S.))
|
Resource3=IDD_LAYERBAR1 (English (U.S.))
|
||||||
Resource4=IDD_ABOUTBOX (English (U.S.))
|
Resource4=IDD_LAYERBAR (English (U.S.))
|
||||||
Resource5=IDR_MAINFRAME (English (U.S.))
|
Resource5=IDD_ABOUTBOX (English (U.S.))
|
||||||
Class9=CTileWindow
|
|
||||||
Resource6=IDD_TILEBAR (English (U.S.))
|
Resource6=IDD_TILEBAR (English (U.S.))
|
||||||
|
|
||||||
[CLS:CChildFrame]
|
[CLS:CChildFrame]
|
||||||
|
@ -32,7 +31,7 @@ Type=0
|
||||||
BaseClass=CMDIChildWnd
|
BaseClass=CMDIChildWnd
|
||||||
HeaderFile=ChildFrm.h
|
HeaderFile=ChildFrm.h
|
||||||
ImplementationFile=ChildFrm.cpp
|
ImplementationFile=ChildFrm.cpp
|
||||||
LastObject=IDC_LAYERBAR_LIST
|
LastObject=CChildFrame
|
||||||
|
|
||||||
[CLS:CGLEnabledView]
|
[CLS:CGLEnabledView]
|
||||||
Type=0
|
Type=0
|
||||||
|
@ -77,13 +76,15 @@ BaseClass=CDocument
|
||||||
HeaderFile=MapEditDoc.h
|
HeaderFile=MapEditDoc.h
|
||||||
ImplementationFile=MapEditDoc.cpp
|
ImplementationFile=MapEditDoc.cpp
|
||||||
LastObject=CMapEditDoc
|
LastObject=CMapEditDoc
|
||||||
|
Filter=N
|
||||||
|
VirtualFilter=DC
|
||||||
|
|
||||||
[CLS:CMapEditView]
|
[CLS:CMapEditView]
|
||||||
Type=0
|
Type=0
|
||||||
BaseClass=CGLEnabledView
|
BaseClass=CGLEnabledView
|
||||||
HeaderFile=MapEditView.h
|
HeaderFile=MapEditView.h
|
||||||
ImplementationFile=MapEditView.cpp
|
ImplementationFile=MapEditView.cpp
|
||||||
LastObject=ID_TOOLBAR_LAYERBAR
|
LastObject=CMapEditView
|
||||||
Filter=C
|
Filter=C
|
||||||
VirtualFilter=VWC
|
VirtualFilter=VWC
|
||||||
|
|
||||||
|
@ -185,15 +186,6 @@ Class=?
|
||||||
ControlCount=1
|
ControlCount=1
|
||||||
Control1=IDC_TILETOOLBAR_COMBO,combobox,1344340227
|
Control1=IDC_TILETOOLBAR_COMBO,combobox,1344340227
|
||||||
|
|
||||||
[CLS:CTileWindow]
|
|
||||||
Type=0
|
|
||||||
HeaderFile=TileWindow.h
|
|
||||||
ImplementationFile=TileWindow.cpp
|
|
||||||
BaseClass=CFrameWnd
|
|
||||||
Filter=C
|
|
||||||
LastObject=CTileWindow
|
|
||||||
VirtualFilter=fWC
|
|
||||||
|
|
||||||
[DLG:IDD_LAYERBAR1 (English (U.S.))]
|
[DLG:IDD_LAYERBAR1 (English (U.S.))]
|
||||||
Type=1
|
Type=1
|
||||||
Class=?
|
Class=?
|
||||||
|
|
|
@ -95,10 +95,11 @@ BOOL CMapEditApp::InitInstance()
|
||||||
// Parse command line for standard shell commands, DDE, file open
|
// Parse command line for standard shell commands, DDE, file open
|
||||||
CCommandLineInfo cmdInfo;
|
CCommandLineInfo cmdInfo;
|
||||||
ParseCommandLine(cmdInfo);
|
ParseCommandLine(cmdInfo);
|
||||||
|
// Prevent creating new doc on startup (should still open cmd line file tho
|
||||||
|
if (cmdInfo.m_nShellCommand==CCommandLineInfo::FileNew) cmdInfo.m_nShellCommand=CCommandLineInfo::FileNothing;
|
||||||
|
|
||||||
// Dispatch commands specified on the command line
|
// Dispatch commands specified on the command line
|
||||||
if (!ProcessShellCommand(cmdInfo))
|
if (!ProcessShellCommand(cmdInfo)) return FALSE;
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
// The main window has been initialized, so show and update it.
|
// The main window has been initialized, so show and update it.
|
||||||
pMainFrame->ShowWindow(m_nCmdShow);
|
pMainFrame->ShowWindow(m_nCmdShow);
|
||||||
|
|
|
@ -37,6 +37,7 @@ BOOL CMapEditDoc::OnNewDocument()
|
||||||
{
|
{
|
||||||
if (!CDocument::OnNewDocument())
|
if (!CDocument::OnNewDocument())
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
TRACE0("New Doc\n");
|
||||||
|
|
||||||
// TODO: add reinitialization code here
|
// TODO: add reinitialization code here
|
||||||
// (SDI documents will reuse this document)
|
// (SDI documents will reuse this document)
|
||||||
|
@ -44,6 +45,17 @@ BOOL CMapEditDoc::OnNewDocument()
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL CMapEditDoc::OnOpenDocument(LPCTSTR lpszPathName)
|
||||||
|
{
|
||||||
|
if (!CDocument::OnOpenDocument(lpszPathName))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
TRACE1("Load Doc %s\n",lpszPathName);
|
||||||
|
|
||||||
|
// TODO: Add your specialized creation code here
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -75,5 +87,3 @@ void CMapEditDoc::Dump(CDumpContext& dc) const
|
||||||
CDocument::Dump(dc);
|
CDocument::Dump(dc);
|
||||||
}
|
}
|
||||||
#endif //_DEBUG
|
#endif //_DEBUG
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ public:
|
||||||
public:
|
public:
|
||||||
virtual BOOL OnNewDocument();
|
virtual BOOL OnNewDocument();
|
||||||
virtual void Serialize(CArchive& ar);
|
virtual void Serialize(CArchive& ar);
|
||||||
|
virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
|
||||||
//}}AFX_VIRTUAL
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
|
|
|
@ -46,8 +46,8 @@ END_MESSAGE_MAP()
|
||||||
|
|
||||||
CMapEditView::CMapEditView()
|
CMapEditView::CMapEditView()
|
||||||
{
|
{
|
||||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
//CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||||
CDialogBar *LayerBar=Frm->GetLayerBar();
|
//CDialogBar *LayerBar=Frm->GetLayerBar();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue