Crossfire Server, Trunk
AnimationWrapper.cpp
Go to the documentation of this file.
1
#include "
AnimationWrapper.h
"
2
#include "../ResourcesManager.h"
3
#include "../CREPixmap.h"
4
#include "
assets/AssetWrapperPanel.h
"
5
6
AnimationWrapper::AnimationWrapper
(
AssetWrapper
*parent,
Animations
*
anim
,
ResourcesManager
*resourcesManager)
7
:
AssetTWrapper
(parent,
"Animation"
,
anim
), myResourcesManager(resourcesManager) {
8
}
9
10
AssetWrapper::PossibleUse
AnimationWrapper::uses
(
const
AssetWrapper
*asset, std::string &)
const
{
11
auto
face =
dynamic_cast<
const
FaceWrapper
*
>
(asset);
12
if
(face) {
13
for
(uint16_t f = 0; f <
myWrappedItem
->
num_animations
; f++) {
14
if
(face->wrappedItem() ==
myWrappedItem
->
faces
[f]) {
15
return
Uses
;
16
}
17
}
18
return
DoesntUse
;
19
}
20
return
DoesntUse
;
21
}
22
23
void
AnimationWrapper::displayFillPanel
(QWidget *panel) {
24
AssetWrapperPanel
*p =
static_cast<
AssetWrapperPanel
*
>
(panel);
25
p->
setItem
(
this
);
26
}
AssetWrapperPanel
Definition:
AssetWrapperPanel.h:16
AssetTWrapper< Animations >::myWrappedItem
Animations * myWrappedItem
Definition:
AssetWrapper.h:87
ResourcesManager
Definition:
ResourcesManager.h:67
AssetWrapper::PossibleUse
PossibleUse
Definition:
AssetWrapper.h:14
AssetWrapperPanel::setItem
virtual void setItem(AssetWrapper *item) override
Definition:
AssetWrapperPanel.cpp:13
AnimationWrapper::AnimationWrapper
AnimationWrapper(AssetWrapper *parent, Animations *anim, ResourcesManager *resourcesManager)
Definition:
AnimationWrapper.cpp:6
AnimationWrapper::displayFillPanel
virtual void displayFillPanel(QWidget *panel) override
Definition:
AnimationWrapper.cpp:23
FaceWrapper
Definition:
FaceWrapper.h:15
animations_struct::num_animations
uint8_t num_animations
Definition:
face.h:27
AssetWrapper
Definition:
AssetWrapper.h:11
AnimationWrapper.h
AnimationWrapper::uses
virtual PossibleUse uses(const AssetWrapper *asset, std::string &) const override
Definition:
AnimationWrapper.cpp:10
AssetWrapper::Uses
@ Uses
Definition:
AssetWrapper.h:14
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:14
AssetTWrapper
Definition:
AssetWrapper.h:72
crossfire-crossfire-server
utils
cre
animations
AnimationWrapper.cpp
Generated by
1.8.17