aboutsummaryrefslogtreecommitdiff
path: root/engines/cruise/font.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/cruise/font.cpp')
-rw-r--r--engines/cruise/font.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/engines/cruise/font.cpp b/engines/cruise/font.cpp
index 5c04154b01..2ef43c952a 100644
--- a/engines/cruise/font.cpp
+++ b/engines/cruise/font.cpp
@@ -50,7 +50,7 @@ int32 getLineHeight(int16 charCount, const FontEntry *fontPtr) {
}
/**
- * This function determins how many lines the text will have
+ * This function determines how many lines the text will have
*/
int32 getTextLineCount(int32 rightBorder_X, int16 wordSpacingWidth,
const FontEntry *fontData, const char *textString) {
@@ -59,6 +59,9 @@ int32 getTextLineCount(int32 rightBorder_X, int16 wordSpacingWidth,
uint8 ch;
int32 total = 0, lineLength = 0;
+ if (rightBorder_X == 0)
+ error("getTextLineCount() - invalid parameter");
+
if (!*textString)
return (0);
@@ -89,7 +92,8 @@ int32 getTextLineCount(int32 rightBorder_X, int16 wordSpacingWidth,
if (lineLength > 0)
total += rightBorder_X;
- return (total / (rightBorder_X == 0 ? 1 : rightBorder_X));
+
+ return (total / rightBorder_X);
}
void loadFNT(const char *fileName) {