[Scummvm-cvs-logs] SF.net SVN: scummvm:[53405] scummvm/trunk/engines/sword25

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Wed Oct 13 12:51:20 CEST 2010


Revision: 53405
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53405&view=rev
Author:   fingolfin
Date:     2010-10-13 10:51:20 +0000 (Wed, 13 Oct 2010)

Log Message:
-----------
SWORD25: Get rid of kernel/bs_stdint.h

Modified Paths:
--------------
    scummvm/trunk/engines/sword25/gfx/framecounter.cpp
    scummvm/trunk/engines/sword25/gfx/framecounter.h
    scummvm/trunk/engines/sword25/gfx/graphicengine.h
    scummvm/trunk/engines/sword25/gfx/image/imageloader.h
    scummvm/trunk/engines/sword25/gfx/image/vectorimage.cpp
    scummvm/trunk/engines/sword25/kernel/callbackregistry.h
    scummvm/trunk/engines/sword25/kernel/filesystemutil.cpp
    scummvm/trunk/engines/sword25/kernel/filesystemutil.h
    scummvm/trunk/engines/sword25/kernel/kernel.h
    scummvm/trunk/engines/sword25/kernel/objectregistry.h

Removed Paths:
-------------
    scummvm/trunk/engines/sword25/kernel/bs_stdint.h

Modified: scummvm/trunk/engines/sword25/gfx/framecounter.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/framecounter.cpp	2010-10-13 10:50:45 UTC (rev 53404)
+++ scummvm/trunk/engines/sword25/gfx/framecounter.cpp	2010-10-13 10:51:20 UTC (rev 53405)
@@ -46,7 +46,7 @@
 
 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 @@
 
 		// 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;
 		}

Modified: scummvm/trunk/engines/sword25/gfx/framecounter.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/framecounter.h	2010-10-13 10:50:45 UTC (rev 53404)
+++ scummvm/trunk/engines/sword25/gfx/framecounter.h	2010-10-13 10:51:20 UTC (rev 53405)
@@ -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 @@
 private:
 	int m_FPS;
 	int m_FPSCount;
-	int64_t m_LastUpdateTime;
-	uint64_t m_UpdateDelay;
+	int64 m_LastUpdateTime;
+	uint64 m_UpdateDelay;
 };
 
 // Inlines

Modified: scummvm/trunk/engines/sword25/gfx/graphicengine.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/graphicengine.h	2010-10-13 10:50:45 UTC (rev 53404)
+++ scummvm/trunk/engines/sword25/gfx/graphicengine.h	2010-10-13 10:51:20 UTC (rev 53405)
@@ -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"

Modified: scummvm/trunk/engines/sword25/gfx/image/imageloader.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/image/imageloader.h	2010-10-13 10:50:45 UTC (rev 53404)
+++ scummvm/trunk/engines/sword25/gfx/image/imageloader.h	2010-10-13 10:51:20 UTC (rev 53405)
@@ -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"
 

Modified: scummvm/trunk/engines/sword25/gfx/image/vectorimage.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/image/vectorimage.cpp	2010-10-13 10:50:45 UTC (rev 53404)
+++ scummvm/trunk/engines/sword25/gfx/image/vectorimage.cpp	2010-10-13 10:51:20 UTC (rev 53405)
@@ -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"

Deleted: scummvm/trunk/engines/sword25/kernel/bs_stdint.h
===================================================================
--- scummvm/trunk/engines/sword25/kernel/bs_stdint.h	2010-10-13 10:50:45 UTC (rev 53404)
+++ scummvm/trunk/engines/sword25/kernel/bs_stdint.h	2010-10-13 10:51:20 UTC (rev 53405)
@@ -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

Modified: scummvm/trunk/engines/sword25/kernel/callbackregistry.h
===================================================================
--- scummvm/trunk/engines/sword25/kernel/callbackregistry.h	2010-10-13 10:50:45 UTC (rev 53404)
+++ scummvm/trunk/engines/sword25/kernel/callbackregistry.h	2010-10-13 10:51:20 UTC (rev 53405)
@@ -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 @@
 	};
 	struct CallbackPtr_Hash {
 		uint operator()(CallbackPtr x) const {
-			return static_cast<uint>((int64)x % ((int64)1 << sizeof(uint)));
+			return (uint)x;
 		}
 	};
 

Modified: scummvm/trunk/engines/sword25/kernel/filesystemutil.cpp
===================================================================
--- scummvm/trunk/engines/sword25/kernel/filesystemutil.cpp	2010-10-13 10:50:45 UTC (rev 53404)
+++ scummvm/trunk/engines/sword25/kernel/filesystemutil.cpp	2010-10-13 10:51:20 UTC (rev 53405)
@@ -87,7 +87,7 @@
 		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

Modified: scummvm/trunk/engines/sword25/kernel/filesystemutil.h
===================================================================
--- scummvm/trunk/engines/sword25/kernel/filesystemutil.h	2010-10-13 10:50:45 UTC (rev 53404)
+++ scummvm/trunk/engines/sword25/kernel/filesystemutil.h	2010-10-13 10:51:20 UTC (rev 53405)
@@ -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 @@
 	 * @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.

Modified: scummvm/trunk/engines/sword25/kernel/kernel.h
===================================================================
--- scummvm/trunk/engines/sword25/kernel/kernel.h	2010-10-13 10:50:45 UTC (rev 53404)
+++ scummvm/trunk/engines/sword25/kernel/kernel.h	2010-10-13 10:51:20 UTC (rev 53405)
@@ -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"
 

Modified: scummvm/trunk/engines/sword25/kernel/objectregistry.h
===================================================================
--- scummvm/trunk/engines/sword25/kernel/objectregistry.h	2010-10-13 10:50:45 UTC (rev 53404)
+++ scummvm/trunk/engines/sword25/kernel/objectregistry.h	2010-10-13 10:51:20 UTC (rev 53405)
@@ -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 @@
 	}
 
 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 @@
 	};
 	struct ClassPointer_Hash {
 		uint operator()(const T *x) const {
-			return static_cast<uint>((int64)x % ((int64)1 << sizeof(uint)));
+			return (uint)x;
 		}
 	};
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list