From 585fc91de5c1fcfc0e51afc9d13bc5736b38edad Mon Sep 17 00:00:00 2001 From: Adrian Frühwirth Date: Sun, 4 Mar 2018 21:54:22 +0100 Subject: TUCKER: Add VerbPreposition enum --- engines/tucker/tucker.cpp | 8 ++++---- engines/tucker/tucker.h | 7 +++++++ 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'engines/tucker') diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp index e4d7cde18a..f7afd16906 100644 --- a/engines/tucker/tucker.cpp +++ b/engines/tucker/tucker.cpp @@ -2068,12 +2068,12 @@ void TuckerEngine::drawInfoString() { } else { infoStringWidth = verbWidth; } - int verbPreposition = 0; + VerbPreposition verbPreposition = kVerbPrepositionNone; int verbPrepositionWidth = 0; if (_actionRequiresTwoObjects) { - verbPreposition = (_actionVerb == kVerbGive) ? 12 : 11; + verbPreposition = (_actionVerb == kVerbGive) ? kVerbPrepositionTo : kVerbPrepositionWith; verbPrepositionWidth = getStringWidth(verbPreposition, infoStrBuf) + 4; - if (_gameLang != Common::EN_ANY && (_actionObj2Num > 0 || _actionObj2Type > 0) && verbPreposition > 0) { + if (_gameLang != Common::EN_ANY && (_actionObj2Num > 0 || _actionObj2Type > 0) && verbPreposition != kVerbPrepositionNone) { infoStringWidth = 0; verbWidth = 0; object1NameWidth = 0; @@ -2084,7 +2084,7 @@ void TuckerEngine::drawInfoString() { } } const int xPos = (kScreenWidth / 2) - 1 - (infoStringWidth / 2); - if (_gameLang == Common::EN_ANY || (_actionObj2Num == 0 && _actionObj2Type == 0) || verbPreposition == 0) { + if (_gameLang == Common::EN_ANY || (_actionObj2Num == 0 && _actionObj2Type == 0) || verbPreposition == kVerbPrepositionNone) { drawItemString(xPos, _actionVerb + 1, infoStrBuf); if (_actionObj1Num > 0 || _actionObj1Type > 0) { drawItemString(xPos + 4 + verbWidth, _actionObj1Num + 1, obj1StrBuf); diff --git a/engines/tucker/tucker.h b/engines/tucker/tucker.h index 03046f67de..2972052ce2 100644 --- a/engines/tucker/tucker.h +++ b/engines/tucker/tucker.h @@ -98,6 +98,13 @@ enum Verb { kVerbUse = 8 }; +enum VerbPreposition { + kVerbPrepositionNone = 0, + + kVerbPrepositionWith = 11, + kVerbPrepositionTo = 12 +}; + enum Part { kPartInit = 0, kPartOne = 1, -- cgit v1.2.3