PrefsDlg.cpp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  1. /*
  2. ===========================================================================
  3. Doom 3 GPL Source Code
  4. Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
  5. This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
  6. Doom 3 Source Code is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. Doom 3 Source Code 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. You should have received a copy of the GNU General Public License
  15. along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
  16. In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
  17. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
  18. ===========================================================================
  19. */
  20. #include "../../idlib/precompiled.h"
  21. #pragma hdrstop
  22. #include "qe3.h"
  23. #include "shlobj.h"
  24. #ifdef _DEBUG
  25. #define new DEBUG_NEW
  26. #undef THIS_FILE
  27. static char THIS_FILE[] = __FILE__;
  28. #endif
  29. #define MOUSE_KEY "radiant_MouseButtons"
  30. #define TLOCK_KEY "radiant_TextureLock"
  31. #define RLOCK_KEY "radiant_RotateLock"
  32. #define LOADLAST_KEY "radiant_LoadLast"
  33. #define LOADLASTMAP_KEY "radiant_LoadLastMap"
  34. #define LASTPROJ_KEY "radiant_LastProject"
  35. #define LASTMAP_KEY "radiant_LastMap"
  36. #define RUN_KEY "radiant_RunBefore"
  37. #define FACE_KEY "radiant_NewFaceGrab"
  38. #define BSP_KEY "radiant_InternalBSP"
  39. #define RCLICK_KEY "radiant_NewRightClick"
  40. #define VERTEX_KEY "radiant_NewVertex"
  41. #define AUTOSAVE_KEY "radiant_Autosave"
  42. #define AUTOSAVETIME_KEY "radiant_AutosaveMinutes"
  43. #define PAK_KEY "radiant_UsePAK"
  44. #define NEWAPPLY_KEY "radiant_ApplyDismissesSurface"
  45. #define HACK_KEY "radiant_Gatewayescapehack"
  46. #define TEXTURE_KEY "radiant_NewTextureWindowStuff"
  47. #define TINYBRUSH_KEY "radiant_CleanTinyBrushes"
  48. #define TINYSIZE_KEY "radiant_CleanTinyBrusheSize"
  49. #define SNAPSHOT_KEY "radiant_Snapshots"
  50. #define PAKFILE_KEY "radiant_PAKFile"
  51. #define STATUS_KEY "radiant_StatusPointSize"
  52. #define MOVESPEED_KEY "radiant_MoveSpeed"
  53. #define ANGLESPEED_KEY "radiant_AngleSpeed"
  54. #define SETGAME_KEY "radiant_UseSetGame"
  55. #define CAMXYUPDATE_KEY "radiant_CamXYUpdate"
  56. #define LIGHTDRAW_KEY "radiant_NewLightStyle"
  57. #define WHATGAME_KEY "radiant_WhichGame"
  58. #define CUBICCLIP_KEY "radiant_CubicClipping"
  59. #define CUBICSCALE_KEY "radiant_CubicScale"
  60. #define ALTEDGE_KEY "radiant_ALTEdgeDrag"
  61. #define FACECOLORS_KEY "radiant_FaceColors"
  62. #define QE4PAINT_KEY "radiant_QE4Paint"
  63. #define SNAPT_KEY "radiant_SnapT"
  64. #define XZVIS_KEY "radiant_XZVIS"
  65. #define YZVIS_KEY "radiant_YZVIS"
  66. #define ZVIS_KEY "radiant_ZVIS"
  67. #define SIZEPAINT_KEY "radiant_SizePainting"
  68. #define DLLENTITIES_KEY "radiant_DLLEntities"
  69. #define WIDETOOLBAR_KEY "radiant_WideToolBar"
  70. #define NOCLAMP_KEY "radiant_NoClamp"
  71. #define PREFAB_KEY "radiant_PrefabPath"
  72. #define USERINI_KEY "radiant_UserINIPath"
  73. #define ROTATION_KEY "radiant_Rotation"
  74. #define SGIOPENGL_KEY "radiant_SGIOpenGL"
  75. #define BUGGYICD_KEY "radiant_BuggyICD"
  76. #define HICOLOR_KEY "radiant_HiColorTextures"
  77. #define CHASEMOUSE_KEY "radiant_ChaseMouse"
  78. #define ENTITYSHOW_KEY "radiant_EntityShow"
  79. #define TEXTURESCALE_KEY "radiant_TextureScale"
  80. #define TEXTURESCROLLBAR_KEY "radiant_TextureScrollbar"
  81. #define DISPLAYLISTS_KEY "radiant_UseDisplayLists"
  82. #define NORMALIZECOLORS_KEY "radiant_NormalizeColors"
  83. #define SHADERS_KEY "radiant_UseShaders"
  84. #define SWITCHCLIP_KEY "radiant_SwitchClipKey"
  85. #define SELWHOLEENTS_KEY "radiant_SelectWholeEntitiesKey"
  86. #define TEXTURESUBSET_KEY "radiant_UseTextureSubsetLoading"
  87. #define TEXTUREQUALITY_KEY "radiant_TextureQuality"
  88. #define SHOWSHADERS_KEY "radiant_ShowShaders"
  89. #define SHADERTEST_KEY "radiant_ShaderTest"
  90. #define GLLIGHTING_KEY "radiant_UseGLLighting"
  91. #define NOSTIPPLE_KEY "radiant_NoStipple"
  92. #define UNDOLEVELS_KEY "radiant_UndoLevels"
  93. #define MAPS_KEY "radiant_RadiantMapPath"
  94. #define MODELS_KEY "radiant_ModelPath"
  95. #define NEWMAPFORMAT_KEY "radiant_NewMapFormat"
  96. #define WINDOW_DEF 0
  97. #define TLOCK_DEF 1
  98. #define LOADLAST_DEF 1
  99. #define RUN_DEF 0
  100. /////////////////////////////////////////////////////////////////////////////
  101. // CPrefsDlg dialog
  102. CPrefsDlg::CPrefsDlg(CWnd* pParent /*=NULL*/)
  103. : CDialog(CPrefsDlg::IDD, pParent)
  104. {
  105. //{{AFX_DATA_INIT(CPrefsDlg)
  106. m_bLoadLast = FALSE;
  107. m_bFace = FALSE;
  108. m_bRightClick = FALSE;
  109. m_bVertex = FALSE;
  110. m_bAutoSave = TRUE;
  111. m_bNewApplyHandling = FALSE;
  112. m_strAutoSave = _T("5");
  113. m_bLoadLastMap = FALSE;
  114. m_bTextureWindow = FALSE;
  115. m_bSnapShots = FALSE;
  116. m_fTinySize = 0.5;
  117. m_bCleanTiny = FALSE;
  118. m_nStatusSize = 10;
  119. m_bCamXYUpdate = FALSE;
  120. m_bNewLightDraw = FALSE;
  121. m_bALTEdge = FALSE;
  122. m_bQE4Painting = TRUE;
  123. m_bSnapTToGrid = FALSE;
  124. m_bXZVis = FALSE;
  125. m_bYZVis = FALSE;
  126. m_bZVis = FALSE;
  127. m_bSizePaint = FALSE;
  128. m_bWideToolbar = TRUE;
  129. m_bNoClamp = FALSE;
  130. m_nRotation = 0;
  131. m_bHiColorTextures = TRUE;
  132. m_bChaseMouse = FALSE;
  133. m_bTextureScrollbar = TRUE;
  134. m_bDisplayLists = TRUE;
  135. m_bNoStipple = FALSE;
  136. m_strMaps = _T("");
  137. m_strModels = _T("");
  138. m_bNewMapFormat = TRUE;
  139. //}}AFX_DATA_INIT
  140. //LoadPrefs();
  141. m_selectByBoundingBrush = FALSE;
  142. m_selectOnlyBrushes = FALSE;
  143. m_selectNoModels = FALSE;
  144. m_nEntityShowState = 0;
  145. m_nTextureScale = 2;
  146. m_bSwitchClip = FALSE;
  147. m_bSelectWholeEntities = TRUE;
  148. m_nTextureQuality = 3;
  149. m_bGLLighting = FALSE;
  150. m_nUndoLevels = 63;
  151. }
  152. void CPrefsDlg::DoDataExchange(CDataExchange* pDX)
  153. {
  154. CDialog::DoDataExchange(pDX);
  155. //{{AFX_DATA_MAP(CPrefsDlg)
  156. DDX_Control(pDX, IDC_SPIN_UNDO, m_wndUndoSpin);
  157. DDX_Control(pDX, IDC_SPIN_POINTSIZE, m_wndFontSpin);
  158. DDX_Control(pDX, IDC_SLIDER_TEXTUREQUALITY, m_wndTexturequality);
  159. DDX_Control(pDX, IDC_SLIDER_CAMSPEED, m_wndCamSpeed);
  160. DDX_Control(pDX, IDC_SPIN_AUTOSAVE, m_wndSpin);
  161. DDX_Check(pDX, IDC_CHECK_LOADLAST, m_bLoadLast);
  162. DDX_Check(pDX, IDC_CHECK_FACE, m_bFace);
  163. DDX_Check(pDX, IDC_CHECK_RIGHTCLICK, m_bRightClick);
  164. DDX_Check(pDX, IDC_CHECK_AUTOSAVE, m_bAutoSave);
  165. DDX_Text(pDX, IDC_EDIT_AUTOSAVE, m_strAutoSave);
  166. DDX_Check(pDX, IDC_CHECK_LOADLASTMAP, m_bLoadLastMap);
  167. DDX_Check(pDX, IDC_CHECK_TEXTUREWINDOW, m_bTextureWindow);
  168. DDX_Check(pDX, IDC_CHECK_SNAPSHOTS, m_bSnapShots);
  169. DDX_Text(pDX, IDC_EDIT_STATUSPOINTSIZE, m_nStatusSize);
  170. DDV_MinMaxInt(pDX, m_nStatusSize, 2, 14);
  171. DDX_Check(pDX, IDC_CHECK_CAMXYUPDATE, m_bCamXYUpdate);
  172. DDX_Check(pDX, IDC_CHECK_LIGHTDRAW, m_bNewLightDraw);
  173. DDX_Check(pDX, IDC_CHECK_ALTDRAG, m_bALTEdge);
  174. DDX_Check(pDX, IDC_CHECK_QE4PAINTING, m_bQE4Painting);
  175. DDX_Check(pDX, IDC_CHECK_SNAPT, m_bSnapTToGrid);
  176. DDX_Check(pDX, IDC_CHECK_SIZEPAINT, m_bSizePaint);
  177. DDX_Check(pDX, IDC_CHECK_WIDETOOLBAR, m_bWideToolbar);
  178. DDX_Check(pDX, IDC_CHECK_NOCLAMP, m_bNoClamp);
  179. DDX_Text(pDX, IDC_EDIT_ROTATION, m_nRotation);
  180. DDX_Check(pDX, IDC_CHECK_HICOLOR, m_bHiColorTextures);
  181. DDX_Check(pDX, IDC_CHECK_MOUSECHASE, m_bChaseMouse);
  182. DDX_Check(pDX, IDC_CHECK_TEXTURESCROLLBAR, m_bTextureScrollbar);
  183. DDX_Check(pDX, IDC_CHECK_DISPLAYLISTS, m_bDisplayLists);
  184. DDX_Check(pDX, IDC_CHECK_NOSTIPPLE, m_bNoStipple);
  185. DDX_Text(pDX, IDC_EDIT_UNDOLEVELS, m_nUndoLevels);
  186. DDV_MinMaxInt(pDX, m_nUndoLevels, 1, 64);
  187. DDX_Text(pDX, IDC_EDIT_MAPS, m_strMaps);
  188. DDX_Check(pDX, IDC_CHECK_NEWMAPFORMAT, m_bNewMapFormat);
  189. //}}AFX_DATA_MAP
  190. }
  191. BEGIN_MESSAGE_MAP(CPrefsDlg, CDialog)
  192. //{{AFX_MSG_MAP(CPrefsDlg)
  193. //}}AFX_MSG_MAP
  194. END_MESSAGE_MAP()
  195. /////////////////////////////////////////////////////////////////////////////
  196. // CPrefsDlg message handlers
  197. BOOL CPrefsDlg::OnInitDialog()
  198. {
  199. CDialog::OnInitDialog();
  200. m_wndSpin.SetRange(1,60);
  201. m_wndCamSpeed.SetRange(10, 5000);
  202. m_wndCamSpeed.SetPos(m_nMoveSpeed);
  203. this->m_wndTexturequality.SetRange(0, 3);
  204. this->m_wndTexturequality.SetPos(m_nTextureQuality);
  205. m_wndFontSpin.SetRange(4,24);
  206. m_wndUndoSpin.SetRange(1,64);
  207. GetDlgItem(IDC_CHECK_HICOLOR)->EnableWindow(TRUE);
  208. GetDlgItem(IDC_CHECK_NOCLAMP)->EnableWindow(TRUE);
  209. //GetDlgItem(IDC_CHECK_NOCLAMP)->EnableWindow(FALSE);
  210. return TRUE; // return TRUE unless you set the focus to a control
  211. // EXCEPTION: OCX Property Pages should return FALSE
  212. }
  213. void CPrefsDlg::OnOK()
  214. {
  215. m_nMoveSpeed = m_wndCamSpeed.GetPos();
  216. m_nAngleSpeed = (float)m_nMoveSpeed * 0.50;
  217. this->m_nTextureQuality = m_wndTexturequality.GetPos();
  218. SavePrefs();
  219. if ( g_pParentWnd ) {
  220. g_pParentWnd->SetGridStatus();
  221. }
  222. Sys_UpdateWindows(W_ALL);
  223. Undo_SetMaxSize(m_nUndoLevels);
  224. CDialog::OnOK();
  225. }
  226. int GetCvarInt(const char *name, const int def) {
  227. idCVar *cvar = cvarSystem->Find( name );
  228. if ( cvar ) {
  229. return cvar->GetInteger();
  230. } else {
  231. return def;
  232. }
  233. }
  234. const char *GetCvarString( const char *name, const char *def ) {
  235. idCVar *cvar = cvarSystem->Find( name );
  236. if ( cvar ) {
  237. return cvar->GetString();
  238. } else {
  239. return def;
  240. }
  241. }
  242. static const char hexDigits[] = "0123456789ABCDEF";
  243. void SetCvarInt( const char *name, const int value ) {
  244. cvarSystem->SetCVarInteger( name, value, CVAR_TOOL );
  245. }
  246. void SetCvarString( const char *name, const char *value ) {
  247. cvarSystem->SetCVarString( name, value, CVAR_TOOL );
  248. }
  249. void SetCvarBinary(const char *name, void *pv, int size) {
  250. unsigned char *in = new unsigned char[size];
  251. idStr s;
  252. memset( in, 0, size );
  253. memcpy( in, pv, size );
  254. for ( int i = 0; i < size; i++ ) {
  255. s += hexDigits[in[i] >> 4];
  256. s += hexDigits[in[i] & 0x0f];
  257. }
  258. delete []in;
  259. SetCvarString(name, s);
  260. }
  261. bool GetCvarBinary( const char *name, void *pv, int size ) {
  262. bool ret = false;
  263. unsigned char *out = new unsigned char[size];
  264. idStr s = GetCvarString( name, "" );
  265. if ( s.Length() / 2 == size ) {
  266. int j = 0;
  267. for ( int i = 0; i < s.Length(); i += 2 ) {
  268. char c;
  269. if (s[i] > '9') {
  270. c = s[i] - 'A' + 0x0a;
  271. } else {
  272. c = s[i] - 0x30;
  273. }
  274. c <<= 4;
  275. if (s[i+1] > '9') {
  276. c |= s[i+1] - 'A' + 0x0a;
  277. } else {
  278. c |= s[i+1] - 0x30;
  279. }
  280. out[j++] = c;
  281. }
  282. memcpy(pv, out, size);
  283. ret = true;
  284. }
  285. delete []out;
  286. return ret;
  287. }
  288. void CPrefsDlg::LoadPrefs() {
  289. CString strBuff;
  290. CString strPrefab = g_strAppPath;
  291. AddSlash(strPrefab);
  292. strPrefab += "Prefabs\\";
  293. m_nMouseButtons = 3;
  294. m_bTextureLock = GetCvarInt( TLOCK_KEY, TLOCK_DEF );
  295. m_bRotateLock = GetCvarInt( RLOCK_KEY, TLOCK_DEF );
  296. m_strLastProject = GetCvarString( LASTPROJ_KEY, "" );
  297. m_strLastMap = GetCvarString( LASTMAP_KEY, "" );
  298. m_bLoadLast = GetCvarInt( LOADLAST_KEY, LOADLAST_DEF );
  299. m_bRunBefore = GetCvarInt( RUN_KEY, RUN_DEF );
  300. m_bFace = GetCvarInt( FACE_KEY, 1 );
  301. m_bRightClick = GetCvarInt( RCLICK_KEY, 1 );
  302. m_bVertex = GetCvarInt( VERTEX_KEY, 1 );
  303. m_bAutoSave = GetCvarInt( AUTOSAVE_KEY, 1 );
  304. m_bNewApplyHandling = GetCvarInt( NEWAPPLY_KEY, 0 );
  305. m_bLoadLastMap = GetCvarInt( LOADLASTMAP_KEY, 0 );
  306. m_bGatewayHack = GetCvarInt( HACK_KEY, 0 );
  307. m_bTextureWindow = GetCvarInt( TEXTURE_KEY, 0 );
  308. m_bCleanTiny = GetCvarInt( TINYBRUSH_KEY, 0 );
  309. strBuff = GetCvarString( TINYSIZE_KEY, "0.5" );
  310. m_fTinySize = atof(strBuff );
  311. m_nAutoSave = GetCvarInt( AUTOSAVETIME_KEY, 5 );
  312. if ( m_nAutoSave <= 0 ) { m_nAutoSave = 1; }
  313. m_strAutoSave.Format("%i", m_nAutoSave );
  314. m_bSnapShots = GetCvarInt( SNAPSHOT_KEY, 0 );
  315. m_nStatusSize = GetCvarInt( STATUS_KEY, 10 );
  316. m_nMoveSpeed = GetCvarInt( MOVESPEED_KEY, 400 );
  317. m_nAngleSpeed = GetCvarInt( ANGLESPEED_KEY, 300 );
  318. m_bCamXYUpdate = GetCvarInt( CAMXYUPDATE_KEY, 1 );
  319. m_bNewLightDraw = GetCvarInt( LIGHTDRAW_KEY, 1 );
  320. m_bCubicClipping = ( GetCvarInt( CUBICCLIP_KEY, 1) != 0 );
  321. m_nCubicScale = GetCvarInt( CUBICSCALE_KEY, 13 );
  322. m_bALTEdge = GetCvarInt( ALTEDGE_KEY, 0 );
  323. m_bQE4Painting = GetCvarInt( QE4PAINT_KEY, 1 );
  324. m_bSnapTToGrid = GetCvarInt( SNAPT_KEY, 0 );
  325. m_bXZVis = GetCvarInt( XZVIS_KEY, 0 );
  326. m_bYZVis = GetCvarInt( YZVIS_KEY, 0 );
  327. m_bZVis = GetCvarInt( ZVIS_KEY, 1 );
  328. m_bSizePaint = GetCvarInt( SIZEPAINT_KEY, 0 );
  329. m_bWideToolbar = GetCvarInt( WIDETOOLBAR_KEY, 1 );
  330. m_bNoClamp = GetCvarInt( NOCLAMP_KEY, 0 );
  331. m_nRotation = GetCvarInt( ROTATION_KEY, 45 );
  332. m_bHiColorTextures = GetCvarInt( HICOLOR_KEY, 1 );
  333. m_bChaseMouse = GetCvarInt( CHASEMOUSE_KEY, 1 );
  334. m_nEntityShowState = GetCvarInt( ENTITYSHOW_KEY, 0 );
  335. m_nTextureScale = GetCvarInt( TEXTURESCALE_KEY, 50 );
  336. m_bTextureScrollbar = GetCvarInt( TEXTURESCROLLBAR_KEY, TRUE );
  337. m_bDisplayLists = GetCvarInt( DISPLAYLISTS_KEY, TRUE );
  338. m_bSwitchClip = GetCvarInt( SWITCHCLIP_KEY, TRUE );
  339. m_bSelectWholeEntities = GetCvarInt( SELWHOLEENTS_KEY, TRUE );
  340. m_nTextureQuality = GetCvarInt( TEXTUREQUALITY_KEY, 6 );
  341. m_bGLLighting = GetCvarInt( GLLIGHTING_KEY, FALSE );
  342. m_bNoStipple = GetCvarInt( NOSTIPPLE_KEY, 0 );
  343. m_nUndoLevels = GetCvarInt( UNDOLEVELS_KEY, 63 );
  344. m_strMaps = GetCvarString( MAPS_KEY, "" );
  345. m_strModels = GetCvarString( MODELS_KEY, "" );
  346. m_bNoStipple = GetCvarInt( NEWMAPFORMAT_KEY, 1 );
  347. if ( m_bRunBefore == FALSE ) {
  348. SetGamePrefs();
  349. }
  350. }
  351. void CPrefsDlg::SavePrefs() {
  352. if ( GetSafeHwnd() ) {
  353. UpdateData(TRUE);
  354. }
  355. m_nMouseButtons = 3;
  356. SetCvarInt( TLOCK_KEY, m_bTextureLock );
  357. SetCvarInt( RLOCK_KEY, m_bRotateLock );
  358. SetCvarInt( LOADLAST_KEY, m_bLoadLast );
  359. SetCvarString( LASTPROJ_KEY, m_strLastProject );
  360. SetCvarString( LASTMAP_KEY, m_strLastMap );
  361. SetCvarInt( RUN_KEY, m_bRunBefore );
  362. SetCvarInt( FACE_KEY, m_bFace );
  363. SetCvarInt( RCLICK_KEY, m_bRightClick );
  364. SetCvarInt( VERTEX_KEY, m_bVertex );
  365. SetCvarInt( AUTOSAVE_KEY, m_bAutoSave );
  366. SetCvarInt( LOADLASTMAP_KEY, m_bLoadLastMap );
  367. SetCvarInt( TEXTURE_KEY, m_bTextureWindow );
  368. m_nAutoSave = atoi( m_strAutoSave );
  369. SetCvarInt( AUTOSAVETIME_KEY, m_nAutoSave );
  370. SetCvarInt( SNAPSHOT_KEY, m_bSnapShots );
  371. SetCvarInt( STATUS_KEY, m_nStatusSize );
  372. SetCvarInt( CAMXYUPDATE_KEY, m_bCamXYUpdate );
  373. SetCvarInt( LIGHTDRAW_KEY, m_bNewLightDraw );
  374. SetCvarInt( MOVESPEED_KEY, m_nMoveSpeed );
  375. SetCvarInt( ANGLESPEED_KEY, m_nAngleSpeed );
  376. SetCvarInt( CUBICCLIP_KEY, m_bCubicClipping );
  377. SetCvarInt( CUBICSCALE_KEY, m_nCubicScale );
  378. SetCvarInt( ALTEDGE_KEY, m_bALTEdge );
  379. SetCvarInt( QE4PAINT_KEY, m_bQE4Painting );
  380. SetCvarInt( SNAPT_KEY, m_bSnapTToGrid );
  381. SetCvarInt( XZVIS_KEY, m_bXZVis );
  382. SetCvarInt( YZVIS_KEY, m_bYZVis );
  383. SetCvarInt( ZVIS_KEY, m_bZVis );
  384. SetCvarInt( SIZEPAINT_KEY, m_bSizePaint );
  385. SetCvarInt( WIDETOOLBAR_KEY, m_bWideToolbar );
  386. SetCvarInt( NOCLAMP_KEY, m_bNoClamp );
  387. SetCvarInt( ROTATION_KEY, m_nRotation );
  388. SetCvarInt( HICOLOR_KEY, m_bHiColorTextures );
  389. SetCvarInt( CHASEMOUSE_KEY, m_bChaseMouse );
  390. SetCvarInt( ENTITYSHOW_KEY, m_nEntityShowState );
  391. SetCvarInt( TEXTURESCALE_KEY, m_nTextureScale );
  392. SetCvarInt( TEXTURESCROLLBAR_KEY, m_bTextureScrollbar );
  393. SetCvarInt( DISPLAYLISTS_KEY, m_bDisplayLists );
  394. SetCvarInt( SWITCHCLIP_KEY, m_bSwitchClip );
  395. SetCvarInt( SELWHOLEENTS_KEY, m_bSelectWholeEntities );
  396. SetCvarInt( TEXTUREQUALITY_KEY, m_nTextureQuality );
  397. SetCvarInt( GLLIGHTING_KEY, m_bGLLighting );
  398. SetCvarInt( NOSTIPPLE_KEY, m_bNoStipple );
  399. SetCvarInt( UNDOLEVELS_KEY, m_nUndoLevels );
  400. SetCvarString( MAPS_KEY, m_strMaps );
  401. SetCvarString( MODELS_KEY, m_strModels );
  402. SetCvarInt( NEWMAPFORMAT_KEY, m_bNewMapFormat );
  403. common->WriteFlaggedCVarsToFile( "editor.cfg", CVAR_TOOL, "sett" );
  404. }
  405. void CPrefsDlg::SetGamePrefs() {
  406. m_bHiColorTextures = TRUE;
  407. m_bWideToolbar = TRUE;
  408. SavePrefs();
  409. }