From 21033f631f5895bb88779c1dd77b6d17466c6840 Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Wed, 9 May 2012 15:50:10 +0200 Subject: WINTERMUTE: Cleanup the debug-warnings a bit. --- engines/wintermute/BDiskFile.cpp | 7 ------- engines/wintermute/BFileManager.cpp | 4 ---- engines/wintermute/BRenderSDL.cpp | 8 +++++++- engines/wintermute/BSurfaceSDL.cpp | 17 ++++++++++++++--- engines/wintermute/StringUtil.cpp | 8 ++++---- 5 files changed, 25 insertions(+), 19 deletions(-) diff --git a/engines/wintermute/BDiskFile.cpp b/engines/wintermute/BDiskFile.cpp index 6e66bb721e..591da4b9db 100644 --- a/engines/wintermute/BDiskFile.cpp +++ b/engines/wintermute/BDiskFile.cpp @@ -56,13 +56,11 @@ CBDiskFile::~CBDiskFile() { HRESULT CBDiskFile::Open(Common::String Filename) { Close(); - warning("CBDiskFile::Open(%s)", Filename.c_str()); char FullPath[MAX_PATH]; for (int i = 0; i < Game->_fileManager->_singlePaths.GetSize(); i++) { sprintf(FullPath, "%s%s", Game->_fileManager->_singlePaths[i], Filename.c_str()); CorrectSlashes(FullPath); - warning("CBDiskFile::Open - Attempting: %s", FullPath); //_file = Common::createFileStream(FullPath); Common::File *tempFile = new Common::File(); if(tempFile->open(FullPath)) { @@ -80,7 +78,6 @@ HRESULT CBDiskFile::Open(Common::String Filename) { if (!_file) { strcpy(FullPath, Filename.c_str()); CorrectSlashes(FullPath); - warning("CBDiskFile::Open - Attempting2: %s", FullPath); //error("Tried to open %s, TODO: add SearchMan-support", Filename.c_str()); //_file = Common::createFileStream(FullPath); Common::File *tempFile = new Common::File(); @@ -90,10 +87,6 @@ HRESULT CBDiskFile::Open(Common::String Filename) { delete tempFile; } } - - if (!_file) { - warning("Couldn't load %s", Filename.c_str()); - } if (_file) { uint32 magic1, magic2; diff --git a/engines/wintermute/BFileManager.cpp b/engines/wintermute/BFileManager.cpp index 68a4db4910..0cc96323cc 100644 --- a/engines/wintermute/BFileManager.cpp +++ b/engines/wintermute/BFileManager.cpp @@ -678,7 +678,6 @@ bool CBFileManager::IsValidPackage(const AnsiString &fileName) const { ////////////////////////////////////////////////////////////////////////// Common::File *CBFileManager::OpenPackage(char *Name) { //TODO: Is it really necessary to do this when we have the ScummVM-system? - warning("OpenPackage(%s)", Name); //RestoreCurrentDir(); @@ -822,17 +821,14 @@ CBFile *CBFileManager::OpenFileRaw(const char *Filename) { } } warning("BFileManager::OpenFileRaw(%s)", Filename); - warning("Trying DiskFile"); CBDiskFile *DiskFile = new CBDiskFile(Game); if (SUCCEEDED(DiskFile->Open(Filename))) return DiskFile; delete DiskFile; - warning("Trying PkgFile"); CBPkgFile *PkgFile = new CBPkgFile(Game); if (SUCCEEDED(PkgFile->Open(Filename))) return PkgFile; delete PkgFile; - warning("Trying ResourceFile"); CBResourceFile *ResFile = new CBResourceFile(Game); if (SUCCEEDED(ResFile->Open(Filename))) return ResFile; diff --git a/engines/wintermute/BRenderSDL.cpp b/engines/wintermute/BRenderSDL.cpp index 78c68c0cea..9e9d7ef6d5 100644 --- a/engines/wintermute/BRenderSDL.cpp +++ b/engines/wintermute/BRenderSDL.cpp @@ -235,7 +235,13 @@ HRESULT CBRenderSDL::Fade(WORD Alpha) { ////////////////////////////////////////////////////////////////////////// HRESULT CBRenderSDL::FadeToColor(uint32 Color, RECT *rect) { - warning("Implement CBRenderSDL::FadeToColor"); + // This particular warning is rather messy, as this function is called a ton, + // thus we avoid printing it more than once. + static bool hasWarned = false; + if (!hasWarned) { + warning("Implement CBRenderSDL::FadeToColor"); // TODO. + hasWarned = true; + } #if 0 SDL_Rect fillRect; diff --git a/engines/wintermute/BSurfaceSDL.cpp b/engines/wintermute/BSurfaceSDL.cpp index b8d256aad1..4f36a13dd5 100644 --- a/engines/wintermute/BSurfaceSDL.cpp +++ b/engines/wintermute/BSurfaceSDL.cpp @@ -301,7 +301,13 @@ bool CBSurfaceSDL::IsTransparentAtLite(int X, int Y) { Uint32 format; int access; int width, height; - warning("CBSurfaceSDL::IsTransparentAtLite not ported yet"); + // This particular warning is rather messy, as this function is called a ton, + // thus we avoid printing it more than once. + static bool hasWarned = false; + if (!hasWarned) { + warning("CBSurfaceSDL::IsTransparentAtLite not ported yet"); + hasWarned = true; + } //SDL_QueryTexture(_texture, &format, &access, &width, &height); //if (access != SDL_TEXTUREACCESS_STREAMING) return false; if (X < 0 || X >= width || Y < 0 || Y >= height) return true; @@ -378,8 +384,13 @@ HRESULT CBSurfaceSDL::DrawSprite(int X, int Y, RECT *Rect, float ZoomX, float Zo byte g = D3DCOLGetG(Alpha); byte b = D3DCOLGetB(Alpha); byte a = D3DCOLGetA(Alpha); - - warning("CBSurfaceSDL::DrawSprite not ported yet"); // TODO. + // This particular warning is rather messy, as this function is called a ton, + // thus we avoid printing it more than once. + static bool hasWarned = false; + if (!hasWarned) { + warning("CBSurfaceSDL::DrawSprite not ported yet"); // TODO. + hasWarned = true; + } #if 0 SDL_SetTextureColorMod(_texture, r, g, b); SDL_SetTextureAlphaMod(_texture, a); diff --git a/engines/wintermute/StringUtil.cpp b/engines/wintermute/StringUtil.cpp index 3fcc156ffc..746250ceeb 100644 --- a/engines/wintermute/StringUtil.cpp +++ b/engines/wintermute/StringUtil.cpp @@ -80,7 +80,7 @@ bool StringUtil::CompareNoCase(const AnsiString &str1, const AnsiString &str2) { ////////////////////////////////////////////////////////////////////////// WideString StringUtil::Utf8ToWide(const Utf8String &Utf8Str) { - error("WideString not supported yet"); + error("StringUtil::Utf8ToWide - WideString not supported yet"); /* size_t WideSize = Utf8Str.size(); if (sizeof(wchar_t) == 2) { @@ -129,7 +129,7 @@ WideString StringUtil::Utf8ToWide(const Utf8String &Utf8Str) { ////////////////////////////////////////////////////////////////////////// Utf8String StringUtil::WideToUtf8(const WideString &WideStr) { - error("Widestring not supported yet"); + error("StringUtil::WideToUtf8 - Widestring not supported yet"); /* size_t WideSize = WideStr.length(); if (sizeof(wchar_t) == 2) { @@ -179,7 +179,7 @@ Utf8String StringUtil::WideToUtf8(const WideString &WideStr) { ////////////////////////////////////////////////////////////////////////// WideString StringUtil::AnsiToWide(const AnsiString &str) { // using default os locale! - error("WideString not supported yet"); + error("StringUtil::AnsiToWide - WideString not supported yet"); /* setlocale(LC_CTYPE, ""); size_t WideSize = mbstowcs(NULL, str.c_str(), 0) + 1; wchar_t *wstr = new wchar_t[WideSize]; @@ -193,7 +193,7 @@ WideString StringUtil::AnsiToWide(const AnsiString &str) { ////////////////////////////////////////////////////////////////////////// AnsiString StringUtil::WideToAnsi(const WideString &wstr) { // using default os locale! - error("WideString not supported yet"); + error("StringUtil::WideToAnsi - WideString not supported yet"); /* setlocale(LC_CTYPE, ""); size_t WideSize = wcstombs(NULL, wstr.c_str(), 0) + 1; char *str = new char[WideSize]; -- cgit v1.2.3