diff options
author | Eugene Sandulenko | 2010-08-18 12:58:22 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2010-10-12 22:59:01 +0000 |
commit | b01994a53bbc96da907a4c28934e644184291017 (patch) | |
tree | 7454011b38391985e9f7ce6bca101f1394d127be /engines/sword25/kernel | |
parent | 4c4e821326a3772ad59fee836eabd5175bbb84ca (diff) | |
download | scummvm-rg350-b01994a53bbc96da907a4c28934e644184291017.tar.gz scummvm-rg350-b01994a53bbc96da907a4c28934e644184291017.tar.bz2 scummvm-rg350-b01994a53bbc96da907a4c28934e644184291017.zip |
SWORD25: removed BS_ prefix from rest of the classes.
The things which are intentionally left with the prefix:
BS_LOG, BS_ASSERT, BS_Rect, BS_String.
svn-id: r53261
Diffstat (limited to 'engines/sword25/kernel')
25 files changed, 313 insertions, 313 deletions
diff --git a/engines/sword25/kernel/filesystemutil.cpp b/engines/sword25/kernel/filesystemutil.cpp index 5eddc06bd0..937c2d6abe 100644 --- a/engines/sword25/kernel/filesystemutil.cpp +++ b/engines/sword25/kernel/filesystemutil.cpp @@ -68,7 +68,7 @@ Common::String GetAbsolutePath(const Common::String &Path) { // Class definitions // ----------------------------------------------------------------------------- -class BS_FileSystemUtilScummVM : public BS_FileSystemUtil { +class BS_FileSystemUtilScummVM : public FileSystemUtil { public: virtual Common::String GetUserdataDirectory() { Common::String path = ConfMan.get("savepath"); @@ -134,7 +134,7 @@ public: // Singleton method of parent class // ----------------------------------------------------------------------------- -BS_FileSystemUtil &BS_FileSystemUtil::GetInstance() { +FileSystemUtil &FileSystemUtil::GetInstance() { static BS_FileSystemUtilScummVM Instance; return Instance; } diff --git a/engines/sword25/kernel/filesystemutil.h b/engines/sword25/kernel/filesystemutil.h index 0fffa72d9f..469c0b509a 100644 --- a/engines/sword25/kernel/filesystemutil.h +++ b/engines/sword25/kernel/filesystemutil.h @@ -60,10 +60,10 @@ namespace Sword25 { // Class definitions // ----------------------------------------------------------------------------- -class BS_FileSystemUtil { +class FileSystemUtil { public: - static BS_FileSystemUtil &GetInstance(); - virtual ~BS_FileSystemUtil() {}; + static FileSystemUtil &GetInstance(); + virtual ~FileSystemUtil() {}; /** * This function returns the name of the directory in which all user data is to be stored. diff --git a/engines/sword25/kernel/inputpersistenceblock.cpp b/engines/sword25/kernel/inputpersistenceblock.cpp index 764cadd373..787eb78e6b 100644 --- a/engines/sword25/kernel/inputpersistenceblock.cpp +++ b/engines/sword25/kernel/inputpersistenceblock.cpp @@ -46,7 +46,7 @@ namespace Sword25 { // Constructor / Destructor // ----------------------------------------------------------------------------- -BS_InputPersistenceBlock::BS_InputPersistenceBlock(const void *Data, unsigned int DataLength) : +InputPersistenceBlock::InputPersistenceBlock(const void *Data, unsigned int DataLength) : m_Data(static_cast<const unsigned char *>(Data), DataLength), m_ErrorState(NONE) { m_Iter = m_Data.begin(); @@ -54,7 +54,7 @@ BS_InputPersistenceBlock::BS_InputPersistenceBlock(const void *Data, unsigned in // ----------------------------------------------------------------------------- -BS_InputPersistenceBlock::~BS_InputPersistenceBlock() { +InputPersistenceBlock::~InputPersistenceBlock() { if (m_Iter != m_Data.end()) BS_LOG_WARNINGLN("Persistence block was not read to the end."); } @@ -62,7 +62,7 @@ BS_InputPersistenceBlock::~BS_InputPersistenceBlock() { // Reading // ----------------------------------------------------------------------------- -void BS_InputPersistenceBlock::Read(int16 &Value) { +void InputPersistenceBlock::Read(int16 &Value) { signed int v; Read(v); Value = static_cast<int16>(v); @@ -70,7 +70,7 @@ void BS_InputPersistenceBlock::Read(int16 &Value) { // ----------------------------------------------------------------------------- -void BS_InputPersistenceBlock::Read(signed int &Value) { +void InputPersistenceBlock::Read(signed int &Value) { if (CheckMarker(SINT_MARKER)) { RawRead(&Value, sizeof(signed int)); Value = ConvertEndianessFromStorageToSystem(Value); @@ -81,7 +81,7 @@ void BS_InputPersistenceBlock::Read(signed int &Value) { // ----------------------------------------------------------------------------- -void BS_InputPersistenceBlock::Read(unsigned int &Value) { +void InputPersistenceBlock::Read(unsigned int &Value) { if (CheckMarker(UINT_MARKER)) { RawRead(&Value, sizeof(unsigned int)); Value = ConvertEndianessFromStorageToSystem(Value); @@ -92,7 +92,7 @@ void BS_InputPersistenceBlock::Read(unsigned int &Value) { // ----------------------------------------------------------------------------- -void BS_InputPersistenceBlock::Read(float &Value) { +void InputPersistenceBlock::Read(float &Value) { if (CheckMarker(FLOAT_MARKER)) { RawRead(&Value, sizeof(float)); Value = ConvertEndianessFromStorageToSystem(Value); @@ -103,7 +103,7 @@ void BS_InputPersistenceBlock::Read(float &Value) { // ----------------------------------------------------------------------------- -void BS_InputPersistenceBlock::Read(bool &Value) { +void InputPersistenceBlock::Read(bool &Value) { if (CheckMarker(BOOL_MARKER)) { unsigned int UIntBool; RawRead(&UIntBool, sizeof(float)); @@ -116,7 +116,7 @@ void BS_InputPersistenceBlock::Read(bool &Value) { // ----------------------------------------------------------------------------- -void BS_InputPersistenceBlock::Read(Common::String &Value) { +void InputPersistenceBlock::Read(Common::String &Value) { Value = ""; if (CheckMarker(STRING_MARKER)) { @@ -132,7 +132,7 @@ void BS_InputPersistenceBlock::Read(Common::String &Value) { // ----------------------------------------------------------------------------- -void BS_InputPersistenceBlock::Read(Common::Array<unsigned char> &Value) { +void InputPersistenceBlock::Read(Common::Array<unsigned char> &Value) { if (CheckMarker(BLOCK_MARKER)) { unsigned int Size; Read(Size); @@ -146,7 +146,7 @@ void BS_InputPersistenceBlock::Read(Common::Array<unsigned char> &Value) { // ----------------------------------------------------------------------------- -void BS_InputPersistenceBlock::RawRead(void *DestPtr, size_t Size) { +void InputPersistenceBlock::RawRead(void *DestPtr, size_t Size) { if (CheckBlockSize(Size)) { memcpy(DestPtr, &*m_Iter, Size); m_Iter += Size; @@ -155,7 +155,7 @@ void BS_InputPersistenceBlock::RawRead(void *DestPtr, size_t Size) { // ----------------------------------------------------------------------------- -bool BS_InputPersistenceBlock::CheckBlockSize(int Size) { +bool InputPersistenceBlock::CheckBlockSize(int Size) { if (m_Data.end() - m_Iter >= Size) { return true; } else { @@ -167,7 +167,7 @@ bool BS_InputPersistenceBlock::CheckBlockSize(int Size) { // ----------------------------------------------------------------------------- -bool BS_InputPersistenceBlock::CheckMarker(unsigned char Marker) { +bool InputPersistenceBlock::CheckMarker(unsigned char Marker) { if (!IsGood() || !CheckBlockSize(1)) return false; if (*m_Iter++ == Marker) { diff --git a/engines/sword25/kernel/inputpersistenceblock.h b/engines/sword25/kernel/inputpersistenceblock.h index 0bd50bbeb1..2013747b92 100644 --- a/engines/sword25/kernel/inputpersistenceblock.h +++ b/engines/sword25/kernel/inputpersistenceblock.h @@ -49,7 +49,7 @@ namespace Sword25 { // Class declaration // ----------------------------------------------------------------------------- -class BS_InputPersistenceBlock : public BS_PersistenceBlock { +class InputPersistenceBlock : public PersistenceBlock { public: enum ErrorState { NONE, @@ -57,8 +57,8 @@ public: OUT_OF_SYNC }; - BS_InputPersistenceBlock(const void *Data, unsigned int DataLength); - virtual ~BS_InputPersistenceBlock(); + InputPersistenceBlock(const void *Data, unsigned int DataLength); + virtual ~InputPersistenceBlock(); void Read(int16 &Value); void Read(signed int &Value); diff --git a/engines/sword25/kernel/kernel.cpp b/engines/sword25/kernel/kernel.cpp index 40833fed04..8c08e18e81 100644 --- a/engines/sword25/kernel/kernel.cpp +++ b/engines/sword25/kernel/kernel.cpp @@ -47,9 +47,9 @@ namespace Sword25 { #define BS_LOG_PREFIX "KERNEL" -BS_Kernel *BS_Kernel::_Instance = 0; +Kernel *Kernel::_Instance = 0; -BS_Kernel::BS_Kernel() : +Kernel::Kernel() : _pWindow(NULL), _Running(false), _pResourceManager(NULL), @@ -75,14 +75,14 @@ BS_Kernel::BS_Kernel() : } // Create window object - _pWindow = BS_Window::CreateBSWindow(0, 0, 0, 0, false); + _pWindow = Window::CreateBSWindow(0, 0, 0, 0, false); if (!_pWindow) { BS_LOG_ERRORLN("Failed to create the window."); } else BS_LOGLN("Window created."); // Create the resource manager - _pResourceManager = new BS_ResourceManager(this); + _pResourceManager = new ResourceManager(this); // Initialise the script engine ScriptEngine *pScript = static_cast<ScriptEngine *>(NewService("script", "lua")); @@ -102,7 +102,7 @@ BS_Kernel::BS_Kernel() : _InitSuccess = true; } -BS_Kernel::~BS_Kernel() { +Kernel::~Kernel() { // Services are de-registered in reverse order of creation while (!_ServiceCreationOrder.empty()) { Superclass *superclass = GetSuperclassByIdentifier(_ServiceCreationOrder.top()); @@ -129,7 +129,7 @@ BS_Kernel::~BS_Kernel() { // Service Methoden // ---------------- -BS_Kernel::Superclass::Superclass(BS_Kernel *pKernel, const Common::String &Identifier) : +Kernel::Superclass::Superclass(Kernel *pKernel, const Common::String &Identifier) : _pKernel(pKernel), _Identifier(Identifier), _ServiceCount(0), @@ -139,7 +139,7 @@ BS_Kernel::Superclass::Superclass(BS_Kernel *pKernel, const Common::String &Iden _ServiceCount++; } -BS_Kernel::Superclass::~Superclass() { +Kernel::Superclass::~Superclass() { DisconnectService(); } @@ -152,7 +152,7 @@ BS_Kernel::Superclass::~Superclass() { * Hierbei ist zu beachten, dass der erste Service die Nummer 0 erhält. Number muss also eine Zahl zwischen * 0 und GetServiceCount() - 1 sein. */ -Common::String BS_Kernel::Superclass::GetServiceIdentifier(unsigned int Number) { +Common::String Kernel::Superclass::GetServiceIdentifier(unsigned int Number) { if (Number > _ServiceCount) return NULL; unsigned int CurServiceOrd = 0; @@ -177,11 +177,11 @@ Common::String BS_Kernel::Superclass::GetServiceIdentifier(unsigned int Number) * @param ServiceIdentifier The name of the service * For the superclass "sfx" an example could be "Fmod" or "directsound" */ -BS_Service *BS_Kernel::Superclass::NewService(const Common::String &ServiceIdentifier) { +Service *Kernel::Superclass::NewService(const Common::String &ServiceIdentifier) { for (unsigned int i = 0; i < BS_SERVICE_COUNT; i++) if (BS_SERVICE_TABLE[i].SuperclassIdentifier == _Identifier && BS_SERVICE_TABLE[i].ServiceIdentifier == ServiceIdentifier) { - BS_Service *NewService_ = BS_SERVICE_TABLE[i].CreateMethod(_pKernel); + Service *NewService_ = BS_SERVICE_TABLE[i].CreateMethod(_pKernel); if (NewService_) { DisconnectService(); @@ -205,7 +205,7 @@ BS_Service *BS_Kernel::Superclass::NewService(const Common::String &ServiceIdent * @param SuperclassIdentfier The name of the superclass which is to be disconnected * z.B: "sfx", "gfx", "package" ... */ -bool BS_Kernel::Superclass::DisconnectService() { +bool Kernel::Superclass::DisconnectService() { if (_ActiveService) { delete _ActiveService; _ActiveService = 0; @@ -216,7 +216,7 @@ bool BS_Kernel::Superclass::DisconnectService() { return false; } -BS_Kernel::Superclass *BS_Kernel::GetSuperclassByIdentifier(const Common::String &Identifier) { +Kernel::Superclass *Kernel::GetSuperclassByIdentifier(const Common::String &Identifier) { Common::Array<Superclass *>::iterator Iter; for (Iter = _SuperclassList.begin(); Iter != _SuperclassList.end(); ++Iter) { if ((*Iter)->GetIdentifier() == Identifier) @@ -230,7 +230,7 @@ BS_Kernel::Superclass *BS_Kernel::GetSuperclassByIdentifier(const Common::String /** * Returns the number of register superclasses */ -unsigned int BS_Kernel::GetSuperclassCount() { +unsigned int Kernel::GetSuperclassCount() { return _SuperclassList.size(); } @@ -240,7 +240,7 @@ unsigned int BS_Kernel::GetSuperclassCount() { * @param Number The number of the superclass to return the identifier for. * It should be noted that the number should be between 0 und GetSuperclassCount() - 1. */ -Common::String BS_Kernel::GetSuperclassIdentifier(unsigned int Number) { +Common::String Kernel::GetSuperclassIdentifier(unsigned int Number) { if (Number > _SuperclassList.size()) return NULL; unsigned int CurSuperclassOrd = 0; @@ -260,7 +260,7 @@ Common::String BS_Kernel::GetSuperclassIdentifier(unsigned int Number) { * @param SuperclassIdentifier The name of the superclass * z.B: "sfx", "gfx", "package" ... */ -unsigned int BS_Kernel::GetServiceCount(const Common::String &SuperclassIdentifier) { +unsigned int Kernel::GetServiceCount(const Common::String &SuperclassIdentifier) { Superclass *pSuperclass; if (!(pSuperclass = GetSuperclassByIdentifier(SuperclassIdentifier))) return 0; @@ -278,7 +278,7 @@ unsigned int BS_Kernel::GetServiceCount(const Common::String &SuperclassIdentifi * Hierbei ist zu beachten, dass der erste Service die Nummer 0 erhält. Number muss also eine Zahl zwischen * 0 und GetServiceCount() - 1 sein. */ -Common::String BS_Kernel::GetServiceIdentifier(const Common::String &SuperclassIdentifier, unsigned int Number) { +Common::String Kernel::GetServiceIdentifier(const Common::String &SuperclassIdentifier, unsigned int Number) { Superclass *pSuperclass; if (!(pSuperclass = GetSuperclassByIdentifier(SuperclassIdentifier))) return NULL; @@ -294,7 +294,7 @@ Common::String BS_Kernel::GetServiceIdentifier(const Common::String &SuperclassI * @param ServiceIdentifier The name of the service * For the superclass "sfx" an example could be "Fmod" or "directsound" */ -BS_Service *BS_Kernel::NewService(const Common::String &SuperclassIdentifier, const Common::String &ServiceIdentifier) { +Service *Kernel::NewService(const Common::String &SuperclassIdentifier, const Common::String &ServiceIdentifier) { Superclass *pSuperclass; if (!(pSuperclass = GetSuperclassByIdentifier(SuperclassIdentifier))) return NULL; @@ -310,7 +310,7 @@ BS_Service *BS_Kernel::NewService(const Common::String &SuperclassIdentifier, co * @param SuperclassIdentfier The name of the superclass which is to be disconnected * z.B: "sfx", "gfx", "package" ... */ -bool BS_Kernel::DisconnectService(const Common::String &SuperclassIdentifier) { +bool Kernel::DisconnectService(const Common::String &SuperclassIdentifier) { Superclass *pSuperclass; if (!(pSuperclass = GetSuperclassByIdentifier(SuperclassIdentifier))) return false; @@ -322,7 +322,7 @@ bool BS_Kernel::DisconnectService(const Common::String &SuperclassIdentifier) { * @param SuperclassIdentfier The name of the superclass * z.B: "sfx", "gfx", "package" ... */ -BS_Service *BS_Kernel::GetService(const Common::String &SuperclassIdentifier) { +Service *Kernel::GetService(const Common::String &SuperclassIdentifier) { Superclass *pSuperclass; if (!(pSuperclass = GetSuperclassByIdentifier(SuperclassIdentifier))) return NULL; @@ -335,7 +335,7 @@ BS_Service *BS_Kernel::GetService(const Common::String &SuperclassIdentifier) { * @param SuperclassIdentfier The name of the superclass * z.B: "sfx", "gfx", "package" ... */ -Common::String BS_Kernel::GetActiveServiceIdentifier(const Common::String &SuperclassIdentifier) { +Common::String Kernel::GetActiveServiceIdentifier(const Common::String &SuperclassIdentifier) { Superclass *pSuperclass = GetSuperclassByIdentifier(SuperclassIdentifier); if (!pSuperclass) return Common::String(""); @@ -349,7 +349,7 @@ Common::String BS_Kernel::GetActiveServiceIdentifier(const Common::String &Super * @param Min The minimum allowed value * @param Max The maximum allowed value */ -int BS_Kernel::GetRandomNumber(int Min, int Max) { +int Kernel::GetRandomNumber(int Min, int Max) { BS_ASSERT(Min <= Max); return Min + _rnd.getRandomNumber(Max - Min + 1); @@ -358,7 +358,7 @@ int BS_Kernel::GetRandomNumber(int Min, int Max) { /** * Returns the elapsed time since startup in milliseconds */ -unsigned int BS_Kernel::GetMilliTicks() { +unsigned int Kernel::GetMilliTicks() { return g_system->getMillis(); } @@ -366,7 +366,7 @@ unsigned int BS_Kernel::GetMilliTicks() { * Returns the elapsed time since the system start in microseconds. * This method should be used only if GetMilliTick() for the desired application is inaccurate. */ -uint64 BS_Kernel::GetMicroTicks() { +uint64 Kernel::GetMicroTicks() { return g_system->getMillis() * 1000; } @@ -376,7 +376,7 @@ uint64 BS_Kernel::GetMicroTicks() { /** * Returns how much memory is being used */ -size_t BS_Kernel::GetUsedMemory() { +size_t Kernel::GetUsedMemory() { return 0; #ifdef SCUMMVM_DISABLED_CODE @@ -396,7 +396,7 @@ size_t BS_Kernel::GetUsedMemory() { /** * Returns a pointer to the active Gfx Service, or NULL if no Gfx service is active */ -GraphicEngine *BS_Kernel::GetGfx() { +GraphicEngine *Kernel::GetGfx() { return static_cast<GraphicEngine *>(GetService("gfx")); } @@ -405,7 +405,7 @@ GraphicEngine *BS_Kernel::GetGfx() { /** * Returns a pointer to the active Sfx Service, or NULL if no Sfx service is active */ -SoundEngine *BS_Kernel::GetSfx() { +SoundEngine *Kernel::GetSfx() { return static_cast<SoundEngine *>(GetService("sfx")); } @@ -414,7 +414,7 @@ SoundEngine *BS_Kernel::GetSfx() { /** * Returns a pointer to the active input service, or NULL if no input service is active */ -InputEngine *BS_Kernel::GetInput() { +InputEngine *Kernel::GetInput() { return static_cast<InputEngine *>(GetService("input")); } @@ -423,7 +423,7 @@ InputEngine *BS_Kernel::GetInput() { /** * Returns a pointer to the active package manager, or NULL if no manager is active */ -PackageManager *BS_Kernel::GetPackage() { +PackageManager *Kernel::GetPackage() { return static_cast<PackageManager *>(GetService("package")); } @@ -432,7 +432,7 @@ PackageManager *BS_Kernel::GetPackage() { /** * Returns a pointer to the script engine, or NULL if it is not active */ -ScriptEngine *BS_Kernel::GetScript() { +ScriptEngine *Kernel::GetScript() { return static_cast<ScriptEngine *>(GetService("script")); } @@ -441,13 +441,13 @@ ScriptEngine *BS_Kernel::GetScript() { /** * Returns a pointer to the movie player, or NULL if it is not active */ -MoviePlayer *BS_Kernel::GetFMV() { +MoviePlayer *Kernel::GetFMV() { return static_cast<MoviePlayer *>(GetService("fmv")); } // ----------------------------------------------------------------------------- -void BS_Kernel::Sleep(unsigned int Msecs) const { +void Kernel::Sleep(unsigned int Msecs) const { g_system->delayMillis(Msecs); } diff --git a/engines/sword25/kernel/kernel.h b/engines/sword25/kernel/kernel.h index e7861db32b..76b092383d 100644 --- a/engines/sword25/kernel/kernel.h +++ b/engines/sword25/kernel/kernel.h @@ -60,7 +60,7 @@ namespace Sword25 { // Class definitions -class BS_Service; +class Service; class GraphicEngine; class ScriptEngine; class SoundEngine; @@ -74,7 +74,7 @@ class MoviePlayer; * This class creates and manages all other engine components such as sound engine, graphics engine ... * It is not necessary to release all the items individually, this is performed by the Kernel class. */ -class BS_Kernel { +class Kernel { public: // Window methods // ---------------- @@ -82,7 +82,7 @@ public: /** * Returns a pointer to the window object */ - BS_Window *GetWindow() { + Window *GetWindow() { return _pWindow; } @@ -98,7 +98,7 @@ public: * @param ServiceIdentifier The name of the service * For the superclass "sfx" an example could be "Fmod" or "directsound" */ - BS_Service *NewService(const Common::String &SuperclassIdentifier, const Common::String &ServiceIdentifier); + Service *NewService(const Common::String &SuperclassIdentifier, const Common::String &ServiceIdentifier); /** * Ends the current service of a superclass. Returns true on success, and false if the superclass @@ -113,7 +113,7 @@ public: * @param SuperclassIdentfier The name of the superclass * z.B: "sfx", "gfx", "package" ... */ - BS_Service *GetService(const Common::String &SuperclassIdentifier); + Service *GetService(const Common::String &SuperclassIdentifier); /** * Returns the name of the currentl active service object of a superclass. @@ -174,7 +174,7 @@ public: /** * Returns a pointer to the BS_ResourceManager */ - BS_ResourceManager *GetResourceManager() { + ResourceManager *GetResourceManager() { return _pResourceManager; } /** @@ -221,8 +221,8 @@ public: /** * Returns the singleton instance for the kernel */ - static BS_Kernel *GetInstance() { - if (!_Instance) _Instance = new BS_Kernel(); + static Kernel *GetInstance() { + if (!_Instance) _Instance = new Kernel(); return _Instance; } @@ -251,26 +251,26 @@ private: // Private singleton methods // ----------------------------------------------------------------------------- - BS_Kernel(); - virtual ~BS_Kernel(); + Kernel(); + virtual ~Kernel(); // ----------------------------------------------------------------------------- // Singleton instance // ----------------------------------------------------------------------------- - static BS_Kernel *_Instance; + static Kernel *_Instance; // Superclass class // ---------------- class Superclass { private: - BS_Kernel *_pKernel; + Kernel *_pKernel; unsigned int _ServiceCount; Common::String _Identifier; - BS_Service *_ActiveService; + Service *_ActiveService; Common::String _ActiveServiceName; public: - Superclass(BS_Kernel *pKernel, const Common::String &Identifier); + Superclass(Kernel *pKernel, const Common::String &Identifier); ~Superclass(); unsigned int GetServiceCount() const { @@ -279,14 +279,14 @@ private: Common::String GetIdentifier() const { return _Identifier; } - BS_Service *GetActiveService() const { + Service *GetActiveService() const { return _ActiveService; } Common::String GetActiveServiceName() const { return _ActiveServiceName; } Common::String GetServiceIdentifier(unsigned int Number); - BS_Service *NewService(const Common::String &ServiceIdentifier); + Service *NewService(const Common::String &ServiceIdentifier); bool DisconnectService(); }; @@ -299,7 +299,7 @@ private: // Active window // ------------- - BS_Window *_pWindow; + Window *_pWindow; // Random number generator // ----------------------- @@ -330,7 +330,7 @@ private: // Resourcemanager // --------------- - BS_ResourceManager *_pResourceManager; + ResourceManager *_pResourceManager; bool _RegisterScriptBindings(); }; @@ -342,7 +342,7 @@ private: class BS_ServiceInfo { public: BS_ServiceInfo(const Common::String &SuperclassIdentifier_, const Common::String &ServiceIdentifier_, - BS_Service*(*CreateMethod_)(BS_Kernel *)) { + Service*(*CreateMethod_)(Kernel *)) { this->SuperclassIdentifier = SuperclassIdentifier_; this->ServiceIdentifier = ServiceIdentifier_; this->CreateMethod = CreateMethod_; @@ -350,7 +350,7 @@ public: Common::String SuperclassIdentifier; Common::String ServiceIdentifier; - BS_Service*(*CreateMethod)(BS_Kernel *); + Service*(*CreateMethod)(Kernel *); }; template<class T> diff --git a/engines/sword25/kernel/kernel_script.cpp b/engines/sword25/kernel/kernel_script.cpp index 9ae78d1e95..f1c75bd691 100644 --- a/engines/sword25/kernel/kernel_script.cpp +++ b/engines/sword25/kernel/kernel_script.cpp @@ -50,7 +50,7 @@ namespace Sword25 { // ----------------------------------------------------------------------------- static int DisconnectService(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); lua_pushboolean(L, pKernel->DisconnectService(luaL_checkstring(L, 1))); @@ -61,7 +61,7 @@ static int DisconnectService(lua_State *L) { // ----------------------------------------------------------------------------- static int GetActiveServiceIdentifier(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); lua_pushstring(L, pKernel->GetActiveServiceIdentifier(luaL_checkstring(L, 1)).c_str()); @@ -72,7 +72,7 @@ static int GetActiveServiceIdentifier(lua_State *L) { // ----------------------------------------------------------------------------- static int GetSuperclassCount(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); lua_pushnumber(L, pKernel->GetSuperclassCount()); @@ -83,7 +83,7 @@ static int GetSuperclassCount(lua_State *L) { // ----------------------------------------------------------------------------- static int GetSuperclassIdentifier(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); lua_pushstring(L, pKernel->GetSuperclassIdentifier( @@ -95,7 +95,7 @@ static int GetSuperclassIdentifier(lua_State *L) { // ----------------------------------------------------------------------------- static int GetServiceCount(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); lua_pushnumber(L, pKernel->GetServiceCount(luaL_checkstring(L, 1))); @@ -106,7 +106,7 @@ static int GetServiceCount(lua_State *L) { // ----------------------------------------------------------------------------- static int GetServiceIdentifier(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); lua_pushstring(L, pKernel->GetServiceIdentifier(luaL_checkstring(L, 1), @@ -118,7 +118,7 @@ static int GetServiceIdentifier(lua_State *L) { // ----------------------------------------------------------------------------- static int GetMilliTicks(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); lua_pushnumber(L, pKernel->GetMilliTicks()); @@ -129,7 +129,7 @@ static int GetMilliTicks(lua_State *L) { // ----------------------------------------------------------------------------- static int GetTimer(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); lua_pushnumber(L, static_cast<lua_Number>(pKernel->GetMicroTicks()) / 1000000.0); @@ -140,7 +140,7 @@ static int GetTimer(lua_State *L) { // ----------------------------------------------------------------------------- static int StartService(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); lua_pushbooleancpp(L, pKernel->NewService(luaL_checkstring(L, 1), luaL_checkstring(L, 2)) != NULL); @@ -151,7 +151,7 @@ static int StartService(lua_State *L) { // ----------------------------------------------------------------------------- static int Sleep(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); pKernel->Sleep(static_cast<unsigned int>(luaL_checknumber(L, 1) * 1000)); return 0; @@ -160,7 +160,7 @@ static int Sleep(lua_State *L) { // ----------------------------------------------------------------------------- static int Crash(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); pKernel->Crash(); return 0; @@ -169,7 +169,7 @@ static int Crash(lua_State *L) { // ----------------------------------------------------------------------------- static int ExecuteFile(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); ScriptEngine *pSE = static_cast<ScriptEngine *>(pKernel->GetService("script")); BS_ASSERT(pSE); @@ -182,28 +182,28 @@ static int ExecuteFile(lua_State *L) { // ----------------------------------------------------------------------------- static int GetUserdataDirectory(lua_State *L) { - lua_pushstring(L, BS_FileSystemUtil::GetInstance().GetUserdataDirectory().c_str()); + lua_pushstring(L, FileSystemUtil::GetInstance().GetUserdataDirectory().c_str()); return 1; } // ----------------------------------------------------------------------------- static int GetPathSeparator(lua_State *L) { - lua_pushstring(L, BS_FileSystemUtil::GetInstance().GetPathSeparator().c_str()); + lua_pushstring(L, FileSystemUtil::GetInstance().GetPathSeparator().c_str()); return 1; } // ----------------------------------------------------------------------------- static int FileExists(lua_State *L) { - lua_pushbooleancpp(L, BS_FileSystemUtil::GetInstance().FileExists(luaL_checkstring(L, 1))); + lua_pushbooleancpp(L, FileSystemUtil::GetInstance().FileExists(luaL_checkstring(L, 1))); return 1; } // ----------------------------------------------------------------------------- static int CreateDirectory(lua_State *L) { - lua_pushbooleancpp(L, BS_FileSystemUtil::GetInstance().CreateDirectory(luaL_checkstring(L, 1))); + lua_pushbooleancpp(L, FileSystemUtil::GetInstance().CreateDirectory(luaL_checkstring(L, 1))); return 1; } @@ -225,7 +225,7 @@ static int GetSubversionRevision(lua_State *L) { // ----------------------------------------------------------------------------- static int GetUsedMemory(lua_State *L) { - lua_pushnumber(L, BS_Kernel::GetInstance()->GetUsedMemory()); + lua_pushnumber(L, Kernel::GetInstance()->GetUsedMemory()); return 1; } @@ -259,9 +259,9 @@ static const luaL_reg KERNEL_FUNCTIONS[] = { // ----------------------------------------------------------------------------- static int IsVisible(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); - BS_Window *pWindow = pKernel->GetWindow(); + Window *pWindow = pKernel->GetWindow(); BS_ASSERT(pWindow); lua_pushbooleancpp(L, pWindow->IsVisible()); @@ -272,9 +272,9 @@ static int IsVisible(lua_State *L) { // ----------------------------------------------------------------------------- static int SetVisible(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); - BS_Window *pWindow = pKernel->GetWindow(); + Window *pWindow = pKernel->GetWindow(); BS_ASSERT(pWindow); pWindow->SetVisible(lua_tobooleancpp(L, 1)); @@ -285,9 +285,9 @@ static int SetVisible(lua_State *L) { // ----------------------------------------------------------------------------- static int GetX(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); - BS_Window *pWindow = pKernel->GetWindow(); + Window *pWindow = pKernel->GetWindow(); BS_ASSERT(pWindow); lua_pushnumber(L, pWindow->GetX()); @@ -298,9 +298,9 @@ static int GetX(lua_State *L) { // ----------------------------------------------------------------------------- static int GetY(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); - BS_Window *pWindow = pKernel->GetWindow(); + Window *pWindow = pKernel->GetWindow(); BS_ASSERT(pWindow); lua_pushnumber(L, pWindow->GetY()); @@ -311,9 +311,9 @@ static int GetY(lua_State *L) { // ----------------------------------------------------------------------------- static int SetX(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); - BS_Window *pWindow = pKernel->GetWindow(); + Window *pWindow = pKernel->GetWindow(); BS_ASSERT(pWindow); pWindow->SetX(static_cast<int>(luaL_checknumber(L, 1))); @@ -324,9 +324,9 @@ static int SetX(lua_State *L) { // ----------------------------------------------------------------------------- static int SetY(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); - BS_Window *pWindow = pKernel->GetWindow(); + Window *pWindow = pKernel->GetWindow(); BS_ASSERT(pWindow); pWindow->SetY(static_cast<int>(luaL_checknumber(L, 1))); @@ -337,9 +337,9 @@ static int SetY(lua_State *L) { // ----------------------------------------------------------------------------- static int GetClientX(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); - BS_Window *pWindow = pKernel->GetWindow(); + Window *pWindow = pKernel->GetWindow(); BS_ASSERT(pWindow); lua_pushnumber(L, pWindow->GetClientX()); @@ -350,9 +350,9 @@ static int GetClientX(lua_State *L) { // ----------------------------------------------------------------------------- static int GetClientY(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); - BS_Window *pWindow = pKernel->GetWindow(); + Window *pWindow = pKernel->GetWindow(); BS_ASSERT(pWindow); lua_pushnumber(L, pWindow->GetClientY()); @@ -363,9 +363,9 @@ static int GetClientY(lua_State *L) { // ----------------------------------------------------------------------------- static int GetWidth(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); - BS_Window *pWindow = pKernel->GetWindow(); + Window *pWindow = pKernel->GetWindow(); BS_ASSERT(pWindow); lua_pushnumber(L, pWindow->GetWidth()); @@ -376,9 +376,9 @@ static int GetWidth(lua_State *L) { // ----------------------------------------------------------------------------- static int GetHeight(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); - BS_Window *pWindow = pKernel->GetWindow(); + Window *pWindow = pKernel->GetWindow(); BS_ASSERT(pWindow); lua_pushnumber(L, pWindow->GetHeight()); @@ -389,9 +389,9 @@ static int GetHeight(lua_State *L) { // ----------------------------------------------------------------------------- static int SetWidth(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); - BS_Window *pWindow = pKernel->GetWindow(); + Window *pWindow = pKernel->GetWindow(); BS_ASSERT(pWindow); pWindow->SetWidth(static_cast<int>(luaL_checknumber(L, 1))); @@ -402,9 +402,9 @@ static int SetWidth(lua_State *L) { // ----------------------------------------------------------------------------- static int SetHeight(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); - BS_Window *pWindow = pKernel->GetWindow(); + Window *pWindow = pKernel->GetWindow(); BS_ASSERT(pWindow); pWindow->SetHeight(static_cast<int>(luaL_checknumber(L, 1))); @@ -415,9 +415,9 @@ static int SetHeight(lua_State *L) { // ----------------------------------------------------------------------------- static int GetTitle(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); - BS_Window *pWindow = pKernel->GetWindow(); + Window *pWindow = pKernel->GetWindow(); BS_ASSERT(pWindow); lua_pushstring(L, pWindow->GetTitle().c_str()); @@ -428,9 +428,9 @@ static int GetTitle(lua_State *L) { // ----------------------------------------------------------------------------- static int SetTitle(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); - BS_Window *pWindow = pKernel->GetWindow(); + Window *pWindow = pKernel->GetWindow(); BS_ASSERT(pWindow); pWindow->SetTitle(luaL_checkstring(L, 1)); @@ -441,9 +441,9 @@ static int SetTitle(lua_State *L) { // ----------------------------------------------------------------------------- static int ProcessMessages(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); - BS_Window *pWindow = pKernel->GetWindow(); + Window *pWindow = pKernel->GetWindow(); BS_ASSERT(pWindow); lua_pushbooleancpp(L, pWindow->ProcessMessages()); @@ -454,9 +454,9 @@ static int ProcessMessages(lua_State *L) { // ----------------------------------------------------------------------------- static int CloseWanted(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); - BS_Window *pWindow = pKernel->GetWindow(); + Window *pWindow = pKernel->GetWindow(); BS_ASSERT(pWindow); lua_pushbooleancpp(L, pWindow->CloseWanted()); @@ -467,9 +467,9 @@ static int CloseWanted(lua_State *L) { // ----------------------------------------------------------------------------- static int WaitForFocus(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); - BS_Window *pWindow = pKernel->GetWindow(); + Window *pWindow = pKernel->GetWindow(); BS_ASSERT(pWindow); lua_pushbooleancpp(L, pWindow->WaitForFocus()); @@ -480,9 +480,9 @@ static int WaitForFocus(lua_State *L) { // ----------------------------------------------------------------------------- static int HasFocus(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); - BS_Window *pWindow = pKernel->GetWindow(); + Window *pWindow = pKernel->GetWindow(); BS_ASSERT(pWindow); lua_pushbooleancpp(L, pWindow->HasFocus()); @@ -519,9 +519,9 @@ static const luaL_reg WINDOW_FUNCTIONS[] = { // ----------------------------------------------------------------------------- static int PrecacheResource(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); - BS_ResourceManager *pResource = pKernel->GetResourceManager(); + ResourceManager *pResource = pKernel->GetResourceManager(); BS_ASSERT(pResource); lua_pushbooleancpp(L, pResource->PrecacheResource(luaL_checkstring(L, 1))); @@ -532,9 +532,9 @@ static int PrecacheResource(lua_State *L) { // ----------------------------------------------------------------------------- static int ForcePrecacheResource(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); - BS_ResourceManager *pResource = pKernel->GetResourceManager(); + ResourceManager *pResource = pKernel->GetResourceManager(); BS_ASSERT(pResource); lua_pushbooleancpp(L, pResource->PrecacheResource(luaL_checkstring(L, 1), true)); @@ -545,9 +545,9 @@ static int ForcePrecacheResource(lua_State *L) { // ----------------------------------------------------------------------------- static int GetMaxMemoryUsage(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); - BS_ResourceManager *pResource = pKernel->GetResourceManager(); + ResourceManager *pResource = pKernel->GetResourceManager(); BS_ASSERT(pResource); lua_pushnumber(L, pResource->GetMaxMemoryUsage()); @@ -558,9 +558,9 @@ static int GetMaxMemoryUsage(lua_State *L) { // ----------------------------------------------------------------------------- static int SetMaxMemoryUsage(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); - BS_ResourceManager *pResource = pKernel->GetResourceManager(); + ResourceManager *pResource = pKernel->GetResourceManager(); BS_ASSERT(pResource); pResource->SetMaxMemoryUsage(static_cast<unsigned int>(lua_tonumber(L, 1))); @@ -571,9 +571,9 @@ static int SetMaxMemoryUsage(lua_State *L) { // ----------------------------------------------------------------------------- static int EmptyCache(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); - BS_ResourceManager *pResource = pKernel->GetResourceManager(); + ResourceManager *pResource = pKernel->GetResourceManager(); BS_ASSERT(pResource); pResource->EmptyCache(); @@ -584,9 +584,9 @@ static int EmptyCache(lua_State *L) { // ----------------------------------------------------------------------------- static int IsLogCacheMiss(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); - BS_ResourceManager *pResource = pKernel->GetResourceManager(); + ResourceManager *pResource = pKernel->GetResourceManager(); BS_ASSERT(pResource); lua_pushbooleancpp(L, pResource->IsLogCacheMiss()); @@ -597,9 +597,9 @@ static int IsLogCacheMiss(lua_State *L) { // ----------------------------------------------------------------------------- static int SetLogCacheMiss(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); - BS_ResourceManager *pResource = pKernel->GetResourceManager(); + ResourceManager *pResource = pKernel->GetResourceManager(); BS_ASSERT(pResource); pResource->SetLogCacheMiss(lua_tobooleancpp(L, 1)); @@ -610,9 +610,9 @@ static int SetLogCacheMiss(lua_State *L) { // ----------------------------------------------------------------------------- static int DumpLockedResources(lua_State *L) { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); - BS_ResourceManager *pResource = pKernel->GetResourceManager(); + ResourceManager *pResource = pKernel->GetResourceManager(); BS_ASSERT(pResource); pResource->DumpLockedResources(); @@ -639,7 +639,7 @@ static const luaL_reg RESOURCE_FUNCTIONS[] = { // ----------------------------------------------------------------------------- static int ReloadSlots(lua_State *L) { - BS_PersistenceService::GetInstance().ReloadSlots(); + PersistenceService::GetInstance().ReloadSlots(); lua_pushnil(L); return 1; } @@ -647,14 +647,14 @@ static int ReloadSlots(lua_State *L) { // ----------------------------------------------------------------------------- static int GetSlotCount(lua_State *L) { - lua_pushnumber(L, BS_PersistenceService::GetInstance().GetSlotCount()); + lua_pushnumber(L, PersistenceService::GetInstance().GetSlotCount()); return 1; } // ----------------------------------------------------------------------------- static int IsSlotOccupied(lua_State *L) { - lua_pushbooleancpp(L, BS_PersistenceService::GetInstance().IsSlotOccupied( + lua_pushbooleancpp(L, PersistenceService::GetInstance().IsSlotOccupied( static_cast<unsigned int>(luaL_checknumber(L, 1)) - 1)); return 1; } @@ -662,14 +662,14 @@ static int IsSlotOccupied(lua_State *L) { // ----------------------------------------------------------------------------- static int GetSavegameDirectory(lua_State *L) { - lua_pushstring(L, BS_PersistenceService::GetInstance().GetSavegameDirectory().c_str()); + lua_pushstring(L, PersistenceService::GetInstance().GetSavegameDirectory().c_str()); return 1; } // ----------------------------------------------------------------------------- static int IsSavegameCompatible(lua_State *L) { - lua_pushbooleancpp(L, BS_PersistenceService::GetInstance().IsSavegameCompatible( + lua_pushbooleancpp(L, PersistenceService::GetInstance().IsSavegameCompatible( static_cast<unsigned int>(luaL_checknumber(L, 1)) - 1)); return 1; } @@ -677,7 +677,7 @@ static int IsSavegameCompatible(lua_State *L) { // ----------------------------------------------------------------------------- static int GetSavegameDescription(lua_State *L) { - lua_pushstring(L, BS_PersistenceService::GetInstance().GetSavegameDescription( + lua_pushstring(L, PersistenceService::GetInstance().GetSavegameDescription( static_cast<unsigned int>(luaL_checknumber(L, 1)) - 1).c_str()); return 1; } @@ -685,21 +685,21 @@ static int GetSavegameDescription(lua_State *L) { // ----------------------------------------------------------------------------- static int GetSavegameFilename(lua_State *L) { - lua_pushstring(L, BS_PersistenceService::GetInstance().GetSavegameFilename(static_cast<unsigned int>(luaL_checknumber(L, 1)) - 1).c_str()); + lua_pushstring(L, PersistenceService::GetInstance().GetSavegameFilename(static_cast<unsigned int>(luaL_checknumber(L, 1)) - 1).c_str()); return 1; } // ----------------------------------------------------------------------------- static int LoadGame(lua_State *L) { - lua_pushbooleancpp(L, BS_PersistenceService::GetInstance().LoadGame(static_cast<unsigned int>(luaL_checknumber(L, 1)) - 1)); + lua_pushbooleancpp(L, PersistenceService::GetInstance().LoadGame(static_cast<unsigned int>(luaL_checknumber(L, 1)) - 1)); return 1; } // ----------------------------------------------------------------------------- static int SaveGame(lua_State *L) { - lua_pushbooleancpp(L, BS_PersistenceService::GetInstance().SaveGame(static_cast<unsigned int>(luaL_checknumber(L, 1)) - 1, luaL_checkstring(L, 2))); + lua_pushbooleancpp(L, PersistenceService::GetInstance().SaveGame(static_cast<unsigned int>(luaL_checknumber(L, 1)) - 1, luaL_checkstring(L, 2))); return 1; } @@ -722,7 +722,7 @@ static const luaL_reg PERSISTENCE_FUNCTIONS[] = { // ----------------------------------------------------------------------------- -bool BS_Kernel::_RegisterScriptBindings() { +bool Kernel::_RegisterScriptBindings() { ScriptEngine *pScript = static_cast<ScriptEngine *>(GetService("script")); BS_ASSERT(pScript); lua_State *L = static_cast<lua_State *>(pScript->GetScriptObject()); diff --git a/engines/sword25/kernel/objectregistry.h b/engines/sword25/kernel/objectregistry.h index befebfaedf..d6a53baf4d 100644 --- a/engines/sword25/kernel/objectregistry.h +++ b/engines/sword25/kernel/objectregistry.h @@ -51,10 +51,10 @@ namespace Sword25 { // ----------------------------------------------------------------------------- template<typename T> -class BS_ObjectRegistry { +class ObjectRegistry { public: - BS_ObjectRegistry() : m_NextHandle(1) {} - virtual ~BS_ObjectRegistry() {} + ObjectRegistry() : m_NextHandle(1) {} + virtual ~ObjectRegistry() {} // ------------------------------------------------------------------------- diff --git a/engines/sword25/kernel/outputpersistenceblock.cpp b/engines/sword25/kernel/outputpersistenceblock.cpp index 589e498408..3bf2b0ae20 100644 --- a/engines/sword25/kernel/outputpersistenceblock.cpp +++ b/engines/sword25/kernel/outputpersistenceblock.cpp @@ -54,7 +54,7 @@ namespace Sword25 { // Construction / Destruction // ----------------------------------------------------------------------------- -BS_OutputPersistenceBlock::BS_OutputPersistenceBlock() { +OutputPersistenceBlock::OutputPersistenceBlock() { m_Data.reserve(INITIAL_BUFFER_SIZE); } @@ -62,7 +62,7 @@ BS_OutputPersistenceBlock::BS_OutputPersistenceBlock() { // Writing // ----------------------------------------------------------------------------- -void BS_OutputPersistenceBlock::Write(signed int Value) { +void OutputPersistenceBlock::Write(signed int Value) { WriteMarker(SINT_MARKER); Value = ConvertEndianessFromSystemToStorage(Value); RawWrite(&Value, sizeof(Value)); @@ -70,7 +70,7 @@ void BS_OutputPersistenceBlock::Write(signed int Value) { // ----------------------------------------------------------------------------- -void BS_OutputPersistenceBlock::Write(unsigned int Value) { +void OutputPersistenceBlock::Write(unsigned int Value) { WriteMarker(UINT_MARKER); Value = ConvertEndianessFromSystemToStorage(Value); RawWrite(&Value, sizeof(Value)); @@ -78,7 +78,7 @@ void BS_OutputPersistenceBlock::Write(unsigned int Value) { // ----------------------------------------------------------------------------- -void BS_OutputPersistenceBlock::Write(float Value) { +void OutputPersistenceBlock::Write(float Value) { WriteMarker(FLOAT_MARKER); Value = ConvertEndianessFromSystemToStorage(Value); RawWrite(&Value, sizeof(Value)); @@ -86,7 +86,7 @@ void BS_OutputPersistenceBlock::Write(float Value) { // ----------------------------------------------------------------------------- -void BS_OutputPersistenceBlock::Write(bool Value) { +void OutputPersistenceBlock::Write(bool Value) { WriteMarker(BOOL_MARKER); unsigned int UIntBool = Value ? 1 : 0; @@ -96,7 +96,7 @@ void BS_OutputPersistenceBlock::Write(bool Value) { // ----------------------------------------------------------------------------- -void BS_OutputPersistenceBlock::Write(const Common::String &String) { +void OutputPersistenceBlock::Write(const Common::String &String) { WriteMarker(STRING_MARKER); Write(String.size()); @@ -105,7 +105,7 @@ void BS_OutputPersistenceBlock::Write(const Common::String &String) { // ----------------------------------------------------------------------------- -void BS_OutputPersistenceBlock::Write(const void *BufferPtr, size_t Size) { +void OutputPersistenceBlock::Write(const void *BufferPtr, size_t Size) { WriteMarker(BLOCK_MARKER); Write(Size); @@ -114,13 +114,13 @@ void BS_OutputPersistenceBlock::Write(const void *BufferPtr, size_t Size) { // ----------------------------------------------------------------------------- -void BS_OutputPersistenceBlock::WriteMarker(unsigned char Marker) { +void OutputPersistenceBlock::WriteMarker(unsigned char Marker) { m_Data.push_back(Marker); } // ----------------------------------------------------------------------------- -void BS_OutputPersistenceBlock::RawWrite(const void *DataPtr, size_t Size) { +void OutputPersistenceBlock::RawWrite(const void *DataPtr, size_t Size) { if (Size > 0) { unsigned int OldSize = m_Data.size(); m_Data.resize(OldSize + Size); diff --git a/engines/sword25/kernel/outputpersistenceblock.h b/engines/sword25/kernel/outputpersistenceblock.h index c13f86215d..3f93e28440 100644 --- a/engines/sword25/kernel/outputpersistenceblock.h +++ b/engines/sword25/kernel/outputpersistenceblock.h @@ -48,9 +48,9 @@ namespace Sword25 { // Class declaration // ----------------------------------------------------------------------------- -class BS_OutputPersistenceBlock : public BS_PersistenceBlock { +class OutputPersistenceBlock : public PersistenceBlock { public: - BS_OutputPersistenceBlock(); + OutputPersistenceBlock(); void Write(signed int Value); void Write(unsigned int Value); diff --git a/engines/sword25/kernel/persistable.h b/engines/sword25/kernel/persistable.h index ff3bd9c098..020bd2477c 100644 --- a/engines/sword25/kernel/persistable.h +++ b/engines/sword25/kernel/persistable.h @@ -37,15 +37,15 @@ namespace Sword25 { -class BS_OutputPersistenceBlock; -class BS_InputPersistenceBlock; +class OutputPersistenceBlock; +class InputPersistenceBlock; -class BS_Persistable { +class Persistable { public: - virtual ~BS_Persistable() {}; + virtual ~Persistable() {}; - virtual bool Persist(BS_OutputPersistenceBlock &Writer) = 0; - virtual bool Unpersist(BS_InputPersistenceBlock &Reader) = 0; + virtual bool Persist(OutputPersistenceBlock &Writer) = 0; + virtual bool Unpersist(InputPersistenceBlock &Reader) = 0; }; } // End of namespace Sword25 diff --git a/engines/sword25/kernel/persistenceblock.h b/engines/sword25/kernel/persistenceblock.h index 71cf2135da..b12c86104a 100644 --- a/engines/sword25/kernel/persistenceblock.h +++ b/engines/sword25/kernel/persistenceblock.h @@ -47,7 +47,7 @@ namespace Sword25 { // Class definition // ----------------------------------------------------------------------------- -class BS_PersistenceBlock { +class PersistenceBlock { public: static unsigned int GetSInt32Size() { return sizeof(signed int) + sizeof(unsigned char); diff --git a/engines/sword25/kernel/persistenceservice.cpp b/engines/sword25/kernel/persistenceservice.cpp index dda570b1d2..9f37c3e963 100644 --- a/engines/sword25/kernel/persistenceservice.cpp +++ b/engines/sword25/kernel/persistenceservice.cpp @@ -78,8 +78,8 @@ Common::String GenerateSavegameFilename(unsigned int SlotID) { Common::String GenerateSavegamePath(unsigned int SlotID) { Common::String oss; - oss = BS_PersistenceService::GetSavegameDirectory(); - oss += BS_FileSystemUtil::GetInstance().GetPathSeparator(); + oss = PersistenceService::GetSavegameDirectory(); + oss += FileSystemUtil::GetInstance().GetPathSeparator(); oss += GenerateSavegameFilename(SlotID); return oss; } @@ -145,7 +145,7 @@ struct SavegameInformation { } }; -struct BS_PersistenceService::Impl { +struct PersistenceService::Impl { SavegameInformation m_SavegameInformations[SLOT_COUNT]; // ----------------------------------------------------------------------------- @@ -172,7 +172,7 @@ struct BS_PersistenceService::Impl { Common::String Filename = GenerateSavegamePath(SlotID); // Feststellen, ob eine Spielstanddatei dieses Namens existiert. - if (BS_FileSystemUtil::GetInstance().FileExists(Filename)) { + if (FileSystemUtil::GetInstance().FileExists(Filename)) { // Read in the game Common::SaveFileManager *sfm = g_system->getSavefileManager(); Common::InSaveFile *File = sfm->openForLoading(Filename); @@ -193,7 +193,7 @@ struct BS_PersistenceService::Impl { // Dateinamen des Spielstandes speichern. CurSavegameInfo.Filename = GenerateSavegameFilename(SlotID); // Die Beschreibung des Spielstandes besteht aus einer textuellen Darstellung des Änderungsdatums der Spielstanddatei. - CurSavegameInfo.Description = FormatTimestamp(BS_FileSystemUtil::GetInstance().GetFileTime(Filename)); + CurSavegameInfo.Description = FormatTimestamp(FileSystemUtil::GetInstance().GetFileTime(Filename)); // Den Offset zu den gespeicherten Spieldaten innerhalb der Datei speichern. // Dieses entspricht der aktuellen Position + 1, da nach der letzten Headerinformation noch ein Leerzeichen als trenner folgt. CurSavegameInfo.GamedataOffset = static_cast<unsigned int>(File->pos()) + 1; @@ -209,19 +209,19 @@ struct BS_PersistenceService::Impl { // Construction / Destruction // ----------------------------------------------------------------------------- -BS_PersistenceService &BS_PersistenceService::GetInstance() { - static BS_PersistenceService Instance; +PersistenceService &PersistenceService::GetInstance() { + static PersistenceService Instance; return Instance; } // ----------------------------------------------------------------------------- -BS_PersistenceService::BS_PersistenceService() : m_impl(new Impl) { +PersistenceService::PersistenceService() : m_impl(new Impl) { } // ----------------------------------------------------------------------------- -BS_PersistenceService::~BS_PersistenceService() { +PersistenceService::~PersistenceService() { delete m_impl; } @@ -229,20 +229,20 @@ BS_PersistenceService::~BS_PersistenceService() { // Implementation // ----------------------------------------------------------------------------- -void BS_PersistenceService::ReloadSlots() { +void PersistenceService::ReloadSlots() { m_impl->ReloadSlots(); } // ----------------------------------------------------------------------------- -unsigned int BS_PersistenceService::GetSlotCount() { +unsigned int PersistenceService::GetSlotCount() { return SLOT_COUNT; } // ----------------------------------------------------------------------------- -Common::String BS_PersistenceService::GetSavegameDirectory() { - return BS_FileSystemUtil::GetInstance().GetUserdataDirectory() + BS_FileSystemUtil::GetInstance().GetPathSeparator() + SAVEGAME_DIRECTORY; +Common::String PersistenceService::GetSavegameDirectory() { + return FileSystemUtil::GetInstance().GetUserdataDirectory() + FileSystemUtil::GetInstance().GetPathSeparator() + SAVEGAME_DIRECTORY; } // ----------------------------------------------------------------------------- @@ -261,21 +261,21 @@ bool CheckSlotID(unsigned int SlotID) { // ----------------------------------------------------------------------------- -bool BS_PersistenceService::IsSlotOccupied(unsigned int SlotID) { +bool PersistenceService::IsSlotOccupied(unsigned int SlotID) { if (!CheckSlotID(SlotID)) return false; return m_impl->m_SavegameInformations[SlotID].IsOccupied; } // ----------------------------------------------------------------------------- -bool BS_PersistenceService::IsSavegameCompatible(unsigned int SlotID) { +bool PersistenceService::IsSavegameCompatible(unsigned int SlotID) { if (!CheckSlotID(SlotID)) return false; return m_impl->m_SavegameInformations[SlotID].IsCompatible; } // ----------------------------------------------------------------------------- -Common::String &BS_PersistenceService::GetSavegameDescription(unsigned int SlotID) { +Common::String &PersistenceService::GetSavegameDescription(unsigned int SlotID) { static Common::String EmptyString; if (!CheckSlotID(SlotID)) return EmptyString; return m_impl->m_SavegameInformations[SlotID].Description; @@ -283,7 +283,7 @@ Common::String &BS_PersistenceService::GetSavegameDescription(unsigned int SlotI // ----------------------------------------------------------------------------- -Common::String &BS_PersistenceService::GetSavegameFilename(unsigned int SlotID) { +Common::String &PersistenceService::GetSavegameFilename(unsigned int SlotID) { static Common::String EmptyString; if (!CheckSlotID(SlotID)) return EmptyString; return m_impl->m_SavegameInformations[SlotID].Filename; @@ -291,7 +291,7 @@ Common::String &BS_PersistenceService::GetSavegameFilename(unsigned int SlotID) // ----------------------------------------------------------------------------- -bool BS_PersistenceService::SaveGame(unsigned int SlotID, const Common::String &ScreenshotFilename) { +bool PersistenceService::SaveGame(unsigned int SlotID, const Common::String &ScreenshotFilename) { // Überprüfen, ob die Slot-ID zulässig ist. if (SlotID >= SLOT_COUNT) { BS_LOG_ERRORLN("Tried to save to an invalid slot (%d). Only slot ids form 0 to %d are allowed.", SlotID, SLOT_COUNT - 1); @@ -302,7 +302,7 @@ bool BS_PersistenceService::SaveGame(unsigned int SlotID, const Common::String & Common::String Filename = GenerateSavegamePath(SlotID).c_str(); // Sicherstellen, dass das Verzeichnis für die Spielstanddateien existiert. - BS_FileSystemUtil::GetInstance().CreateDirectory(GetSavegameDirectory()); + FileSystemUtil::GetInstance().CreateDirectory(GetSavegameDirectory()); // Spielstanddatei öffnen und die Headerdaten schreiben. Common::SaveFileManager *sfm = g_system->getSavefileManager(); @@ -318,13 +318,13 @@ bool BS_PersistenceService::SaveGame(unsigned int SlotID, const Common::String & } // Alle notwendigen Module persistieren. - BS_OutputPersistenceBlock Writer; + OutputPersistenceBlock Writer; bool Success = true; - Success &= BS_Kernel::GetInstance()->GetScript()->Persist(Writer); + Success &= Kernel::GetInstance()->GetScript()->Persist(Writer); Success &= RegionRegistry::GetInstance().Persist(Writer); - Success &= BS_Kernel::GetInstance()->GetGfx()->Persist(Writer); - Success &= BS_Kernel::GetInstance()->GetSfx()->Persist(Writer); - Success &= BS_Kernel::GetInstance()->GetInput()->Persist(Writer); + Success &= Kernel::GetInstance()->GetGfx()->Persist(Writer); + Success &= Kernel::GetInstance()->GetSfx()->Persist(Writer); + Success &= Kernel::GetInstance()->GetInput()->Persist(Writer); if (!Success) { error("Unable to persist modules for savegame file \"%s\".", Filename.c_str()); } @@ -353,7 +353,7 @@ bool BS_PersistenceService::SaveGame(unsigned int SlotID, const Common::String & } // Screenshotdatei an die Datei anfügen. - if (BS_FileSystemUtil::GetInstance().FileExists(ScreenshotFilename)) { + if (FileSystemUtil::GetInstance().FileExists(ScreenshotFilename)) { Common::File ScreenshotFile; if (!ScreenshotFile.open(ScreenshotFilename.c_str())) error("Unable to load screenshot file"); @@ -378,7 +378,7 @@ bool BS_PersistenceService::SaveGame(unsigned int SlotID, const Common::String & // ----------------------------------------------------------------------------- -bool BS_PersistenceService::LoadGame(unsigned int SlotID) { +bool PersistenceService::LoadGame(unsigned int SlotID) { Common::SaveFileManager *sfm = g_system->getSavefileManager(); Common::InSaveFile *File; @@ -431,16 +431,16 @@ bool BS_PersistenceService::LoadGame(unsigned int SlotID) { return false; } - BS_InputPersistenceBlock Reader(&UncompressedDataBuffer[0], CurSavegameInfo.GamedataUncompressedLength); + InputPersistenceBlock Reader(&UncompressedDataBuffer[0], CurSavegameInfo.GamedataUncompressedLength); // Einzelne Engine-Module depersistieren. bool Success = true; - Success &= BS_Kernel::GetInstance()->GetScript()->Unpersist(Reader); + Success &= Kernel::GetInstance()->GetScript()->Unpersist(Reader); // Muss unbedingt nach Script passieren. Da sonst die bereits wiederhergestellten Regions per Garbage-Collection gekillt werden. Success &= RegionRegistry::GetInstance().Unpersist(Reader); - Success &= BS_Kernel::GetInstance()->GetGfx()->Unpersist(Reader); - Success &= BS_Kernel::GetInstance()->GetSfx()->Unpersist(Reader); - Success &= BS_Kernel::GetInstance()->GetInput()->Unpersist(Reader); + Success &= Kernel::GetInstance()->GetGfx()->Unpersist(Reader); + Success &= Kernel::GetInstance()->GetSfx()->Unpersist(Reader); + Success &= Kernel::GetInstance()->GetInput()->Unpersist(Reader); delete[] CompressedDataBuffer; delete[] UncompressedDataBuffer; diff --git a/engines/sword25/kernel/persistenceservice.h b/engines/sword25/kernel/persistenceservice.h index 15fb15c7ec..06d5422d46 100644 --- a/engines/sword25/kernel/persistenceservice.h +++ b/engines/sword25/kernel/persistenceservice.h @@ -47,16 +47,16 @@ namespace Sword25 { // Class declaration // ----------------------------------------------------------------------------- -class BS_PersistenceService { +class PersistenceService { public: - BS_PersistenceService(); - virtual ~BS_PersistenceService(); + PersistenceService(); + virtual ~PersistenceService(); // ----------------------------------------------------------------------------- // Singleton Method // ----------------------------------------------------------------------------- - static BS_PersistenceService &GetInstance(); + static PersistenceService &GetInstance(); // ----------------------------------------------------------------------------- // Interface diff --git a/engines/sword25/kernel/resmanager.cpp b/engines/sword25/kernel/resmanager.cpp index 1f9fb69230..b6c70cd0ad 100644 --- a/engines/sword25/kernel/resmanager.cpp +++ b/engines/sword25/kernel/resmanager.cpp @@ -43,12 +43,12 @@ namespace Sword25 { #define BS_LOG_PREFIX "RESOURCEMANAGER" -BS_ResourceManager::~BS_ResourceManager() { +ResourceManager::~ResourceManager() { // Clear all unlocked resources EmptyCache(); // All remaining resources are not released, so print warnings and release - Common::List<BS_Resource *>::iterator Iter = m_Resources.begin(); + Common::List<Resource *>::iterator Iter = m_Resources.begin(); for (; Iter != m_Resources.end(); ++Iter) { BS_LOG_WARNINGLN("Resource \"%s\" was not released.", (*Iter)->GetFileName().c_str()); @@ -67,7 +67,7 @@ BS_ResourceManager::~BS_ResourceManager() { * Note: This method is not optimised for speed and should be used only for debugging purposes * @param Ord Ordinal number of the resource. Must be between 0 and GetResourceCount() - 1. */ -BS_Resource *BS_ResourceManager::GetResourceByOrdinal(int Ord) const { +Resource *ResourceManager::GetResourceByOrdinal(int Ord) const { // Überprüfen ob der Index Ord innerhald der Listengrenzen liegt. if (Ord < 0 || Ord >= GetResourceCount()) { BS_LOG_ERRORLN("Resource ordinal (%d) out of bounds (0 - %d).", Ord, GetResourceCount() - 1); @@ -76,7 +76,7 @@ BS_Resource *BS_ResourceManager::GetResourceByOrdinal(int Ord) const { // Liste durchlaufen und die Resource mit dem gewünschten Index zurückgeben. int CurOrd = 0; - Common::List<BS_Resource *>::const_iterator Iter = m_Resources.begin(); + Common::List<Resource *>::const_iterator Iter = m_Resources.begin(); for (; Iter != m_Resources.end(); ++Iter, ++CurOrd) { if (CurOrd == Ord) return (*Iter); @@ -92,7 +92,7 @@ BS_Resource *BS_ResourceManager::GetResourceByOrdinal(int Ord) const { * BS_ResourceService, and thus helps all resource services in the ResourceManager list * @param pService Which service */ -bool BS_ResourceManager::RegisterResourceService(BS_ResourceService *pService) { +bool ResourceManager::RegisterResourceService(ResourceService *pService) { if (!pService) { BS_LOG_ERRORLN("Can't register NULL resource service."); return false; @@ -106,14 +106,14 @@ bool BS_ResourceManager::RegisterResourceService(BS_ResourceService *pService) { /** * Deletes resources as necessary until the specified memory limit is not being exceeded. */ -void BS_ResourceManager::DeleteResourcesIfNecessary() { +void ResourceManager::DeleteResourcesIfNecessary() { // If enough memory is available, or no resources are loaded, then the function can immediately end if (m_KernelPtr->GetUsedMemory() < m_MaxMemoryUsage || m_Resources.empty()) return; // Keep deleting resources until the memory usage of the process falls below the set maximum limit. // The list is processed backwards in order to first release those resources who have been // not been accessed for the longest - Common::List<BS_Resource *>::iterator Iter = m_Resources.end(); + Common::List<Resource *>::iterator Iter = m_Resources.end(); do { --Iter; @@ -125,9 +125,9 @@ void BS_ResourceManager::DeleteResourcesIfNecessary() { /** * Releases all resources that are not locked. **/ -void BS_ResourceManager::EmptyCache() { +void ResourceManager::EmptyCache() { // Scan through the resource list - Common::List<BS_Resource *>::iterator Iter = m_Resources.begin(); + Common::List<Resource *>::iterator Iter = m_Resources.begin(); while (Iter != m_Resources.end()) { if ((*Iter)->GetLockCount() == 0) { // Delete the resource @@ -141,7 +141,7 @@ void BS_ResourceManager::EmptyCache() { * Returns a requested resource. If any error occurs, returns NULL * @param FileName Filename of resource */ -BS_Resource *BS_ResourceManager::RequestResource(const Common::String &FileName) { +Resource *ResourceManager::RequestResource(const Common::String &FileName) { // Get the absolute path to the file Common::String UniqueFileName = GetUniqueFileName(FileName); if (UniqueFileName == "") @@ -150,7 +150,7 @@ BS_Resource *BS_ResourceManager::RequestResource(const Common::String &FileName) // Determine whether the resource is already loaded // If the resource is found, it will be placed at the head of the resource list and returned { - BS_Resource *pResource = GetResource(UniqueFileName); + Resource *pResource = GetResource(UniqueFileName); if (pResource) { MoveToFront(pResource); (pResource)->AddReference(); @@ -161,7 +161,7 @@ BS_Resource *BS_ResourceManager::RequestResource(const Common::String &FileName) // The resource was not found, therefore, must not be loaded yet if (m_LogCacheMiss) BS_LOG_WARNINGLN("\"%s\" was not precached.", UniqueFileName.c_str()); - BS_Resource *pResource; + Resource *pResource; if ((pResource = LoadResource(UniqueFileName))) { pResource->AddReference(); return pResource; @@ -176,13 +176,13 @@ BS_Resource *BS_ResourceManager::RequestResource(const Common::String &FileName) * @param ForceReload Indicates whether the file should be reloaded if it's already in the cache. * This is useful for files that may have changed in the interim */ -bool BS_ResourceManager::PrecacheResource(const Common::String &FileName, bool ForceReload) { +bool ResourceManager::PrecacheResource(const Common::String &FileName, bool ForceReload) { // Get the absolute path to the file Common::String UniqueFileName = GetUniqueFileName(FileName); if (UniqueFileName == "") return false; - BS_Resource *ResourcePtr = GetResource(UniqueFileName); + Resource *ResourcePtr = GetResource(UniqueFileName); if (ForceReload && ResourcePtr) { if (ResourcePtr->GetLockCount()) { @@ -206,7 +206,7 @@ bool BS_ResourceManager::PrecacheResource(const Common::String &FileName, bool F * Moves a resource to the top of the resource list * @param pResource The resource */ -void BS_ResourceManager::MoveToFront(BS_Resource *pResource) { +void ResourceManager::MoveToFront(Resource *pResource) { // Erase the resource from it's current position m_Resources.erase(pResource->_Iterator); // Re-add the resource at the front of the list @@ -221,7 +221,7 @@ void BS_ResourceManager::MoveToFront(BS_Resource *pResource) { * The resource must not already be loaded * @param FileName The unique filename of the resource to be loaded */ -BS_Resource *BS_ResourceManager::LoadResource(const Common::String &FileName) { +Resource *ResourceManager::LoadResource(const Common::String &FileName) { // ResourceService finden, der die Resource laden kann. for (unsigned int i = 0; i < m_ResourceServices.size(); ++i) { if (m_ResourceServices[i]->CanLoadResource(FileName)) { @@ -229,7 +229,7 @@ BS_Resource *BS_ResourceManager::LoadResource(const Common::String &FileName) { DeleteResourcesIfNecessary(); // Load the resource - BS_Resource *pResource; + Resource *pResource; if (!(pResource = m_ResourceServices[i]->LoadResource(FileName))) { BS_LOG_ERRORLN("Responsible service could not load resource \"%s\".", FileName.c_str()); return NULL; @@ -254,7 +254,7 @@ BS_Resource *BS_ResourceManager::LoadResource(const Common::String &FileName) { * Returns the full path of a given resource filename. * It will return an empty string if a path could not be created. */ -Common::String BS_ResourceManager::GetUniqueFileName(const Common::String &FileName) const { +Common::String ResourceManager::GetUniqueFileName(const Common::String &FileName) const { // Get a pointer to the package manager PackageManager *pPackage = (PackageManager *)m_KernelPtr->GetService("package"); if (!pPackage) { @@ -273,14 +273,14 @@ Common::String BS_ResourceManager::GetUniqueFileName(const Common::String &FileN /** * Deletes a resource, removes it from the lists, and updates m_UsedMemory */ -Common::List<BS_Resource *>::iterator BS_ResourceManager::DeleteResource(BS_Resource *pResource) { +Common::List<Resource *>::iterator ResourceManager::DeleteResource(Resource *pResource) { // Remove the resource from the hash table m_ResourceHashTable[pResource->GetFileNameHash() % HASH_TABLE_BUCKETS].remove(pResource); - BS_Resource *pDummy = pResource; + Resource *pDummy = pResource; // Delete the resource from the resource list - Common::List<BS_Resource *>::iterator Result = m_Resources.erase(pResource->_Iterator); + Common::List<Resource *>::iterator Result = m_Resources.erase(pResource->_Iterator); // Delete the resource delete(pDummy); @@ -294,12 +294,12 @@ Common::List<BS_Resource *>::iterator BS_ResourceManager::DeleteResource(BS_Reso * @param UniqueFileName The absolute path and filename * Gibt einen Pointer auf die angeforderte Resource zurück, oder NULL, wenn die Resourcen nicht geladen ist. */ -BS_Resource *BS_ResourceManager::GetResource(const Common::String &UniqueFileName) const { +Resource *ResourceManager::GetResource(const Common::String &UniqueFileName) const { // Determine whether the resource is already loaded - const Common::List<BS_Resource *>& HashBucket = m_ResourceHashTable[ + const Common::List<Resource *>& HashBucket = m_ResourceHashTable[ BS_String::GetHash(UniqueFileName) % HASH_TABLE_BUCKETS]; { - Common::List<BS_Resource *>::const_iterator Iter = HashBucket.begin(); + Common::List<Resource *>::const_iterator Iter = HashBucket.begin(); for (; Iter != HashBucket.end(); ++Iter) { // Wenn die Resource gefunden wurde wird sie zurückgegeben. if ((*Iter)->GetFileName() == UniqueFileName) @@ -314,8 +314,8 @@ BS_Resource *BS_ResourceManager::GetResource(const Common::String &UniqueFileNam /** * Writes the names of all currently locked resources to the log file */ -void BS_ResourceManager::DumpLockedResources() { - for (Common::List<BS_Resource *>::iterator Iter = m_Resources.begin(); Iter != m_Resources.end(); ++Iter) { +void ResourceManager::DumpLockedResources() { + for (Common::List<Resource *>::iterator Iter = m_Resources.begin(); Iter != m_Resources.end(); ++Iter) { if ((*Iter)->GetLockCount() > 0) { BS_LOGLN("%s", (*Iter)->GetFileName().c_str()); } @@ -328,7 +328,7 @@ void BS_ResourceManager::DumpLockedResources() { * as a guideline, and not as a fixed boundary. It is not guaranteed not to be exceeded; * the whole game engine may still use more memory than any amount specified. */ -void BS_ResourceManager::SetMaxMemoryUsage(unsigned int MaxMemoryUsage) { +void ResourceManager::SetMaxMemoryUsage(unsigned int MaxMemoryUsage) { m_MaxMemoryUsage = MaxMemoryUsage; DeleteResourcesIfNecessary(); } diff --git a/engines/sword25/kernel/resmanager.h b/engines/sword25/kernel/resmanager.h index e642e54055..47c920ce6b 100644 --- a/engines/sword25/kernel/resmanager.h +++ b/engines/sword25/kernel/resmanager.h @@ -43,19 +43,19 @@ namespace Sword25 { // Class definitions -class BS_ResourceService; -class BS_Resource; -class BS_Kernel; +class ResourceService; +class Resource; +class Kernel; -class BS_ResourceManager { - friend class BS_Kernel; +class ResourceManager { + friend class Kernel; public: /** * Returns a requested resource. If any error occurs, returns NULL * @param FileName Filename of resource */ - BS_Resource *RequestResource(const Common::String &FileName); + Resource *RequestResource(const Common::String &FileName); /** * Loads a resource into the cache @@ -77,14 +77,14 @@ public: * Note: This method is not optimised for speed and should be used only for debugging purposes * @param Ord Ordinal number of the resource. Must be between 0 and GetResourceCount() - 1. */ - BS_Resource *GetResourceByOrdinal(int Ord) const; + Resource *GetResourceByOrdinal(int Ord) const; /** * Registers a RegisterResourceService. This method is the constructor of * BS_ResourceService, and thus helps all resource services in the ResourceManager list * @param pService Which service */ - bool RegisterResourceService(BS_ResourceService *pService); + bool RegisterResourceService(ResourceService *pService); /** * Releases all resources that are not locked. @@ -132,12 +132,12 @@ private: * Creates a new resource manager * Only the BS_Kernel class can generate copies this class. Thus, the constructor is private */ - BS_ResourceManager(BS_Kernel *pKernel) : + ResourceManager(Kernel *pKernel) : m_KernelPtr(pKernel), m_MaxMemoryUsage(100000000), m_LogCacheMiss(false) {}; - virtual ~BS_ResourceManager(); + virtual ~ResourceManager(); enum { HASH_TABLE_BUCKETS = 256 @@ -147,7 +147,7 @@ private: * Moves a resource to the top of the resource list * @param pResource The resource */ - void MoveToFront(BS_Resource *pResource); + void MoveToFront(Resource *pResource); /** * Loads a resource and updates the m_UsedMemory total @@ -155,7 +155,7 @@ private: * The resource must not already be loaded * @param FileName The unique filename of the resource to be loaded */ - BS_Resource *LoadResource(const Common::String &FileName); + Resource *LoadResource(const Common::String &FileName); /** * Returns the full path of a given resource filename. @@ -166,25 +166,25 @@ private: /** * Deletes a resource, removes it from the lists, and updates m_UsedMemory */ - Common::List<BS_Resource *>::iterator DeleteResource(BS_Resource *pResource); + Common::List<Resource *>::iterator DeleteResource(Resource *pResource); /** * Returns a pointer to a loaded resource. If any error occurs, NULL will be returned. * @param UniqueFileName The absolute path and filename * Gibt einen Pointer auf die angeforderte Resource zurück, oder NULL, wenn die Resourcen nicht geladen ist. */ - BS_Resource *GetResource(const Common::String &UniqueFileName) const; + Resource *GetResource(const Common::String &UniqueFileName) const; /** * Deletes resources as necessary until the specified memory limit is not being exceeded. */ void DeleteResourcesIfNecessary(); - BS_Kernel *m_KernelPtr; + Kernel *m_KernelPtr; unsigned int m_MaxMemoryUsage; - Common::Array<BS_ResourceService *> m_ResourceServices; - Common::List<BS_Resource *> m_Resources; - Common::List<BS_Resource *> m_ResourceHashTable[HASH_TABLE_BUCKETS]; + Common::Array<ResourceService *> m_ResourceServices; + Common::List<Resource *> m_Resources; + Common::List<Resource *> m_ResourceHashTable[HASH_TABLE_BUCKETS]; bool m_LogCacheMiss; }; diff --git a/engines/sword25/kernel/resource.cpp b/engines/sword25/kernel/resource.cpp index 2223d1b965..9456270034 100644 --- a/engines/sword25/kernel/resource.cpp +++ b/engines/sword25/kernel/resource.cpp @@ -41,16 +41,16 @@ namespace Sword25 { #define BS_LOG_PREFIX "RESOURCE" -BS_Resource::BS_Resource(const Common::String &FileName, RESOURCE_TYPES Type) : +Resource::Resource(const Common::String &FileName, RESOURCE_TYPES Type) : _Type(Type), _RefCount(0) { - BS_ASSERT(BS_Kernel::GetInstance()->GetService("package")); + BS_ASSERT(Kernel::GetInstance()->GetService("package")); - _FileName = static_cast<PackageManager *>(BS_Kernel::GetInstance()->GetService("package"))->GetAbsolutePath(FileName); + _FileName = static_cast<PackageManager *>(Kernel::GetInstance()->GetService("package"))->GetAbsolutePath(FileName); _FileNameHash = BS_String::GetHash(FileName); } -void BS_Resource::Release() { +void Resource::Release() { if (_RefCount) { --_RefCount; } else diff --git a/engines/sword25/kernel/resource.h b/engines/sword25/kernel/resource.h index 4653eab149..7d696ec198 100644 --- a/engines/sword25/kernel/resource.h +++ b/engines/sword25/kernel/resource.h @@ -41,11 +41,11 @@ namespace Sword25 { -class BS_Kernel; -class BS_ResourceManager; +class Kernel; +class ResourceManager; -class BS_Resource { - friend class BS_ResourceManager; +class Resource { + friend class ResourceManager; public: enum RESOURCE_TYPES { @@ -56,7 +56,7 @@ public: TYPE_FONT }; - BS_Resource(const Common::String &UniqueFileName, RESOURCE_TYPES Type); + Resource(const Common::String &UniqueFileName, RESOURCE_TYPES Type); /** * Prevents the resource from being released. @@ -103,14 +103,14 @@ public: } protected: - virtual ~BS_Resource() {}; + virtual ~Resource() {}; private: Common::String _FileName; ///< The absolute filename unsigned int _FileNameHash; ///< The hash value of the filename unsigned int _RefCount; ///< The number of locks unsigned int _Type; ///< The type of the resource - Common::List<BS_Resource *>::iterator _Iterator; ///< Points to the resource position in the LRU list + Common::List<Resource *>::iterator _Iterator; ///< Points to the resource position in the LRU list }; } // End of namespace Sword25 diff --git a/engines/sword25/kernel/resservice.h b/engines/sword25/kernel/resservice.h index 2197d283bf..2fbadda054 100644 --- a/engines/sword25/kernel/resservice.h +++ b/engines/sword25/kernel/resservice.h @@ -43,23 +43,23 @@ namespace Sword25 { -class BS_Resource; +class Resource; -class BS_ResourceService : public BS_Service { +class ResourceService : public Service { public: - BS_ResourceService(BS_Kernel *pKernel) : BS_Service(pKernel) { - BS_ResourceManager *pResource = pKernel->GetResourceManager(); + ResourceService(Kernel *pKernel) : Service(pKernel) { + ResourceManager *pResource = pKernel->GetResourceManager(); pResource->RegisterResourceService(this); } - virtual ~BS_ResourceService() {} + virtual ~ResourceService() {} /** * Loads a resource * @return Returns the resource if successful, otherwise NULL */ - virtual BS_Resource *LoadResource(const Common::String &FileName) = 0; + virtual Resource *LoadResource(const Common::String &FileName) = 0; /** * Checks whether the given name can be loaded by the resource service diff --git a/engines/sword25/kernel/scummvmwindow.cpp b/engines/sword25/kernel/scummvmwindow.cpp index 2b4e820160..e4102945b2 100644 --- a/engines/sword25/kernel/scummvmwindow.cpp +++ b/engines/sword25/kernel/scummvmwindow.cpp @@ -43,11 +43,11 @@ namespace Sword25 { -bool BS_ScummVMWindow::_ClassRegistered = false; +bool ScummVMWindow::_ClassRegistered = false; // Constructor / Destructor // ------------------------ -BS_ScummVMWindow::BS_ScummVMWindow(int X, int Y, int Width, int Height, bool Visible) { +ScummVMWindow::ScummVMWindow(int X, int Y, int Width, int Height, bool Visible) { // Presume that init will fail _InitSuccess = false; @@ -70,53 +70,53 @@ BS_ScummVMWindow::BS_ScummVMWindow(int X, int Y, int Width, int Height, bool Vis _CloseWanted = false; } -BS_ScummVMWindow::~BS_ScummVMWindow() { +ScummVMWindow::~ScummVMWindow() { } // Get Methods // ------------ -int BS_ScummVMWindow::GetX() { +int ScummVMWindow::GetX() { return 0; } -int BS_ScummVMWindow::GetY() { +int ScummVMWindow::GetY() { return 0; } -int BS_ScummVMWindow::GetClientX() { +int ScummVMWindow::GetClientX() { return 0; } -int BS_ScummVMWindow::GetClientY() { +int ScummVMWindow::GetClientY() { return 0; } -int BS_ScummVMWindow::GetWidth() { +int ScummVMWindow::GetWidth() { return g_system->getWidth(); } -int BS_ScummVMWindow::GetHeight() { +int ScummVMWindow::GetHeight() { return g_system->getHeight(); } -Common::String BS_ScummVMWindow::GetTitle() { +Common::String ScummVMWindow::GetTitle() { return Common::String(""); } -bool BS_ScummVMWindow::IsVisible() { +bool ScummVMWindow::IsVisible() { return true; } -bool BS_ScummVMWindow::HasFocus() { +bool ScummVMWindow::HasFocus() { // FIXME: Is there a way to tell if ScummVM has the focus in Windowed mode? return true; } -uint BS_ScummVMWindow::GetWindowHandle() { +uint ScummVMWindow::GetWindowHandle() { return 0; } -void BS_ScummVMWindow::SetWindowAlive(bool v) { +void ScummVMWindow::SetWindowAlive(bool v) { _WindowAlive = v; } @@ -124,36 +124,36 @@ void BS_ScummVMWindow::SetWindowAlive(bool v) { // Set Methods // ------------ -void BS_ScummVMWindow::SetX(int X) { +void ScummVMWindow::SetX(int X) { // No implementation } -void BS_ScummVMWindow::SetY(int Y) { +void ScummVMWindow::SetY(int Y) { // No implementation } -void BS_ScummVMWindow::SetWidth(int Width) { +void ScummVMWindow::SetWidth(int Width) { // No implementation } -void BS_ScummVMWindow::SetHeight(int Height) { +void ScummVMWindow::SetHeight(int Height) { // No implementation } -void BS_ScummVMWindow::SetVisible(bool Visible) { +void ScummVMWindow::SetVisible(bool Visible) { // No implementation } -void BS_ScummVMWindow::SetTitle(const Common::String &Title) { +void ScummVMWindow::SetTitle(const Common::String &Title) { // No implementation } -bool BS_ScummVMWindow::ProcessMessages() { +bool ScummVMWindow::ProcessMessages() { // No implementation return false; } -bool BS_ScummVMWindow::WaitForFocus() { +bool ScummVMWindow::WaitForFocus() { // No implementation return true; } diff --git a/engines/sword25/kernel/scummvmwindow.h b/engines/sword25/kernel/scummvmwindow.h index 57d9a7e2f9..2b5f514b7d 100644 --- a/engines/sword25/kernel/scummvmwindow.h +++ b/engines/sword25/kernel/scummvmwindow.h @@ -48,10 +48,10 @@ namespace Sword25 { // Class definition -class BS_ScummVMWindow : public BS_Window { +class ScummVMWindow : public Window { public: - BS_ScummVMWindow(int X, int Y, int Width, int Height, bool Visible); - virtual ~BS_ScummVMWindow(); + ScummVMWindow(int X, int Y, int Width, int Height, bool Visible); + virtual ~ScummVMWindow(); bool IsVisible(); void SetVisible(bool Visible); diff --git a/engines/sword25/kernel/service.h b/engines/sword25/kernel/service.h index 0afcb05f11..addcf50a08 100644 --- a/engines/sword25/kernel/service.h +++ b/engines/sword25/kernel/service.h @@ -53,21 +53,21 @@ namespace Sword25 { // Klassendefinition -class BS_Kernel; +class Kernel; -class BS_Service { +class Service { private: - BS_Kernel *_pKernel; + Kernel *_pKernel; protected: - BS_Service(BS_Kernel *pKernel) : _pKernel(pKernel) {}; + Service(Kernel *pKernel) : _pKernel(pKernel) {}; - BS_Kernel *GetKernel() const { + Kernel *GetKernel() const { return _pKernel; } public: - virtual ~BS_Service() {}; + virtual ~Service() {}; }; } // End of namespace Sword25 diff --git a/engines/sword25/kernel/service_ids.h b/engines/sword25/kernel/service_ids.h index 1135317cb2..ee8221b69a 100644 --- a/engines/sword25/kernel/service_ids.h +++ b/engines/sword25/kernel/service_ids.h @@ -49,13 +49,13 @@ namespace Sword25 { -BS_Service *OpenGLGfx_CreateObject(BS_Kernel *pKernel); -BS_Service *ScummVMPackageManager_CreateObject(BS_Kernel *pKernel); -BS_Service *ScummVMInput_CreateObject(BS_Kernel *pKernel); -BS_Service *FMODExSound_CreateObject(BS_Kernel *pKernel); -BS_Service *LuaScriptEngine_CreateObject(BS_Kernel *pKernel); -BS_Service *Geometry_CreateObject(BS_Kernel *pKernel); -BS_Service *OggTheora_CreateObject(BS_Kernel *pKernel); +Service *OpenGLGfx_CreateObject(Kernel *pKernel); +Service *ScummVMPackageManager_CreateObject(Kernel *pKernel); +Service *ScummVMInput_CreateObject(Kernel *pKernel); +Service *FMODExSound_CreateObject(Kernel *pKernel); +Service *LuaScriptEngine_CreateObject(Kernel *pKernel); +Service *Geometry_CreateObject(Kernel *pKernel); +Service *OggTheora_CreateObject(Kernel *pKernel); // Services are recorded in this table const BS_ServiceInfo BS_SERVICE_TABLE[] = { diff --git a/engines/sword25/kernel/window.cpp b/engines/sword25/kernel/window.cpp index b4936e8afc..8d2dc309e7 100644 --- a/engines/sword25/kernel/window.cpp +++ b/engines/sword25/kernel/window.cpp @@ -40,9 +40,9 @@ namespace Sword25 { // Erstellt ein Fenster des GUI des aktuellen Betriebssystems -BS_Window *BS_Window::CreateBSWindow(int X, int Y, int Width, int Height, bool Visible) { +Window *Window::CreateBSWindow(int X, int Y, int Width, int Height, bool Visible) { // Fenster erstellen - BS_Window *pWindow = (BS_Window *) new BS_ScummVMWindow(X, Y, Width, Height, Visible); + Window *pWindow = (Window *) new ScummVMWindow(X, Y, Width, Height, Visible); // Falls das Fenster erfolgreich initialisiert wurde, wird ein Pointer auf das Fensterobjekt // zurückgegeben @@ -56,13 +56,13 @@ BS_Window *BS_Window::CreateBSWindow(int X, int Y, int Width, int Height, bool V // Gibt True zurück wenn das Fenster WM_CLOSE empfangen hat - // solange, bis RejectClose() aufgerufen wurde. -bool BS_Window::CloseWanted() { +bool Window::CloseWanted() { bool result = _CloseWanted; _CloseWanted = false; return result; } -void BS_Window::SetCloseWanted(bool Wanted) { +void Window::SetCloseWanted(bool Wanted) { _CloseWanted = Wanted; } diff --git a/engines/sword25/kernel/window.h b/engines/sword25/kernel/window.h index ae8709f157..aee23087cb 100644 --- a/engines/sword25/kernel/window.h +++ b/engines/sword25/kernel/window.h @@ -57,13 +57,13 @@ namespace Sword25 { * Windows are exclusively created by BS_Window::CreateBSWindow(). * BS_Windows selects the correct class for the environment. */ -class BS_Window { +class Window { protected: bool _InitSuccess; bool _CloseWanted; public: - virtual ~BS_Window() {}; + virtual ~Window() {}; /** * Returns the visibility of the window. @@ -169,7 +169,7 @@ public: * @param Height The height of the window without the frame * @param Visible Specifies whether window should be visible */ - static BS_Window *CreateBSWindow(int X, int Y, int Width, int Height, bool Visible); + static Window *CreateBSWindow(int X, int Y, int Width, int Height, bool Visible); }; } // End of namespace Sword25 |