aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Fry2018-04-26 20:23:56 +1000
committerEugene Sandulenko2018-07-20 06:43:33 +0000
commita6cd908e0efd17fe0835f929953c4e1260ac297b (patch)
treea0374db86919678bc607ffca437223ddbdb79cdb
parentb3e9c972f1f43b6f571acbc3e00bcbcb23bce891 (diff)
downloadscummvm-rg350-a6cd908e0efd17fe0835f929953c4e1260ac297b.tar.gz
scummvm-rg350-a6cd908e0efd17fe0835f929953c4e1260ac297b.tar.bz2
scummvm-rg350-a6cd908e0efd17fe0835f929953c4e1260ac297b.zip
ILLUSIONS: Replace text flag magic numbers with defines
-rw-r--r--engines/illusions/menusystem.cpp4
-rw-r--r--engines/illusions/screentext.h5
-rw-r--r--engines/illusions/textdrawer.cpp5
-rw-r--r--engines/illusions/threads/talkthread.cpp2
-rw-r--r--engines/illusions/threads/talkthread_duckman.cpp2
5 files changed, 12 insertions, 6 deletions
diff --git a/engines/illusions/menusystem.cpp b/engines/illusions/menusystem.cpp
index fe82a7f776..266d0b9c2c 100644
--- a/engines/illusions/menusystem.cpp
+++ b/engines/illusions/menusystem.cpp
@@ -416,9 +416,9 @@ uint BaseMenuSystem::drawMenuText(BaseMenu *menu) {
textPt.x = v9;
textPt.y = v9;
- uint flags = 1;
+ uint flags = TEXT_FLAG_LEFT_ALIGN;
if (menu->_field8 != menu->_fieldA)
- flags = 25;
+ flags |= TEXT_FLAG_BORDER_DECORATION;
WidthHeight dimensions;
dimensions._width = 300;
diff --git a/engines/illusions/screentext.h b/engines/illusions/screentext.h
index 6b365e5f6e..e71b6ccbbe 100644
--- a/engines/illusions/screentext.h
+++ b/engines/illusions/screentext.h
@@ -30,6 +30,11 @@
namespace Illusions {
+#define TEXT_FLAG_LEFT_ALIGN 1
+#define TEXT_FLAG_CENTER_ALIGN 2
+#define TEXT_FLAG_RIGHT_ALIGN 4
+#define TEXT_FLAG_BORDER_DECORATION 24
+
class IllusionsEngine;
class FontResource;
diff --git a/engines/illusions/textdrawer.cpp b/engines/illusions/textdrawer.cpp
index e562732486..1d1ac5797f 100644
--- a/engines/illusions/textdrawer.cpp
+++ b/engines/illusions/textdrawer.cpp
@@ -23,6 +23,7 @@
#include "illusions/illusions.h"
#include "illusions/textdrawer.h"
#include "illusions/screen.h"
+#include "illusions/screentext.h"
namespace Illusions {
@@ -111,10 +112,10 @@ bool TextDrawer::wrapTextIntern(int16 x, int16 y, int16 maxWidth, int16 maxHeigh
if (textPosY + _font->_charHeight <= maxHeight) {
int16 textPosX;
- if (_textFlags & 2) {
+ if (_textFlags & TEXT_FLAG_CENTER_ALIGN) {
textPosX = (_dimensions->_width - currLineWidth) / 2;
maxLineWidth = _dimensions->_width;
- } else if (_textFlags & 4) {
+ } else if (_textFlags & TEXT_FLAG_RIGHT_ALIGN) {
textPosX = _dimensions->_width - currLineWidth;
} else {
textPosX = x;
diff --git a/engines/illusions/threads/talkthread.cpp b/engines/illusions/threads/talkthread.cpp
index e9c3e36aee..f8b4c15bf4 100644
--- a/engines/illusions/threads/talkthread.cpp
+++ b/engines/illusions/threads/talkthread.cpp
@@ -302,7 +302,7 @@ int TalkThread::insertText() {
_vm->getDefaultTextDimensions(dimensions);
uint16 *outTextPtr;
_vm->_screenText->insertText((uint16*)_currEntryText, 0x120001, dimensions,
- Common::Point(0, 0), 2, 0, 0, 0, 0, 0, outTextPtr);
+ Common::Point(0, 0), TEXT_FLAG_CENTER_ALIGN, 0, 0, 0, 0, 0, outTextPtr);
_entryText = (byte*)outTextPtr;
Common::Point pt;
_vm->getDefaultTextPosition(pt);
diff --git a/engines/illusions/threads/talkthread_duckman.cpp b/engines/illusions/threads/talkthread_duckman.cpp
index f891301bf9..07fe1bb56a 100644
--- a/engines/illusions/threads/talkthread_duckman.cpp
+++ b/engines/illusions/threads/talkthread_duckman.cpp
@@ -310,7 +310,7 @@ int TalkThread_Duckman::insertText() {
_vm->getDefaultTextDimensions(dimensions);
uint16 *outTextPtr;
_vm->_screenText->insertText((uint16*)_currEntryText, 0x120001, dimensions,
- Common::Point(0, 0), 2, 0, 0, _color.r, _color.g, _color.b, outTextPtr);
+ Common::Point(0, 0), TEXT_FLAG_CENTER_ALIGN, 0, 0, _color.r, _color.g, _color.b, outTextPtr);
_entryText = (byte*)outTextPtr;
Common::Point pt;
_vm->getDefaultTextPosition(pt);