This commit is contained in:
parent
5ea7baa201
commit
fcf5f61083
12 changed files with 212 additions and 151 deletions
|
@ -13,6 +13,7 @@
|
|||
#include "MapEdit.h"
|
||||
#include "MapEditDoc.h"
|
||||
#include "MapEditView.h"
|
||||
#include "MainFrm.h"
|
||||
|
||||
#include "Core.h"
|
||||
#include "Layer.h"
|
||||
|
@ -48,9 +49,9 @@ void CCore::Init(CMapEditView *Wnd)
|
|||
{
|
||||
ParentWindow=Wnd;
|
||||
ActiveLayer=0;
|
||||
MapPos.x=MapPos.y=MapPos.z=0;
|
||||
CamPos.x=CamPos.y=CamPos.z=0;
|
||||
UpdateView(0,0,0);
|
||||
CTileSet NewSet("c:/temp/1/test.gin",this);
|
||||
CTileSet NewSet("c:/temp/2/test.gin",this);
|
||||
TileSet.push_back(NewSet);
|
||||
}
|
||||
|
||||
|
@ -61,24 +62,30 @@ void CCore::Init(CMapEditView *Wnd)
|
|||
/*****************************************************************************/
|
||||
void CCore::Render()
|
||||
{
|
||||
|
||||
for (int i=0;i<LAYER_TYPE_MAX;i++)
|
||||
// theApp.SetTileView(TRUE);
|
||||
if (GetTileView())
|
||||
{
|
||||
if (i==LAYER_TYPE_ACTION)
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
Layers[i]->Render(MapPos,Test3dFlag);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
}
|
||||
ParentWindow->Invalidate();
|
||||
else
|
||||
{
|
||||
for (int i=0;i<LAYER_TYPE_MAX;i++)
|
||||
{
|
||||
if (i==LAYER_TYPE_ACTION)
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
Layers[i]->Render(CamPos,Test3dFlag);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
}
|
||||
}
|
||||
// ParentWindow->Invalidate();
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::UpdateView(float XOfs,float YOfs,float ZOfs)
|
||||
{
|
||||
MapPos=MapPos+Vec(XOfs,YOfs,ZOfs);
|
||||
if (MapPos.z>-1) MapPos.z=-1;
|
||||
CamPos=CamPos+Vec(XOfs,YOfs,ZOfs);
|
||||
if (CamPos.z>-1) CamPos.z=-1;
|
||||
|
||||
ParentWindow->Invalidate();
|
||||
}
|
||||
|
@ -130,8 +137,8 @@ float YOfs=0;
|
|||
RECT ThisRect;
|
||||
|
||||
ParentWindow->GetWindowRect(&ThisRect);
|
||||
XS=MapPos.z*2;//*Layers[ActiveLayer]->GetLayerZPos();
|
||||
YS=MapPos.z*2;//*Layers[ActiveLayer]->GetLayerZPos();
|
||||
XS=CamPos.z*2;//*Layers[ActiveLayer]->GetLayerZPos();
|
||||
YS=CamPos.z*2;//*Layers[ActiveLayer]->GetLayerZPos();
|
||||
XS/=((ThisRect.right-ThisRect.left));
|
||||
YS/=((ThisRect.bottom-ThisRect.top));
|
||||
|
||||
|
@ -171,5 +178,44 @@ CLayer *CCore::LayerGet(int i)
|
|||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
void CCore::SetTileView(BOOL f)
|
||||
{
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CToolBar *ToolBar=Frm->GetToolBar();
|
||||
|
||||
TileViewFlag=f;
|
||||
ToolBar->GetToolBarCtrl().PressButton(ID_TOOLBAR_TILEPALETTE,TileViewFlag);
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::ToggleTileView()
|
||||
{
|
||||
SetTileView(!TileViewFlag);
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
void CCore::SetLayerPalette(BOOL f)
|
||||
{
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CToolBar *ToolBar=Frm->GetToolBar();
|
||||
CDialogBar *LayerPalette=Frm->GetLayerBar();
|
||||
|
||||
LayerPaletteFlag=f;
|
||||
ToolBar->GetToolBarCtrl().PressButton(ID_TOOLBAR_LAYERBAR,LayerPaletteFlag);
|
||||
Frm->ShowControlBar(LayerPalette, LayerPaletteFlag, FALSE);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CCore::ToggleLayerPalette()
|
||||
{
|
||||
SetLayerPalette(!LayerPaletteFlag);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -33,34 +33,42 @@ public:
|
|||
CCore();
|
||||
~CCore();
|
||||
// Control
|
||||
void LButtonControl(UINT nFlags, CPoint &point,BOOL DownFlag);
|
||||
void MButtonControl(UINT nFlags, CPoint &point,BOOL DownFlag);
|
||||
void RButtonControl(UINT nFlags, CPoint &point,BOOL DownFlag);
|
||||
void MouseWheel(UINT nFlags, short zDelta, CPoint &pt);
|
||||
void MouseMove(UINT nFlags, CPoint &point);
|
||||
void LButtonControl(UINT nFlags, CPoint &point,BOOL DownFlag);
|
||||
void MButtonControl(UINT nFlags, CPoint &point,BOOL DownFlag);
|
||||
void RButtonControl(UINT nFlags, CPoint &point,BOOL DownFlag);
|
||||
void MouseWheel(UINT nFlags, short zDelta, CPoint &pt);
|
||||
void MouseMove(UINT nFlags, CPoint &point);
|
||||
|
||||
// Blah
|
||||
void Init(CMapEditView *Wnd);
|
||||
void Render();
|
||||
void UpdateView(float XOfs,float YOfs,float ZOfs);
|
||||
void SetMouseMode(MOUSE_MODE CurrentMode,MOUSE_MODE NewMode);
|
||||
void Init(CMapEditView *Wnd);
|
||||
void Render();
|
||||
void UpdateView(float XOfs,float YOfs,float ZOfs);
|
||||
void SetMouseMode(MOUSE_MODE CurrentMode,MOUSE_MODE NewMode);
|
||||
|
||||
Vec &GetMapPos() {return(MapPos);}
|
||||
Vec &GetCamPos() {return(CamPos);}
|
||||
|
||||
void SetTileView(BOOL f);
|
||||
BOOL GetTileView() {return(TileViewFlag);}
|
||||
void ToggleTileView();
|
||||
|
||||
void SetLayerPalette(BOOL f);
|
||||
BOOL GetLayerPalette() {return(LayerPaletteFlag);}
|
||||
void ToggleLayerPalette();
|
||||
|
||||
// Layers
|
||||
void LayerSetActive(int Layer);
|
||||
int LayerGetActive();
|
||||
CLayer *LayerGet(int i);
|
||||
void LayerSetActive(int Layer);
|
||||
int LayerGetActive();
|
||||
CLayer *LayerGet(int i);
|
||||
|
||||
// Tex Cache
|
||||
CTexCache &GetTexCache() {return(TexCache);}
|
||||
CTexCache &GetTexCache() {return(TexCache);}
|
||||
|
||||
|
||||
private:
|
||||
CMapEditView *ParentWindow;
|
||||
MOUSE_MODE MouseMode;
|
||||
CPoint CurrentMousePos,LastMousePos;
|
||||
Vec MapPos;
|
||||
Vec CamPos;
|
||||
|
||||
CLayer *Layers[LAYER_TYPE_MAX];
|
||||
int ActiveLayer;
|
||||
|
@ -68,6 +76,9 @@ private:
|
|||
std::vector<CTileSet> TileSet;
|
||||
CTexCache TexCache;
|
||||
|
||||
BOOL TileViewFlag;
|
||||
BOOL LayerPaletteFlag;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -665,7 +665,7 @@ void CGLEnabledView::OnSizeGL(int cx, int cy)
|
|||
glPushMatrix();
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
gluPerspective(40.0,m_dAspectRatio,0.1f, 10.0f);
|
||||
gluPerspective(40.0,m_dAspectRatio,0.1f, 100.0f);
|
||||
glTranslatef(0.0f,0.0f,-4.f);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPopMatrix();
|
||||
|
|
|
@ -16,44 +16,6 @@
|
|||
#include "Layer.h"
|
||||
#include "Utils.h"
|
||||
|
||||
/*
|
||||
Core Functionality
|
||||
|
||||
Layers
|
||||
Gfx Layers
|
||||
Background Layer
|
||||
Mid Layer
|
||||
Action Layer
|
||||
Fore Layer
|
||||
Tile Bank
|
||||
Tile Set
|
||||
Core
|
||||
GUI
|
||||
|
||||
Map Data
|
||||
Core
|
||||
|
||||
Project
|
||||
Load Project
|
||||
Save Project
|
||||
|
||||
Output
|
||||
PSX Data
|
||||
Map Data
|
||||
Level Data
|
||||
Tile Data
|
||||
Tile Blocks
|
||||
Textures
|
||||
AGB Data
|
||||
Map Data
|
||||
Level Data
|
||||
Tile Data
|
||||
Textures
|
||||
|
||||
Edit Functions
|
||||
Paint
|
||||
Tile Mirror
|
||||
*/
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
|
@ -70,19 +32,10 @@ CLayer::~CLayer()
|
|||
/*****************************************************************************/
|
||||
void CLayer::Render(Vec &MapPos,BOOL Is3d)
|
||||
{
|
||||
|
||||
/*
|
||||
if (Is3d && CanRender3d())
|
||||
Render3d(MapPos);
|
||||
else
|
||||
Render2d(MapPos);
|
||||
*/
|
||||
Vec ZeroPos(0,0,0);
|
||||
if (Is3d && CanRender3d())
|
||||
Render3d(ZeroPos);
|
||||
else
|
||||
Render2d(ZeroPos);
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -120,7 +73,6 @@ float XYDiv=GetLayerZPosDiv();
|
|||
asd+=0.5;
|
||||
|
||||
glCallList(TestTile);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "stdafx.h"
|
||||
#include "MapEdit.h"
|
||||
|
||||
#include "MainFrm.h"
|
||||
#include "MainFrm.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
|
@ -20,8 +20,6 @@ IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
|
|||
BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
|
||||
//{{AFX_MSG_MAP(CMainFrame)
|
||||
ON_WM_CREATE()
|
||||
ON_COMMAND(ID_TOOLBAR_LAYERBAR, OnToolbarLayerbar)
|
||||
ON_COMMAND(ID_TOOLBAR_TILEPALETTE, OnToolbarTilepalette)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
@ -50,25 +48,39 @@ CMainFrame::~CMainFrame()
|
|||
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
|
||||
{
|
||||
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1) return -1;
|
||||
// ToolBat
|
||||
EnableDocking(CBRS_ALIGN_ANY);
|
||||
|
||||
// ToolBar
|
||||
|
||||
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
|
||||
{
|
||||
TRACE0("Failed to create toolbar\n");
|
||||
return -1; // fail to create
|
||||
}
|
||||
m_wndToolBar.SetWindowText("ToolBar");
|
||||
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
|
||||
DockControlBar(&m_wndToolBar);
|
||||
|
||||
|
||||
// TileBar
|
||||
if (!m_wndTileBar.Create(this,IDD_TILEBAR,(CBRS_TOP | CBRS_SIZE_DYNAMIC | CBRS_FLOAT_MULTI ),IDD_TILEBAR))
|
||||
{
|
||||
TRACE0("Failed to create ToolBar\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
m_wndTileBar.EnableDocking( CBRS_ALIGN_TOP);
|
||||
m_wndTileBar.SetWindowText("TileBar");
|
||||
DockControlBar(&m_wndTileBar);
|
||||
|
||||
|
||||
// Status Bar
|
||||
if (!m_wndStatusBar.Create(this) || !m_wndStatusBar.SetIndicators(indicators,sizeof(indicators)/sizeof(UINT)))
|
||||
{
|
||||
TRACE0("Failed to create status bar\n");
|
||||
return -1; // fail to create
|
||||
}
|
||||
|
||||
EnableDocking(CBRS_ALIGN_ANY);
|
||||
|
||||
m_wndToolBar.SetWindowText("ToolBar");
|
||||
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
|
||||
DockControlBar(&m_wndToolBar);
|
||||
|
||||
// LayerBar
|
||||
if (!m_wndLayerBar.Create(this,IDD_LAYERBAR,(CBRS_LEFT | CBRS_SIZE_DYNAMIC),IDD_LAYERBAR))
|
||||
{
|
||||
|
@ -79,10 +91,7 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
|
|||
m_wndLayerBar.EnableDocking( CBRS_ALIGN_ANY);
|
||||
m_wndLayerBar.SetWindowText("Layer");
|
||||
DockControlBar(&m_wndLayerBar);
|
||||
|
||||
|
||||
// FloatControlBar(&m_wndLayerBar,CPoint(256,256));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -114,23 +123,5 @@ void CMainFrame::Dump(CDumpContext& dc) const
|
|||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMainFrame message handlers
|
||||
/***************************************************************************/
|
||||
/***************************************************************************/
|
||||
/***************************************************************************/
|
||||
/*** Layer Bar Stuff ***/
|
||||
|
||||
void CMainFrame::OnToolbarLayerbar()
|
||||
{
|
||||
int State=m_wndLayerBar.IsWindowVisible();
|
||||
|
||||
ShowControlBar(&m_wndLayerBar, !State, FALSE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
void CMainFrame::OnToolbarTilepalette()
|
||||
{
|
||||
// TODO: Add your command handler code here
|
||||
|
||||
}
|
||||
|
|
|
@ -10,8 +10,6 @@
|
|||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//#include "LayerBar.h"
|
||||
|
||||
class CMainFrame : public CMDIFrameWnd
|
||||
{
|
||||
DECLARE_DYNAMIC(CMainFrame)
|
||||
|
@ -20,7 +18,9 @@ public:
|
|||
|
||||
// Attributes
|
||||
public:
|
||||
CToolBar *GetToolBar() {return(&m_wndToolBar);}
|
||||
CDialogBar *GetLayerBar() {return(&m_wndLayerBar);}
|
||||
CDialogBar *GetTileBar() {return(&m_wndTileBar);}
|
||||
// Operations
|
||||
public:
|
||||
|
||||
|
@ -42,14 +42,12 @@ protected: // control bar embedded members
|
|||
CStatusBar m_wndStatusBar;
|
||||
CToolBar m_wndToolBar;
|
||||
CDialogBar m_wndLayerBar;
|
||||
|
||||
CDialogBar m_wndTileBar;
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CMainFrame)
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnToolbarLayerbar();
|
||||
afx_msg void OnToolbarTilepalette();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
[General Info]
|
||||
Version=1
|
||||
LastClass=CMapEditView
|
||||
LastTemplate=CDialog
|
||||
LastTemplate=CFrameWnd
|
||||
NewFileInclude1=#include "stdafx.h"
|
||||
NewFileInclude2=#include "mapedit.h"
|
||||
LastPage=0
|
||||
|
||||
ClassCount=8
|
||||
ClassCount=9
|
||||
Class1=CChildFrame
|
||||
Class2=CGLEnabledView
|
||||
Class3=CListBoxEx
|
||||
|
@ -18,11 +18,14 @@ Class6=CAboutDlg
|
|||
Class7=CMapEditDoc
|
||||
Class8=CMapEditView
|
||||
|
||||
ResourceCount=4
|
||||
ResourceCount=6
|
||||
Resource1=IDR_MAPEDITYPE (English (U.S.))
|
||||
Resource2=IDD_ABOUTBOX (English (U.S.))
|
||||
Resource3=IDD_LAYERBAR (English (U.S.))
|
||||
Resource4=IDR_MAINFRAME (English (U.S.))
|
||||
Resource2=IDR_MAINFRAME (English (U.S.))
|
||||
Resource3=IDD_LAYERBAR1 (English (U.S.))
|
||||
Resource4=IDD_LAYERBAR (English (U.S.))
|
||||
Resource5=IDD_ABOUTBOX (English (U.S.))
|
||||
Class9=CTileWindow
|
||||
Resource6=IDD_TILEBAR (English (U.S.))
|
||||
|
||||
[CLS:CChildFrame]
|
||||
Type=0
|
||||
|
@ -51,6 +54,8 @@ BaseClass=CMDIFrameWnd
|
|||
HeaderFile=MainFrm.h
|
||||
ImplementationFile=MainFrm.cpp
|
||||
LastObject=CMainFrame
|
||||
Filter=M
|
||||
VirtualFilter=fWC
|
||||
|
||||
[CLS:CMapEditApp]
|
||||
Type=0
|
||||
|
@ -78,7 +83,7 @@ Type=0
|
|||
BaseClass=CGLEnabledView
|
||||
HeaderFile=MapEditView.h
|
||||
ImplementationFile=MapEditView.cpp
|
||||
LastObject=CMapEditView
|
||||
LastObject=ID_TOOLBAR_LAYERBAR
|
||||
Filter=C
|
||||
VirtualFilter=VWC
|
||||
|
||||
|
@ -174,3 +179,24 @@ Class=?
|
|||
ControlCount=1
|
||||
Control1=IDC_LAYERBAR_LIST,listbox,1352728833
|
||||
|
||||
[DLG:IDD_TILEBAR (English (U.S.))]
|
||||
Type=1
|
||||
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=?
|
||||
ControlCount=1
|
||||
Control1=IDC_LAYERBAR_LIST,listbox,1352728833
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ public:
|
|||
{
|
||||
return(CurrentDoc);
|
||||
}
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CMapEditApp)
|
||||
|
|
|
@ -179,12 +179,21 @@ END
|
|||
IDD_LAYERBAR DIALOGEX 0, 0, 92, 92
|
||||
STYLE DS_MODALFRAME | WS_CHILD
|
||||
EXSTYLE WS_EX_TOOLWINDOW
|
||||
FONT 8, "MS Sans Serif"
|
||||
FONT 8, "MS Sans Serif", 0, 0, 0x1
|
||||
BEGIN
|
||||
LISTBOX IDC_LAYERBAR_LIST,5,5,80,85,LBS_NOINTEGRALHEIGHT |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
END
|
||||
|
||||
IDD_TILEBAR DIALOGEX 0, 0, 186, 12
|
||||
STYLE WS_CHILD
|
||||
EXSTYLE WS_EX_TOOLWINDOW
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
COMBOBOX IDC_TILETOOLBAR_COMBO,0,0,170,14,CBS_DROPDOWNLIST |
|
||||
CBS_SORT | WS_VSCROLL | WS_TABSTOP
|
||||
END
|
||||
|
||||
|
||||
#ifndef _MAC
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -252,10 +261,39 @@ BEGIN
|
|||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 85
|
||||
END
|
||||
|
||||
IDD_TILEBAR, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 179
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 5
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog Info
|
||||
//
|
||||
|
||||
IDD_TILEBAR DLGINIT
|
||||
BEGIN
|
||||
IDC_TILETOOLBAR_COMBO, 0x403, 2, 0
|
||||
0x0031,
|
||||
IDC_TILETOOLBAR_COMBO, 0x403, 2, 0
|
||||
0x0032,
|
||||
IDC_TILETOOLBAR_COMBO, 0x403, 2, 0
|
||||
0x0033,
|
||||
IDC_TILETOOLBAR_COMBO, 0x403, 2, 0
|
||||
0x0034,
|
||||
IDC_TILETOOLBAR_COMBO, 0x403, 2, 0
|
||||
0x0035,
|
||||
0
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
|
|
|
@ -35,6 +35,8 @@ BEGIN_MESSAGE_MAP(CMapEditView, CGLEnabledView)
|
|||
ON_WM_RBUTTONDOWN()
|
||||
ON_WM_RBUTTONUP()
|
||||
ON_WM_MOUSEMOVE()
|
||||
ON_COMMAND(ID_TOOLBAR_LAYERBAR, OnToolbarLayerbar)
|
||||
ON_COMMAND(ID_TOOLBAR_TILEPALETTE, OnToolbarTilepalette)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
@ -44,7 +46,7 @@ END_MESSAGE_MAP()
|
|||
CMapEditView::CMapEditView()
|
||||
{
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
LayerBar=Frm->GetLayerBar();
|
||||
CDialogBar *LayerBar=Frm->GetLayerBar();
|
||||
|
||||
}
|
||||
|
||||
|
@ -69,7 +71,6 @@ void CMapEditView::OnCreateGL()
|
|||
glClearDepth(1.0f); // Depth Buffer Setup
|
||||
glEnable(GL_DEPTH_TEST); // Enables Depth Testing
|
||||
glDepthFunc(GL_LEQUAL); // The Type Of Depth Testing To Do
|
||||
// glDepthRange(-100000,+100000);
|
||||
glEnable(GL_LIGHT0); // Quick And Dirty Lighting (Assumes Light0 Is SetUp)
|
||||
glEnable(GL_LIGHTING); // Enable Lighting
|
||||
glEnable(GL_COLOR_MATERIAL); // Enable Material Coloring
|
||||
|
@ -79,27 +80,6 @@ void CMapEditView::OnCreateGL()
|
|||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
void CMapEditView::OnSizeGL(int cx, int cy)
|
||||
{
|
||||
// set correspondence between window and OGL viewport
|
||||
glViewport(0,0,cx,cy);
|
||||
|
||||
}
|
||||
|
||||
void CMapEditView::UpdateCamera()
|
||||
{
|
||||
//Vec &CamPos=Core
|
||||
// update the camera
|
||||
glPushMatrix();
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
gluPerspective(40.0,m_dAspectRatio,0.1f, 10.0f);
|
||||
glTranslatef(0.0f,0.0f,-4.f);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPopMatrix();
|
||||
|
||||
}
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
void CMapEditView::OnDrawGL()
|
||||
{
|
||||
|
@ -150,6 +130,8 @@ void CMapEditView::UpdateAll()
|
|||
/*********************************************************************************/
|
||||
void CMapEditView::UpdateLayerBar()
|
||||
{
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CDialogBar *LayerBar=Frm->GetLayerBar();
|
||||
CListBox *Dlg=(CListBox *)LayerBar->GetDlgItem(IDC_LAYERBAR_LIST);
|
||||
int CurSel=Dlg->GetCurSel();
|
||||
|
||||
|
@ -167,6 +149,8 @@ int CurSel=Dlg->GetCurSel();
|
|||
/*********************************************************************************/
|
||||
int CMapEditView::GetLayerCurSel()
|
||||
{
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CDialogBar *LayerBar=Frm->GetLayerBar();
|
||||
CListBox *Dlg=(CListBox *)LayerBar->GetDlgItem(IDC_LAYERBAR_LIST);
|
||||
return(Dlg->GetCurSel());
|
||||
|
||||
|
@ -175,6 +159,8 @@ CListBox *Dlg=(CListBox *)LayerBar->GetDlgItem(IDC_LAYERBAR_LIST);
|
|||
/*********************************************************************************/
|
||||
int CMapEditView::GetLayerCount()
|
||||
{
|
||||
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
|
||||
CDialogBar *LayerBar=Frm->GetLayerBar();
|
||||
CListBox *Dlg=(CListBox *)LayerBar->GetDlgItem(IDC_LAYERBAR_LIST);
|
||||
return(Dlg->GetCount());
|
||||
|
||||
|
@ -193,3 +179,13 @@ void CMapEditView::OnRButtonUp(UINT nFlags, CPoint point) {Core.RButtonContro
|
|||
void CMapEditView::OnMouseMove(UINT nFlags, CPoint point) {Core.MouseMove(nFlags, point);}
|
||||
|
||||
|
||||
|
||||
void CMapEditView::OnToolbarLayerbar()
|
||||
{
|
||||
Core.ToggleLayerPalette();
|
||||
}
|
||||
|
||||
void CMapEditView::OnToolbarTilepalette()
|
||||
{
|
||||
Core.ToggleTileView();
|
||||
}
|
||||
|
|
|
@ -21,8 +21,6 @@ public:
|
|||
CMapEditDoc* GetDocument();
|
||||
void OnCreateGL();
|
||||
void OnDrawGL();
|
||||
void OnSizeGL(int cx, int cy);
|
||||
void UpdateCamera();
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
@ -45,9 +43,8 @@ public:
|
|||
int GetLayerCount();
|
||||
|
||||
protected:
|
||||
void VideoMode(ColorsNumber &c,ZAccuracy &z,BOOL &dbuf);
|
||||
void VideoMode(ColorsNumber &c,ZAccuracy &z,BOOL &dbuf);
|
||||
CCore Core;
|
||||
CDialogBar *LayerBar;
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
|
@ -61,6 +58,8 @@ protected:
|
|||
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
||||
afx_msg void OnToolbarLayerbar();
|
||||
afx_msg void OnToolbarTilepalette();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
//
|
||||
#define IDD_ABOUTBOX 100
|
||||
#define IDD_LAYERBAR 103
|
||||
#define IDD_TILETOOLBAR 104
|
||||
#define IDD_TILEBAR 104
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDR_MAPEDITYPE 129
|
||||
#define IDC_LAYERBAR_NEW 1000
|
||||
|
@ -11,6 +13,7 @@
|
|||
#define IDC_LAYERBAR_UP 1002
|
||||
#define IDC_LAYERBAR_DOWN 1003
|
||||
#define IDC_LAYERBAR_LIST 1011
|
||||
#define IDC_TILETOOLBAR_COMBO 1013
|
||||
#define ID_TOOLBAR_LAYERBAR 32773
|
||||
#define ID_TOOLBAR_TILEPALETTE 32774
|
||||
|
||||
|
@ -19,9 +22,9 @@
|
|||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_3D_CONTROLS 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 139
|
||||
#define _APS_NEXT_RESOURCE_VALUE 141
|
||||
#define _APS_NEXT_COMMAND_VALUE 32775
|
||||
#define _APS_NEXT_CONTROL_VALUE 1012
|
||||
#define _APS_NEXT_CONTROL_VALUE 1015
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue