[Scummvm-cvs-logs] SF.net SVN: scummvm:[46362] tools/branches/gsoc2009-gui

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Dec 13 21:23:42 CET 2009


Revision: 46362
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46362&view=rev
Author:   fingolfin
Date:     2009-12-13 20:23:42 +0000 (Sun, 13 Dec 2009)

Log Message:
-----------
TOOLS: Aligh codebase a bit more with the main ScummVM code base

Modified Paths:
--------------
    tools/branches/gsoc2009-gui/common/file.h
    tools/branches/gsoc2009-gui/compress_saga.cpp
    tools/branches/gsoc2009-gui/encode_dxa.cpp
    tools/branches/gsoc2009-gui/util.h

Added Paths:
-----------
    tools/branches/gsoc2009-gui/common/endian.h
    tools/branches/gsoc2009-gui/common/scummsys.h
    tools/branches/gsoc2009-gui/common/util.h
    tools/branches/gsoc2009-gui/tool_exception.h

Removed Paths:
-------------
    tools/branches/gsoc2009-gui/utils/util.h

Added: tools/branches/gsoc2009-gui/common/endian.h
===================================================================
--- tools/branches/gsoc2009-gui/common/endian.h	                        (rev 0)
+++ tools/branches/gsoc2009-gui/common/endian.h	2009-12-13 20:23:42 UTC (rev 46362)
@@ -0,0 +1,92 @@
+/* ScummVM Tools
+ * Copyright (C) 2002-2009 The ScummVM project
+ *
+ * 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 COMMON_ENDIAN_H
+#define COMMON_ENDIAN_H
+
+#include "common/scummsys.h"
+
+#if defined(INVERSE_MKID)
+#define MKID_BE(a) ((uint32) \
+		(((a) >> 24) & 0x000000FF) | \
+		(((a) >>  8) & 0x0000FF00) | \
+		(((a) <<  8) & 0x00FF0000) | \
+		(((a) << 24) & 0xFF000000))
+
+#else
+#  define MKID_BE(a) ((uint32)(a))
+#endif
+
+static inline uint32 SWAP_32(uint32 a) {
+	return uint16(((a >> 24) & 0xFF) | ((a >> 8) & 0xFF00) | ((a << 8) & 0xFF0000) |
+		((a << 24) & 0xFF000000));
+}
+
+static inline uint16 SWAP_16(uint16 a) {
+	return uint16(((a >> 8) & 0xFF) | ((a << 8) & 0xFF00));
+}
+
+
+FORCEINLINE uint16 READ_LE_UINT16(const void *ptr) {
+	const byte *b = (const byte *)ptr;
+	return uint16((b[1] << 8) + b[0]);
+}
+FORCEINLINE uint32 READ_LE_UINT32(const void *ptr) {
+	const byte *b = (const byte *)ptr;
+	return (b[3] << 24) + (b[2] << 16) + (b[1] << 8) + (b[0]);
+}
+FORCEINLINE void WRITE_LE_UINT16(void *ptr, uint16 value) {
+	byte *b = (byte *)ptr;
+	b[0] = (byte)(value >> 0);
+	b[1] = (byte)(value >> 8);
+}
+FORCEINLINE void WRITE_LE_UINT32(void *ptr, uint32 value) {
+	byte *b = (byte *)ptr;
+	b[0] = (byte)(value >>  0);
+	b[1] = (byte)(value >>  8);
+	b[2] = (byte)(value >> 16);
+	b[3] = (byte)(value >> 24);
+}
+
+FORCEINLINE uint16 READ_BE_UINT16(const void *ptr) {
+	const byte *b = (const byte *)ptr;
+	return uint16((b[0] << 8) + b[1]);
+}
+FORCEINLINE uint32 READ_BE_UINT32(const void *ptr) {
+	const byte *b = (const byte *)ptr;
+	return uint32((b[0] << 24) + (b[1] << 16) + (b[2] << 8) + (b[3]));
+}
+FORCEINLINE void WRITE_BE_UINT16(void *ptr, uint16 value) {
+	byte *b = (byte *)ptr;
+	b[0] = (byte)(value >> 8);
+	b[1] = (byte)(value >> 0);
+}
+FORCEINLINE void WRITE_BE_UINT32(void *ptr, uint32 value) {
+	byte *b = (byte *)ptr;
+	b[0] = (byte)(value >> 24);
+	b[1] = (byte)(value >> 16);
+	b[2] = (byte)(value >>  8);
+	b[3] = (byte)(value >>  0);
+}
+
+
+#endif


Property changes on: tools/branches/gsoc2009-gui/common/endian.h
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Modified: tools/branches/gsoc2009-gui/common/file.h
===================================================================
--- tools/branches/gsoc2009-gui/common/file.h	2009-12-13 20:12:20 UTC (rev 46361)
+++ tools/branches/gsoc2009-gui/common/file.h	2009-12-13 20:23:42 UTC (rev 46362)
@@ -23,10 +23,9 @@
 #ifndef COMMON_FILE_H
 #define COMMON_FILE_H
 
-#include "util.h"
+#include "common/scummsys.h"
 
-#include <stdio.h>
-#include <string>
+#include "tool_exception.h"
 
 /**
  * Something unexpected happened while reading / writing to a file

Added: tools/branches/gsoc2009-gui/common/scummsys.h
===================================================================
--- tools/branches/gsoc2009-gui/common/scummsys.h	                        (rev 0)
+++ tools/branches/gsoc2009-gui/common/scummsys.h	2009-12-13 20:23:42 UTC (rev 46362)
@@ -0,0 +1,112 @@
+/* ScummVM Tools
+ * Copyright (C) 2002-2009 The ScummVM project
+ *
+ * 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 COMMON_SCUMMSYS_H
+#define COMMON_SCUMMSYS_H
+
+
+/*
+ * Some useful types
+ */
+
+typedef unsigned char byte;
+typedef unsigned char uint8;
+typedef unsigned short uint16;
+typedef signed char int8;
+typedef signed short int16;
+#ifdef __amigaos4__
+#include <exec/types.h>
+#include <stdlib.h>
+#else
+typedef unsigned int uint32;
+typedef signed int int32;
+#endif
+
+/*
+ * Various utility macros
+ */
+
+#if defined(_MSC_VER)
+
+	#define scumm_stricmp stricmp
+	#define scumm_strnicmp _strnicmp
+	#define snprintf _snprintf
+
+	#define SCUMM_LITTLE_ENDIAN
+	#pragma once
+	#pragma warning( disable : 4068 ) /* turn off "unknown pragma" warning */
+	#pragma warning( disable : 4996 ) /* turn off warnings about unsafe functions */
+
+#elif defined(__MINGW32__)
+
+	#define scumm_stricmp strcasecmp
+	#define scumm_stricmp stricmp
+	#define scumm_strnicmp strnicmp
+
+	#define SCUMM_LITTLE_ENDIAN
+
+#elif defined(UNIX)
+	#define scumm_stricmp strcasecmp
+	#define scumm_strnicmp strncasecmp
+
+	#if defined(__DECCXX) /* Assume alpha architecture */
+	#define INVERSE_MKID
+	#define SCUMM_NEED_ALIGNMENT
+	#endif
+
+#else
+
+	#error No system type defined
+
+#endif
+
+
+/*
+ * GCC specific stuff
+ */
+#if defined(__GNUC__)
+	#define GCC_PACK __attribute__((packed))
+#else
+	#define GCC_PACK
+#endif
+
+#ifndef ARRAYSIZE
+#define ARRAYSIZE(x) ((int)(sizeof(x) / sizeof(x[0])))
+#endif
+
+#ifndef FORCEINLINE
+#define FORCEINLINE static inline
+#endif
+
+#if defined(__GNUC__)
+#define NORETURN_PRE
+#define NORETURN_POST	__attribute__((__noreturn__))
+#elif defined(_MSC_VER)
+#define NORETURN_PRE	_declspec(noreturn)
+#define NORETURN_POST
+#else
+#define NORETURN_PRE
+#define NORETURN_POST
+#endif
+
+
+#endif


Property changes on: tools/branches/gsoc2009-gui/common/scummsys.h
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Copied: tools/branches/gsoc2009-gui/common/util.h (from rev 46360, tools/branches/gsoc2009-gui/utils/util.h)
===================================================================
--- tools/branches/gsoc2009-gui/common/util.h	                        (rev 0)
+++ tools/branches/gsoc2009-gui/common/util.h	2009-12-13 20:23:42 UTC (rev 46362)
@@ -0,0 +1,104 @@
+/* ScummVM Tools
+ * Copyright (C) 2002-2009 The ScummVM project
+ *
+ * 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 COMMON_UTIL_H
+#define COMMON_UTIL_H
+
+#include "common/scummsys.h"
+
+namespace Common {
+
+
+#ifdef MIN
+#undef MIN
+#endif
+
+#ifdef MAX
+#undef MAX
+#endif
+
+template<typename T> inline T ABS (T x)			{ return (x>=0) ? x : -x; }
+template<typename T> inline T MIN (T a, T b)	{ return (a<b) ? a : b; }
+template<typename T> inline T MAX (T a, T b)	{ return (a>b) ? a : b; }
+template<typename T> inline T CLIP (T v, T amin, T amax)
+		{ if (v < amin) return amin; else if (v > amax) return amax; else return v; }
+
+/**
+ * List of game language.
+ */
+enum Language {
+	EN_ANY,     // Generic English (when only one game version exist)
+	EN_USA,
+	EN_GRB,
+
+	DE_DEU,
+	FR_FRA,
+	IT_ITA,
+	PT_BRA,
+	ES_ESP,
+	JA_JPN,
+	ZH_TWN,
+	KO_KOR,
+	SE_SWE,
+	HB_ISR,
+	RU_RUS,
+	CZ_CZE,
+	NL_NLD,
+	NB_NOR,
+	PL_POL,
+
+	UNK_LANG = -1	// Use default language (i.e. none specified)
+};
+
+/**
+ * List of game platforms. Specifying a platform for a target can be used to
+ * give the game engines a hint for which platform the game data file are.
+ * This may be optional or required, depending on the game engine and the
+ * game in question.
+ */
+enum Platform {
+	kPlatformPC,
+	kPlatformAmiga,
+	kPlatformAtariST,
+	kPlatformMacintosh,
+	kPlatformFMTowns,
+	kPlatformWindows,
+	kPlatformNES,
+	kPlatformC64,
+	kPlatformLinux,
+	kPlatformAcorn,
+	kPlatformSegaCD,
+	kPlatform3DO,
+//	kPlatformPCEngine,
+
+	kPlatformUnknown = -1
+};
+
+} // End of Common namespace
+
+/* Misc stuff */
+void NORETURN_PRE error(const char *s, ...) NORETURN_POST;
+void warning(const char *s, ...);
+void debug(int level, const char *s, ...);
+void notice(const char *s, ...);
+
+#endif

Modified: tools/branches/gsoc2009-gui/compress_saga.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_saga.cpp	2009-12-13 20:12:20 UTC (rev 46361)
+++ tools/branches/gsoc2009-gui/compress_saga.cpp	2009-12-13 20:23:42 UTC (rev 46362)
@@ -26,7 +26,7 @@
 #include "compress_saga.h"
 #include "common/md5.h"
 #include "common/file.h"
-#include "utils/util.h"
+#include "common/util.h"
 #include "utils/audiostream.h"
 #include "utils/voc.h"
 #include "utils/wave.h"

Modified: tools/branches/gsoc2009-gui/encode_dxa.cpp
===================================================================
--- tools/branches/gsoc2009-gui/encode_dxa.cpp	2009-12-13 20:12:20 UTC (rev 46361)
+++ tools/branches/gsoc2009-gui/encode_dxa.cpp	2009-12-13 20:23:42 UTC (rev 46362)
@@ -24,6 +24,7 @@
 #include "encode_dxa.h"
 #include "util.h"
 
+#include <sys/stat.h>
 #include <png.h>
 
 const uint32 typeDEXA = 0x41584544;

Added: tools/branches/gsoc2009-gui/tool_exception.h
===================================================================
--- tools/branches/gsoc2009-gui/tool_exception.h	                        (rev 0)
+++ tools/branches/gsoc2009-gui/tool_exception.h	2009-12-13 20:23:42 UTC (rev 46362)
@@ -0,0 +1,57 @@
+/* ScummVM Tools
+ * Copyright (C) 2002-2009 The ScummVM project
+ *
+ * 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 TOOL_EXCEPTION_H
+#define TOOL_EXCEPTION_H
+
+#include <string>
+#include <stdexcept>
+
+/**
+ * Throw an exception of this type (or subtype of it), if the tool fails fatally.
+ * This type is intended for general errors
+ */
+class ToolException : public std::runtime_error {
+public:
+	/**
+	 * Construct an exception, with an appropriate error message
+	 * A return value for the tool should be supplied if none is appropriate
+	 * @todo If the tools are even more C++ized, the tool should decide retcode itself, not by exception
+	 *
+	 * @param error The error message
+	 * @param retcode The return value of the process
+	 */
+	ToolException(std::string error, int retcode = -1) : std::runtime_error(error), _retcode(retcode) {}
+
+	int _retcode;
+};
+
+/**
+ * Something unexpected happened while reading / writing to a file
+ * Usually premature end, or that it could not be opened (write / read protected)
+ */
+class AbortException : public ToolException {
+public: 
+	AbortException() : ToolException("Operation was aborted", -2) {}
+};
+
+#endif


Property changes on: tools/branches/gsoc2009-gui/tool_exception.h
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Modified: tools/branches/gsoc2009-gui/util.h
===================================================================
--- tools/branches/gsoc2009-gui/util.h	2009-12-13 20:12:20 UTC (rev 46361)
+++ tools/branches/gsoc2009-gui/util.h	2009-12-13 20:23:42 UTC (rev 46362)
@@ -23,120 +23,18 @@
 #ifndef UTIL_H
 #define UTIL_H
 
+// This header is DEPRECATED. Everything should be gradually migrated away
+// from using this to directly including the required headers.
+
+#include "common/scummsys.h"
+#include "common/endian.h"
+#include "common/util.h"
+
 #include <assert.h>
 #include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sys/stat.h>
 
-#if !defined(_MSC_VER)
-#include <unistd.h>
-#endif
 
-#ifdef WIN32
-#include <io.h>
-#include <process.h>
 #endif
-
-#include "utils/util.h"
-#include <string>
-#include <stdexcept>
-
-/*
- * GCC specific stuff
- */
-#if defined(__GNUC__)
-	#define GCC_PACK __attribute__((packed))
-#else
-	#define GCC_PACK
-#endif
-
-#ifndef ARRAYSIZE
-#define ARRAYSIZE(x) ((int)(sizeof(x) / sizeof(x[0])))
-#endif
-
-#if defined(INVERSE_MKID)
-#define MKID_BE(a) ((uint32) \
-		(((a) >> 24) & 0x000000FF) | \
-		(((a) >>  8) & 0x0000FF00) | \
-		(((a) <<  8) & 0x00FF0000) | \
-		(((a) << 24) & 0xFF000000))
-
-#else
-#  define MKID_BE(a) ((uint32)(a))
-#endif
-
-static inline uint32 SWAP_32(uint32 a) {
-	return uint16(((a >> 24) & 0xFF) | ((a >> 8) & 0xFF00) | ((a << 8) & 0xFF0000) |
-		((a << 24) & 0xFF000000));
-}
-
-static inline uint16 SWAP_16(uint16 a) {
-	return uint16(((a >> 8) & 0xFF) | ((a << 8) & 0xFF00));
-}
-
-#ifndef FORCEINLINE
-#define FORCEINLINE static inline
-#endif
-
-FORCEINLINE uint16 READ_LE_UINT16(const void *ptr) {
-	const byte *b = (const byte *)ptr;
-	return uint16((b[1] << 8) + b[0]);
-}
-FORCEINLINE uint32 READ_LE_UINT32(const void *ptr) {
-	const byte *b = (const byte *)ptr;
-	return (b[3] << 24) + (b[2] << 16) + (b[1] << 8) + (b[0]);
-}
-FORCEINLINE void WRITE_LE_UINT16(void *ptr, uint16 value) {
-	byte *b = (byte *)ptr;
-	b[0] = (byte)(value >> 0);
-	b[1] = (byte)(value >> 8);
-}
-FORCEINLINE void WRITE_LE_UINT32(void *ptr, uint32 value) {
-	byte *b = (byte *)ptr;
-	b[0] = (byte)(value >>  0);
-	b[1] = (byte)(value >>  8);
-	b[2] = (byte)(value >> 16);
-	b[3] = (byte)(value >> 24);
-}
-
-FORCEINLINE uint16 READ_BE_UINT16(const void *ptr) {
-	const byte *b = (const byte *)ptr;
-	return uint16((b[0] << 8) + b[1]);
-}
-FORCEINLINE uint32 READ_BE_UINT32(const void *ptr) {
-	const byte *b = (const byte *)ptr;
-	return uint32((b[0] << 24) + (b[1] << 16) + (b[2] << 8) + (b[3]));
-}
-FORCEINLINE void WRITE_BE_UINT16(void *ptr, uint16 value) {
-	byte *b = (byte *)ptr;
-	b[0] = (byte)(value >> 8);
-	b[1] = (byte)(value >> 0);
-}
-FORCEINLINE void WRITE_BE_UINT32(void *ptr, uint32 value) {
-	byte *b = (byte *)ptr;
-	b[0] = (byte)(value >> 24);
-	b[1] = (byte)(value >> 16);
-	b[2] = (byte)(value >>  8);
-	b[3] = (byte)(value >>  0);
-}
-
-#if defined(__GNUC__)
-#define NORETURN_PRE
-#define NORETURN_POST	__attribute__((__noreturn__))
-#elif defined(_MSC_VER)
-#define NORETURN_PRE	_declspec(noreturn)
-#define NORETURN_POST
-#else
-#define NORETURN_PRE
-#define NORETURN_POST
-#endif
-
-/* Misc stuff */
-void NORETURN_PRE error(const char *s, ...) NORETURN_POST;
-void warning(const char *s, ...);
-void debug(int level, const char *s, ...);
-void notice(const char *s, ...);
-
-#endif

Deleted: tools/branches/gsoc2009-gui/utils/util.h
===================================================================
--- tools/branches/gsoc2009-gui/utils/util.h	2009-12-13 20:12:20 UTC (rev 46361)
+++ tools/branches/gsoc2009-gui/utils/util.h	2009-12-13 20:23:42 UTC (rev 46362)
@@ -1,184 +0,0 @@
-/* Scumm Tools
- * Copyright (C) 2004-2006  The ScummVM Team
- *
- * 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 COMMON_UTIL_H
-#define COMMON_UTIL_H
-
-#include <exception>
-#include <stdexcept>
-#include <string>
-
-namespace Common {
-
-
-#ifdef MIN
-#undef MIN
-#endif
-
-#ifdef MAX
-#undef MAX
-#endif
-
-template<typename T> inline T ABS (T x)			{ return (x>=0) ? x : -x; }
-template<typename T> inline T MIN (T a, T b)	{ return (a<b) ? a : b; }
-template<typename T> inline T MAX (T a, T b)	{ return (a>b) ? a : b; }
-template<typename T> inline T CLIP (T v, T amin, T amax)
-		{ if (v < amin) return amin; else if (v > amax) return amax; else return v; }
-
-/**
- * List of game language.
- */
-enum Language {
-	EN_ANY,     // Generic English (when only one game version exist)
-	EN_USA,
-	EN_GRB,
-
-	DE_DEU,
-	FR_FRA,
-	IT_ITA,
-	PT_BRA,
-	ES_ESP,
-	JA_JPN,
-	ZH_TWN,
-	KO_KOR,
-	SE_SWE,
-	HB_ISR,
-	RU_RUS,
-	CZ_CZE,
-	NL_NLD,
-	NB_NOR,
-	PL_POL,
-
-	UNK_LANG = -1	// Use default language (i.e. none specified)
-};
-
-/**
- * List of game platforms. Specifying a platform for a target can be used to
- * give the game engines a hint for which platform the game data file are.
- * This may be optional or required, depending on the game engine and the
- * game in question.
- */
-enum Platform {
-	kPlatformPC,
-	kPlatformAmiga,
-	kPlatformAtariST,
-	kPlatformMacintosh,
-	kPlatformFMTowns,
-	kPlatformWindows,
-	kPlatformNES,
-	kPlatformC64,
-	kPlatformLinux,
-	kPlatformAcorn,
-	kPlatformSegaCD,
-	kPlatform3DO,
-//	kPlatformPCEngine,
-
-	kPlatformUnknown = -1
-};
-
-} // End of Common namespace
-
-/*
- * Some useful types
- */
-
-typedef unsigned char byte;
-typedef unsigned char uint8;
-typedef unsigned short uint16;
-typedef signed char int8;
-typedef signed short int16;
-#ifdef __amigaos4__
-#include <exec/types.h>
-#include <stdlib.h>
-#else
-typedef unsigned int uint32;
-typedef signed int int32;
-#endif
-
-/*
- * Various utility macros
- */
-
-#if defined(_MSC_VER)
-
-	#define scumm_stricmp stricmp
-	#define scumm_strnicmp _strnicmp
-	#define snprintf _snprintf
-
-	#define SCUMM_LITTLE_ENDIAN
-	#pragma once
-	#pragma warning( disable : 4068 ) /* turn off "unknown pragma" warning */
-	#pragma warning( disable : 4996 ) /* turn off warnings about unsafe functions */
-
-#elif defined(__MINGW32__)
-
-	#define scumm_stricmp strcasecmp
-	#define scumm_stricmp stricmp
-	#define scumm_strnicmp strnicmp
-
-	#define SCUMM_LITTLE_ENDIAN
-
-#elif defined(UNIX)
-	#define scumm_stricmp strcasecmp
-	#define scumm_strnicmp strncasecmp
-
-	#if defined(__DECCXX) /* Assume alpha architecture */
-	#define INVERSE_MKID
-	#define SCUMM_NEED_ALIGNMENT
-	#endif
-
-#else
-
-	#error No system type defined
-
-#endif
-
-
-/**
- * Throw an exception of this type (or subtype of it), if the tool fails fatally.
- * This type is intended for general errors
- */
-class ToolException : public std::runtime_error {
-public:
-	/**
-	 * Construct an exception, with an appropriate error message
-	 * A return value for the tool should be supplied if none is appropriate
-	 * @todo If the tools are even more C++ized, the tool should decide retcode itself, not by exception
-	 *
-	 * @param error The error message
-	 * @param retcode The return value of the process
-	 */
-	ToolException(std::string error, int retcode = -1) : std::runtime_error(error), _retcode(retcode) {}
-
-	int _retcode;
-};
-
-/**
- * Something unexpected happened while reading / writing to a file
- * Usually premature end, or that it could not be opened (write / read protected)
- */
-class AbortException : public ToolException {
-public: 
-	AbortException() : ToolException("Operation was aborted", -2) {}
-};
-
-#endif


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