diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-20 14:33:09 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-20 14:33:09 +1000 |
commit | 6352e8e3196f78388b6c771073f9e03eaa612673 (patch) | |
tree | e23772f79a7fbc41bc9108951e9e136857484bf4 /source/game/StarLightSource.cpp | |
parent | 6741a057e5639280d85d0f88ba26f000baa58f61 (diff) |
everything everywhere
all at once
Diffstat (limited to 'source/game/StarLightSource.cpp')
-rw-r--r-- | source/game/StarLightSource.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/source/game/StarLightSource.cpp b/source/game/StarLightSource.cpp new file mode 100644 index 0000000..65b7429 --- /dev/null +++ b/source/game/StarLightSource.cpp @@ -0,0 +1,32 @@ +#include "StarLightSource.hpp" +#include "StarDataStreamExtra.hpp" + +namespace Star { + +void LightSource::translate(Vec2F const& pos) { + position += pos; +} + +DataStream& operator<<(DataStream& ds, LightSource const& lightSource) { + ds.write(lightSource.position); + ds.write(lightSource.color); + ds.write(lightSource.pointLight); + ds.write(lightSource.pointBeam); + ds.write(lightSource.beamAngle); + ds.write(lightSource.beamAmbience); + + return ds; +} + +DataStream& operator>>(DataStream& ds, LightSource& lightSource) { + ds.read(lightSource.position); + ds.read(lightSource.color); + ds.read(lightSource.pointLight); + ds.read(lightSource.pointBeam); + ds.read(lightSource.beamAngle); + ds.read(lightSource.beamAmbience); + + return ds; +} + +} |