diff options
Diffstat (limited to 'engines/sword25/kernel')
-rw-r--r-- | engines/sword25/kernel/callbackregistry.h | 31 | ||||
-rw-r--r-- | engines/sword25/kernel/inputpersistenceblock.h | 4 | ||||
-rw-r--r-- | engines/sword25/kernel/service_ids.h | 26 |
3 files changed, 30 insertions, 31 deletions
diff --git a/engines/sword25/kernel/callbackregistry.h b/engines/sword25/kernel/callbackregistry.h index 19da7e30fb..4197930ae0 100644 --- a/engines/sword25/kernel/callbackregistry.h +++ b/engines/sword25/kernel/callbackregistry.h @@ -39,39 +39,40 @@ // Includes // ----------------------------------------------------------------------------- +#include "common/scummsys.h" +#include "common/str.h" +#include "common/hash-str.h" +#include "common/hashmap.h" #include "sword25/kernel/common.h" -#include "sword25/kernel/memlog_off.h" -#include <map> -#include "sword25/kernel/memlog_on.h" +namespace Sword25 { // ----------------------------------------------------------------------------- // Klassendeklaration // ----------------------------------------------------------------------------- -class BS_CallbackRegistry -{ +class BS_CallbackRegistry { public: - static BS_CallbackRegistry & GetInstance() - { + static BS_CallbackRegistry & GetInstance() { static BS_CallbackRegistry Instance; return Instance; } - bool RegisterCallbackFunction(const std::string & Name, void * Ptr); - void * ResolveCallbackFunction(const std::string & Name) const; - std::string ResolveCallbackPointer(void * Ptr) const; + bool RegisterCallbackFunction(const Common::String &Name, void * Ptr); + void * ResolveCallbackFunction(const Common::String &Name) const; + Common::String ResolveCallbackPointer(void *Ptr) const; private: - typedef std::map<std::string, void *> NameToPtrMap; + typedef Common::HashMap<Common::String, void *, Common::CaseSensitiveString_Hash, Common::CaseSensitiveString_EqualTo> NameToPtrMap; NameToPtrMap m_NameToPtrMap; - typedef std::map<void *, std::string> PtrToNameMap; + typedef Common::HashMap<void *, Common::String, Common::CaseSensitiveString_Hash, Common::CaseSensitiveString_EqualTo> PtrToNameMap; PtrToNameMap m_PtrToNameMap; - void * FindPtrByName(const std::string & Name) const; - std::string FindNameByPtr(void * Ptr) const; - void StoreCallbackFunction(const std::string & Name, void * Ptr); + void * FindPtrByName(const Common::String &Name) const; + Common::String FindNameByPtr(void * Ptr) const; + void StoreCallbackFunction(const Common::String & Name, void * Ptr); }; +} // End of namespace Sword25 #endif diff --git a/engines/sword25/kernel/inputpersistenceblock.h b/engines/sword25/kernel/inputpersistenceblock.h index b30429771b..0e8e3bf5e6 100644 --- a/engines/sword25/kernel/inputpersistenceblock.h +++ b/engines/sword25/kernel/inputpersistenceblock.h @@ -39,11 +39,9 @@ // Includes // ----------------------------------------------------------------------------- +#include "common/array.h" #include "sword25/kernel/common.h" #include "sword25/kernel/persistenceblock.h" -#include "sword25/kernel/memlog_off.h" -#include <vector> -#include "sword25/kernel/memlog_on.h" namespace Sword25 { diff --git a/engines/sword25/kernel/service_ids.h b/engines/sword25/kernel/service_ids.h index 1aefc2d890..7bb352d9e5 100644 --- a/engines/sword25/kernel/service_ids.h +++ b/engines/sword25/kernel/service_ids.h @@ -49,24 +49,24 @@ namespace Sword25 { -BS_Service *BS_OpenGLGfx_CreateObject(BS_Kernel* pKernel); -BS_Service *BS_ScummVMPackageManager_CreateObject(BS_Kernel* pKernel); -BS_Service *BS_StdWinInput_CreateObject(BS_Kernel* pKernel); -BS_Service *BS_FMODExSound_CreateObject(BS_Kernel* pKernel); -BS_Service *BS_LuaScriptEngine_CreateObject(BS_Kernel* pKernel); -BS_Service *BS_Geometry_CreateObject(BS_Kernel* pKernel); -BS_Service *BS_OggTheora_CreateObject(BS_Kernel* pKernel); +BS_Service *BS_OpenGLGfx_CreateObject(BS_Kernel *pKernel); +BS_Service *BS_ScummVMPackageManager_CreateObject(BS_Kernel *pKernel); +BS_Service *BS_ScummVMInput_CreateObject(BS_Kernel *pKernel); +BS_Service *BS_FMODExSound_CreateObject(BS_Kernel *pKernel); +BS_Service *BS_LuaScriptEngine_CreateObject(BS_Kernel *pKernel); +BS_Service *BS_Geometry_CreateObject(BS_Kernel *pKernel); +BS_Service *BS_OggTheora_CreateObject(BS_Kernel *pKernel); // Services are recorded in this table -const BS_ServiceInfo BS_SERVICE_TABLE[] = -{ - // Die ersten beiden Parameter sind die Namen der Superclass und des Services. - // Der dritte Parameter ist die statische Methode der Klasse, die ein Objekt der Klasse erzeugt und zurückgibt. - // Beispiel: +const BS_ServiceInfo BS_SERVICE_TABLE[] = { + // The first two parameters are the name of the superclass and service + // The third parameter is the static method of the class that creates an object + // of the class and returns it + // Example: // BS_ServiceInfo("Superclass", "Service", CreateMethod) BS_ServiceInfo("gfx", "opengl", BS_OpenGLGfx_CreateObject), BS_ServiceInfo("package", "archiveFS", BS_ScummVMPackageManager_CreateObject), - BS_ServiceInfo("input", "winapi", BS_StdWinInput_CreateObject), + BS_ServiceInfo("input", "winapi", BS_ScummVMInput_CreateObject), BS_ServiceInfo("sfx", "fmodex", BS_FMODExSound_CreateObject), BS_ServiceInfo("script", "lua", BS_LuaScriptEngine_CreateObject), BS_ServiceInfo("geometry", "std", BS_Geometry_CreateObject), |