diff options
author | Willem Jan Palenstijn | 2013-04-15 20:44:41 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2013-04-15 20:44:41 +0200 |
commit | 250967a63f8583f577601e8eacadb3ec6111514e (patch) | |
tree | c04a70a178ed5901c94bdbb20ae43847437d8b63 /engines/wintermute/base | |
parent | d4982381d2e0c9e4cc6e774f0303a230ccda5ea2 (diff) | |
download | scummvm-rg350-250967a63f8583f577601e8eacadb3ec6111514e.tar.gz scummvm-rg350-250967a63f8583f577601e8eacadb3ec6111514e.tar.bz2 scummvm-rg350-250967a63f8583f577601e8eacadb3ec6111514e.zip |
WINTERMUTE: Fix warnings and improve const-correctness
Diffstat (limited to 'engines/wintermute/base')
-rw-r--r-- | engines/wintermute/base/base_game.cpp | 4 | ||||
-rw-r--r-- | engines/wintermute/base/font/base_font.cpp | 4 | ||||
-rw-r--r-- | engines/wintermute/base/font/base_font.h | 4 | ||||
-rw-r--r-- | engines/wintermute/base/font/base_font_bitmap.cpp | 8 | ||||
-rw-r--r-- | engines/wintermute/base/font/base_font_bitmap.h | 4 | ||||
-rw-r--r-- | engines/wintermute/base/font/base_font_truetype.cpp | 12 | ||||
-rw-r--r-- | engines/wintermute/base/font/base_font_truetype.h | 4 |
7 files changed, 20 insertions, 20 deletions
diff --git a/engines/wintermute/base/base_game.cpp b/engines/wintermute/base/base_game.cpp index 0248c349e7..94ea36cd06 100644 --- a/engines/wintermute/base/base_game.cpp +++ b/engines/wintermute/base/base_game.cpp @@ -2564,8 +2564,8 @@ bool BaseGame::displayQuickMsg() { // display for (uint32 i = 0; i < _quickMessages.size(); i++) { - _systemFont->drawText((byte *)_quickMessages[i]->getText(), 0, posY, _renderer->_width); - posY += _systemFont->getTextHeight((byte *)_quickMessages[i]->getText(), _renderer->_width); + _systemFont->drawText((const byte *)_quickMessages[i]->getText(), 0, posY, _renderer->_width); + posY += _systemFont->getTextHeight((const byte *)_quickMessages[i]->getText(), _renderer->_width); } return STATUS_OK; } diff --git a/engines/wintermute/base/font/base_font.cpp b/engines/wintermute/base/font/base_font.cpp index e3c8827254..596f9fb5c6 100644 --- a/engines/wintermute/base/font/base_font.cpp +++ b/engines/wintermute/base/font/base_font.cpp @@ -57,13 +57,13 @@ void BaseFont::drawText(const byte *text, int x, int y, int width, TTextAlign al ////////////////////////////////////////////////////////////////////// -int BaseFont::getTextHeight(byte *text, int width) { +int BaseFont::getTextHeight(const byte *text, int width) { return 0; } ////////////////////////////////////////////////////////////////////// -int BaseFont::getTextWidth(byte *text, int maxLength) { +int BaseFont::getTextWidth(const byte *text, int maxLength) { return 0; } diff --git a/engines/wintermute/base/font/base_font.h b/engines/wintermute/base/font/base_font.h index 0abe62ab98..50587fa7eb 100644 --- a/engines/wintermute/base/font/base_font.h +++ b/engines/wintermute/base/font/base_font.h @@ -38,8 +38,8 @@ namespace Wintermute { class BaseFont: public BaseObject { public: DECLARE_PERSISTENT(BaseFont, BaseObject) - virtual int getTextWidth(byte *text, int maxLength = -1); - virtual int getTextHeight(byte *text, int width); + virtual int getTextWidth(const byte *text, int maxLength = -1); + virtual int getTextHeight(const byte *text, int width); virtual void drawText(const byte *text, int x, int y, int width, TTextAlign align = TAL_LEFT, int max_height = -1, int maxLength = -1); virtual int getLetterHeight(); diff --git a/engines/wintermute/base/font/base_font_bitmap.cpp b/engines/wintermute/base/font/base_font_bitmap.cpp index af66cbb89f..5139620727 100644 --- a/engines/wintermute/base/font/base_font_bitmap.cpp +++ b/engines/wintermute/base/font/base_font_bitmap.cpp @@ -76,20 +76,20 @@ void BaseFontBitmap::drawText(const byte *text, int x, int y, int width, TTextAl ////////////////////////////////////////////////////////////////////// -int BaseFontBitmap::getTextHeight(byte *text, int width) { +int BaseFontBitmap::getTextHeight(const byte *text, int width) { return textHeightDraw(text, 0, 0, width, TAL_LEFT, false); } ////////////////////////////////////////////////////////////////////// -int BaseFontBitmap::getTextWidth(byte *text, int maxLength) { +int BaseFontBitmap::getTextWidth(const byte *text, int maxLength) { AnsiString str; if (_gameRef->_textEncoding == TEXT_UTF8) { - WideString wstr = StringUtil::utf8ToWide(Utf8String((char *)text)); + WideString wstr = StringUtil::utf8ToWide(Utf8String((const char *)text)); str = StringUtil::wideToAnsi(wstr); } else { - str = AnsiString((char *)text); + str = AnsiString((const char *)text); } if (maxLength >= 0 && str.size() > (uint32)maxLength) { diff --git a/engines/wintermute/base/font/base_font_bitmap.h b/engines/wintermute/base/font/base_font_bitmap.h index 2f3a69d097..e380a949e2 100644 --- a/engines/wintermute/base/font/base_font_bitmap.h +++ b/engines/wintermute/base/font/base_font_bitmap.h @@ -39,8 +39,8 @@ public: DECLARE_PERSISTENT(BaseFontBitmap, BaseFont) bool loadBuffer(byte *Buffer); bool loadFile(const Common::String &filename); - virtual int getTextWidth(byte *text, int maxLength = -1); - virtual int getTextHeight(byte *text, int width); + virtual int getTextWidth(const byte *text, int maxLength = -1); + virtual int getTextHeight(const byte *text, int width); virtual void drawText(const byte *text, int x, int y, int width, TTextAlign align = TAL_LEFT, int max_height = -1, int maxLength = -1); virtual int getLetterHeight(); diff --git a/engines/wintermute/base/font/base_font_truetype.cpp b/engines/wintermute/base/font/base_font_truetype.cpp index 7f1ff340d2..246c6befb7 100644 --- a/engines/wintermute/base/font/base_font_truetype.cpp +++ b/engines/wintermute/base/font/base_font_truetype.cpp @@ -111,13 +111,13 @@ void BaseFontTT::initLoop() { } ////////////////////////////////////////////////////////////////////////// -int BaseFontTT::getTextWidth(byte *text, int maxLength) { +int BaseFontTT::getTextWidth(const byte *text, int maxLength) { WideString textStr; if (_gameRef->_textEncoding == TEXT_UTF8) { - textStr = StringUtil::utf8ToWide((char *)text); + textStr = StringUtil::utf8ToWide((const char *)text); } else { - textStr = StringUtil::ansiToWide((char *)text); + textStr = StringUtil::ansiToWide((const char *)text); } if (maxLength >= 0 && textStr.size() > (uint32)maxLength) { @@ -132,13 +132,13 @@ int BaseFontTT::getTextWidth(byte *text, int maxLength) { } ////////////////////////////////////////////////////////////////////////// -int BaseFontTT::getTextHeight(byte *text, int width) { +int BaseFontTT::getTextHeight(const byte *text, int width) { WideString textStr; if (_gameRef->_textEncoding == TEXT_UTF8) { - textStr = StringUtil::utf8ToWide((char *)text); + textStr = StringUtil::utf8ToWide((const char *)text); } else { - textStr = StringUtil::ansiToWide((char *)text); + textStr = StringUtil::ansiToWide((const char *)text); } diff --git a/engines/wintermute/base/font/base_font_truetype.h b/engines/wintermute/base/font/base_font_truetype.h index ba4aac9380..c9ac4cd993 100644 --- a/engines/wintermute/base/font/base_font_truetype.h +++ b/engines/wintermute/base/font/base_font_truetype.h @@ -100,8 +100,8 @@ public: BaseFontTT(BaseGame *inGame); virtual ~BaseFontTT(void); - virtual int getTextWidth(byte *text, int maxLength = -1); - virtual int getTextHeight(byte *text, int width); + virtual int getTextWidth(const byte *text, int maxLength = -1); + virtual int getTextHeight(const byte *text, int width); virtual void drawText(const byte *text, int x, int y, int width, TTextAlign align = TAL_LEFT, int max_height = -1, int maxLength = -1); virtual int getLetterHeight(); |