SuperTuxKart
Loading...
Searching...
No Matches
options_screen_video.hpp
1// SuperTuxKart - a fun racing game with go-kart
2// Copyright (C) 2009-2015 Marianne Gagnon
3//
4// This program is free software; you can redistribute it and/or
5// modify it under the terms of the GNU General Public License
6// as published by the Free Software Foundation; either version 3
7// of the License, or (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program; if not, write to the Free Software
16// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
18
19#ifndef __HEADER_OPTIONS_SCREEN_VIDEO_HPP__
20#define __HEADER_OPTIONS_SCREEN_VIDEO_HPP__
21
22#include <string>
23
24#include "guiengine/screen.hpp"
25
26namespace GUIEngine { class Widget; }
27
29{
30 bool lights;
31 int shadows;
32 bool bloom;
33 bool lightshaft;
34 bool glow;
35 bool mlaa;
36 bool ssao;
37 bool light_scatter;
38 bool animatedCharacters;
39 int particles;
40 int image_quality;
41 bool degraded_ibl;
42};
43
45{
46 bool motionblur;
48 bool dof;
49};
50
52{
53 float value;
54};
55
57{
58 int width;
59 int height;
60 bool fullscreen;
61
63 {
64 width = 0;
65 height = 0;
66 }
67
68 Resolution(int w, int h)
69 {
70 width = w;
71 height = h;
72 }
73
74 bool operator< (Resolution r) const
75 {
76 return width < r.width || (width == r.width && height < r.height);
77 }
78
79 float getRatio() const
80 {
81 return (float) width / height;
82 }
83};
84
89class OptionsScreenVideo : public GUIEngine::Screen, public GUIEngine::ScreenSingleton<OptionsScreenVideo>
90{
91private:
92 static bool m_fullscreen_checkbox_focus;
93 bool m_prev_adv_pipline;
94 int m_prev_img_quality;
96 bool m_inited;
97 std::vector<GFXPreset> m_presets;
98 std::vector<BlurPreset> m_blur_presets;
99 std::vector<ScaleRttsCustomPreset> m_scale_rtts_custom_presets;
100 std::vector<Resolution> m_resolutions;
101
102 void updateTooltip();
103 void updateBlurTooltip();
104 void updateResolutionsList();
105 void initPresets();
106 static void onScrollResolutionsList(void* data);
107public:
109
111 virtual void loadedFromFile() OVERRIDE;
112
114 virtual void eventCallback(GUIEngine::Widget* widget, const std::string& name,
115 const int playerID) OVERRIDE;
116
118 virtual void init() OVERRIDE;
119
121 virtual void tearDown() OVERRIDE;
122
124 virtual void unloaded() OVERRIDE;
125
126 virtual bool onEscapePressed() OVERRIDE;
127
128 void updateGfxSlider();
129 void updateBlurSlider();
130 void updateScaleRTTsSlider();
131 static int getImageQuality();
132 static void setImageQuality(int quality);
133};
134
135#endif
Declares a class to be a singleton.
Definition: screen.hpp:59
Represents a single GUI screen.
Definition: screen.hpp:97
The nearly-abstract base of all widgets (not fully abstract since a bare Widget can be created for th...
Definition: widget.hpp:143
Graphics options screen.
Definition: options_screen_video.hpp:90
virtual void tearDown() OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: options_screen_video.cpp:953
virtual void loadedFromFile() OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: options_screen_video.cpp:213
virtual void unloaded() OVERRIDE
implement optional callback from parent class GUIEngine::Screen
Definition: options_screen_video.cpp:986
virtual void eventCallback(GUIEngine::Widget *widget, const std::string &name, const int playerID) OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: options_screen_video.cpp:755
virtual bool onEscapePressed() OVERRIDE
Called when escape is pressed.
Definition: options_screen_video.cpp:978
virtual void init() OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: options_screen_video.cpp:234
Contains all GUI engine related classes and functions.
Definition: abstract_state_manager.hpp:33
Definition: options_screen_video.hpp:45
bool dof
Depth of field.
Definition: options_screen_video.hpp:48
Definition: options_screen_video.hpp:29
Definition: options_screen_video.hpp:57
Definition: options_screen_video.hpp:52