1 /*
2  * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net)
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  */
9 #include "PhaseLocker.h"
10 
11 #include "minmax.h"
12 
13 //-----------------------------------------------------------------
PhaseLocker()14 PhaseLocker::PhaseLocker()
15 {
16     m_lockPhases = 0;
17 }
18 //-----------------------------------------------------------------
19 /**
20  * Reserve game cycle for blocking animation.
21  * @param count how much phases we need
22  */
23     void
ensurePhases(int count)24 PhaseLocker::ensurePhases(int count)
25 {
26     m_lockPhases = max(m_lockPhases, count);
27 }
28 //-----------------------------------------------------------------
29 void
decLock()30 PhaseLocker::decLock()
31 {
32     if (m_lockPhases > 0) {
33         m_lockPhases--;
34     }
35 }
36 
37