mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
don't update rain during pause
This commit is contained in:
@@ -111,7 +111,7 @@ basic_precipitation::init() {
|
||||
void
|
||||
basic_precipitation::update() {
|
||||
|
||||
auto const timedelta { static_cast<float>( ( DebugModeFlag ? Timer::GetDeltaTime() : Timer::GetDeltaTime() ) ) };
|
||||
auto const timedelta = Timer::GetDeltaTime();
|
||||
|
||||
if( timedelta == 0.0 ) { return; }
|
||||
|
||||
|
||||
11
renderer.cpp
11
renderer.cpp
@@ -2797,12 +2797,17 @@ void opengl_renderer::Render_precipitation()
|
||||
::glRotated(roll, forward.x, 0.0, forward.z);
|
||||
}
|
||||
}
|
||||
if (Global.Weather == "rain:")
|
||||
if (!Global.iPause)
|
||||
{
|
||||
// oddly enough random streaks produce more natural looking rain than ones the eye can follow
|
||||
::glRotated(Random() * 360, 0.0, 1.0, 0.0);
|
||||
if (Global.Weather == "rain:")
|
||||
// oddly enough random streaks produce more natural looking rain than ones the eye can follow
|
||||
m_precipitationrotation = Random() * 360;
|
||||
else
|
||||
m_precipitationrotation = 0.0;
|
||||
}
|
||||
|
||||
::glRotated(m_precipitationrotation, 0.0, 1.0, 0.0);
|
||||
|
||||
model_ubs.set_modelview(OpenGLMatrices.data(GL_MODELVIEW));
|
||||
model_ubs.param[0] = interpolate(0.5f * (Global.DayLight.diffuse + Global.DayLight.ambient), colors::white, 0.5f * clamp<float>(Global.fLuminance, 0.f, 1.f));
|
||||
model_ubs.param[1].x = simulation::Environment.m_precipitation.get_textureoffset();
|
||||
|
||||
@@ -330,6 +330,8 @@ class opengl_renderer
|
||||
GLuint m_gltimequery = 0;
|
||||
GLuint64 m_gllasttime = 0;
|
||||
|
||||
double m_precipitationrotation;
|
||||
|
||||
glm::mat4 perspective_projection(float fov, float aspect, float z_near, float z_far);
|
||||
glm::mat4 perpsective_frustumtest_projection(float fov, float aspect, float z_near, float z_far);
|
||||
glm::mat4 ortho_projection(float left, float right, float bottom, float top, float z_near, float z_far);
|
||||
|
||||
Reference in New Issue
Block a user