-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathAnimation.h
123 lines (103 loc) · 2.32 KB
/
Animation.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#pragma once
#include <vector>
#include <string>
#include <windows.h>
#include "utils.h"
enum FILTER_OPERATORS {
FILTER_AND,
FILTER_OR,
FILTER_NOT
};
struct Animation
{
int shortcutIndex;
std::string strShortcutIndex;
char* animLibrary;
char* animName;
int duration;
bool matchesFilter(std::string filterStr);
std::string toString() {
return strShortcutIndex + " " + std::string(animLibrary) + " " + std::string(animName) + " " + std::to_string(duration);
}
};
struct AnimationSequence
{
std::vector<Animation> animationsInSequence;
static AnimationSequence nullAnimationSequence() {
return AnimationSequence{ std::vector<Animation>() };
}
bool isNullAnimationSequence() {
if (animationsInSequence.size() == 0) {
return true;
}
else {
return false;
}
}
int getDurationOfAnimations() {
if (isNullAnimationSequence()) {
return 0;
}
else {
int duration = 0;
for (auto &animation : animationsInSequence) {
duration = duration + animation.duration;
}
return duration;
}
}
std::string toString() {
if (isNullAnimationSequence()) {
return "No animations";
}
else {
std::string strAnims = "";
for (auto &animation : animationsInSequence) {
strAnims += animation.strShortcutIndex +" ";
}
return strAnims;
}
}
};
struct AnimationFlag
{
std::string name;
int id;
bool isFacialAnimation() {
if (id == -1) {
return true;
}
else {
return false;
}
}
};
enum ANIMATION_FLAGS
{
ANIMATION_LOOP_FLAG1 = 1,
ANIMATION_FLAG2 = 2,
ANIMATION_FLAG3 = 4,
ANIMATION_FLAG4 = 8,
ANIMATION_UPPER_BODY_FLAG5 = 16,
ANIMATION_ALLOW_MOVEMENT_FLAG6 = 32,
ANIMATION_FLAG7 = 64,
ANIMATION_STOP_ON_MOVEMENT_FLAG8 = 128,
ANIMATION_CRAZY_FLAG9 = 256,
ANIMATION_FLAG10 = 512,
ANIMATION_FLAG11 = 1024,
ANIMATION_FLAG12 = 2048,
ANIMATION_FLAG13 = 4096,
ANIMATION_FLAG14 = 8162,
ANIMATION_FLAG15 = 16384,
ANIMATION_FLAG16 = 32768,
ANIMATION_FLAG17 = 65536,
ANIMATION_FLAG18 = 131072,
ANIMATION_FLAG19 = 262144,
};
bool initAnimations(std::string fileName);
std::vector<Animation> getAllAnimations();
Animation getAnimationForShortcutIndex(int index);
Animation getAnimationForShortcutIndex(std::string strIndex);
std::vector<AnimationFlag> getAnimationFlags();
AnimationFlag getDefaultAnimationFlag();
AnimationFlag getNextAnimationFlag(AnimationFlag animationFlag);