Browse Source

Fixing bug in counters

Panagiotis Christopoulos Charitos 10 years ago
parent
commit
5aa585e760
2 changed files with 4 additions and 2 deletions
  1. 2 0
      include/anki/core/Counters.h
  2. 2 2
      src/core/Counters.cpp

+ 2 - 0
include/anki/core/Counters.h

@@ -3,6 +3,8 @@
 // Code licensed under the BSD License.
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 // http://www.anki3d.org/LICENSE
 
 
+#pragma once
+
 #include "anki/util/StdTypes.h"
 #include "anki/util/StdTypes.h"
 #include "anki/util/Singleton.h"
 #include "anki/util/Singleton.h"
 #include "anki/util/DArray.h"
 #include "anki/util/DArray.h"

+ 2 - 2
src/core/Counters.cpp

@@ -130,7 +130,7 @@ void CountersManager::increaseCounter(Counter counter, U64 val)
 {
 {
 	ANKI_ASSERT(cinfo[U(counter)].m_flags & CF_U64);
 	ANKI_ASSERT(cinfo[U(counter)].m_flags & CF_U64);
 
 
-	if(cinfo[(U)counter].m_flags & CF_PER_FRAME)
+	if(cinfo[U(counter)].m_flags & CF_PER_FRAME)
 	{
 	{
 		m_perframeValues[U(counter)].m_int += val;
 		m_perframeValues[U(counter)].m_int += val;
 	}
 	}
@@ -255,7 +255,7 @@ void CountersManager::flush()
 				else
 				else
 				{
 				{
 					err = m_perrunFile.writeText("%" MAX_NAME "f",
 					err = m_perrunFile.writeText("%" MAX_NAME "f",
-						&m_perrunValues[i].m_float);
+						m_perrunValues[i].m_float);
 				}
 				}
 			}
 			}
 			else
 			else