1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #if !defined(AFX_MAIN_FRAME_H__90D61263_7782_11D5_9CD4_0050DAC3A412__INCLUDED_)
18 #define AFX_MAIN_FRAME_H__90D61263_7782_11D5_9CD4_0050DAC3A412__INCLUDED_
22 #endif // _MSC_VER > 1000
23 // main_frame.h : header file
26 class CSceneDlgMouseListener
: public NLMISC::IEventListener
29 class CObjectViewer
*ObjViewerDlg
;
30 class CMainFrame
*SceneDlg
;
32 * Register the listener to the server.
34 void addToServer (NLMISC::CEventServer
& server
);
35 void releaseFromServer (NLMISC::CEventServer
& server
);
38 virtual void operator ()(const class NLMISC::CEvent
& event
) ;
42 /////////////////////////////////////////////////////////////////////////////
45 typedef void (*winProc
)(NL3D::IDriver
*drv
, HWND hWnd
, UINT message
, WPARAM wParam
, LPARAM lParam
);
47 class CMainFrame
: public CFrameWnd
49 //DECLARE_DYNCREATE(CMainFrame)
51 CMainFrame( CObjectViewer
*objView
, winProc
);
52 virtual ~CMainFrame();
57 enum TMouseMove
{MoveCamera
=0, MoveSceneRoot
, MoveElement
, MoveObjectLightTest
, MoveFX
, MoveFXUserMatrix
};
58 enum TCameraMode
{FirstMode
=0, ObjectMode
, CameraMode
};
63 winProc DriverWindowProc
;
64 CObjectViewer
*ObjView
;
68 bool AnimationSetWindow
;
69 bool MixerSlotsWindow
;
74 bool GlobalWindWindow
;
76 bool LightGroupWindow
;
77 bool ChooseFrameDelayWindow
;
78 bool ChooseBGColorWindow
;
79 bool ChooseSunColorWindow
;
80 bool SkeletonScaleWindow
;
82 TMouseMove MouseMoveType
;
88 NLMISC::CRGBA BgColor
;
90 float GlobalWindPower
;
96 void registerValue (bool update
=true);
98 bool isMoveCamera() const {return MouseMoveType
==MoveCamera
;}
99 bool isMoveSceneRoot() const {return MouseMoveType
==MoveSceneRoot
;}
100 bool isMoveElement() const {return MouseMoveType
==MoveElement
;}
101 bool isMoveFX() const {return MouseMoveType
==MoveFX
;}
102 bool isMoveFXUserMatrix() const {return MouseMoveType
==MoveFXUserMatrix
;}
103 bool isMoveObjectLightTest() const {return MouseMoveType
==MoveObjectLightTest
;}
109 // ClassWizard generated virtual function overrides
110 //{{AFX_VIRTUAL(CMainFrame)
112 virtual LRESULT
WindowProc(UINT message
, WPARAM wParam
, LPARAM lParam
);
118 // Generated message map functions
119 //{{AFX_MSG(CMainFrame)
120 afx_msg
void OnReloadTextures();
121 afx_msg
void OnClear();
122 afx_msg
void OnEditMoveelement();
123 afx_msg
void OnEditMoveFX();
124 afx_msg
void OnEditMoveFXUserMatrix();
125 afx_msg
void OnEditX();
126 afx_msg
void OnEditY();
127 afx_msg
void OnEditZ();
128 afx_msg
void OnEnableElementXrotate();
129 afx_msg
void OnEnableElementYrotate();
130 afx_msg
void OnEnableElementZrotate();
131 afx_msg
void OnFileExit();
132 afx_msg
void OnFileLoadconfig();
133 afx_msg
void OnFileOpen();
134 afx_msg
void OnFileSaveconfig();
135 afx_msg
void OnViewFirstpersonmode();
136 afx_msg
void OnViewCamera();
137 afx_msg
void OnViewObjectmode();
138 afx_msg
void OnResetCamera();
139 afx_msg
void OnViewSetbackground();
140 afx_msg
void OnViewSetmovespeed();
141 afx_msg
void OnActivateFog();
142 afx_msg
void OnSetupFog();
143 afx_msg
void OnWindowAnimation();
144 afx_msg
void OnWindowAnimationset();
145 afx_msg
void OnWindowMixersslots();
146 afx_msg
void OnWindowParticles();
147 afx_msg
void OnWindowDayNight();
148 afx_msg
void OnWindowWaterPool();
149 afx_msg
void OnWindowSoundAnim();
150 afx_msg
void OnWindowChooseFrameDelay();
151 afx_msg
void OnWindowChooseBGColor();
152 afx_msg
void OnWindowChooseSunColor();
153 afx_msg
void OnSetLightGroupFactor();
154 afx_msg
void OnShowSceneMatrix();
155 afx_msg
void OnShowOcclusionTestMeshs();
156 afx_msg
void OnShowFXMatrix();
157 afx_msg
void OnShowFXUserMatrix();
158 afx_msg
void OnUpdateShowSceneMatrix(CCmdUI
* pCmdUI
);
159 afx_msg
void OnUpdateShowFXMatrix(CCmdUI
* pCmdUI
);
160 afx_msg
void OnUpdateShowFXUserMatrix(CCmdUI
* pCmdUI
);
161 afx_msg
void OnUpdateShowOcclusionTestMeshs(CCmdUI
* pCmdUI
);
162 afx_msg
int OnCreate(LPCREATESTRUCT lpCreateStruct
);
163 afx_msg BOOL
OnEraseBkgnd(CDC
* pDC
);
164 afx_msg
void OnUpdateWindowAnimation(CCmdUI
* pCmdUI
);
165 afx_msg
void OnUpdateWindowAnimationset(CCmdUI
* pCmdUI
);
166 afx_msg
void OnUpdateWindowMixersslots(CCmdUI
* pCmdUI
);
167 afx_msg
void OnUpdateWindowParticles(CCmdUI
* pCmdUI
);
168 afx_msg
void OnUpdateWindowDayNight(CCmdUI
* pCmdUI
);
169 afx_msg
void OnUpdateWindowWaterPool(CCmdUI
* pCmdUI
);
170 afx_msg
void OnUpdateWindowSoundAnim(CCmdUI
* pCmdUI
);
171 afx_msg
void OnUpdateWindowChooseFrameDelay(CCmdUI
* pCmdUI
);
172 afx_msg
void OnUpdateWindowBGColor(CCmdUI
* pCmdUI
);
173 afx_msg
void OnUpdateWindowSunColor(CCmdUI
* pCmdUI
);
174 afx_msg
void OnUpdateViewObjectmode(CCmdUI
* pCmdUI
);
175 afx_msg
void OnUpdateViewFirstpersonmode(CCmdUI
* pCmdUI
);
176 afx_msg
void OnUpdateViewCamera(CCmdUI
* pCmdUI
);
177 afx_msg
void OnUpdateEditX(CCmdUI
* pCmdUI
);
178 afx_msg
void OnUpdateEditY(CCmdUI
* pCmdUI
);
179 afx_msg
void OnUpdateEditZ(CCmdUI
* pCmdUI
);
180 afx_msg
void OnUpdateEditMoveelement(CCmdUI
* pCmdUI
);
181 afx_msg
void OnUpdateEditMoveFX(CCmdUI
* pCmdUI
);
182 afx_msg
void OnUpdateEditMoveFXUserMatrix(CCmdUI
* pCmdUI
);
183 afx_msg
void OnUpdateWindowLightGroup(CCmdUI
* pCmdUI
);
184 afx_msg
void OnHelpAboutobjectviewer();
185 afx_msg
void OnRemoveAllInstancesFromScene();
186 afx_msg
void OnActivateTextureSet(UINT nID
);
187 afx_msg
void OnShuffleTextureSet();
188 afx_msg
void OnWindowVegetable();
189 afx_msg
void OnUpdateWindowVegetable(CCmdUI
* pCmdUI
);
190 afx_msg
void OnWindowGlobalwind();
191 afx_msg
void OnUpdateWindowGlobalwind(CCmdUI
* pCmdUI
);
192 afx_msg
void OnEditMoveObjectLightTest();
193 afx_msg
void OnUpdateEditMoveObjectLightTest(CCmdUI
* pCmdUI
);
194 afx_msg
void OnEditMovecamera();
195 afx_msg
void OnUpdateEditMovecamera(CCmdUI
* pCmdUI
);
196 afx_msg
void OnEditMovescene();
197 afx_msg
void OnUpdateEditMovescene(CCmdUI
* pCmdUI
);
198 afx_msg
void OnViewResetSceneRoot();
199 afx_msg
void OnViewResetFXRoot();
200 afx_msg
void OnViewResetFXUserMatrix();
201 afx_msg
void OnViewSetSceneRotation();
202 afx_msg
void OnShootScene();
203 afx_msg
void OnWindowSkeletonScale();
204 afx_msg
void OnUpdateWindowSkeletonScale(CCmdUI
* pCmdUI
);
205 afx_msg
void OnWindowTuneMRM();
206 afx_msg
void OnUpdateWindowTuneMRM(CCmdUI
* pCmdUI
);
207 afx_msg
void OnSnapShotTool();
209 afx_msg
void OnSceneCamera(UINT id
);
210 afx_msg
void OnUpdateSceneCamera(CCmdUI
* pCmdUI
);
211 DECLARE_MESSAGE_MAP()
213 CSceneDlgMouseListener _RightButtonMouseListener
;
215 // The default behaviour of CFrameWnd::PostNcDestroy() is to call 'delete this'. We dont want that behaviour, we want the object viewer to call this
216 virtual void PostNcDestroy()
222 float _LastSceneRotX
;
223 float _LastSceneRotY
;
224 float _LastSceneRotZ
;
227 /////////////////////////////////////////////////////////////////////////////
229 //{{AFX_INSERT_LOCATION}}
230 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
232 #endif // !defined(AFX_MAIN_FRAME_H__90D61263_7782_11D5_9CD4_0050DAC3A412__INCLUDED_)