diff --git a/font.cpp b/font.cpp index 71131f2d574..c65bc41bac6 100644 --- a/font.cpp +++ b/font.cpp @@ -24,7 +24,7 @@ #include #include -Font::Font(const char *filename, const char *data, int len) : +Font::Font(const char *filename, const char *data, int /*len*/) : Resource(filename) { _numChars = READ_LE_UINT32(data); @@ -44,7 +44,7 @@ Font::Font(const char *filename, const char *data, int len) : _charIndex = (uint16 *)malloc(sizeof(_charIndex) * _numChars); if (!_charIndex) error("Could not load font %s. Out of memory\n", filename); - for (int i = 0; i < _numChars; ++i) { + for (uint i = 0; i < _numChars; ++i) { _charIndex[i] = READ_LE_UINT16(data + 2 * i); } @@ -54,7 +54,7 @@ Font::Font(const char *filename, const char *data, int len) : _charHeaders = (CharHeader *)malloc(sizeof(CharHeader) * _numChars); if (!_charHeaders) error("Could not load font %s. Out of memory\n", filename); - for (int i = 0; i < _numChars; ++i) { + for (uint i = 0; i < _numChars; ++i) { _charHeaders[i].offset = READ_LE_UINT32(data); // 1 unknown byte before the startingLine, and 2 afterwards are skipped _charHeaders[i].unknown = READ_LE_UINT32(data + 4); diff --git a/textobject.cpp b/textobject.cpp index 5a5ad972577..4c7b5cac0ff 100644 --- a/textobject.cpp +++ b/textobject.cpp @@ -24,9 +24,9 @@ std::string parseMsgText(const char *msg, char *msgId); TextObject::TextObject() : - _created(false), _x(0), _y(0), _width(0), _height(0), _textBitmap(NULL), - _bitmapWidth(0), _bitmapHeight(0), _textObjectHandle(NULL), _justify(0), - _font(NULL), _text(NULL) { + _created(false), _x(0), _y(0), _width(0), _height(0), _justify(0), + _font(NULL), _text(NULL), _textBitmap(NULL), _bitmapWidth(0), + _bitmapHeight(0), _textObjectHandle(NULL) { memset(_textID, 0, 10); _fgColor._vals[0] = 0; _fgColor._vals[1] = 0; @@ -64,7 +64,7 @@ void TextObject::createBitmap() { for (int i = 0; msg[i] != '\0'; ++i) { _bitmapWidth += _font->getCharLogicalWidth(msg[i]) + _font->getCharStartingCol(msg[i]); - int h = _font->getCharHeight(msg[i]) + _font->getCharStartingLine(msg[i]); + uint h = _font->getCharHeight(msg[i]) + _font->getCharStartingLine(msg[i]); if (h > _bitmapHeight) _bitmapHeight = h; } @@ -76,7 +76,7 @@ void TextObject::createBitmap() { // Fill bitmap int offset = 0; - for (int line = 0; line < _bitmapHeight; ++line) { + for (uint line = 0; line < _bitmapHeight; ++line) { for (int c = 0; msg[c] != '\0'; ++c) { uint32 charWidth = _font->getCharWidth(msg[c]); uint32 charLogicalWidth = _font->getCharLogicalWidth(msg[c]); diff --git a/textobject.h b/textobject.h index a6f5e94a1ad..41eab8caf17 100644 --- a/textobject.h +++ b/textobject.h @@ -57,13 +57,13 @@ protected: bool _created; Color _fgColor; int _x, _y; - int _width, _height; + uint _width, _height; int _justify; Font *_font; char *_text; char _textID[32]; uint8 *_textBitmap; - int _bitmapHeight, _bitmapWidth; + uint _bitmapWidth, _bitmapHeight; Driver::TextObjectHandle *_textObjectHandle; };