From fcb36b6b9083a52f68989da12b1adb377a782469 Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Tue, 12 Jun 2012 16:15:53 +0200 Subject: WINTERMUTE: Clear out the debug-printing, so that it's actually readable. --- engines/wintermute/utils/StringUtil.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'engines/wintermute/utils') diff --git a/engines/wintermute/utils/StringUtil.cpp b/engines/wintermute/utils/StringUtil.cpp index 8ca2ed8c07..050f76b3b6 100644 --- a/engines/wintermute/utils/StringUtil.cpp +++ b/engines/wintermute/utils/StringUtil.cpp @@ -178,8 +178,14 @@ Utf8String StringUtil::WideToUtf8(const WideString &WideStr) { ////////////////////////////////////////////////////////////////////////// WideString StringUtil::AnsiToWide(const AnsiString &str) { + // TODO: This function gets called a lot, so warnings like these drown out the usefull information + static bool hasWarned = false; + if (!hasWarned) { + hasWarned = true; + warning("StringUtil::AnsiToWide - WideString not supported yet"); + } // using default os locale! - warning("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 +199,12 @@ WideString StringUtil::AnsiToWide(const AnsiString &str) { ////////////////////////////////////////////////////////////////////////// AnsiString StringUtil::WideToAnsi(const WideString &wstr) { // using default os locale! - warning("StringUtil::WideToAnsi - WideString not supported yet"); + // TODO: This function gets called a lot, so warnings like these drown out the usefull information + static bool hasWarned = false; + if (!hasWarned) { + hasWarned = true; + warning("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