Crossfire Server, Trunk
AnimationWrapper.cpp
Go to the documentation of this file.
1 /*
2  * Crossfire -- cooperative multi-player graphical RPG and adventure game
3  *
4  * Copyright (c) 2022 the Crossfire Development Team
5  *
6  * Crossfire is free software and comes with ABSOLUTELY NO WARRANTY. You are
7  * welcome to redistribute it under certain conditions. For details, please
8  * see COPYING and LICENSE.
9  *
10  * The authors can be reached via e-mail at <crossfire@metalforge.org>.
11  */
12 
13 #include "AnimationWrapper.h"
14 #include "../ResourcesManager.h"
15 #include "../CREPixmap.h"
17 
19  : AssetTWrapper(parent, "Animation", anim), myResourcesManager(resourcesManager) {
20 }
21 
23  auto face = dynamic_cast<const FaceWrapper *>(asset);
24  if (face) {
25  for (uint16_t f = 0; f < myWrappedItem->num_animations; f++) {
26  if (face->wrappedItem() == myWrappedItem->faces[f]) {
27  return Uses;
28  }
29  }
30  return DoesntUse;
31  }
32  return DoesntUse;
33 }
AssetTWrapper< Animations >::myWrappedItem
Animations * myWrappedItem
Definition: AssetWrapper.h:97
ResourcesManager
Definition: ResourcesManager.h:79
AssetWrapper::PossibleUse
PossibleUse
Definition: AssetWrapper.h:28
AnimationWrapper::AnimationWrapper
AnimationWrapper(AssetWrapper *parent, Animations *anim, ResourcesManager *resourcesManager)
Definition: AnimationWrapper.cpp:18
FaceWrapper
Definition: FaceWrapper.h:27
animations_struct::num_animations
uint8_t num_animations
Definition: face.h:27
AssetWrapper
Definition: AssetWrapper.h:22
AnimationWrapper.h
AnimationWrapper::uses
virtual PossibleUse uses(const AssetWrapper *asset, std::string &) const override
Definition: AnimationWrapper.cpp:22
AssetWrapper::Uses
@ Uses
Definition: AssetWrapper.h:28
animate.anim
string anim
Definition: animate.py:20
AssetWrapperPanel.h
animations_struct
Definition: face.h:25
animations_struct::faces
const Face ** faces
Definition: face.h:30
AssetWrapper::DoesntUse
@ DoesntUse
Definition: AssetWrapper.h:28
AssetTWrapper
Definition: AssetWrapper.h:87