00001 /* 00002 * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 */ 00009 #include "PhaseLocker.h" 00010 00011 #include "minmax.h" 00012 00013 //----------------------------------------------------------------- 00014 PhaseLocker::PhaseLocker() 00015 { 00016 m_lockPhases = 0; 00017 } 00018 //----------------------------------------------------------------- 00019 /** 00020 * Reserve game cycle for blocking animation. 00021 * @param count how much phases we need 00022 */ 00023 void 00024 PhaseLocker::ensurePhases(int count) 00025 { 00026 m_lockPhases = max(m_lockPhases, count); 00027 } 00028 //----------------------------------------------------------------- 00029 void 00030 PhaseLocker::decLock() 00031 { 00032 if (m_lockPhases > 0) { 00033 m_lockPhases--; 00034 } 00035 } 00036