diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-03-19 18:21:54 +1100 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-03-19 18:21:54 +1100 |
commit | 983bb82a96707ae81be5c35e7f9af700ade7d77e (patch) | |
tree | 7594648ca829fc8b4c958d02f86b9cc22b04f5d7 /source/game/StarWorldClient.hpp | |
parent | 17ea975970d8f2be994bb1c8e7646f9c8a6c4647 (diff) |
Async lighting improvements
Diffstat (limited to 'source/game/StarWorldClient.hpp')
-rw-r--r-- | source/game/StarWorldClient.hpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/source/game/StarWorldClient.hpp b/source/game/StarWorldClient.hpp index 3fe66eb..6ccd52e 100644 --- a/source/game/StarWorldClient.hpp +++ b/source/game/StarWorldClient.hpp @@ -170,7 +170,7 @@ public: void collectLiquid(List<Vec2I> const& tilePositions, LiquidId liquidId); - void waitForLighting(Image* out = nullptr); + Maybe<Vec2I> waitForLighting(Image* out = nullptr); typedef std::function<bool(PlayerPtr, StringView)> BroadcastCallback; BroadcastCallback& broadcastCallback(); @@ -210,6 +210,7 @@ private: typedef function<ClientTile const& (Vec2I)> ClientTileGetter; void lightingTileGather(); + void lightingCalc(); void lightingMain(); void initWorld(WorldStartPacket const& packet); @@ -272,9 +273,18 @@ private: Mutex m_lightingMutex; ConditionVariable m_lightingCond; + atomic<bool> m_stopLightingThread; + + Mutex m_lightMapPrepMutex; Mutex m_lightMapMutex; + + Image m_pendingLightMap; Image m_lightMap; - atomic<bool> m_stopLightingThread; + List<LightSource> m_pendingLights; + List<std::pair<Vec2F, Vec3B>> m_pendingParticleLights; + RectI m_pendingLightRange; + Vec2I m_lightMinPosition; + List<PreviewTile> m_previewTiles; SkyPtr m_sky; |