| 1 | /* |
|---|
| 2 | ================================================================================= |
|---|
| 3 | This file is part of Cafu, the open-source game engine and graphics engine |
|---|
| 4 | for multiplayer, cross-platform, real-time 3D action. |
|---|
| 5 | Copyright (C) 2002-2012 Carsten Fuchs Software. |
|---|
| 6 | |
|---|
| 7 | Cafu is free software: you can redistribute it and/or modify it under the terms |
|---|
| 8 | of the GNU General Public License as published by the Free Software Foundation, |
|---|
| 9 | either version 3 of the License, or (at your option) any later version. |
|---|
| 10 | |
|---|
| 11 | Cafu is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
|---|
| 12 | without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|---|
| 13 | PURPOSE. See the GNU General Public License for more details. |
|---|
| 14 | |
|---|
| 15 | You should have received a copy of the GNU General Public License |
|---|
| 16 | along with Cafu. If not, see <http://www.gnu.org/licenses/>. |
|---|
| 17 | |
|---|
| 18 | For support and more information about Cafu, visit us at <http://www.cafu.de>. |
|---|
| 19 | ================================================================================= |
|---|
| 20 | */ |
|---|
| 21 | |
|---|
| 22 | #ifndef CAFU_OPTIONS_HPP_INCLUDED |
|---|
| 23 | #define CAFU_OPTIONS_HPP_INCLUDED |
|---|
| 24 | |
|---|
| 25 | #include "Templates/Array.hpp" |
|---|
| 26 | #include "wx/wx.h" |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | class GameConfigT; |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | class OptionsT |
|---|
| 33 | { |
|---|
| 34 | public: |
|---|
| 35 | |
|---|
| 36 | struct GeneralT |
|---|
| 37 | { |
|---|
| 38 | int UndoLevels; |
|---|
| 39 | bool LockingTextures; |
|---|
| 40 | bool NewUVsFaceAligned; ///< Whether the texture-space axes of newly created brush faces are initialized "face aligned" or "world aligned". |
|---|
| 41 | |
|---|
| 42 | wxString EngineExe; |
|---|
| 43 | wxString BSPExe; |
|---|
| 44 | wxString LightExe; |
|---|
| 45 | wxString PVSExe; |
|---|
| 46 | }; |
|---|
| 47 | |
|---|
| 48 | struct View2DT |
|---|
| 49 | { |
|---|
| 50 | bool DrawVertices; |
|---|
| 51 | bool SelectByHandles; |
|---|
| 52 | bool ShowEntityInfo; |
|---|
| 53 | bool ShowEntityTargets; |
|---|
| 54 | bool UseGroupColors; |
|---|
| 55 | }; |
|---|
| 56 | |
|---|
| 57 | struct View3DT |
|---|
| 58 | { |
|---|
| 59 | bool ReverseY; ///< Whether to reverse the mouse's Y axis when mouse looking. |
|---|
| 60 | int BackPlane; ///< Distance to far clipping plane in world units. |
|---|
| 61 | int ModelDistance; ///< Distance in world units within which models render. |
|---|
| 62 | bool AnimateModels; ///< Whether or not to animate models. |
|---|
| 63 | int MaxCameraVelocity; ///< Max forward speed in world units per second. |
|---|
| 64 | int TimeToMaxSpeed; ///< Time to max forward speed in milliseconds. |
|---|
| 65 | float MouseSensitivity; ///< Mouse sensitivity for the angular (rotating and orbiting) modes of 3D views navigation, in degrees (of rotation) per pixel (of mouse movement). |
|---|
| 66 | int SplitPlanesDepth; ///< The depth up to which the split planes of the BSP tree should be rendered (for debugging/developers only). |
|---|
| 67 | }; |
|---|
| 68 | |
|---|
| 69 | struct GridT |
|---|
| 70 | { |
|---|
| 71 | int InitialSpacing; ///< The default spacing between grid lines, in world units (usually 4, 8 or 16). |
|---|
| 72 | int MinPixelSpacing; ///< The minimum pixel spacing between grid lines. The grid is hidden if it gets smaller than this. |
|---|
| 73 | bool UseDottedGrid; ///< When true, the grid is rendered with dots. Otherwise, it is rendered with lines. |
|---|
| 74 | bool ShowHighlight1; ///< Whether every n-th world unit should be highlighted. |
|---|
| 75 | int SpacingHighlight1; ///< The spacing number n that should be highlighted. |
|---|
| 76 | bool ShowHighlight2; ///< Whether every m-th world unit should be highlighted. |
|---|
| 77 | int SpacingHighlight2; ///< The spacing number m that should be highlighted. |
|---|
| 78 | |
|---|
| 79 | wxColour ColorBackground; ///< The background color. |
|---|
| 80 | wxColour ColorBaseGrid; ///< The base grid color. |
|---|
| 81 | wxColour ColorHighlight1; ///< The color for highlighting every n-th world unit, if enabled. |
|---|
| 82 | wxColour ColorHighlight2; ///< The color for highlighting every m-th world unit, if enabled. |
|---|
| 83 | wxColour ColorAxes; ///< The color for the major axes through the origin. |
|---|
| 84 | }; |
|---|
| 85 | |
|---|
| 86 | struct ColorsT |
|---|
| 87 | { |
|---|
| 88 | wxColour Entity; ///< The default color of point entities & brush entities, can be overridden by the EntityClassDefs.lua file. |
|---|
| 89 | wxColour Selection; ///< The color of selected objects. |
|---|
| 90 | wxColour SelectedFace; ///< The color of a selected face. |
|---|
| 91 | wxColour SelectedEdge; ///< The color of a selected edge. |
|---|
| 92 | wxColour Vertex; ///< The color of vertices. |
|---|
| 93 | wxColour ToolHandle; ///< The color of tool handles. |
|---|
| 94 | wxColour ToolSelection; ///< The color of the selection tool. |
|---|
| 95 | wxColour ToolMorph; ///< The color of the morph tool. |
|---|
| 96 | wxColour ToolDrag; ///< The color of tool bounds while it is being dragged. |
|---|
| 97 | }; |
|---|
| 98 | |
|---|
| 99 | |
|---|
| 100 | ~OptionsT(); |
|---|
| 101 | |
|---|
| 102 | void Init(); |
|---|
| 103 | void Write() const; |
|---|
| 104 | void DeleteGameConfigs(); |
|---|
| 105 | |
|---|
| 106 | GeneralT general; |
|---|
| 107 | View2DT view2d; |
|---|
| 108 | View3DT view3d; |
|---|
| 109 | GridT Grid; |
|---|
| 110 | ColorsT colors; |
|---|
| 111 | ArrayT<GameConfigT*> GameConfigs; |
|---|
| 112 | unsigned long DaysSinceInstalled; |
|---|
| 113 | }; |
|---|
| 114 | |
|---|
| 115 | |
|---|
| 116 | extern OptionsT Options; |
|---|
| 117 | |
|---|
| 118 | #endif |
|---|