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