summaryrefslogtreecommitdiffstats
path: root/pacman-c++/animationmanager.cpp
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2011-04-05 01:29:33 +0200
committermanuel <manuel@mausz.at>2011-04-05 01:29:33 +0200
commit4232f8450d896068713d988cf5541835c3818682 (patch)
tree470916a3e1978419d41115eb1e87a0928769e03c /pacman-c++/animationmanager.cpp
parent3dba415cd9741874cdaf0781d7e725808c8a2b8d (diff)
downloadfoop-4232f8450d896068713d988cf5541835c3818682.tar.gz
foop-4232f8450d896068713d988cf5541835c3818682.tar.bz2
foop-4232f8450d896068713d988cf5541835c3818682.zip
- we love ogg, we hate mp3/wav
- a lot of coding style/intent fix - add constant.h to pro files
Diffstat (limited to 'pacman-c++/animationmanager.cpp')
-rw-r--r--pacman-c++/animationmanager.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/pacman-c++/animationmanager.cpp b/pacman-c++/animationmanager.cpp
index 69bec53..f4ddef7 100644
--- a/pacman-c++/animationmanager.cpp
+++ b/pacman-c++/animationmanager.cpp
@@ -11,46 +11,46 @@ AnimationManager::AnimationManager()
11 11
12AnimationManager *AnimationManager::self() 12AnimationManager *AnimationManager::self()
13{ 13{
14 if (!instance) 14 if (!instance)
15 instance = new AnimationManager; 15 instance = new AnimationManager;
16 return instance; 16 return instance;
17} 17}
18 18
19void AnimationManager::registerAnimation(QAbstractAnimation *anim) 19void AnimationManager::registerAnimation(QAbstractAnimation *anim)
20{ 20{
21 QObject::connect(anim, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterAnimation_helper(QObject*))); 21 QObject::connect(anim, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterAnimation_helper(QObject*)));
22 animations.append(anim); 22 animations.append(anim);
23} 23}
24 24
25void AnimationManager::unregisterAnimation_helper(QObject *obj) 25void AnimationManager::unregisterAnimation_helper(QObject *obj)
26{ 26{
27 unregisterAnimation(static_cast<QAbstractAnimation*>(obj)); 27 unregisterAnimation(static_cast<QAbstractAnimation*>(obj));
28} 28}
29 29
30void AnimationManager::unregisterAnimation(QAbstractAnimation *anim) 30void AnimationManager::unregisterAnimation(QAbstractAnimation *anim)
31{ 31{
32 QObject::disconnect(anim, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterAnimation_helper(QObject*))); 32 QObject::disconnect(anim, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterAnimation_helper(QObject*)));
33 animations.removeAll(anim); 33 animations.removeAll(anim);
34} 34}
35 35
36void AnimationManager::unregisterAllAnimations() 36void AnimationManager::unregisterAllAnimations()
37{ 37{
38 animations.clear(); 38 animations.clear();
39} 39}
40 40
41void AnimationManager::pauseAll() 41void AnimationManager::pauseAll()
42{ 42{
43 foreach (QAbstractAnimation* animation, animations) 43 foreach (QAbstractAnimation* animation, animations)
44 { 44 {
45 if (animation->state() == QAbstractAnimation::Running) 45 if (animation->state() == QAbstractAnimation::Running)
46 animation->pause(); 46 animation->pause();
47 } 47 }
48} 48}
49void AnimationManager::resumeAll() 49void AnimationManager::resumeAll()
50{ 50{
51 foreach (QAbstractAnimation* animation, animations) 51 foreach (QAbstractAnimation* animation, animations)
52 { 52 {
53 if (animation->state() == QAbstractAnimation::Paused) 53 if (animation->state() == QAbstractAnimation::Paused)
54 animation->resume(); 54 animation->resume();
55 } 55 }
56} 56}