[NiL-SVN] SF.net SVN: nil: [522] trunk/nil-ng/src/common/World.cc
Status: Alpha
Brought to you by:
e-user
|
From: <e-...@us...> - 2007-09-22 21:11:20
|
Revision: 522
http://nil.svn.sourceforge.net/nil/?rev=522&view=rev
Author: e-user
Date: 2007-09-22 14:11:23 -0700 (Sat, 22 Sep 2007)
Log Message:
-----------
improved performance test simulation
Modified Paths:
--------------
trunk/nil-ng/src/common/World.cc
Modified: trunk/nil-ng/src/common/World.cc
===================================================================
--- trunk/nil-ng/src/common/World.cc 2007-09-22 21:05:06 UTC (rev 521)
+++ trunk/nil-ng/src/common/World.cc 2007-09-22 21:11:23 UTC (rev 522)
@@ -60,9 +60,19 @@
console->set_mode(SdlConsole::FULLSCREEN);
+ unsigned short delta = 0;
unsigned int time = SDL_GetTicks();
- for (int i = 1; i < 100; i++)
- *console->cdebug << "Performance test " << i << IConsole::endl;
+ for (int i = 1; i < 100000; i++)
+ {
+ *console->cdebug << "Performance test " << i << IConsole::endl;
+ if(SDL_GetTicks() - delta >= 33)
+ {
+ SDL_Delay(100);
+ delta = SDL_GetTicks();
+ console->draw();
+ graphics.update();
+ }
+ }
*console->cmessage << "Done in "
<< (float) (SDL_GetTicks() - time) / 1000 << "s" << IConsole::endl;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|