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:104
ResourcesManager
Definition: ResourcesManager.h:80
AssetWrapper::PossibleUse
PossibleUse
Definition: AssetWrapper.h:32
AnimationWrapper::AnimationWrapper
AnimationWrapper(AssetWrapper *parent, Animations *anim, ResourcesManager *resourcesManager)
Definition: AnimationWrapper.cpp:18
FaceWrapper
Definition: FaceWrapper.h:24
AssetWrapper
Definition: AssetWrapper.h:25
AnimationWrapper.h
AnimationWrapper::uses
virtual PossibleUse uses(const AssetWrapper *asset, std::string &) const override
Definition: AnimationWrapper.cpp:22
AssetWrapper::Uses
@ Uses
Definition: AssetWrapper.h:32
animate.anim
string anim
Definition: animate.py:20
Animations::num_animations
uint8_t num_animations
Definition: face.h:27
AssetWrapperPanel.h
Animations::faces
const Face ** faces
Definition: face.h:30
Animations
Definition: face.h:25
AssetWrapper::DoesntUse
@ DoesntUse
Definition: AssetWrapper.h:32
AssetTWrapper
Definition: AssetWrapper.h:94