aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-06-12 16:15:53 +0200
committerEinar Johan Trøan Sømåen2012-06-12 16:15:53 +0200
commitfcb36b6b9083a52f68989da12b1adb377a782469 (patch)
tree7ff9674b8ff8091fa868da32e22dc35cbdd21a59 /engines
parentc2a2a816f1f3ca39867a150fb224376b784b5ce0 (diff)
downloadscummvm-rg350-fcb36b6b9083a52f68989da12b1adb377a782469.tar.gz
scummvm-rg350-fcb36b6b9083a52f68989da12b1adb377a782469.tar.bz2
scummvm-rg350-fcb36b6b9083a52f68989da12b1adb377a782469.zip
WINTERMUTE: Clear out the debug-printing, so that it's actually readable.
Diffstat (limited to 'engines')
-rw-r--r--engines/wintermute/Ad/AdEntity.cpp4
-rw-r--r--engines/wintermute/Base/BFontTT.cpp17
-rw-r--r--engines/wintermute/Base/BSurfaceSDL.cpp1
-rw-r--r--engines/wintermute/utils/StringUtil.cpp15
4 files changed, 28 insertions, 9 deletions
diff --git a/engines/wintermute/Ad/AdEntity.cpp b/engines/wintermute/Ad/AdEntity.cpp
index 91b9123697..71f466fde1 100644
--- a/engines/wintermute/Ad/AdEntity.cpp
+++ b/engines/wintermute/Ad/AdEntity.cpp
@@ -585,8 +585,8 @@ HRESULT CAdEntity::Update() {
}
}
break;
- default:
- warning("AdEntity::Update - Unhandled enum");
+ default: // Silence unhandled enum-warning
+ break;
}
diff --git a/engines/wintermute/Base/BFontTT.cpp b/engines/wintermute/Base/BFontTT.cpp
index 9b05790876..6c61d6bc0d 100644
--- a/engines/wintermute/Base/BFontTT.cpp
+++ b/engines/wintermute/Base/BFontTT.cpp
@@ -160,7 +160,6 @@ int CBFontTT::GetTextHeight(byte *Text, int Width) {
//////////////////////////////////////////////////////////////////////////
void CBFontTT::DrawText(byte *Text, int X, int Y, int Width, TTextAlign Align, int MaxHeight, int MaxLength) {
- warning("Draw text: %s", Text);
if (Text == NULL || strcmp((char *)Text, "") == 0) return;
WideString text = (char*)Text;
@@ -203,6 +202,7 @@ void CBFontTT::DrawText(byte *Text, int X, int Y, int Width, TTextAlign Align,
// not found, create one
if (!Surface) {
+ warning("Draw text: %s", Text);
Surface = RenderTextToTexture(text, Width, Align, MaxHeight, textOffset);
if (Surface) {
// write surface to cache
@@ -258,8 +258,12 @@ CBSurface *CBFontTT::RenderTextToTexture(const WideString &text, int width, TTex
} else if (align == TAL_RIGHT) {
alignment = Graphics::kTextAlignRight;
}
-
- warning("CBFontTT::RenderTextToTexture - Not fully ported 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("CBFontTT::RenderTextToTexture - Not fully ported yet");
+ }
warning("%s %d %d %d %d", text.c_str(), D3DCOLGetR(_layers[0]->_color), D3DCOLGetG(_layers[0]->_color),D3DCOLGetB(_layers[0]->_color),D3DCOLGetA(_layers[0]->_color));
// void drawString(Surface *dst, const Common::String &str, int x, int y, int w, uint32 color, TextAlign align = kTextAlignLeft, int deltax = 0, bool useEllipsis = true) const;
Graphics::Surface *surface = new Graphics::Surface();
@@ -833,7 +837,12 @@ void CBFontTT::WrapText(const WideString &text, int maxWidth, int maxHeight, Tex
//////////////////////////////////////////////////////////////////////////
void CBFontTT::MeasureText(const WideString &text, int maxWidth, int maxHeight, int &textWidth, int &textHeight) {
//TextLineList lines;
- warning("Todo: Test Mesuretext");
+ // 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("Todo: Test Mesuretext");
+ }
if (maxWidth >= 0) {
Common::Array<Common::String> lines;
_font->wordWrapText(text, maxWidth, lines);
diff --git a/engines/wintermute/Base/BSurfaceSDL.cpp b/engines/wintermute/Base/BSurfaceSDL.cpp
index 4e4253b1a2..200a34166a 100644
--- a/engines/wintermute/Base/BSurfaceSDL.cpp
+++ b/engines/wintermute/Base/BSurfaceSDL.cpp
@@ -76,7 +76,6 @@ HRESULT CBSurfaceSDL::create(const char *filename, bool default_ck, byte ck_red,
if (strFileName.hasSuffix(".png")) {
imgDecoder = new Graphics::PNGDecoder();
} else if (strFileName.hasSuffix(".bmp")) {
- warning("Loaded BMP WITH FILENAME!!!! %s", filename);
imgDecoder = new Graphics::BitmapDecoder();
} else if (strFileName.hasSuffix(".tga")) {
imgDecoder = new WinterMute::TGA();
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];