Use configured resolution for login/outgame/ingame
[ryzomcore.git] / ryzom / tools / leveldesign / master / master.cpp
blob6d2b17d925be11ef405ac1d84ba961b0036ee367
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
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.
8 //
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 // master.cpp : Defines the class behaviors for the application.
20 #include "stdafx.h"
21 #include "master.h"
23 #include "MainFrm.h"
25 #ifdef _DEBUG
26 #undef THIS_FILE
27 static char THIS_FILE[] = __FILE__;
28 #endif
30 #ifdef NL_NEW
31 #undef new
32 #endif
34 /////////////////////////////////////////////////////////////////////////////
35 // CMasterApp
37 BEGIN_MESSAGE_MAP(CMasterApp, CWinApp)
38 //{{AFX_MSG_MAP(CMasterApp)
39 ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
40 // NOTE - the ClassWizard will add and remove mapping macros here.
41 // DO NOT EDIT what you see in these blocks of generated code!
42 //}}AFX_MSG_MAP
43 // Standard file based document commands
44 ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
45 ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
46 END_MESSAGE_MAP()
48 /////////////////////////////////////////////////////////////////////////////
49 // CMasterApp construction
51 CMasterApp::CMasterApp()
53 // TODO: add construction code here,
54 // Place all significant initialization in InitInstance
55 m_pMainWnd = NULL;
58 /////////////////////////////////////////////////////////////////////////////
59 // The one and only CMasterApp object
61 CMasterApp theApp;
63 /////////////////////////////////////////////////////////////////////////////
64 // CMasterApp initialization
66 BOOL CMasterApp::InitInstance()
68 AfxEnableControlContainer();
70 // Standard initialization
71 // If you are not using these features and wish to reduce the size
72 // of your final executable, you should remove from the following
73 // the specific initialization routines you do not need.
75 #ifdef _AFXDLL
76 Enable3dControls(); // Call this when using MFC in a shared DLL
77 #else
78 Enable3dControlsStatic(); // Call this when linking to MFC statically
79 #endif
81 // Change the registry key under which our settings are stored.
82 // TODO: You should modify this string to be something appropriate
83 // such as the name of your company or organization.
84 SetRegistryKey(_T("Local AppWizard-Generated Applications"));
86 LoadStdProfileSettings(); // Load standard INI file options (including MRU)
88 CMainFrame *pMF = new CMainFrame();
89 pMF->LoadFrame(IDR_MAINFRAME);
91 m_pMainWnd = pMF;
92 // Parse command line for standard shell commands, DDE, file open
93 CCommandLineInfo cmdInfo;
94 ParseCommandLine(cmdInfo);
96 // Dispatch commands specified on the command line
97 if (!ProcessShellCommand(cmdInfo))
98 return FALSE;
100 // The one and only window has been initialized, so show and update it.
101 m_pMainWnd->ShowWindow(SW_SHOW);
102 m_pMainWnd->UpdateWindow();
104 return TRUE;
107 BOOL CMasterApp::PreTranslateMessage (MSG*pMsg)
109 if (m_pMainWnd != NULL)
110 return ((CMainFrame*)m_pMainWnd)->PreTranslateMessage (pMsg);
111 return FALSE;
114 /////////////////////////////////////////////////////////////////////////////
115 // CAboutDlg dialog used for App About
117 class CAboutDlg : public CDialog
119 public:
120 CAboutDlg();
122 // Dialog Data
123 //{{AFX_DATA(CAboutDlg)
124 enum { IDD = IDD_ABOUTBOX };
125 //}}AFX_DATA
127 // ClassWizard generated virtual function overrides
128 //{{AFX_VIRTUAL(CAboutDlg)
129 protected:
130 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
131 //}}AFX_VIRTUAL
133 // Implementation
134 protected:
135 //{{AFX_MSG(CAboutDlg)
136 // No message handlers
137 //}}AFX_MSG
138 DECLARE_MESSAGE_MAP()
141 CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
143 //{{AFX_DATA_INIT(CAboutDlg)
144 //}}AFX_DATA_INIT
147 void CAboutDlg::DoDataExchange(CDataExchange* pDX)
149 CDialog::DoDataExchange(pDX);
150 //{{AFX_DATA_MAP(CAboutDlg)
151 //}}AFX_DATA_MAP
154 BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
155 //{{AFX_MSG_MAP(CAboutDlg)
156 // No message handlers
157 //}}AFX_MSG_MAP
158 END_MESSAGE_MAP()
160 // App command to run the dialog
161 void CMasterApp::OnAppAbout()
163 CAboutDlg aboutDlg;
164 aboutDlg.DoModal();
167 /////////////////////////////////////////////////////////////////////////////
168 // CMasterApp message handlers