mirror of https://github.com/skeeto/pixelcity.git
Loading screen compile is a little smarter with CPU cycles, which should make things load faster. Code cleanup.
This commit is contained in:
parent
f66a2e8da7
commit
9ff19c93f8
11
Entity.cpp
11
Entity.cpp
|
@ -210,6 +210,8 @@ float EntityProgress ()
|
|||
void EntityUpdate ()
|
||||
{
|
||||
|
||||
unsigned stop_time;
|
||||
|
||||
if (!TextureReady ()) {
|
||||
sorted = false;
|
||||
return;
|
||||
|
@ -218,10 +220,11 @@ void EntityUpdate ()
|
|||
qsort (entity_list, entity_count, sizeof (struct entity), do_compare);
|
||||
sorted = true;
|
||||
}
|
||||
|
||||
if (!compiled)
|
||||
for (int i = 0; i < 10; i++)
|
||||
do_compile ();
|
||||
//We want to do several cells at once. Enough to get things done, but
|
||||
//not so many that the program is unresponsive.
|
||||
stop_time = GetTickCount () + 100;
|
||||
while (!compiled && GetTickCount () < stop_time)
|
||||
do_compile ();
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue