Browse Source

Minor code convention & class documentation edit: put static variables to the beginning of .cpp file and don't use underscore.

Lasse Öörni 9 years ago
parent
commit
a090cd94fd
2 changed files with 8 additions and 8 deletions
  1. 4 4
      Source/Urho3D/Core/EventProfiler.cpp
  2. 4 4
      Source/Urho3D/Core/EventProfiler.h

+ 4 - 4
Source/Urho3D/Core/EventProfiler.cpp

@@ -35,6 +35,8 @@ namespace Urho3D
 static const int LINE_MAX_LENGTH = 256;
 static const int NAME_MAX_LENGTH = 30;
 
+bool EventProfiler::active = false;
+
 EventProfiler::EventProfiler(Context* context) : 
     Object(context),
     current_(0),
@@ -53,9 +55,9 @@ EventProfiler::~EventProfiler()
     root_ = 0;
 }
 
-void EventProfiler::SetActive(bool active)
+void EventProfiler::SetActive(bool newActive)
 {
-    active_ = active;
+    active = newActive;
 }
 
 void EventProfiler::BeginFrame()
@@ -172,6 +174,4 @@ void EventProfiler::PrintData(EventProfilerBlock* block, String& output, unsigne
         PrintData(i->second_, output, depth, maxDepth, showUnused, showTotal);
 }
 
-bool EventProfiler::active_ = false;
-
 }

+ 4 - 4
Source/Urho3D/Core/EventProfiler.h

@@ -174,10 +174,10 @@ public:
     /// Destruct.
     virtual ~EventProfiler();
 
-    /// Activate the event profiler to collect information. Request deactivation, will delete all blocks!
+    /// Activate the event profiler to collect information. This incurs slight performance hit on each SendEvent. By default inactive.
     static void SetActive(bool active);
     /// Return true if active.
-    static bool IsActive() { return active_; }
+    static bool IsActive() { return active; }
 
     /// Begin timing a profiling block.
     void BeginBlock(StringHash eventID)
@@ -228,8 +228,8 @@ private:
     unsigned intervalFrames_;
     /// Total frames.
     unsigned totalFrames_;
-    /// Profiler active.
-    static bool active_;
+    /// Profiler active. Default false.
+    static bool active;
 };
 
 }