doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MEOptions.cpp
Go to the documentation of this file.
1 /*
2 ===========================================================================
3 
4 Doom 3 GPL Source Code
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
6 
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
8 
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13 
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
21 
22 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.
23 
24 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.
25 
26 ===========================================================================
27 */
28 #include "../../idlib/precompiled.h"
29 #pragma hdrstop
30 
31 #include "MEOptions.h"
32 
37 
38  registry.Init("Software\\id Software\\DOOM3\\Tools\\MaterialEditor");
39 
41  stageWidth = 0;
46 
47 }
48 
53 }
54 
58 bool MEOptions::Save (void) {
59 
60  registry.SetFloat("materialTreeWidth", materialTreeWidth);
61  registry.SetFloat("stageWidth", stageWidth);
62  registry.SetFloat("previewPropertiesWidth", previewPropertiesWidth);
63  registry.SetFloat("materialEditHeight", materialEditHeight);
64  registry.SetFloat("materialPropHeadingWidth", materialPropHeadingWidth);
65  registry.SetFloat("previewPropHeadingWidth", previewPropHeadingWidth);
66 
67  return registry.Save();
68 }
69 
73 bool MEOptions::Load (void) {
74 
75  if(!registry.Load()) {
76  return false;
77  }
78 
79  materialTreeWidth = (int)registry.GetFloat("materialTreeWidth");
80  stageWidth = (int)registry.GetFloat("stageWidth");
81  previewPropertiesWidth = (int)registry.GetFloat("previewPropertiesWidth");
82  materialEditHeight = (int)registry.GetFloat("materialEditHeight");
83  materialPropHeadingWidth = (int)registry.GetFloat("materialPropHeadingWidth");
84  previewPropHeadingWidth = (int)registry.GetFloat("previewPropHeadingWidth");
85 
86  return true;
87 
88 }
int stageWidth
Definition: MEOptions.h:84
rvRegistryOptions registry
Definition: MEOptions.h:79
void Init(const char *key)
int materialEditHeight
Definition: MEOptions.h:86
case const int
Definition: Callbacks.cpp:52
bool Load(void)
Loads the material editor options from the registry.
Definition: MEOptions.cpp:73
int materialPropHeadingWidth
Definition: MEOptions.h:87
float GetFloat(const char *name)
~MEOptions()
Destructor for MEOptions.
Definition: MEOptions.cpp:52
int previewPropertiesWidth
Definition: MEOptions.h:85
int materialTreeWidth
Definition: MEOptions.h:83
MEOptions()
Constructor for MEOptions.
Definition: MEOptions.cpp:36
bool Save(void)
Saves the material editor options to the registry.
Definition: MEOptions.cpp:58
int previewPropHeadingWidth
Definition: MEOptions.h:88
void SetFloat(const char *name, float v)