Skip to content

Commit

Permalink
added caelum cycle button
Browse files Browse the repository at this point in the history
  • Loading branch information
tritonas00 authored and Petr Ohlídal committed Sep 2, 2021
1 parent e65e200 commit eab4a09
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/main/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions source/main/Application.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions source/main/GameContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
6 changes: 6 additions & 0 deletions source/main/gui/panels/GUI_TopMenubar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>() != MpState::CONNECTED && App::GetSimTerrain()->getWater())
Expand Down
2 changes: 2 additions & 0 deletions source/main/system/CVar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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*/);
Expand Down

0 comments on commit eab4a09

Please # to comment.