• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include "animation_type.h"
17 
18 #include <scene/ext/util.h>
19 
SCENE_BEGIN_NAMESPACE()20 SCENE_BEGIN_NAMESPACE()
21 
22 bool AnimationResourceType::Build(const META_NS::IMetadata::Ptr& d)
23 {
24     bool res = Super::Build(d);
25     if (res) {
26         auto context = GetInterfaceBuildArg<IRenderContext>(d, "RenderContext");
27         if (!context) {
28             CORE_LOG_E("Invalid arguments to construct AnimationResourceType");
29             return false;
30         }
31         context_ = context;
32     }
33     return res;
34 }
GetResourceName() const35 BASE_NS::string AnimationResourceType::GetResourceName() const
36 {
37     return "AnimationResource";
38 }
GetResourceType() const39 BASE_NS::Uid AnimationResourceType::GetResourceType() const
40 {
41     return ClassId::AnimationResource.Id().ToUid();
42 }
LoadResource(const StorageInfo & s) const43 CORE_NS::IResource::Ptr AnimationResourceType::LoadResource(const StorageInfo& s) const
44 {
45     return nullptr;
46 }
SaveResource(const CORE_NS::IResource::ConstPtr & p,const StorageInfo & s) const47 bool AnimationResourceType::SaveResource(const CORE_NS::IResource::ConstPtr& p, const StorageInfo& s) const
48 {
49     return true;
50 }
ReloadResource(const StorageInfo & s,const CORE_NS::IResource::Ptr &) const51 bool AnimationResourceType::ReloadResource(const StorageInfo& s, const CORE_NS::IResource::Ptr&) const
52 {
53     return false;
54 }
55 
56 SCENE_END_NAMESPACE()