diff --git a/TR5Main/Game/effects/weather.cpp b/TR5Main/Game/effects/weather.cpp index 73ceba4f4..863e2a455 100644 --- a/TR5Main/Game/effects/weather.cpp +++ b/TR5Main/Game/effects/weather.cpp @@ -62,10 +62,18 @@ namespace Environment FlashProgress = 0.0f; FlashColorBase = Vector3::Zero; - // Clear weather particles + // Clear weather + Weather = WeatherType::None; + WeatherStrength = 1.0f; Particles.clear(); } + void EnvironmentController::SetWeather(WeatherType weather, float strength) + { + Weather = weather; + WeatherStrength = strength; + } + void EnvironmentController::Flash(int r, int g, int b, float speed) { FlashProgress = 1.0f; @@ -203,13 +211,10 @@ namespace Environment if (Particles.size() > 0) Particles.erase(std::remove_if(Particles.begin(), Particles.end(), [](const WeatherParticle& part) { return !part.Enabled; }), Particles.end()); - // TEST! - Weather = WeatherType::Rain; - if (Weather == WeatherType::None) return; - int spawnDensity = (Weather == WeatherType::Rain) ? RAIN_SPAWN_DENSITY : SNOW_SPAWN_DENSITY; + int spawnDensity = round((float)(Weather == WeatherType::Rain ? RAIN_SPAWN_DENSITY : SNOW_SPAWN_DENSITY) * WeatherStrength); int maxCount = (Weather == WeatherType::Rain) ? WEATHER_PARTICLES_MAX_COUNT : WEATHER_PARTICLES_MAX_COUNT / SNOW_PARTICLES_COUNT_DIVIDER; int newParticlesCount = 0; diff --git a/TR5Main/Game/effects/weather.h b/TR5Main/Game/effects/weather.h index ea584dbb0..8b0b553c2 100644 --- a/TR5Main/Game/effects/weather.h +++ b/TR5Main/Game/effects/weather.h @@ -9,11 +9,11 @@ namespace Environment constexpr auto WEATHER_PARTICLES_MAX_COUNT = 1024; constexpr auto SNOW_PARTICLES_COUNT_DIVIDER = 2; - constexpr auto SNOW_SPAWN_DENSITY = 32; - constexpr auto RAIN_SPAWN_DENSITY = 256; + constexpr auto SNOW_SPAWN_DENSITY = 16; + constexpr auto RAIN_SPAWN_DENSITY = 32; constexpr auto MAX_SNOW_SIZE = 32; - constexpr auto MAX_RAIN_SIZE = 96; + constexpr auto MAX_RAIN_SIZE = 128; constexpr auto WEATHER_PARTICLES_TRANSPARENCY = 0.8f; constexpr auto WEATHER_PARTICLES_NEAR_DEATH_LIFE_VALUE = 16; @@ -57,14 +57,15 @@ namespace Environment const std::vector& GetParticles() const { return Particles; } + void SetWeather(WeatherType weather, float strength); void Flash(int r, int g, int b, float speed); void Update(); void Clear(); private: // Weather + float WeatherStrength = 1.0f; WeatherType Weather = WeatherType::Snow; - int WeatherStrength; std::vector Particles; // Sky diff --git a/TR5Main/Renderer/RenderEnums.h b/TR5Main/Renderer/RenderEnums.h index 118c4af67..95bff5693 100644 --- a/TR5Main/Renderer/RenderEnums.h +++ b/TR5Main/Renderer/RenderEnums.h @@ -76,14 +76,6 @@ enum RENDERER_SPRITE_TYPE SPRITE_TYPE_BILLBOARD_LOOKAT }; -enum RENDERER_SPRITE_ROTATION -{ - SPRITE_ROTATION_0_DEGREES, - SPRITE_ROTATION_90_DEGREES, - SPRITE_ROTATION_180_DEGREES, - SPRITE_ROTATION_270_DEGREES, -}; - enum RENDERER_POLYGON_SHAPE { RENDERER_POLYGON_QUAD, diff --git a/TR5Main/Renderer/Renderer11DrawEffect.cpp b/TR5Main/Renderer/Renderer11DrawEffect.cpp index 547625fda..c677183f1 100644 --- a/TR5Main/Renderer/Renderer11DrawEffect.cpp +++ b/TR5Main/Renderer/Renderer11DrawEffect.cpp @@ -123,7 +123,7 @@ namespace TEN::Renderer addSpriteBillboardConstrained(&m_sprites[Objects[ID_DEFAULT_SPRITES].meshIndex + SPR_LIGHTHING], c, Vector4(r / 255.0f, g / 255.0f, b / 255.0f, 1.0f), - SPRITE_ROTATION_90_DEGREES, + (PI / 2), 1.0f, { arc->width * 8.0f, Vector3::Distance(pos1, pos2) },