[Scummvm-cvs-logs] scummvm master -> 3c6c91a60446016af2554df2ef8eaa6d5f4140ec

clone2727 clone2727 at gmail.com
Fri Oct 18 05:09:15 CEST 2013


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
3c6c91a604 ZVISION: Make the line height be an int


Commit: 3c6c91a60446016af2554df2ef8eaa6d5f4140ec
    https://github.com/scummvm/scummvm/commit/3c6c91a60446016af2554df2ef8eaa6d5f4140ec
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2013-10-17T20:08:17-07:00

Commit Message:
ZVISION: Make the line height be an int

Changed paths:
    engines/zvision/truetype_font.cpp
    engines/zvision/truetype_font.h



diff --git a/engines/zvision/truetype_font.cpp b/engines/zvision/truetype_font.cpp
index 8d6aaca..289b5fb 100644
--- a/engines/zvision/truetype_font.cpp
+++ b/engines/zvision/truetype_font.cpp
@@ -94,7 +94,7 @@ Graphics::Surface *TruetypeFont::drawTextToSurface(const Common::String &text, u
 	Common::Array<Common::String> lines;
 	_font->wordWrapText(text, maxWidth, lines);
 
-	while (maxHeight > 0 && lines.size() * _lineHeight > maxHeight) {
+	while (maxHeight > 0 && (int)lines.size() * _lineHeight > maxHeight) {
 		lines.pop_back();
 	}
 	if (lines.size() == 0) {
@@ -107,7 +107,7 @@ Graphics::Surface *TruetypeFont::drawTextToSurface(const Common::String &text, u
 	int heightOffset = 0;
 	for (Common::Array<Common::String>::iterator it = lines.begin(); it != lines.end(); it++) {
 		_font->drawString(surface, *it, 0, 0 + heightOffset, maxWidth, textColor, align);
-		heightOffset += (int)_lineHeight;
+		heightOffset += _lineHeight;
 	}
 
 	return surface;
diff --git a/engines/zvision/truetype_font.h b/engines/zvision/truetype_font.h
index 4f2ff86..33f016c 100644
--- a/engines/zvision/truetype_font.h
+++ b/engines/zvision/truetype_font.h
@@ -45,7 +45,7 @@ public:
 private:
 	ZVision *_engine;
 	Graphics::Font *_font;
-	float _lineHeight;
+	int _lineHeight;
 
 	size_t _maxCharWidth;
 	size_t _maxCharHeight;






More information about the Scummvm-git-logs mailing list