示例#1
0
//////////////////////////////////////////////////////////////////////////
// update
//virtual 
void CsCore::update()
{
	// Should be handled in CsPackage. Look into doing it.
	processCreateResources();
	processLoadingResources();
	processLoadedResource();
	processUnloadingResources();
	processCallbacks();
}
示例#2
0
//////////////////////////////////////////////////////////////////////////
// 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();
	}
}
示例#3
0
//////////////////////////////////////////////////////////////////////////
// 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!" );
}
示例#4
0
//////////////////////////////////////////////////////////////////////////
// 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
}
示例#5
0
//////////////////////////////////////////////////////////////////////////
// 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!" );
}
示例#6
0
//////////////////////////////////////////////////////////////////////////
// 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
}