コード例 #1
0
		void SkeletonAnimationManager::ReloadAssets()
		{
			Engine *eng = Engine::Get();

			const ResourcePool<SkeletonAnimation>::Iterator end = resPool->End();
			for(ResourcePool<SkeletonAnimation>::Iterator iter = resPool->Begin(); iter != end; ++iter) {
				SkeletonAnimation *skelAnim = iter.Ptr();
				Rid rid = skelAnim->rid;
				if(rid != RID_NONE) {
					skelAnim->~SkeletonAnimation();
					new(skelAnim) SkeletonAnimation();
					skelAnim->Load(rid);
				}
			}
		}
コード例 #2
0
		bool SkeletonAnimationManager::ReloadAsset(Rid rid)
		{
			Handle handle = resPool->Match(Resource::FindPredicate<SkeletonAnimation>(rid)) | managerId;
			if(handle == HANDLE_NONE) {
				return false;
			}
			SkeletonAnimation *skelAnim = resPool->Get(handle & HANDLE_VALUE_MASK);
			resPool->Free(handle & HANDLE_VALUE_MASK);

			if(rid != RID_NONE) {
				skelAnim->~SkeletonAnimation();
				new(skelAnim) SkeletonAnimation();
				return skelAnim->Load(rid);
			}
			return true;
		}
コード例 #3
0
		Handle SkeletonAnimationManager::Load(Rid rid)
		{
			Handle handle = resPool->Match(Resource::FindPredicate<SkeletonAnimation>(rid)) | managerId;
			if(handle != HANDLE_NONE) {
				return handle;
			}

			handle = resPool->Alloc() | managerId;
			SkeletonAnimation *skelAnim = resPool->Get(handle & HANDLE_VALUE_MASK);
			new(skelAnim) SkeletonAnimation();
		
			if(!skelAnim->Load(rid)) {
				resPool->Free(handle & HANDLE_VALUE_MASK);
				return HANDLE_NONE;
			}
			return handle;
		}