[colobot] 09/74: Added performance counter for UI particles

Didier Raboud odyx at moszumanska.debian.org
Mon Nov 7 07:49:59 UTC 2016


This is an automated email from the git hooks/post-receive script.

odyx pushed a commit to branch debian/master
in repository colobot.

commit dbe7fd6ef074e3ce43cdd30ef357d73f279ffd5c
Author: krzys-h <krzys_h at interia.pl>
Date:   Sun Jul 24 18:19:37 2016 +0200

    Added performance counter for UI particles
---
 src/common/profiler.h          |  3 ++-
 src/graphics/engine/engine.cpp | 14 +++++++++-----
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/common/profiler.h b/src/common/profiler.h
index 9e22207..d0d373a 100644
--- a/src/common/profiler.h
+++ b/src/common/profiler.h
@@ -39,7 +39,8 @@ enum PerformanceCounter
     PCNT_UPDATE_CBOT,           //! < running CBot code (part of CRobotMain update)
 
     PCNT_RENDER_ALL,            //! < the whole rendering process
-    PCNT_RENDER_PARTICLE,       //! < rendering the particles in 3D
+    PCNT_RENDER_PARTICLE_WORLD, //! < rendering the particles in 3D
+    PCNT_RENDER_PARTICLE_IFACE, //! < rendering the particles in 2D interface
     PCNT_RENDER_WATER,          //! < rendering the water
     PCNT_RENDER_TERRAIN,        //! < rendering the terrain
     PCNT_RENDER_OBJECTS,        //! < rendering the 3D objects
diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp
index bbda7dc..7e5d4a8 100644
--- a/src/graphics/engine/engine.cpp
+++ b/src/graphics/engine/engine.cpp
@@ -3481,9 +3481,9 @@ void CEngine::Draw3DScene()
     }
     m_displayGoto.clear();
 
-    CProfiler::StartPerformanceCounter(PCNT_RENDER_PARTICLE);
+    CProfiler::StartPerformanceCounter(PCNT_RENDER_PARTICLE_WORLD);
     m_particle->DrawParticle(SH_WORLD); // draws the particles of the 3D world
-    CProfiler::StopPerformanceCounter(PCNT_RENDER_PARTICLE);
+    CProfiler::StopPerformanceCounter(PCNT_RENDER_PARTICLE_WORLD);
 
     m_device->SetRenderState(RENDER_STATE_LIGHTING, true);
 
@@ -4034,7 +4034,9 @@ void CEngine::DrawInterface()
 
     if (!m_screenshotMode && m_renderInterface)
     {
+        CProfiler::StartPerformanceCounter(PCNT_RENDER_PARTICLE_IFACE);
         m_particle->DrawParticle(SH_INTERFACE);  // draws the particles of the interface
+        CProfiler::StopPerformanceCounter(PCNT_RENDER_PARTICLE_IFACE);
     }
 
     // 3D objects drawn in front of interface
@@ -5033,7 +5035,7 @@ void CEngine::DrawStats()
 
     float height = m_text->GetAscent(FONT_COLOBOT, 13.0f);
     float width = 0.4f;
-    const int TOTAL_LINES = 21;
+    const int TOTAL_LINES = 22;
 
     Math::Point pos(0.05f * m_size.x/m_size.y, 0.05f + TOTAL_LINES * height);
 
@@ -5080,6 +5082,7 @@ void CEngine::DrawStats()
         drawStatsValue(name, CProfiler::GetPerformanceCounterTime(counter));
     };
 
+    // TODO: Find a more generic way to calculate these in CProfiler
 
     long long engineUpdate = CProfiler::GetPerformanceCounterTime(PCNT_UPDATE_ENGINE) -
                              CProfiler::GetPerformanceCounterTime(PCNT_UPDATE_PARTICLE);
@@ -5092,7 +5095,7 @@ void CEngine::DrawStats()
                             CProfiler::GetPerformanceCounterTime(PCNT_UPDATE_GAME);
 
     long long otherRender = CProfiler::GetPerformanceCounterTime(PCNT_RENDER_ALL) -
-                            CProfiler::GetPerformanceCounterTime(PCNT_RENDER_PARTICLE) -
+                            CProfiler::GetPerformanceCounterTime(PCNT_RENDER_PARTICLE_WORLD) -
                             CProfiler::GetPerformanceCounterTime(PCNT_RENDER_WATER) -
                             CProfiler::GetPerformanceCounterTime(PCNT_RENDER_TERRAIN) -
                             CProfiler::GetPerformanceCounterTime(PCNT_RENDER_OBJECTS) -
@@ -5109,11 +5112,12 @@ void CEngine::DrawStats()
     drawStatsValue(  "    Other update",      otherUpdate);
     drawStatsLine(   "");
     drawStatsCounter("Frame render",      PCNT_RENDER_ALL);
-    drawStatsCounter("    Particle render",   PCNT_RENDER_PARTICLE);
+    drawStatsCounter("    Particle render",   PCNT_RENDER_PARTICLE_WORLD);
     drawStatsCounter("    Water render",      PCNT_RENDER_WATER);
     drawStatsCounter("    Terrain render",    PCNT_RENDER_TERRAIN);
     drawStatsCounter("    Objects render",    PCNT_RENDER_OBJECTS);
     drawStatsCounter("    UI render",         PCNT_RENDER_INTERFACE);
+    drawStatsCounter("        particles",     PCNT_RENDER_PARTICLE_IFACE);
     drawStatsCounter("    Shadow map render", PCNT_RENDER_SHADOW_MAP);
     drawStatsValue(  "    Other render",      otherRender);
     drawStatsCounter("Swap buffers & VSync",  PCNT_SWAP_BUFFERS);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git



More information about the Pkg-games-commits mailing list