Loading screen compile is a little smarter with CPU cycles, which should make things load faster. Code cleanup.

This commit is contained in:
Shamus Young 2009-05-07 22:09:35 +00:00
parent f66a2e8da7
commit 9ff19c93f8
1 changed files with 7 additions and 4 deletions

View File

@ -210,6 +210,8 @@ float EntityProgress ()
void EntityUpdate () void EntityUpdate ()
{ {
unsigned stop_time;
if (!TextureReady ()) { if (!TextureReady ()) {
sorted = false; sorted = false;
return; return;
@ -218,10 +220,11 @@ void EntityUpdate ()
qsort (entity_list, entity_count, sizeof (struct entity), do_compare); qsort (entity_list, entity_count, sizeof (struct entity), do_compare);
sorted = true; sorted = true;
} }
//We want to do several cells at once. Enough to get things done, but
if (!compiled) //not so many that the program is unresponsive.
for (int i = 0; i < 10; i++) stop_time = GetTickCount () + 100;
do_compile (); while (!compiled && GetTickCount () < stop_time)
do_compile ();
} }