Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

- `RealTimeLimitProgress` and `SimTimeLimitProgress` on `Timer` are now both writable properties in Lua, and not only readable.

- New `Settings.ini` property `LaunchMinimised = 0/1` to have the game window start out minimised, so that launching the game doesn't take input focus or cover other windows. Disabled by default.

</details>

<details><summary><b>Changed</b></summary>
Expand Down
2 changes: 2 additions & 0 deletions Source/Managers/SettingsMan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ int SettingsMan::ReadProperty(const std::string_view& propName, Reader& reader)
MatchProperty("EnableVSync", { reader >> g_WindowMan.m_EnableVSync; });
MatchProperty("Fullscreen", { reader >> g_WindowMan.m_Fullscreen; });
MatchProperty("UseMultiDisplays", { reader >> g_WindowMan.m_UseMultiDisplays; });
MatchProperty("LaunchMinimised", { reader >> g_WindowMan.m_LaunchMinimised; });
MatchProperty("TwoPlayerSplitscreenVertSplit", { reader >> g_FrameMan.m_TwoPlayerVSplit; });
MatchProperty("MasterVolume", { g_AudioMan.SetMasterVolume(std::stof(reader.ReadPropValue()) / 100.0F); });
MatchProperty("MuteMaster", { reader >> g_AudioMan.m_MuteMaster; });
Expand Down Expand Up @@ -220,6 +221,7 @@ int SettingsMan::Save(Writer& writer) const {
writer.NewPropertyWithValue("Fullscreen", g_WindowMan.m_Fullscreen);
writer.NewPropertyWithValue("EnableVSync", g_WindowMan.m_EnableVSync);
writer.NewPropertyWithValue("UseMultiDisplays", g_WindowMan.m_UseMultiDisplays);
writer.NewPropertyWithValue("LaunchMinimised", g_WindowMan.m_LaunchMinimised);
writer.NewPropertyWithValue("TwoPlayerSplitscreenVertSplit", g_FrameMan.m_TwoPlayerVSplit);

writer.NewLine(false, 2);
Expand Down
5 changes: 4 additions & 1 deletion Source/Managers/WindowMan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ void WindowMan::Clear() {
m_Fullscreen = false;
m_EnableVSync = true;
m_UseMultiDisplays = false;
m_LaunchMinimised = false;
}

void WindowMan::ClearMultiDisplayData() {
Expand Down Expand Up @@ -184,6 +185,7 @@ void WindowMan::CreatePrimaryWindow() {
SDL_SetBooleanProperty(windowProps, SDL_PROP_WINDOW_CREATE_RESIZABLE_BOOLEAN, true);
SDL_SetBooleanProperty(windowProps, SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN, true);
SDL_SetBooleanProperty(windowProps, SDL_PROP_WINDOW_CREATE_FULLSCREEN_BOOLEAN, m_Fullscreen);
SDL_SetBooleanProperty(windowProps, SDL_PROP_WINDOW_CREATE_MINIMIZED_BOOLEAN, m_LaunchMinimised);
SDL_SetNumberProperty(windowProps, SDL_PROP_WINDOW_CREATE_X_NUMBER, windowPosX);
SDL_SetNumberProperty(windowProps, SDL_PROP_WINDOW_CREATE_Y_NUMBER, windowPosY);
SDL_SetNumberProperty(windowProps, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, m_ResX * m_ResMultiplier);
Expand All @@ -207,7 +209,8 @@ void WindowMan::CreatePrimaryWindow() {
SDL_GL_SwapWindow(m_PrimaryWindow.get());
SDL_SetCursor(NULL);

if (!m_Fullscreen && IsResolutionMaximized(m_ResX, m_ResY, m_ResMultiplier)) {
// Maximising a minimised window would bring it back up.
if (!m_Fullscreen && !m_LaunchMinimised && IsResolutionMaximized(m_ResX, m_ResY, m_ResMultiplier)) {
SDL_MaximizeWindow(m_PrimaryWindow.get());
}

Expand Down
1 change: 1 addition & 0 deletions Source/Managers/WindowMan.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ namespace RTE {

bool m_EnableVSync; //!< Whether vertical synchronization is enabled.
bool m_UseMultiDisplays; //!< Whether the multi-display arrangement should be ignored and only the display the main window is currently positioned at should be used for fullscreen.
bool m_LaunchMinimised; //!< Whether the game window starts out minimised, so that launching the game doesn't take input focus or cover other windows.

bool m_DrawPostProcessBuffer; //!< Whether to draw the PostProcessBuffer while not in Activity. Resets on Frame Clear.

Expand Down
Loading