|
From: <cn...@us...> - 2009-08-22 06:16:39
|
Revision: 507
http://hgengine.svn.sourceforge.net/hgengine/?rev=507&view=rev
Author: cnlohr
Date: 2009-08-22 06:16:33 +0000 (Sat, 22 Aug 2009)
Log Message:
-----------
switch to MHash for listing of all GL Calls, so I can still (sort of) profile when logging all calls
Modified Paths:
--------------
Mercury2/src/GLHeaders.h
Mercury2/src/GLHelpers.cpp
Modified: Mercury2/src/GLHeaders.h
===================================================================
--- Mercury2/src/GLHeaders.h 2009-08-22 06:15:15 UTC (rev 506)
+++ Mercury2/src/GLHeaders.h 2009-08-22 06:16:33 UTC (rev 507)
@@ -35,9 +35,8 @@
LOG.Write(ssprintf("GL FBO Error:%s", GlError2String(e).c_str())); \
assert(0); } }
-#include <map>
-
+#include <MercuryHash.h>
extern uint32_t GLCALLCOUNT;
-extern std::map<MString, uint32_t> GLFUNCTCOUNT;
+extern MHash< uint32_t> GLFUNCTCOUNT;
#endif
Modified: Mercury2/src/GLHelpers.cpp
===================================================================
--- Mercury2/src/GLHelpers.cpp 2009-08-22 06:15:15 UTC (rev 506)
+++ Mercury2/src/GLHelpers.cpp 2009-08-22 06:16:33 UTC (rev 507)
@@ -1,8 +1,9 @@
#include <GLHeaders.h>
#include <GLHelpers.h>
+#include <MercuryHash.h>
uint32_t GLCALLCOUNT = 0;
-std::map<MString, uint32_t> GLFUNCTCOUNT;
+MHash< uint32_t> GLFUNCTCOUNT;
MString GlError2String(uint32_t e)
{
@@ -117,13 +118,12 @@
void PrintGLFunctionCalls()
{
- std::map<MString,uint32_t>::iterator i;
+ MVector < MString > v;
+ GLFUNCTCOUNT.VectorIndices( v );
+ //We now know all the names of the functions that were called.
+ for( unsigned i = 0; i < v.size(); i++ )
+ LOG.Write(ssprintf( "%d ", GLFUNCTCOUNT[v[i]] ) + v[i] );
- for(i = GLFUNCTCOUNT.begin(); i != GLFUNCTCOUNT.end(); ++i)
- {
- LOG.Write(ssprintf( "%d ", i->second ) + i->first);
- }
-
GLFUNCTCOUNT.clear();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|