This commit is contained in:
parent
46791b36f4
commit
84eb6ded52
15 changed files with 243 additions and 108 deletions
|
@ -30,7 +30,6 @@ BOOL Test3dFlag=TRUE;
|
|||
/*****************************************************************************/
|
||||
CCore::CCore()
|
||||
{
|
||||
MouseMode=MOUSE_MODE_NONE;
|
||||
Layers[LAYER_TYPE_BACK]= new CLayerBack(this);
|
||||
Layers[LAYER_TYPE_MID]= new CLayerMid(this);
|
||||
Layers[LAYER_TYPE_ACTION]= new CLayerAction(this);
|
||||
|
@ -51,14 +50,13 @@ int i;
|
|||
void CCore::Init(CMapEditView *Wnd)
|
||||
{
|
||||
ParentWindow=Wnd;
|
||||
ActiveLayer=0;
|
||||
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));
|
||||
TRACE1("%i\n",TileSet.size());
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -68,6 +66,10 @@ void CCore::Render()
|
|||
{
|
||||
Vec &ThisCam=GetCam();
|
||||
|
||||
if (RenderFlag)
|
||||
{
|
||||
RenderFlag=FALSE;
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
if (GetTileView())
|
||||
{
|
||||
|
||||
|
@ -76,13 +78,14 @@ Vec &ThisCam=GetCam();
|
|||
{
|
||||
for (int i=0;i<LAYER_TYPE_MAX;i++)
|
||||
{
|
||||
if (i==LAYER_TYPE_ACTION)
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
Layers[i]->Render(ThisCam,Test3dFlag);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
}
|
||||
}
|
||||
Layers[ActiveLayer]->RenderGrid(ThisCam);
|
||||
}
|
||||
// Calc CursorPos
|
||||
Layers[ActiveLayer]->FindCursorPos(ThisCam,CurrentMousePos);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -117,8 +120,7 @@ void CCore::MouseWheel(UINT nFlags, short zDelta, CPoint &pt)
|
|||
void CCore::MouseMove(UINT nFlags, CPoint &point)
|
||||
{
|
||||
Vec Ofs(0,0,0);
|
||||
//float XOfs=0;
|
||||
//float YOfs=0;
|
||||
|
||||
Vec &ThisCam=GetCam();
|
||||
// check if active doc
|
||||
if (theApp.GetCurrent()!=ParentWindow->GetDocument()) return;
|
||||
|
@ -132,8 +134,8 @@ Vec &ThisCam=GetCam();
|
|||
RECT ThisRect;
|
||||
|
||||
ParentWindow->GetWindowRect(&ThisRect);
|
||||
XS=ThisCam.z*2;//*Layers[ActiveLayer]->GetLayerZPos();
|
||||
YS=ThisCam.z*2;//*Layers[ActiveLayer]->GetLayerZPos();
|
||||
XS=ThisCam.z*4;//*Layers[ActiveLayer]->GetLayerZPos();
|
||||
YS=ThisCam.z*4;//*Layers[ActiveLayer]->GetLayerZPos();
|
||||
XS/=((ThisRect.right-ThisRect.left));
|
||||
YS/=((ThisRect.bottom-ThisRect.top));
|
||||
|
||||
|
@ -144,10 +146,10 @@ Vec &ThisCam=GetCam();
|
|||
Ofs.x*=XS;
|
||||
Ofs.y*=YS;
|
||||
|
||||
TRACE2("Move %i %i \n",point.x,point.y);
|
||||
UpdateView(Ofs);
|
||||
}
|
||||
|
||||
// Mouse has moved, so need to redraw windows, to get CursorPos (And pos render)
|
||||
ParentWindow->Invalidate();
|
||||
|
||||
}
|
||||
|
||||
|
@ -176,7 +178,6 @@ CListBox *Dlg=(CListBox *)LayerBar->GetDlgItem(IDC_LAYERBAR_LIST);
|
|||
|
||||
ToolBar->GetToolBarCtrl().PressButton(ID_TOOLBAR_LAYERBAR,LayerViewFlag);
|
||||
Frm->ShowControlBar(LayerBar, LayerViewFlag, FALSE);
|
||||
// UpdateView();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -202,7 +203,6 @@ CToolBar *ToolBar=Frm->GetToolBar();
|
|||
/*****************************************************************************/
|
||||
GLint CCore::GetTile(int Bank,int TileNo)
|
||||
{
|
||||
TRACE1("%i\n",TileSet.size());
|
||||
return(TileSet[Bank].GetTile(TileNo));
|
||||
}
|
||||
/*****************************************************************************/
|
||||
|
@ -225,16 +225,21 @@ void CCore::UpdateAll()
|
|||
UpdateTileView(TileViewFlag);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::Redraw(BOOL f)
|
||||
{
|
||||
RenderFlag=f;
|
||||
if (RenderFlag)
|
||||
ParentWindow->Invalidate();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::UpdateView(Vec Ofs)
|
||||
{
|
||||
Vec &ThisCam=GetCam();
|
||||
|
||||
ThisCam=ThisCam+Ofs;
|
||||
Ofs.y=-Ofs.y;
|
||||
ThisCam+=Ofs;
|
||||
if (ThisCam.z>-1) ThisCam.z=-1;
|
||||
|
||||
ParentWindow->Invalidate();
|
||||
Redraw();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -14,16 +14,6 @@
|
|||
#include "TileSet.h"
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
enum MOUSE_MODE
|
||||
{
|
||||
MOUSE_MODE_NONE=0,
|
||||
MOUSE_MODE_LMB_EDIT,
|
||||
MOUSE_MODE_MMB_EDIT,
|
||||
MOUSE_MODE_RMB_EDIT,
|
||||
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
class CMapEditView;
|
||||
|
@ -67,12 +57,15 @@ public:
|
|||
void UpdateView(Vec Ofs=Vec(0,0,0));
|
||||
|
||||
Vec &GetCam();
|
||||
|
||||
void SetCursorPos(CPoint &Pos) {CursorPos=Pos;}
|
||||
CPoint &GetCursorPos() {return(CursorPos);}
|
||||
CMapEditView *GetParentWindow() {return(ParentWindow);}
|
||||
void Redraw(BOOL f=TRUE);
|
||||
|
||||
private:
|
||||
CMapEditView *ParentWindow;
|
||||
MOUSE_MODE MouseMode;
|
||||
CPoint CurrentMousePos,LastMousePos;
|
||||
CPoint CursorPos,LastCursorPos;
|
||||
Vec MapCam,TileCam;
|
||||
|
||||
CLayer *Layers[LAYER_TYPE_MAX];
|
||||
|
@ -81,6 +74,7 @@ private:
|
|||
std::vector<CTileSet> TileSet;
|
||||
CTexCache TexCache;
|
||||
|
||||
BOOL RenderFlag;
|
||||
BOOL TileViewFlag;
|
||||
BOOL LayerViewFlag;
|
||||
|
||||
|
|
|
@ -216,7 +216,7 @@ void CGLEnabledView::OnDraw(CDC* pDC)
|
|||
wglMakeCurrent(m_pCDC->GetSafeHdc(), m_hRC);
|
||||
|
||||
// clear background
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
// glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
// call the virtual drawing procedure (to be overridden by user)
|
||||
OnDrawGL();
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
#include <gl\gl.h>
|
||||
#include <gl\glu.h>
|
||||
#include <gl\glut.h>
|
||||
//#include "GLEnabledView.h"
|
||||
#include "GLEnabledView.h"
|
||||
|
||||
//#include "MapEditDoc.h"
|
||||
//#include "MapEditView.h"
|
||||
#include "MapEditDoc.h"
|
||||
#include "MapEditView.h"
|
||||
|
||||
#include "Core.h"
|
||||
#include "Layer.h"
|
||||
|
@ -43,9 +43,6 @@ int Height=Map.GetHeight();
|
|||
/*****************************************************************************/
|
||||
void CLayer::Render(Vec &MapPos,BOOL Is3d)
|
||||
{
|
||||
if (Is3d && CanRender3d())
|
||||
Render3d(MapPos);
|
||||
else
|
||||
Render2d(MapPos);
|
||||
}
|
||||
|
||||
|
@ -62,7 +59,6 @@ int Height=Map.GetHeight();
|
|||
glTranslatef(MapPos.x/XYDiv,MapPos.y/XYDiv,MapPos.z);
|
||||
|
||||
glBegin(GL_QUADS);
|
||||
SetTestColor();
|
||||
BuildGLQuad(-1,Width+1,-1,0,0); // Bottom
|
||||
BuildGLQuad(-1,Width+1,Height+1,Height,0); // Top
|
||||
BuildGLQuad(-1,0,Height,0,0); // Left
|
||||
|
@ -73,37 +69,133 @@ int Height=Map.GetHeight();
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
float asd=0;
|
||||
void CLayer::Render3d(Vec &MapPos)
|
||||
{
|
||||
float XYDiv=GetLayerZPosDiv();
|
||||
float X,Y;
|
||||
int XX=0;
|
||||
int YY=0;
|
||||
int MapW=Map.GetWidth();
|
||||
int MapH=Map.GetHeight();
|
||||
float StartX=MapPos.x/XYDiv;
|
||||
float StartY=MapPos.y/XYDiv;
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
Y=MapPos.y;
|
||||
|
||||
for (YY=0; YY<3; YY++)
|
||||
for (int YLoop=0; YLoop<MapH; YLoop++)
|
||||
{
|
||||
X=MapPos.x;
|
||||
for (XX=0; XX<3; XX++)
|
||||
for (int XLoop=0; XLoop<MapW; XLoop++)
|
||||
{
|
||||
glLoadIdentity();
|
||||
glTranslatef(X/XYDiv,Y/XYDiv,MapPos.z);
|
||||
// glRotatef(asd,0,1,0);
|
||||
// asd+=0.5;
|
||||
// glCallList(Core->GetTile(0,2));
|
||||
glCallList(Core->GetTile(0,XX+(YY*3)));
|
||||
sMapElem &ThisTile=Map.GetTile(XLoop,YLoop);
|
||||
|
||||
X+=1.0f;
|
||||
glLoadIdentity(); // Slow way, but good to go for the mo
|
||||
glTranslatef(StartX+XLoop,StartY-YLoop,MapPos.z);
|
||||
glCallList(Core->GetTile(ThisTile.Bank,ThisTile.Tile));
|
||||
}
|
||||
Y+=1.0f;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CLayer::RenderGrid(Vec &MapPos)
|
||||
{
|
||||
float XYDiv=GetLayerZPosDiv();
|
||||
int MapW=Map.GetWidth();
|
||||
int MapH=Map.GetHeight();
|
||||
float StartX=MapPos.x/XYDiv;
|
||||
float StartY=MapPos.y/XYDiv;
|
||||
float OverVal=0.5;
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(StartX,StartY,MapPos.z);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
|
||||
glBegin(GL_LINES);
|
||||
glNormal3f( 1,1,1);
|
||||
glColor3ub(255,255,255);
|
||||
|
||||
for (int YLoop=0; YLoop<MapH+1; YLoop++)
|
||||
{
|
||||
glVertex3f( 0-OverVal, -YLoop+1, 0);
|
||||
glVertex3f( MapW+OverVal, -YLoop+1, 0);
|
||||
}
|
||||
|
||||
for (int XLoop=0; XLoop<MapW+1; XLoop++)
|
||||
{
|
||||
glVertex3f( XLoop, 0+1+OverVal, 0);
|
||||
glVertex3f( XLoop, -MapH+1-OverVal, 0);
|
||||
}
|
||||
glEnd();
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CLayer::FindCursorPos(Vec &MapPos,CPoint &MousePos)
|
||||
{
|
||||
GLint Viewport[4];
|
||||
GLuint SelectBuffer[SELECT_BUFFER_SIZE];
|
||||
int HitCount;
|
||||
int TileID=0;
|
||||
CPoint &CursorPos=Core->GetCursorPos();
|
||||
|
||||
float XYDiv=GetLayerZPosDiv();
|
||||
int MapW=Map.GetWidth();
|
||||
int MapH=Map.GetHeight();
|
||||
float StartX=MapPos.x/XYDiv;
|
||||
float StartY=MapPos.y/XYDiv;
|
||||
|
||||
glGetIntegerv(GL_VIEWPORT, Viewport);
|
||||
glSelectBuffer (SELECT_BUFFER_SIZE, SelectBuffer );
|
||||
glRenderMode (GL_SELECT);
|
||||
|
||||
glInitNames();
|
||||
glPushName(-1);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
gluPickMatrix( MousePos.x ,(Viewport[3]-MousePos.y),5.0,5.0,Viewport);
|
||||
Core->GetParentWindow()->SetupPersMatrix();
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(StartX,StartY,MapPos.z);
|
||||
|
||||
|
||||
for (int YLoop=0; YLoop<MapH; YLoop++)
|
||||
{
|
||||
for (int XLoop=0; XLoop<MapW; XLoop++)
|
||||
{
|
||||
glLoadName (TileID);
|
||||
glBegin (GL_QUADS);
|
||||
BuildGLQuad(XLoop,XLoop+1,-YLoop,-YLoop+1,0);
|
||||
glEnd();
|
||||
TileID++;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
for (int H=0;H<HitCount;H++)
|
||||
{
|
||||
BestHit=Ptr; // Fakeness for the mo
|
||||
}
|
||||
|
||||
if (BestHit)
|
||||
{
|
||||
int HitID=BestHit[3];
|
||||
CursorPos.x=HitID%MapH;
|
||||
CursorPos.y=HitID/MapW;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -9,6 +9,13 @@
|
|||
#include "gl3d.h"
|
||||
#include "Map.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
enum LAYER_ENUMS
|
||||
{
|
||||
SELECT_BUFFER_SIZE=16,
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
enum LAYER_TYPE
|
||||
{
|
||||
LAYER_TYPE_BACK=0,
|
||||
|
@ -19,14 +26,6 @@ enum LAYER_TYPE
|
|||
LAYER_TYPE_MAX
|
||||
};
|
||||
|
||||
/*
|
||||
struct sMapElem
|
||||
{
|
||||
int Bank;
|
||||
int Tile;
|
||||
int Flags;
|
||||
};
|
||||
*/
|
||||
|
||||
/*****************************************************************************/
|
||||
class CCore;
|
||||
|
@ -46,19 +45,16 @@ virtual char *GetName()=0;
|
|||
virtual void Render(Vec &MapPos,BOOL Is3d);
|
||||
virtual void Render2d(Vec &MapPos);
|
||||
virtual void Render3d(Vec &MapPos);
|
||||
virtual void RenderGrid(Vec &MapPos);
|
||||
|
||||
virtual float GetLayerZPosDiv()=0;
|
||||
virtual BOOL CanRender3d()=0;
|
||||
virtual void SetTestColor()=0;
|
||||
|
||||
// Control
|
||||
|
||||
virtual void FindCursorPos(Vec &MapPos,CPoint &MousePos);
|
||||
|
||||
protected:
|
||||
// float Width,Height;
|
||||
|
||||
CCore *Core;
|
||||
// std::vector< std::vector<sMapElem> > Map;
|
||||
// sMapElem *Map;
|
||||
CMap Map;
|
||||
|
||||
};
|
||||
|
|
|
@ -14,6 +14,11 @@ static char THIS_FILE[] = __FILE__;
|
|||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMainFrame
|
||||
static UINT indicators[] =
|
||||
{
|
||||
ID_SEPARATOR, // status line indicator
|
||||
ID_INDICATOR_CURSORXY,
|
||||
};
|
||||
|
||||
IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
|
||||
|
||||
|
@ -21,15 +26,9 @@ BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
|
|||
//{{AFX_MSG_MAP(CMainFrame)
|
||||
ON_WM_CREATE()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
static UINT indicators[] =
|
||||
{
|
||||
ID_SEPARATOR, // status line indicator
|
||||
ID_INDICATOR_CAPS,
|
||||
ID_INDICATOR_NUM,
|
||||
ID_INDICATOR_SCRL,
|
||||
};
|
||||
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMainFrame construction/destruction
|
||||
|
@ -125,3 +124,5 @@ void CMainFrame::Dump(CDumpContext& dc) const
|
|||
// CMainFrame message handlers
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ public:
|
|||
CToolBar *GetToolBar() {return(&m_wndToolBar);}
|
||||
CDialogBar *GetLayerBar() {return(&m_wndLayerBar);}
|
||||
CDialogBar *GetTileBar() {return(&m_wndTileBar);}
|
||||
CStatusBar *GetStatusBar() {return(&m_wndStatusBar);}
|
||||
// Operations
|
||||
public:
|
||||
|
||||
|
@ -52,6 +53,13 @@ protected:
|
|||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
enum STATUS_BAR_ENUM
|
||||
{
|
||||
STATUS_BAR_SEP=0,
|
||||
STATUS_BAR_XPOS,
|
||||
STATUS_BAR_YPOS,
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
|
|
|
@ -4,6 +4,11 @@
|
|||
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "gl3d.h"
|
||||
#include <gl\gl.h>
|
||||
#include <gl\glu.h>
|
||||
#include <gl\glut.h>
|
||||
|
||||
#include "Map.h"
|
||||
|
||||
|
||||
|
@ -31,7 +36,6 @@ void CMap::SetSize(int Width,int Height)
|
|||
for (int Y=0;Y<Height;Y++)
|
||||
for (int X=0;X<Width;X++)
|
||||
{
|
||||
TRACE2("%i,%i\n",X,Y);
|
||||
Map[X][Y].Bank=0;
|
||||
Map[X][Y].Tile=(X+Y)%9;
|
||||
}
|
||||
|
|
|
@ -28,6 +28,8 @@ public:
|
|||
void SetWidth(int Width);
|
||||
void SetHeight(int Height);
|
||||
|
||||
sMapElem &GetTile(int X,int Y) {return(Map[X][Y]);}
|
||||
|
||||
protected:
|
||||
std::vector< std::vector<sMapElem> > Map;
|
||||
};
|
||||
|
|
|
@ -20,10 +20,10 @@ Class8=CMapEditView
|
|||
|
||||
ResourceCount=6
|
||||
Resource1=IDR_MAPEDITYPE (English (U.S.))
|
||||
Resource2=IDR_MAINFRAME (English (U.S.))
|
||||
Resource2=IDD_LAYERBAR (English (U.S.))
|
||||
Resource3=IDD_LAYERBAR1 (English (U.S.))
|
||||
Resource4=IDD_LAYERBAR (English (U.S.))
|
||||
Resource5=IDD_ABOUTBOX (English (U.S.))
|
||||
Resource4=IDD_ABOUTBOX (English (U.S.))
|
||||
Resource5=IDR_MAINFRAME (English (U.S.))
|
||||
Class9=CTileWindow
|
||||
Resource6=IDD_TILEBAR (English (U.S.))
|
||||
|
||||
|
|
|
@ -319,6 +319,7 @@ BEGIN
|
|||
ID_INDICATOR_SCRL "SCRL"
|
||||
ID_INDICATOR_OVR "OVR"
|
||||
ID_INDICATOR_REC "REC"
|
||||
ID_INDICATOR_CURSORXY "CursorXY"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
|
|
|
@ -37,6 +37,7 @@ BEGIN_MESSAGE_MAP(CMapEditView, CGLEnabledView)
|
|||
ON_WM_MOUSEMOVE()
|
||||
ON_COMMAND(ID_TOOLBAR_LAYERBAR, OnToolbarLayerbar)
|
||||
ON_COMMAND(ID_TOOLBAR_TILEPALETTE, OnToolbarTilepalette)
|
||||
ON_UPDATE_COMMAND_UI(ID_INDICATOR_CURSORXY, OnStatusCursorXY)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
@ -80,12 +81,35 @@ void CMapEditView::OnCreateGL()
|
|||
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
void CMapEditView::OnDrawGL()
|
||||
{
|
||||
Core.Render();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
void CMapEditView::OnSizeGL(int cx, int cy)
|
||||
{
|
||||
glViewport(0,0,cx,cy);
|
||||
// update the camera
|
||||
glPushMatrix();
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
SetupPersMatrix();
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPopMatrix();
|
||||
Core.Redraw();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
void CMapEditView::SetupPersMatrix()
|
||||
{
|
||||
gluPerspective(40.0,m_dAspectRatio,0.1f, 100.0f);
|
||||
glTranslatef(0.0f,0.0f,-4.f);
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMapEditView diagnostics
|
||||
|
||||
|
@ -126,6 +150,17 @@ void CMapEditView::UpdateAll()
|
|||
Core.UpdateAll();
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
void CMapEditView::OnStatusCursorXY(CCmdUI *pCmdUI)
|
||||
{
|
||||
CPoint &XY=Core.GetCursorPos();
|
||||
CString XYStr;
|
||||
pCmdUI->Enable();
|
||||
if (XY.x!=-1 && XY.y!=-1)
|
||||
XYStr.Format( "%d\t%d", XY.x,XY.y);
|
||||
pCmdUI->SetText(XYStr);
|
||||
}
|
||||
|
||||
/*********************************************************************************/
|
||||
/*********************************************************************************/
|
||||
/*********************************************************************************/
|
||||
|
@ -140,3 +175,5 @@ void CMapEditView::OnMouseMove(UINT nFlags, CPoint point) {Core.MouseMove(nFl
|
|||
|
||||
void CMapEditView::OnToolbarLayerbar() {Core.ToggleLayerView();}
|
||||
void CMapEditView::OnToolbarTilepalette() {Core.ToggleTileView();}
|
||||
|
||||
|
||||
|
|
|
@ -21,6 +21,8 @@ public:
|
|||
CMapEditDoc* GetDocument();
|
||||
void OnCreateGL();
|
||||
void OnDrawGL();
|
||||
void OnSizeGL(int cx, int cy);
|
||||
void SetupPersMatrix();
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
@ -57,6 +59,7 @@ protected:
|
|||
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
||||
afx_msg void OnToolbarLayerbar();
|
||||
afx_msg void OnToolbarTilepalette();
|
||||
afx_msg void OnStatusCursorXY(CCmdUI *pCmdUI);
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
|
|
@ -55,17 +55,8 @@ int ChildCount=ThisNode.GetPruneChildCount();
|
|||
CTile NewTile;
|
||||
NewTile.Load(Core,this,Scene,ThisNode.PruneChildList[Child]);
|
||||
Tile.push_back(NewTile);
|
||||
// AddTileToSet(Scene,ThisNode.PruneChildList[Child]);
|
||||
}
|
||||
|
||||
/*
|
||||
std::vector<GString> const &Tex=Scene.GetTexNames();
|
||||
|
||||
for (i=0;i<Tex.size();i++)
|
||||
{
|
||||
TRACE1("%s\n",Tex[i]);
|
||||
}
|
||||
*/
|
||||
|
||||
return(1);
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#define IDC_TILETOOLBAR_COMBO 1013
|
||||
#define ID_TOOLBAR_LAYERBAR 32773
|
||||
#define ID_TOOLBAR_TILEPALETTE 32774
|
||||
#define ID_INDICATOR_CURSORXY 59142
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
|
|
Loading…
Add table
Reference in a new issue