diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sword25/gfx/framecounter.cpp | 4 | ||||
-rw-r--r-- | engines/sword25/gfx/framecounter.h | 12 | ||||
-rw-r--r-- | engines/sword25/gfx/graphicengine.h | 1 | ||||
-rw-r--r-- | engines/sword25/gfx/image/imageloader.h | 1 | ||||
-rw-r--r-- | engines/sword25/gfx/image/vectorimage.cpp | 1 | ||||
-rw-r--r-- | engines/sword25/kernel/bs_stdint.h | 47 | ||||
-rw-r--r-- | engines/sword25/kernel/callbackregistry.h | 3 | ||||
-rw-r--r-- | engines/sword25/kernel/filesystemutil.cpp | 2 | ||||
-rw-r--r-- | engines/sword25/kernel/filesystemutil.h | 3 | ||||
-rw-r--r-- | engines/sword25/kernel/kernel.h | 1 | ||||
-rw-r--r-- | engines/sword25/kernel/objectregistry.h | 4 |
11 files changed, 15 insertions, 64 deletions
diff --git a/engines/sword25/gfx/framecounter.cpp b/engines/sword25/gfx/framecounter.cpp index 15bc7d00ea..e152e4429e 100644 --- a/engines/sword25/gfx/framecounter.cpp +++ b/engines/sword25/gfx/framecounter.cpp @@ -46,7 +46,7 @@ Framecounter::Framecounter(int UpdateFrequency) : void Framecounter::Update() { // Aktuellen Systemtimerstand auslesen - uint64_t Timer = g_system->getMillis() * 1000; + uint64 Timer = g_system->getMillis() * 1000; // Falls m_LastUpdateTime == -1 ist, wird der Frame-Counter zum ersten Mal aufgerufen und der aktuelle Systemtimer als erster // Messzeitpunkt genommen. @@ -58,7 +58,7 @@ void Framecounter::Update() { // Falls der Messzeitraum verstrichen ist, wird die durchschnittliche Framerate berechnet und ein neuer Messzeitraum begonnen. if (Timer - m_LastUpdateTime >= m_UpdateDelay) { - m_FPS = static_cast<int>((1000000 * (uint64_t)m_FPSCount) / (Timer - m_LastUpdateTime)); + m_FPS = static_cast<int>((1000000 * (uint64)m_FPSCount) / (Timer - m_LastUpdateTime)); m_LastUpdateTime = Timer; m_FPSCount = 0; } diff --git a/engines/sword25/gfx/framecounter.h b/engines/sword25/gfx/framecounter.h index 8a8402a3bb..dcfae8acbf 100644 --- a/engines/sword25/gfx/framecounter.h +++ b/engines/sword25/gfx/framecounter.h @@ -37,15 +37,21 @@ // Includes #include "sword25/kernel/common.h" -#include "sword25/kernel/bs_stdint.h" namespace Sword25 { + /** * A simple class that implements a frame counter */ class Framecounter { private: + + // TODO: This class should be rewritten based on Audio::Timestamp, + // which provides higher accuracy and avoids using 64 bit data types. + typedef unsigned long long uint64; + typedef signed long long int64; + enum { DEFAULT_UPDATE_FREQUENCY = 10 }; @@ -79,8 +85,8 @@ public: private: int m_FPS; int m_FPSCount; - int64_t m_LastUpdateTime; - uint64_t m_UpdateDelay; + int64 m_LastUpdateTime; + uint64 m_UpdateDelay; }; // Inlines diff --git a/engines/sword25/gfx/graphicengine.h b/engines/sword25/gfx/graphicengine.h index ecbfa377c8..d3443f42f2 100644 --- a/engines/sword25/gfx/graphicengine.h +++ b/engines/sword25/gfx/graphicengine.h @@ -49,7 +49,6 @@ #include "common/str.h" #include "graphics/surface.h" #include "sword25/kernel/common.h" -#include "sword25/kernel/bs_stdint.h" #include "sword25/kernel/resservice.h" #include "sword25/kernel/persistable.h" #include "sword25/gfx/framecounter.h" diff --git a/engines/sword25/gfx/image/imageloader.h b/engines/sword25/gfx/image/imageloader.h index aae48a083c..e895f339e6 100644 --- a/engines/sword25/gfx/image/imageloader.h +++ b/engines/sword25/gfx/image/imageloader.h @@ -43,7 +43,6 @@ #define SWORD25_IMAGELOADER_H // Includes -#include "sword25/kernel/bs_stdint.h" #include "sword25/kernel/common.h" #include "sword25/gfx/graphicengine.h" diff --git a/engines/sword25/gfx/image/vectorimage.cpp b/engines/sword25/gfx/image/vectorimage.cpp index c2a80cb5f2..5c15c4771a 100644 --- a/engines/sword25/gfx/image/vectorimage.cpp +++ b/engines/sword25/gfx/image/vectorimage.cpp @@ -36,7 +36,6 @@ // Includes // ----------------------------------------------------------------------------- -#include "sword25/kernel/bs_stdint.h" #include "sword25/gfx/image/art.h" #include "sword25/gfx/image/vectorimage.h" #include "sword25/gfx/image/renderedimage.h" diff --git a/engines/sword25/kernel/bs_stdint.h b/engines/sword25/kernel/bs_stdint.h deleted file mode 100644 index 360ac59436..0000000000 --- a/engines/sword25/kernel/bs_stdint.h +++ /dev/null @@ -1,47 +0,0 @@ -/* 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$ - * - */ - -/* - * This code is based on Broken Sword 2.5 engine - * - * Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer - * - * Licensed under GNU GPL v2 - * - */ - -// TODO: Properly replace all game occurances that use these types with proper ScummVM types, and remove this file - -#ifndef SWORD25_STDINT_H -#define SWORD25_STDINT_H - -#include "common/scummsys.h" - -typedef unsigned long long uint64_t; -typedef signed long long int64_t; -typedef unsigned long long uint64; -typedef signed long long int64; - -#endif diff --git a/engines/sword25/kernel/callbackregistry.h b/engines/sword25/kernel/callbackregistry.h index c5076d22f5..8671a932de 100644 --- a/engines/sword25/kernel/callbackregistry.h +++ b/engines/sword25/kernel/callbackregistry.h @@ -43,7 +43,6 @@ #include "common/str.h" #include "common/hash-str.h" #include "common/hashmap.h" -#include "sword25/kernel/bs_stdint.h" #include "sword25/kernel/common.h" namespace Sword25 { @@ -76,7 +75,7 @@ private: }; struct CallbackPtr_Hash { uint operator()(CallbackPtr x) const { - return static_cast<uint>((int64)x % ((int64)1 << sizeof(uint))); + return (uint)x; } }; diff --git a/engines/sword25/kernel/filesystemutil.cpp b/engines/sword25/kernel/filesystemutil.cpp index 853e6b247f..c77a70daaa 100644 --- a/engines/sword25/kernel/filesystemutil.cpp +++ b/engines/sword25/kernel/filesystemutil.cpp @@ -87,7 +87,7 @@ public: return Common::String("/"); } - virtual int64 GetFileSize(const Common::String &Filename) { + virtual uint32 GetFileSize(const Common::String &Filename) { Common::FSNode node(Filename); // If the file does not exist, return -1 as a result diff --git a/engines/sword25/kernel/filesystemutil.h b/engines/sword25/kernel/filesystemutil.h index 43ce7c908e..de23520255 100644 --- a/engines/sword25/kernel/filesystemutil.h +++ b/engines/sword25/kernel/filesystemutil.h @@ -52,7 +52,6 @@ #include "common/str.h" #include "common/str-array.h" #include "sword25/kernel/common.h" -#include "sword25/kernel/bs_stdint.h" namespace Sword25 { @@ -81,7 +80,7 @@ public: * @return Returns the size of the specified file. If the size could not be * determined, or the file does not exist, returns -1 */ - virtual int64 GetFileSize(const Common::String &Filename) = 0; + virtual uint32 GetFileSize(const Common::String &Filename) = 0; /** * @param Filename The path to a file. * @return Returns the timestamp of the specified file. diff --git a/engines/sword25/kernel/kernel.h b/engines/sword25/kernel/kernel.h index 6bc6f3de03..29cf1b550c 100644 --- a/engines/sword25/kernel/kernel.h +++ b/engines/sword25/kernel/kernel.h @@ -53,7 +53,6 @@ #include "engines/engine.h" #include "sword25/kernel/common.h" -#include "sword25/kernel/bs_stdint.h" #include "sword25/kernel/window.h" #include "sword25/kernel/resmanager.h" diff --git a/engines/sword25/kernel/objectregistry.h b/engines/sword25/kernel/objectregistry.h index dc702f2d75..0f50b79b00 100644 --- a/engines/sword25/kernel/objectregistry.h +++ b/engines/sword25/kernel/objectregistry.h @@ -37,7 +37,6 @@ #include "common/func.h" #include "common/hashmap.h" -#include "sword25/kernel/bs_stdint.h" #include "sword25/kernel/common.h" namespace Sword25 { @@ -131,7 +130,6 @@ public: } protected: - // FIXME: I'm not entirely sure my current hash function is legitimate struct ClassPointer_EqualTo { bool operator()(const T *x, const T *y) const { return x == y; @@ -139,7 +137,7 @@ protected: }; struct ClassPointer_Hash { uint operator()(const T *x) const { - return static_cast<uint>((int64)x % ((int64)1 << sizeof(uint))); + return (uint)x; } }; |