From 0bd7e4bbf8b1fef91690fbf72eedbf120a75b1f3 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Fri, 25 Aug 2023 13:12:14 +0900 Subject: [PATCH] Minor tweaks to spark effect --- src/spark_effect.cc | 2 ++ src/spark_effect.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/spark_effect.cc b/src/spark_effect.cc index 79f0863..b747e3b 100644 --- a/src/spark_effect.cc +++ b/src/spark_effect.cc @@ -7,6 +7,8 @@ SparkEffect::SparkEffect(int count, float lifetime, Vector3 pos, float pos_xz_variance, float radius) : sparks(), lifetime(lifetime), timer(0.0F) { + sparks.reserve(count); + Vector3 above_pos = pos; above_pos.y += radius; for (; count > 0; --count) { diff --git a/src/spark_effect.h b/src/spark_effect.h index 3746d69..0dde24a 100644 --- a/src/spark_effect.h +++ b/src/spark_effect.h @@ -10,7 +10,7 @@ constexpr float SPARK_RADIUS = 0.03F; constexpr float SPARK_VEL_RATE = 5.0F; constexpr float SPARK_VEL_VARIANCE = 1.0F; -constexpr float SPARK_ACC_RATE = 10.0F; +constexpr float SPARK_ACC_RATE = 8.0F; class SparkEffect { public: