]> git.tdb.fi Git - libs/gl.git/commitdiff
Miscellaneous fixes to ResourceManager
authorMikko Rasa <tdb@tdb.fi>
Thu, 18 Sep 2014 17:42:20 +0000 (20:42 +0300)
committerMikko Rasa <tdb@tdb.fi>
Thu, 18 Sep 2014 17:42:20 +0000 (20:42 +0300)
source/resourcemanager.cpp

index 8b647f31f9ef24f5bd7d13d2ae5bb46f46b54c98..a5c3691f9cb5caaae9d4f38af19ba6ac44c3bd7c 100644 (file)
@@ -114,7 +114,7 @@ void ResourceManager::tick()
 {
        LoadingThread::State thread_state = thread.get_state();
        bool check_total_size = false;
-       if(thread_state==LoadingThread::SYNC_PENDING)
+       if(thread_state==LoadingThread::SYNC_PENDING || thread_state==LoadingThread::LOAD_FINISHED)
        {
                thread.sync();
                check_total_size = true;
@@ -156,7 +156,7 @@ void ResourceManager::tick()
                                if(i->second.loaded && i->second.last_used<unload_limit)
                                {
                                        UInt64 impact = i->second.data_size*(frame-i->second.last_used);
-                                       if(!best || impact<best_impact)
+                                       if(!best || impact>best_impact)
                                        {
                                                best = &i->second;
                                                best_impact = impact;