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

summaryrefslogtreecommitdiff
path: root/source/game/StarLightSource.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2024-03-26 07:31:33 +1100
committerKae <80987908+Novaenia@users.noreply.github.com>2024-03-26 07:31:33 +1100
commitc484fab32dcac655164f082805d1d55d1d058f2f (patch)
tree9eeabdaee723a88bbebdd77d41d1bb93ee3def83 /source/game/StarLightSource.cpp
parent77d7f8eb81af21dd231f6384951fc2c14c149d5c (diff)
experiment: auto-conversion of object spread lights to hybrid spread/point lights
Diffstat (limited to 'source/game/StarLightSource.cpp')
-rw-r--r--source/game/StarLightSource.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/game/StarLightSource.cpp b/source/game/StarLightSource.cpp
index 65b7429..b20b15c 100644
--- a/source/game/StarLightSource.cpp
+++ b/source/game/StarLightSource.cpp
@@ -3,6 +3,12 @@
namespace Star {
+EnumMap<LightType> const LightTypeNames{
+ {LightType::Spread, "Spread"},
+ {LightType::Point, "Point"},
+ {LightType::PointAsSpread, "PointAsSpread"}
+};
+
void LightSource::translate(Vec2F const& pos) {
position += pos;
}
@@ -10,7 +16,7 @@ void LightSource::translate(Vec2F const& pos) {
DataStream& operator<<(DataStream& ds, LightSource const& lightSource) {
ds.write(lightSource.position);
ds.write(lightSource.color);
- ds.write(lightSource.pointLight);
+ ds.write(lightSource.type);
ds.write(lightSource.pointBeam);
ds.write(lightSource.beamAngle);
ds.write(lightSource.beamAmbience);
@@ -21,7 +27,7 @@ DataStream& operator<<(DataStream& ds, LightSource const& lightSource) {
DataStream& operator>>(DataStream& ds, LightSource& lightSource) {
ds.read(lightSource.position);
ds.read(lightSource.color);
- ds.read(lightSource.pointLight);
+ ds.read(lightSource.type);
ds.read(lightSource.pointBeam);
ds.read(lightSource.beamAngle);
ds.read(lightSource.beamAmbience);