diff options
author | Kai Blaschke <kai.blaschke@kb-dev.net> | 2024-02-19 23:29:39 +0100 |
---|---|---|
committer | Kai Blaschke <kai.blaschke@kb-dev.net> | 2024-02-19 23:44:59 +0100 |
commit | d0099a6d790b66f21e4e266e569d64fb82fb0a81 (patch) | |
tree | 69174faa3f95079e5e33e00970d161c9b3f02048 /source/base/StarCellularLighting.cpp | |
parent | 42fc1d6714036a2814f1e6ab293eaa0009320ef4 (diff) |
Fixed some uninitialized members
May have caused undefined behavior in few cases, as most of the fixed members were used before being initialized.
Diffstat (limited to 'source/base/StarCellularLighting.cpp')
-rw-r--r-- | source/base/StarCellularLighting.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/base/StarCellularLighting.cpp b/source/base/StarCellularLighting.cpp index 49c5676..e4fe8dd 100644 --- a/source/base/StarCellularLighting.cpp +++ b/source/base/StarCellularLighting.cpp @@ -2,8 +2,13 @@ namespace Star { -CellularLightingCalculator::CellularLightingCalculator(bool monochrome) { - setMonochrome(monochrome); +CellularLightingCalculator::CellularLightingCalculator(bool monochrome) + : m_monochrome(monochrome) +{ + if (monochrome) + m_lightArray.setRight(ScalarCellularLightArray()); + else + m_lightArray.setLeft(ColoredCellularLightArray()); } void CellularLightingCalculator::setMonochrome(bool monochrome) { |