////////////////////////////////////////////////////////////////////////// // update //virtual void CsCore::update() { // Should be handled in CsPackage. Look into doing it. processCreateResources(); processLoadingResources(); processLoadedResource(); processUnloadingResources(); processCallbacks(); }
////////////////////////////////////////////////////////////////////////// // update //virtual void CsCore::update() { // TODO: Remove these, all is handled in CsResource now! processCreateResources(); processLoadingResources(); processLoadedResource(); processUnloadingResources(); // Garbage collection. // TODO: Mark packages for clean up instead of just iterating over them. if( IsCollectingGarbage_ ) { freeUnreferencedPackages(); } }
////////////////////////////////////////////////////////////////////////// // close //virtual void CsCore::close() { // Verify we have no more resources to be created or loading. BcVerifyMsg( CreateResources_.size() == 0, "CsCore: Resources to be created, but system is closing!" ); BcVerifyMsg( LoadingResources_.size() == 0, "CsCore: Resources currently loading, but system is closing!" ); // Finish processing unloading resources. if( UnloadingResources_.size() > 0 ) { processUnloadingResources(); } // Verify we don't have any left floating loaded or unloading. BcVerifyMsg( LoadedResources_.size() == 0, "CsCore: Resources still loaded, but system is closing!" ); BcVerifyMsg( UnloadingResources_.size() == 0, "CsCore: Resources still unloading, but system is closing!" ); }
////////////////////////////////////////////////////////////////////////// // close //virtual void CsCore::close() { // Verify we have no more resources to be created or loading. BcVerifyMsg( CreateResources_.size() == 0, "CsCore: Resources to be created, but system is closing!" ); BcVerifyMsg( LoadingResources_.size() == 0, "CsCore: Resources currently loading, but system is closing!" ); // Finish processing unloading resources. if( UnloadingResources_.size() > 0 ) { processUnloadingResources(); } // Verify we don't have any left floating loaded or unloading. BcVerifyMsg( LoadedResources_.size() == 0, "CsCore: Resources still loaded, but system is closing!" ); BcVerifyMsg( UnloadingResources_.size() == 0, "CsCore: Resources still unloading, but system is closing!" ); #if PSY_SERVER BcAssertMsg( FsCore::pImpl() != NULL, "CsCore: FsCore is NULL when unsubscribing from events!" ); FsCore::pImpl()->unsubscribe( fsEVT_MONITOR_MODIFIED, DelegateOnFileModified_ ); FsCore::pImpl()->unsubscribe( fsEVT_MONITOR_CREATED, DelegateOnFileModified_ ); #endif }
////////////////////////////////////////////////////////////////////////// // close //virtual void CsCore::close() { // Verify we have no more resources to be created or loading. BcVerifyMsg( CreateResources_.size() == 0, "CsCore: Resources to be created, but system is closing!" ); BcVerifyMsg( LoadingResources_.size() == 0, "CsCore: Resources currently loading, but system is closing!" ); while( PackageList_.size() > 0 ) { freeUnreferencedPackages(); // Finish processing unloading resources. if( UnloadingResources_.size() > 0 ) { processUnloadingResources(); } } if( LoadedResources_.size() > 0 ) { BcPrintf( "==========================================\n" ); BcPrintf( "CsCore: Dump Resource On Exit:\n" ); BcPrintf( "==========================================\n" ); TResourceListIterator It( LoadedResources_.begin() ); while( It != LoadedResources_.end() ) { CsResource* pResource = (*It); BcPrintf( "%s.%s:%s \n", (*pResource->getPackageName()).c_str(), (*pResource->getName()).c_str(), (*pResource->getTypeName()).c_str() ); ++It; } BcPrintf( "==========================================\n" ); } // Verify we don't have any left floating loaded or unloading. BcVerifyMsg( LoadedResources_.size() == 0, "CsCore: Resources still loaded, but system is closing! Has the scene cleaned up properly?" ); BcVerifyMsg( UnloadingResources_.size() == 0, "CsCore: Resources still unloading, but system is closing!" ); }
////////////////////////////////////////////////////////////////////////// // update //virtual void CsCore::update() { // TODO: Remove these, all is handled in CsResource now! processCreateResources(); processLoadingResources(); processLoadedResource(); processUnloadingResources(); #ifdef PSY_SERVER { // Import everything in the import list. BcScopedLock< BcMutex > Lock( ContainerLock_ ); CsResourceRef<> Handle; for( TImportListIterator Iter( ImportList_.begin() ); Iter != ImportList_.end(); ++Iter ) { internalImportResource( (*Iter), Handle, NULL, BcTrue ); } ImportList_.clear(); } #endif }