diff options
Diffstat (limited to 'engines/sword25/gfx/framecounter.h')
-rwxr-xr-x | engines/sword25/gfx/framecounter.h | 83 |
1 files changed, 45 insertions, 38 deletions
diff --git a/engines/sword25/gfx/framecounter.h b/engines/sword25/gfx/framecounter.h index 650a2e9068..e91b3b0cda 100755 --- a/engines/sword25/gfx/framecounter.h +++ b/engines/sword25/gfx/framecounter.h @@ -1,21 +1,27 @@ -// ----------------------------------------------------------------------------- -// This file is part of Broken Sword 2.5 -// Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdörfer -// -// Broken Sword 2.5 is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// Broken Sword 2.5 is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Broken Sword 2.5; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -// ----------------------------------------------------------------------------- +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ #ifndef SWORD25_FRAMECOUNTER_H #define SWORD25_FRAMECOUNTER_H @@ -24,39 +30,39 @@ #include "sword25/kernel/common.h" #include "sword25/kernel/bs_stdint.h" +namespace Sword25 { + /** - @brief Eine einfache Klasse die einen Framecounter implementiert. -*/ -class BS_Framecounter -{ + * A simple class that implements a frame counter + */ +class BS_Framecounter { private: - enum - { + enum { DEFAULT_UPDATE_FREQUENCY = 10 }; public: /** - @brief Erzeugt ein neues BS_Framecounter Objekt. - @param UpdateFrequency gibt an wie oft der Framecounter in einer Sekunde aktualisiert werden soll.<br> - Der Standardwert ist 10. - */ + * Creates a new BS_Framecounter object + * @param UpdateFrequency Specifies how often the frame counter should be updated in a sceond. + * The default value is 10. + */ BS_Framecounter(int UpdateFrequency = DEFAULT_UPDATE_FREQUENCY); /** - @brief Bestimmt wie oft der Framecounter in einer Sekunde aktualisiert werden soll. - @param UpdateFrequency gibt an wie oft der Framecounter in einer Sekunde aktualisiert werden soll. - */ + * Determines how often the frame counter should be updated in a second. + * @param UpdateFrequency Specifies how often the frame counter should be updated in a second. + */ inline void SetUpdateFrequency(int UpdateFrequency); /** - @brief Diese Methode muss einmal pro Frame aufgerufen werden. - */ + * This method must be called once per frame. + */ void Update(); /** - @brief Gibt den aktuellen FPS-Wert zurück. - */ + * Returns the current FPS value. + */ int GetFPS() const { return m_FPS; } private: @@ -67,10 +73,11 @@ private: }; // Inlines -void BS_Framecounter::SetUpdateFrequency(int UpdateFrequency) -{ - // Frequenz in Laufzeit (in Microsekunden) umrechnen. +void BS_Framecounter::SetUpdateFrequency(int UpdateFrequency) { + // Frequency in time (converted to microseconds) m_UpdateDelay = 1000000 / UpdateFrequency; } +} // End of namespace Sword25 + #endif |