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 ()
|
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 ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue