From c14123b3d06bb91527be7e0ff2806aa327ed9312 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Thu, 31 Aug 2023 15:34:58 +0900 Subject: [PATCH] Minor refactoring --- src/common_constants.cc | 4 ++++ src/common_constants.h | 1 + src/screen_trunner.cc | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/common_constants.cc b/src/common_constants.cc index 16d2f3a..2b3dcf5 100644 --- a/src/common_constants.cc +++ b/src/common_constants.cc @@ -39,3 +39,7 @@ void set_color_from_neon_color(NeonColor nc, Color *c_out) { break; } } + +void set_color_from_neon_random(Color *c_out) { + set_color_from_neon_color(get_random_neon_color(), c_out); +} diff --git a/src/common_constants.h b/src/common_constants.h index 574a1e4..ba8d7c0 100644 --- a/src/common_constants.h +++ b/src/common_constants.h @@ -22,5 +22,6 @@ enum class NeonColor { extern NeonColor get_random_neon_color(); extern void set_color_from_neon_color(NeonColor nc, Color *c_out); +extern void set_color_from_neon_random(Color *c_out); #endif diff --git a/src/screen_trunner.cc b/src/screen_trunner.cc index 975d36b..397ec8c 100644 --- a/src/screen_trunner.cc +++ b/src/screen_trunner.cc @@ -109,7 +109,7 @@ bool TRunnerScreen::update(float dt, bool is_resized) { if (walker_hack_success && controlled_walker_idx.has_value()) { walkers[controlled_walker_idx.value()].set_player_controlled(true); Color color; - set_color_from_neon_color(get_random_neon_color(), &color); + set_color_from_neon_random(&color); electricityEffects.push_back(ElectricityEffect( walkers[controlled_walker_idx.value()].get_body_pos(), ELECTRICITY_EFFECT_RADIUS, ELECTRICITY_EFFECT_LINE_COUNT,