MCPcopy Create free account
hub / github.com/EasyRPG/Player / GetConfig

Method GetConfig

src/baseui.cpp:79–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79Game_ConfigVideo BaseUi::GetConfig() const {
80 Game_ConfigVideo cfg = vcfg;
81
82 cfg.Hide();
83
84 vGetConfig(cfg);
85
86 Rect metrics = GetWindowMetrics();
87 cfg.window_x.Set(metrics.x);
88 cfg.window_y.Set(metrics.y);
89 cfg.window_width.Set(metrics.width);
90 cfg.window_height.Set(metrics.height);
91
92 if (!cfg.fullscreen.IsOptionVisible()) {
93 cfg.fps.RemoveFromValidSet(ConfigEnum::ShowFps::Overlay);
94 }
95
96 if (cfg.vsync.IsOptionVisible()
97 && cfg.vsync.Get()) {
98 cfg.fps_limit.SetLocked(true);
99 cfg.fps_limit.SetDescription("This option requires V-Sync to be disabled");
100 }
101
102 if (cfg.fullscreen.IsOptionVisible()
103 && cfg.fullscreen.Get()) {
104 cfg.window_zoom.SetLocked(true);
105 cfg.window_zoom.SetDescription("This option requires to be in windowed mode");
106 }
107
108 if (Player::has_custom_resolution) {
109 cfg.game_resolution.SetLocked(true);
110 cfg.game_resolution.SetDescription("This game uses a custom resolution");
111 }
112
113 return cfg;
114}
115
116bool BaseUi::ChangeDisplaySurfaceResolution(int new_width, int new_height) {
117 if (new_width == current_display_mode.width && new_height == current_display_mode.height) {

Callers

nothing calls this directly

Calls 7

HideMethod · 0.80
IsOptionVisibleMethod · 0.80
RemoveFromValidSetMethod · 0.80
SetLockedMethod · 0.80
SetDescriptionMethod · 0.80
SetMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected