diff --git a/source/main/Application.cpp b/source/main/Application.cpp index 2965a768c4..6d35990693 100644 --- a/source/main/Application.cpp +++ b/source/main/Application.cpp @@ -199,6 +199,8 @@ CVar* gfx_flares_mode; CVar* gfx_shadow_type; CVar* gfx_extcam_mode; CVar* gfx_sky_mode; +CVar* gfx_sky_time_cycle; +CVar* gfx_sky_time_speed; CVar* gfx_texture_filter; CVar* gfx_vegetation_mode; CVar* gfx_water_mode; diff --git a/source/main/Application.h b/source/main/Application.h index f25872f5ea..8afd444223 100644 --- a/source/main/Application.h +++ b/source/main/Application.h @@ -374,6 +374,8 @@ extern CVar* gfx_flares_mode; extern CVar* gfx_shadow_type; extern CVar* gfx_extcam_mode; extern CVar* gfx_sky_mode; +extern CVar* gfx_sky_time_cycle; +extern CVar* gfx_sky_time_speed; extern CVar* gfx_texture_filter; extern CVar* gfx_vegetation_mode; extern CVar* gfx_water_mode; diff --git a/source/main/GameContext.cpp b/source/main/GameContext.cpp index 9fd4c434d3..598fc6a67a 100644 --- a/source/main/GameContext.cpp +++ b/source/main/GameContext.cpp @@ -984,6 +984,10 @@ void GameContext::UpdateSkyInputEvents(float dt) { time_factor = -10000.0f; } + else if (App::gfx_sky_time_cycle->GetBool()) + { + time_factor = App::gfx_sky_time_speed->GetInt(); + } if (App::GetSimTerrain()->getSkyManager()->GetSkyTimeFactor() != time_factor) { diff --git a/source/main/gui/panels/GUI_TopMenubar.cpp b/source/main/gui/panels/GUI_TopMenubar.cpp index 00289ecd4b..e8f57f59e6 100644 --- a/source/main/gui/panels/GUI_TopMenubar.cpp +++ b/source/main/gui/panels/GUI_TopMenubar.cpp @@ -478,6 +478,12 @@ void TopMenubar::Update() { App::GetSimTerrain()->getSkyManager()->SetTime(time); } + ImGui::SameLine(); + DrawGCheckbox(App::gfx_sky_time_cycle, _LC("TopMenubar", "Cycle")); + if (App::gfx_sky_time_cycle->GetBool()) + { + DrawGIntSlider(App::gfx_sky_time_speed, _LC("TopMenubar", "Speed"), 10, 2000); + } } #endif // USE_CAELUM if (RoR::App::gfx_water_waves->GetBool() && App::mp_state->GetEnum() != MpState::CONNECTED && App::GetSimTerrain()->getWater()) diff --git a/source/main/system/CVar.cpp b/source/main/system/CVar.cpp index fdf7160f1f..e257095f64 100644 --- a/source/main/system/CVar.cpp +++ b/source/main/system/CVar.cpp @@ -145,6 +145,8 @@ void Console::CVarSetupBuiltins() App::gfx_shadow_type = this->CVarCreate("gfx_shadow_type", "Shadow technique", CVAR_ARCHIVE | CVAR_TYPE_INT, "1"/*(int)GfxShadowType::PSSM*/); App::gfx_extcam_mode = this->CVarCreate("gfx_extcam_mode", "External Camera Mode", CVAR_ARCHIVE | CVAR_TYPE_INT, "2"/*(int)GfxExtCamMode::PITCHING*/); App::gfx_sky_mode = this->CVarCreate("gfx_sky_mode", "Sky effects", CVAR_ARCHIVE | CVAR_TYPE_INT, "1"/*(int)GfxSkyMode::CAELUM*/); + App::gfx_sky_time_cycle = this->CVarCreate("gfx_sky_time_cycle", "", CVAR_TYPE_BOOL, "false"); + App::gfx_sky_time_speed = this->CVarCreate("gfx_sky_time_speed", "", CVAR_TYPE_INT, "300"); App::gfx_texture_filter = this->CVarCreate("gfx_texture_filter", "Texture Filtering", CVAR_ARCHIVE | CVAR_TYPE_INT, "3"/*(int)GfxTexFilter::ANISOTROPIC*/); App::gfx_vegetation_mode = this->CVarCreate("gfx_vegetation_mode", "Vegetation", CVAR_ARCHIVE | CVAR_TYPE_INT, "3"/*(int)GfxVegetation::FULL*/); App::gfx_water_mode = this->CVarCreate("gfx_water_mode", "Water effects", CVAR_ARCHIVE | CVAR_TYPE_INT, "3"/*(int)GfxWaterMode::FULL_FAST*/);