Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/base
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2024-03-19 18:21:54 +1100
committerKae <80987908+Novaenia@users.noreply.github.com>2024-03-19 18:21:54 +1100
commit983bb82a96707ae81be5c35e7f9af700ade7d77e (patch)
tree7594648ca829fc8b4c958d02f86b9cc22b04f5d7 /source/base
parent17ea975970d8f2be994bb1c8e7646f9c8a6c4647 (diff)
Async lighting improvements
Diffstat (limited to 'source/base')
-rw-r--r--source/base/StarCellularLighting.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/source/base/StarCellularLighting.cpp b/source/base/StarCellularLighting.cpp
index e4fe8dd..c0a92ea 100644
--- a/source/base/StarCellularLighting.cpp
+++ b/source/base/StarCellularLighting.cpp
@@ -89,12 +89,17 @@ void CellularLightingCalculator::calculate(Image& output) {
output.reset(arrayMax[0] - arrayMin[0], arrayMax[1] - arrayMin[1], PixelFormat::RGB24);
- for (size_t x = arrayMin[0]; x < arrayMax[0]; ++x) {
- for (size_t y = arrayMin[1]; y < arrayMax[1]; ++y) {
- if (m_monochrome)
+ if (m_monochrome) {
+ for (size_t x = arrayMin[0]; x < arrayMax[0]; ++x) {
+ for (size_t y = arrayMin[1]; y < arrayMax[1]; ++y) {
output.set24(x - arrayMin[0], y - arrayMin[1], Color::grayf(m_lightArray.right().getLight(x, y)).toRgb());
- else
+ }
+ }
+ } else {
+ for (size_t x = arrayMin[0]; x < arrayMax[0]; ++x) {
+ for (size_t y = arrayMin[1]; y < arrayMax[1]; ++y) {
output.set24(x - arrayMin[0], y - arrayMin[1], Color::v3fToByte(m_lightArray.left().getLight(x, y)));
+ }
}
}
}