diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-07-03 18:31:12 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-07-03 18:31:12 +1000 |
commit | deb96742e020be5e83314a5a28ddba3c96df6f6e (patch) | |
tree | 84a3e2fe6b0fd852c14a50a82a21c2b352291801 /source/rendering/StarWorldPainter.cpp | |
parent | 1dacc0f41ad04a75e9fa3ca2bb6289aac57b68a7 (diff) |
Prevent particle copy, tweak debugging some more
probably not too time-saving
Diffstat (limited to 'source/rendering/StarWorldPainter.cpp')
-rw-r--r-- | source/rendering/StarWorldPainter.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/rendering/StarWorldPainter.cpp b/source/rendering/StarWorldPainter.cpp index 9a93365..7bcbb45 100644 --- a/source/rendering/StarWorldPainter.cpp +++ b/source/rendering/StarWorldPainter.cpp @@ -72,7 +72,7 @@ void WorldPainter::render(WorldRenderData& renderData, function<void()> lightWai if (lightWaiter) { auto start = Time::monotonicMicroseconds(); lightWaiter(); - LogMap::set("render_world_async_lighting_wait_time", strf(u8"{:05d}\u00b5s", Time::monotonicMicroseconds() - start)); + LogMap::set("client_render_world_async_light_wait", strf(u8"{:05d}\u00b5s", Time::monotonicMicroseconds() - start)); } if (renderData.isFullbright) { @@ -166,7 +166,10 @@ void WorldPainter::renderParticles(WorldRenderData& renderData, Particle::Layer const int textParticleFontSize = m_assets->json("/rendering.config:textParticleFontSize").toInt(); const RectF particleRenderWindow = RectF::withSize(Vec2F(), Vec2F(m_camera.screenSize())).padded(m_assets->json("/rendering.config:particleRenderWindowPadding").toInt()); - for (Particle const& particle : renderData.particles) { + if (!renderData.particles) + return; + + for (Particle const& particle : *renderData.particles) { if (layer != particle.layer) continue; @@ -218,7 +221,7 @@ void WorldPainter::renderParticles(WorldRenderData& renderData, Particle::Layer } else if (particle.type == Particle::Type::Text) { Vec2F position = m_camera.worldToScreen(particle.position); - unsigned size = round((float)textParticleFontSize * m_camera.pixelRatio() * particle.size); + int size = min(128.0f, round((float)textParticleFontSize * m_camera.pixelRatio() * particle.size)); if (size > 0) { m_textPainter->setFontSize(size); m_textPainter->setFontColor(particle.color.toRgba()); |