diff options
author | David Corrales | 2007-05-31 23:44:43 +0000 |
---|---|---|
committer | David Corrales | 2007-05-31 23:44:43 +0000 |
commit | 0cab5b7791e56b32455748bf20c21f0d6b42f654 (patch) | |
tree | 9e6580328542f1db230e019ba77e3db1be8fa50b /common | |
parent | 6c69d531d262e14fa02b6e1adb42baaa5c74dbe6 (diff) | |
parent | 22c0403e0dfec16badf156afa842c6c37e850263 (diff) | |
download | scummvm-rg350-0cab5b7791e56b32455748bf20c21f0d6b42f654.tar.gz scummvm-rg350-0cab5b7791e56b32455748bf20c21f0d6b42f654.tar.bz2 scummvm-rg350-0cab5b7791e56b32455748bf20c21f0d6b42f654.zip |
Merged the fs branch with trunk. r26949:27031
svn-id: r27032
Diffstat (limited to 'common')
44 files changed, 258 insertions, 127 deletions
diff --git a/common/advancedDetector.cpp b/common/advancedDetector.cpp index 84b8365584..24e884a164 100644 --- a/common/advancedDetector.cpp +++ b/common/advancedDetector.cpp @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2004-2006 The ScummVM project +/* 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 @@ -69,7 +72,7 @@ GameList gameIDList(const Common::ADParams ¶ms) { return GameList(params.list); } -void upgradeTargetIfNecessary(const Common::ADParams ¶ms) { +static void upgradeTargetIfNecessary(const Common::ADParams ¶ms) { if (params.obsoleteList == 0) return; @@ -97,25 +100,21 @@ GameDescriptor findGameID( const PlainGameDescriptor *g = params.list; while (g->gameid) { if (0 == scumm_stricmp(gameid, g->gameid)) - return *g; + return GameDescriptor(*g); g++; } - GameDescriptor gs; - if (params.obsoleteList != 0) { const Common::ADObsoleteGameID *o = params.obsoleteList; while (o->from) { if (0 == scumm_stricmp(gameid, o->from)) { - gs["gameid"] = gameid; - gs["description"] = "Obsolete game ID"; - return gs; + return GameDescriptor(gameid, "Obsolete game ID"); } o++; } - } else - return GameDescriptor(g->gameid, g->description); - return gs; + } + + return GameDescriptor(); } static GameDescriptor toGameDescriptor(const ADGameDescription &g, const PlainGameDescriptor *sg) { @@ -221,6 +220,9 @@ const ADGameDescription *detectBestMatchingGame( PluginError detectGameForEngineCreation( const Common::ADParams ¶ms ) { + + upgradeTargetIfNecessary(params); + Common::String gameid = ConfMan.get("gameid"); FSList fslist; diff --git a/common/advancedDetector.h b/common/advancedDetector.h index ec8249db83..fab847e671 100644 --- a/common/advancedDetector.h +++ b/common/advancedDetector.h @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2005-2006 The ScummVM project +/* 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 @@ -207,9 +210,7 @@ GameList detectAllGames(const FSList &fslist, const Common::ADParams ¶ms); const ADGameDescription *detectBestMatchingGame(const Common::ADParams ¶ms); // FIXME/TODO: Rename this function to something more sensible. -void upgradeTargetIfNecessary(const Common::ADParams ¶ms); - -// FIXME/TODO: Rename this function to something more sensible. +// Only used by ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_FUNC PluginError detectGameForEngineCreation(const Common::ADParams ¶ms); @@ -237,7 +238,6 @@ PluginError detectGameForEngineCreation(const Common::ADParams ¶ms); PluginError Engine_##engine##_create(OSystem *syst, Engine **engine) { \ assert(syst); \ assert(engine); \ - Common::AdvancedDetector::upgradeTargetIfNecessary(params); \ PluginError err = Common::AdvancedDetector::detectGameForEngineCreation(params); \ if (err == kNoError) \ *engine = factoryFunc(syst); \ diff --git a/common/algorithm.h b/common/algorithm.h index 616dc67317..19fb397fd8 100644 --- a/common/algorithm.h +++ b/common/algorithm.h @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2007 The ScummVM project +/* 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 diff --git a/common/array.h b/common/array.h index 97ee6abdf4..af9ec811da 100644 --- a/common/array.h +++ b/common/array.h @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002-2006 The ScummVM project +/* 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 diff --git a/common/config-file.cpp b/common/config-file.cpp index eef70ef1b9..c89c169b44 100644 --- a/common/config-file.cpp +++ b/common/config-file.cpp @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2005-2006 The ScummVM project +/* 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 diff --git a/common/config-file.h b/common/config-file.h index 2e1e80ed10..3f0812dd2b 100644 --- a/common/config-file.h +++ b/common/config-file.h @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2005-2006 The ScummVM project +/* 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 diff --git a/common/config-manager.cpp b/common/config-manager.cpp index 41f3c1a7e9..5c0cd7c40f 100644 --- a/common/config-manager.cpp +++ b/common/config-manager.cpp @@ -1,6 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001-2006 The ScummVM project +/* 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 @@ -33,6 +35,8 @@ #include "common/file.h" #include "common/util.h" +DECLARE_SINGLETON(Common::ConfigManager); + #ifdef __PLAYSTATION2__ #include "backends/platform/ps2/systemps2.h" #endif diff --git a/common/config-manager.h b/common/config-manager.h index 9561ce01c3..79f56c5bca 100644 --- a/common/config-manager.h +++ b/common/config-manager.h @@ -1,6 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001-2006 The ScummVM project +/* 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 diff --git a/common/endian.h b/common/endian.h index c2e9267b58..685af27a17 100644 --- a/common/endian.h +++ b/common/endian.h @@ -1,6 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001-2006 The ScummVM project +/* 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 diff --git a/common/events.h b/common/events.h index 1f05188d90..9b434e94f9 100644 --- a/common/events.h +++ b/common/events.h @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002-2007 The ScummVM project +/* 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 @@ -34,7 +37,7 @@ namespace Common { * @see Event * * @todo Merge EVENT_LBUTTONDOWN, EVENT_RBUTTONDOWN and EVENT_WHEELDOWN; - * likewiese EVENT_LBUTTONUP, EVENT_RBUTTONUP, EVENT_WHEELUP. + * likewise EVENT_LBUTTONUP, EVENT_RBUTTONUP, EVENT_WHEELUP. * To do that, we just have to add a field to the Event which * indicates which button was pressed. */ @@ -53,7 +56,8 @@ enum EventType { EVENT_WHEELDOWN = 9, EVENT_QUIT = 10, - EVENT_SCREEN_CHANGED = 11 + EVENT_SCREEN_CHANGED = 11, + EVENT_PREDICTIVE_DIALOG = 12 }; /** diff --git a/common/file.cpp b/common/file.cpp index 9ccfcd85ba..2eba1bcb3d 100644 --- a/common/file.cpp +++ b/common/file.cpp @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002-2006 The ScummVM project +/* 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 diff --git a/common/file.h b/common/file.h index c5371098c5..3d816a6104 100644 --- a/common/file.h +++ b/common/file.h @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002-2006 The ScummVM project +/* 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 diff --git a/common/fs.cpp b/common/fs.cpp index e9c673abb2..ef106c2488 100644 --- a/common/fs.cpp +++ b/common/fs.cpp @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002-2006 The ScummVM project +/* 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 diff --git a/common/fs.h b/common/fs.h index 6a89bfcdaf..5e441a212f 100644 --- a/common/fs.h +++ b/common/fs.h @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002-2006 The ScummVM project +/* 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 diff --git a/common/func.h b/common/func.h index 19d0ceafec..a424fcf205 100644 --- a/common/func.h +++ b/common/func.h @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002-2006 The ScummVM project +/* 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 @@ -247,7 +250,7 @@ template <typename T> struct Hash; #define GENERATE_TRIVIAL_HASH_FUNCTOR(T) \ - template <> struct Hash<T> { \ + template <> struct Hash<T> : public UnaryFunction<T, uint> { \ uint operator()(T val) const { return (uint)val; } \ } diff --git a/common/hash-str.h b/common/hash-str.h index 99ebf99a10..5575735f1d 100644 --- a/common/hash-str.h +++ b/common/hash-str.h @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002-2006 The ScummVM project +/* 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 diff --git a/common/hashmap.cpp b/common/hashmap.cpp index 1bab04a6a1..4749234740 100644 --- a/common/hashmap.cpp +++ b/common/hashmap.cpp @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2006 The ScummVM project +/* 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 diff --git a/common/hashmap.h b/common/hashmap.h index 982e3df70f..28ba022e70 100644 --- a/common/hashmap.h +++ b/common/hashmap.h @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2006 The ScummVM project +/* 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 diff --git a/common/iff_container.h b/common/iff_container.h index 730163254f..0d07b5bd57 100644 --- a/common/iff_container.h +++ b/common/iff_container.h @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2006 The ScummVM project +/* 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 @@ -15,8 +18,8 @@ * 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$ + * $URL:https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/branches/gsoc2007-fsnode/common/iff_container.h $ + * $Id:iff_container.h 26949 2007-05-26 20:23:24Z david_corrales $ */ #ifndef COMMON_IFF_CONTAINER_H diff --git a/common/list.h b/common/list.h index 68a464d194..1fda266da9 100644 --- a/common/list.h +++ b/common/list.h @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002-2006 The ScummVM project +/* 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 diff --git a/common/md5.cpp b/common/md5.cpp index 700897e08f..a48ecb4948 100644 --- a/common/md5.cpp +++ b/common/md5.cpp @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002-2006 The ScummVM project +/* 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 @@ -301,37 +304,37 @@ bool md5_file(ReadStream &stream, uint8 digest[16], uint32 length) { return true; } -bool md5_file_string(const FilesystemNode &file, char md5str[32+1], uint32 length) { +bool md5_file_string(const FilesystemNode &file, char *md5str, uint32 length) { uint8 digest[16]; if (!md5_file(file, digest, length)) return false; for (int i = 0; i < 16; i++) { - sprintf(md5str + i*2, "%02x", (int)digest[i]); + snprintf(md5str + i*2, 3, "%02x", (int)digest[i]); } return true; } -bool md5_file_string(const char *name, char md5str[32+1], uint32 length) { +bool md5_file_string(const char *name, char *md5str, uint32 length) { uint8 digest[16]; if (!md5_file(name, digest, length)) return false; for (int i = 0; i < 16; i++) { - sprintf(md5str + i*2, "%02x", (int)digest[i]); + snprintf(md5str + i*2, 3, "%02x", (int)digest[i]); } return true; } -bool md5_file_string(ReadStream &stream, char md5str[32+1], uint32 length) { +bool md5_file_string(ReadStream &stream, char *md5str, uint32 length) { uint8 digest[16]; if (!md5_file(stream, digest, length)) return false; for (int i = 0; i < 16; i++) { - sprintf(md5str + i*2, "%02x", (int)digest[i]); + snprintf(md5str + i*2, 3, "%02x", (int)digest[i]); } return true; diff --git a/common/md5.h b/common/md5.h index 6700ff355f..578c363e8c 100644 --- a/common/md5.h +++ b/common/md5.h @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002-2006 The ScummVM project +/* 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 @@ -35,9 +38,10 @@ bool md5_file(ReadStream &stream, uint8 digest[16], uint32 length = 0); // The following two methods work similar to the above two, but // instead of computing the binary MD5 digest, they produce // a human readable lowercase hexstring representing the digest. -bool md5_file_string(const char *name, char md5str[32+1], uint32 length = 0); -bool md5_file_string(const FilesystemNode &file, char md5str[32+1], uint32 length = 0); -bool md5_file_string(ReadStream &stream, char md5str[32+1], uint32 length = 0); +// The md5str parameter must point to a buffer of 32+1 chars. +bool md5_file_string(const char *name, char *md5str, uint32 length = 0); +bool md5_file_string(const FilesystemNode &file, char *md5str, uint32 length = 0); +bool md5_file_string(ReadStream &stream, char *md5str, uint32 length = 0); } // End of namespace Common diff --git a/common/mutex.cpp b/common/mutex.cpp index 3ce520cffe..693b14db2f 100644 --- a/common/mutex.cpp +++ b/common/mutex.cpp @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2003-2006 The ScummVM project +/* 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 diff --git a/common/mutex.h b/common/mutex.h index ca332b32ad..236d75d958 100644 --- a/common/mutex.h +++ b/common/mutex.h @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2003-2006 The ScummVM project +/* 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 diff --git a/common/noncopyable.h b/common/noncopyable.h index 7fafc44121..e0af397546 100644 --- a/common/noncopyable.h +++ b/common/noncopyable.h @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002-2007 The ScummVM project +/* 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 diff --git a/common/pack-end.h b/common/pack-end.h index 28461e16a7..701b12dccc 100644 --- a/common/pack-end.h +++ b/common/pack-end.h @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002-2006 The ScummVM project +/* 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 diff --git a/common/pack-start.h b/common/pack-start.h index b39238d03b..0b2c3eff82 100644 --- a/common/pack-start.h +++ b/common/pack-start.h @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002-2006 The ScummVM project +/* 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 diff --git a/common/rect.h b/common/rect.h index be1035669a..b4355052f6 100644 --- a/common/rect.h +++ b/common/rect.h @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002-2006 The ScummVM project +/* 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 diff --git a/common/savefile.h b/common/savefile.h index 9d781b92f8..e1a54638b5 100644 --- a/common/savefile.h +++ b/common/savefile.h @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002-2006 The ScummVM project +/* 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 diff --git a/common/scummsys.h b/common/scummsys.h index 0ba3f67bd8..e4f52295fb 100644 --- a/common/scummsys.h +++ b/common/scummsys.h @@ -1,6 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001-2006 The ScummVM project +/* 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 diff --git a/common/singleton.h b/common/singleton.h index f26324999e..56039afb37 100644 --- a/common/singleton.h +++ b/common/singleton.h @@ -1,6 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001-2006 The ScummVM project +/* 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 @@ -37,6 +39,8 @@ private: Singleton<T>(const Singleton<T>&); Singleton<T>& operator= (const Singleton<T>&); + static T* _singleton; + /** * The default object factory used by the template class Singleton. * By specialising this template function, one can make a singleton use a @@ -56,13 +60,16 @@ public: public: static T& instance() { - // TODO: We aren't thread safe. + // TODO: We aren't thread safe. For now we ignore it since the + // only thing using this singleton template is the config manager, + // and that is first instantiated long before any threads. // TODO: We don't leak, but the destruction order is nevertheless // semi-random. If we use multiple singletons, the destruction // order might become an issue. There are various approaches // to solve that problem, but for now this is sufficient - static T *instance = T::makeInstance(); - return *instance; + if (!_singleton) + _singleton = T::makeInstance(); + return *_singleton; } protected: Singleton<T>() { } @@ -75,6 +82,8 @@ protected: typedef T SingletonBaseType; }; +#define DECLARE_SINGLETON(T) template<> T* Common::Singleton<T>::_singleton=0 + } // End of namespace Common #endif diff --git a/common/stack.h b/common/stack.h index 127f8a5cf5..1d38c7d2ac 100644 --- a/common/stack.h +++ b/common/stack.h @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002-2006 The ScummVM project +/* 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 diff --git a/common/stdafx.h b/common/stdafx.h index dde816d361..19f2bc8aef 100644 --- a/common/stdafx.h +++ b/common/stdafx.h @@ -1,6 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001-2006 The ScummVM project +/* 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 diff --git a/common/str.cpp b/common/str.cpp index e5272bd133..01d24c1e75 100644 --- a/common/str.cpp +++ b/common/str.cpp @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002-2006 The ScummVM project +/* 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 diff --git a/common/str.h b/common/str.h index 9fbb6734f5..509300dd6f 100644 --- a/common/str.h +++ b/common/str.h @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002-2006 The ScummVM project +/* 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 diff --git a/common/stream.cpp b/common/stream.cpp index 55ada03195..c94faf7ec0 100644 --- a/common/stream.cpp +++ b/common/stream.cpp @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002-2006 The ScummVM project +/* 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 diff --git a/common/stream.h b/common/stream.h index 783415025a..9b3ac5a501 100644 --- a/common/stream.h +++ b/common/stream.h @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2004-2006 The ScummVM project +/* 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 diff --git a/common/system.cpp b/common/system.cpp index 17ecb3f124..2720a19775 100644 --- a/common/system.cpp +++ b/common/system.cpp @@ -1,6 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001-2006 The ScummVM project +/* 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 diff --git a/common/system.h b/common/system.h index c1ff066095..ccca1fb7c7 100644 --- a/common/system.h +++ b/common/system.h @@ -1,6 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2001 Ludvig Strigeus - * Copyright (C) 2001-2007 The ScummVM project +/* 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 diff --git a/common/timer.h b/common/timer.h index 30a733aaee..68f8aef258 100644 --- a/common/timer.h +++ b/common/timer.h @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002-2006 The ScummVM project +/* 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 diff --git a/common/unzip.cpp b/common/unzip.cpp index abfbdcc4fe..379c20dc02 100644 --- a/common/unzip.cpp +++ b/common/unzip.cpp @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2006 The ScummVM project +/* 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 diff --git a/common/unzip.h b/common/unzip.h index 1fa8f775f2..0152690516 100644 --- a/common/unzip.h +++ b/common/unzip.h @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2006 The ScummVM project +/* 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 diff --git a/common/util.cpp b/common/util.cpp index 5e5d719e31..fc5fe9a4e5 100644 --- a/common/util.cpp +++ b/common/util.cpp @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002-2006 The ScummVM project +/* 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 diff --git a/common/util.h b/common/util.h index d6cfeca89f..2325ba523a 100644 --- a/common/util.h +++ b/common/util.h @@ -1,5 +1,8 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2002-2006 The ScummVM project +/* 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 |