Cafu Engine
Options.hpp
1 /*
2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
5 */
6 
7 #ifndef CAFU_OPTIONS_HPP_INCLUDED
8 #define CAFU_OPTIONS_HPP_INCLUDED
9 
10 #include "Templates/Array.hpp"
11 #include "wx/wx.h"
12 
13 
14 class GameConfigT;
15 
16 
17 class OptionsT
18 {
19  public:
20 
21  struct GeneralT
22  {
23  int UndoLevels;
24  bool LockingTextures;
25  bool NewUVsFaceAligned; ///< Whether the texture-space axes of newly created brush faces are initialized "face aligned" or "world aligned".
26 
27  wxString EngineExe;
28  wxString BSPExe;
29  wxString LightExe;
30  wxString PVSExe;
31  };
32 
33  struct View2DT
34  {
35  bool DrawVertices;
36  bool SelectByHandles;
37  bool ShowEntityInfo;
38  bool ShowEntityTargets;
39  bool UseGroupColors;
40  };
41 
42  struct View3DT
43  {
44  bool ReverseY; ///< Whether to reverse the mouse's Y axis when mouse looking.
45  int BackPlane; ///< Distance to far clipping plane in world units.
46  int ModelDistance; ///< Distance in world units within which models render.
47  bool AnimateModels; ///< Whether or not to animate models.
48  int MaxCameraVelocity; ///< Max forward speed in world units per second.
49  int TimeToMaxSpeed; ///< Time to max forward speed in milliseconds.
50  float MouseSensitivity; ///< Mouse sensitivity for the angular (rotating and orbiting) modes of 3D views navigation, in degrees (of rotation) per pixel (of mouse movement).
51  int SplitPlanesDepth; ///< The depth up to which the split planes of the BSP tree should be rendered (for debugging/developers only).
52  };
53 
54  struct GridT
55  {
56  int InitialSpacing; ///< The default spacing between grid lines, in world units (usually 4, 8 or 16).
57  int MinPixelSpacing; ///< The minimum pixel spacing between grid lines. The grid is hidden if it gets smaller than this.
58  bool UseDottedGrid; ///< When true, the grid is rendered with dots. Otherwise, it is rendered with lines.
59  bool ShowHighlight1; ///< Whether every n-th world unit should be highlighted.
60  int SpacingHighlight1; ///< The spacing number n that should be highlighted.
61  bool ShowHighlight2; ///< Whether every m-th world unit should be highlighted.
62  int SpacingHighlight2; ///< The spacing number m that should be highlighted.
63 
64  wxColour ColorBackground; ///< The background color.
65  wxColour ColorBaseGrid; ///< The base grid color.
66  wxColour ColorHighlight1; ///< The color for highlighting every n-th world unit, if enabled.
67  wxColour ColorHighlight2; ///< The color for highlighting every m-th world unit, if enabled.
68  wxColour ColorAxes; ///< The color for the major axes through the origin.
69  };
70 
71  struct ColorsT
72  {
73  wxColour Selection; ///< The color of selected objects.
74  wxColour SelectedFace; ///< The color of a selected face.
75  wxColour SelectedEdge; ///< The color of a selected edge.
76  wxColour Vertex; ///< The color of vertices.
77  wxColour ToolHandle; ///< The color of tool handles.
78  wxColour ToolSelection; ///< The color of the selection tool.
79  wxColour ToolMorph; ///< The color of the morph tool.
80  wxColour ToolDrag; ///< The color of tool bounds while it is being dragged.
81  };
82 
83 
84  ~OptionsT();
85 
86  void Init();
87  void Write() const;
88  void DeleteGameConfigs();
89 
90  GeneralT general;
91  View2DT view2d;
92  View3DT view3d;
93  GridT Grid;
94  ColorsT colors;
95  ArrayT<GameConfigT*> GameConfigs;
96  unsigned long DaysSinceInstalled;
97 };
98 
99 
100 extern OptionsT Options;
101 
102 #endif
wxColour SelectedFace
The color of a selected face.
Definition: Options.hpp:74
wxColour ToolHandle
The color of tool handles.
Definition: Options.hpp:77
wxColour ToolDrag
The color of tool bounds while it is being dragged.
Definition: Options.hpp:80
bool UseDottedGrid
When true, the grid is rendered with dots. Otherwise, it is rendered with lines.
Definition: Options.hpp:58
wxColour Vertex
The color of vertices.
Definition: Options.hpp:76
wxColour ColorBackground
The background color.
Definition: Options.hpp:64
bool ReverseY
Whether to reverse the mouse's Y axis when mouse looking.
Definition: Options.hpp:44
bool NewUVsFaceAligned
Whether the texture-space axes of newly created brush faces are initialized "face aligned" or "world ...
Definition: Options.hpp:25
bool ShowHighlight2
Whether every m-th world unit should be highlighted.
Definition: Options.hpp:61
Definition: Options.hpp:17
bool AnimateModels
Whether or not to animate models.
Definition: Options.hpp:47
int MinPixelSpacing
The minimum pixel spacing between grid lines. The grid is hidden if it gets smaller than this...
Definition: Options.hpp:57
int ModelDistance
Distance in world units within which models render.
Definition: Options.hpp:46
wxColour ColorHighlight2
The color for highlighting every m-th world unit, if enabled.
Definition: Options.hpp:67
bool ShowHighlight1
Whether every n-th world unit should be highlighted.
Definition: Options.hpp:59
wxColour ColorBaseGrid
The base grid color.
Definition: Options.hpp:65
wxColour ToolSelection
The color of the selection tool.
Definition: Options.hpp:78
int SpacingHighlight1
The spacing number n that should be highlighted.
Definition: Options.hpp:60
int MaxCameraVelocity
Max forward speed in world units per second.
Definition: Options.hpp:48
Definition: Options.hpp:33
Definition: Options.hpp:42
int SpacingHighlight2
The spacing number m that should be highlighted.
Definition: Options.hpp:62
wxColour ColorHighlight1
The color for highlighting every n-th world unit, if enabled.
Definition: Options.hpp:66
The class describes the settings for a game/MOD.
Definition: GameConfig.hpp:32
float MouseSensitivity
Mouse sensitivity for the angular (rotating and orbiting) modes of 3D views navigation, in degrees (of rotation) per pixel (of mouse movement).
Definition: Options.hpp:50
int InitialSpacing
The default spacing between grid lines, in world units (usually 4, 8 or 16).
Definition: Options.hpp:56
int TimeToMaxSpeed
Time to max forward speed in milliseconds.
Definition: Options.hpp:49
wxColour ToolMorph
The color of the morph tool.
Definition: Options.hpp:79
int SplitPlanesDepth
The depth up to which the split planes of the BSP tree should be rendered (for debugging/developers o...
Definition: Options.hpp:51
wxColour SelectedEdge
The color of a selected edge.
Definition: Options.hpp:75
wxColour ColorAxes
The color for the major axes through the origin.
Definition: Options.hpp:68
wxColour Selection
The color of selected objects.
Definition: Options.hpp:73
Definition: Options.hpp:21
Definition: Options.hpp:71
int BackPlane
Distance to far clipping plane in world units.
Definition: Options.hpp:45
Definition: Options.hpp:54