aboutsummaryrefslogtreecommitdiff
path: root/engines/sword25/gfx/framecounter.h
diff options
context:
space:
mode:
authorPaul Gilbert2010-07-31 06:23:38 +0000
committerEugene Sandulenko2010-10-12 21:55:38 +0000
commite78b19a650e27fe9a24d0e4c9c938294c7b08650 (patch)
treed61751dd6dbefe6834742ff9cc5d10f61be4dc02 /engines/sword25/gfx/framecounter.h
parent1842de4b0035854f271a40dcaa514cdba66bcf57 (diff)
downloadscummvm-rg350-e78b19a650e27fe9a24d0e4c9c938294c7b08650.tar.gz
scummvm-rg350-e78b19a650e27fe9a24d0e4c9c938294c7b08650.tar.bz2
scummvm-rg350-e78b19a650e27fe9a24d0e4c9c938294c7b08650.zip
SWORD25: Converted kernel/kernel.cpp to compile under ScummVM
This commit creates a skeleton detection and engine class, as well as code necessary to call the kernel initiation. The kernel/kernel.cpp has been converted to compile under ScummVM, along with all dependant header files. svn-id: r53184
Diffstat (limited to 'engines/sword25/gfx/framecounter.h')
-rwxr-xr-xengines/sword25/gfx/framecounter.h83
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