WWConfig.cpp 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. // WWConfig.cpp : Defines the class behaviors for the application.
  19. //
  20. #include "stdafx.h"
  21. #include "WWConfig.h"
  22. #include "WWConfigDlg.h"
  23. #include "argv.h"
  24. #include "locale_api.h"
  25. #include "wwconfig_ids.h"
  26. #ifdef _DEBUG
  27. #define new DEBUG_NEW
  28. #undef THIS_FILE
  29. static char THIS_FILE[] = __FILE__;
  30. #endif
  31. int GlobalExitValue=1;
  32. void AutoConfigSettings();
  33. void CheckDriverVersion();
  34. /////////////////////////////////////////////////////////////////////////////
  35. // CWWConfigApp
  36. BEGIN_MESSAGE_MAP(CWWConfigApp, CWinApp)
  37. //{{AFX_MSG_MAP(CWWConfigApp)
  38. // NOTE - the ClassWizard will add and remove mapping macros here.
  39. // DO NOT EDIT what you see in these blocks of generated code!
  40. //}}AFX_MSG
  41. ON_COMMAND(ID_HELP, CWinApp::OnHelp)
  42. END_MESSAGE_MAP()
  43. /////////////////////////////////////////////////////////////////////////////
  44. // CWWConfigApp construction
  45. CWWConfigApp::CWWConfigApp()
  46. {
  47. // TODO: add construction code here,
  48. // Place all significant initialization in InitInstance
  49. }
  50. /////////////////////////////////////////////////////////////////////////////
  51. // The one and only CWWConfigApp object
  52. CWWConfigApp theApp;
  53. /////////////////////////////////////////////////////////////////////////////
  54. // CWWConfigApp initialization
  55. // Modified: 12/06/2001 by MML - Retrieving strings from Locomoto file.
  56. BOOL CWWConfigApp::InitInstance()
  57. {
  58. AfxEnableControlContainer();
  59. //-------------------------------------------------------------------------
  60. // Standard initialization
  61. //
  62. // If you are not using these features and wish to reduce the size
  63. // of your final executable, you should remove from the following
  64. // the specific initialization routines you do not need.
  65. //-------------------------------------------------------------------------
  66. #ifdef _AFXDLL
  67. Enable3dControls(); // Call this when using MFC in a shared DLL
  68. #else
  69. Enable3dControlsStatic(); // Call this when linking to MFC statically
  70. #endif
  71. //-------------------------------------------------------------------------
  72. // Get the Command line parameters.
  73. //-------------------------------------------------------------------------
  74. CString cmd(m_lpCmdLine);
  75. //=========================================================================
  76. // Init the strings.
  77. //=========================================================================
  78. int language = -1;
  79. if( cmd.Find( "-French") !=-1 ) {
  80. language = IDL_FRENCH;
  81. } else if( cmd.Find( "-German") !=-1 ) {
  82. language = IDL_GERMAN;
  83. } else if( cmd.Find( "-Japanese") !=-1 ) {
  84. language = IDL_JAPANESE;
  85. } else if( cmd.Find( "-Korean") !=-1 ) {
  86. language = IDL_KOREAN;
  87. } else if( cmd.Find( "-Chinese") !=-1 ) {
  88. language = IDL_CHINESE;
  89. } else if( cmd.Find( "-English") !=-1 ) {
  90. language = IDL_ENGLISH;
  91. }
  92. Locale_Init( language, "WWConfig.loc" );
  93. //
  94. //
  95. //
  96. if (cmd.Find("-autoconfig")!=-1) {
  97. AutoConfigSettings();
  98. }
  99. else if (cmd.Find("-driverversion")!=-1) {
  100. CheckDriverVersion();
  101. }
  102. else {
  103. CWWConfigDlg dlg;
  104. m_pMainWnd = &dlg;
  105. int nResponse = dlg.DoModal();
  106. if (nResponse == IDOK)
  107. {
  108. // TODO: Place code here to handle when the dialog is
  109. // dismissed with OK
  110. }
  111. else if (nResponse == IDCANCEL)
  112. {
  113. // TODO: Place code here to handle when the dialog is
  114. // dismissed with Cancel
  115. }
  116. }
  117. //-------------------------------------------------------------------------
  118. // Free the strings.
  119. //-------------------------------------------------------------------------
  120. Locale_Restore();
  121. // Since the dialog has been closed, return FALSE so that we exit the
  122. // application, rather than start the application's message pump.
  123. return FALSE;
  124. }
  125. int CWWConfigApp::ExitInstance()
  126. {
  127. // TODO: Add your specialized code here and/or call the base class
  128. CWinApp::ExitInstance();
  129. return GlobalExitValue;
  130. }