aboutsummaryrefslogtreecommitdiff
path: root/queen/command.cpp
diff options
context:
space:
mode:
authorJoost Peters2004-02-13 22:33:21 +0000
committerJoost Peters2004-02-13 22:33:21 +0000
commitbf0d58fe8942bfc4fd38b751c922e88af5e3124d (patch)
tree339b2cdadc23e61d14a1a4e837148f1116465509 /queen/command.cpp
parenta4df55fbc1e474f9dad0ff3fa3fb8f89123a8d51 (diff)
downloadscummvm-rg350-bf0d58fe8942bfc4fd38b751c922e88af5e3124d.tar.gz
scummvm-rg350-bf0d58fe8942bfc4fd38b751c922e88af5e3124d.tar.bz2
scummvm-rg350-bf0d58fe8942bfc4fd38b751c922e88af5e3124d.zip
Applied patch #896726 (reversed hebrew text) and reduced overhead a little by introducing an _isReversed boolean
svn-id: r12860
Diffstat (limited to 'queen/command.cpp')
-rw-r--r--queen/command.cpp60
1 files changed, 47 insertions, 13 deletions
diff --git a/queen/command.cpp b/queen/command.cpp
index 9673ba999b..c6b7ca4da5 100644
--- a/queen/command.cpp
+++ b/queen/command.cpp
@@ -45,15 +45,27 @@ void CmdText::display(uint8 color) {
}
void CmdText::displayTemp(uint8 color, bool locked, Verb v, const char *name) {
- char temp[MAX_COMMAND_LEN];
- if (locked) {
- sprintf(temp, "%s%s", _vm->logic()->joeResponse(39), _vm->logic()->verbName(v));
+ char temp[MAX_COMMAND_LEN] = "";
+ if (_isReversed) {
+ if (name != NULL)
+ sprintf(temp, "%s ", name);
+
+ if (locked) {
+ strcat(temp, _vm->logic()->verbName(v));
+ strcat(temp, " ");
+ strcat(temp, _vm->logic()->joeResponse(39));
+ } else
+ strcat(temp, _vm->logic()->verbName(v));
} else {
- strcpy(temp, _vm->logic()->verbName(v));
- }
- if (name != NULL) {
- strcat(temp, " ");
- strcat(temp, name);
+ if (locked)
+ sprintf(temp, "%s %s", _vm->logic()->joeResponse(39), _vm->logic()->verbName(v));
+ else
+ strcpy(temp, _vm->logic()->verbName(v));
+
+ if (name != NULL) {
+ strcat(temp, " ");
+ strcat(temp, name);
+ }
}
_vm->display()->textCurrentColor(color);
_vm->display()->setTextCentered(COMMAND_Y_POS, temp, false);
@@ -61,7 +73,10 @@ void CmdText::displayTemp(uint8 color, bool locked, Verb v, const char *name) {
void CmdText::displayTemp(uint8 color, const char *name) {
char temp[MAX_COMMAND_LEN];
- sprintf(temp, "%s %s", _command, name);
+ if (_isReversed)
+ sprintf(temp, "%s %s", name, _command);
+ else
+ sprintf(temp, "%s %s", _command, name);
_vm->display()->textCurrentColor(color);
_vm->display()->setTextCentered(COMMAND_Y_POS, temp, false);
}
@@ -71,13 +86,31 @@ void CmdText::setVerb(Verb v) {
}
void CmdText::addLinkWord(Verb v) {
- strcat(_command, " ");
- strcat(_command, _vm->logic()->verbName(v));
+ if (_isReversed) {
+ char temp[MAX_COMMAND_LEN];
+
+ strcpy(temp, _command);
+ strcpy(_command, _vm->logic()->verbName(v));
+ strcat(_command, " ");
+ strcat(_command, temp);
+ } else {
+ strcat(_command, " ");
+ strcat(_command, _vm->logic()->verbName(v));
+ }
}
void CmdText::addObject(const char *objName) {
- strcat(_command, " ");
- strcat(_command, objName);
+ if (_isReversed) {
+ char temp[MAX_COMMAND_LEN];
+
+ strcpy(temp, _command);
+ strcpy(_command, objName);
+ strcat(_command, " ");
+ strcat(_command, temp);
+ } else {
+ strcat(_command, " ");
+ strcat(_command, objName);
+ }
}
bool CmdText::isEmpty() const {
@@ -95,6 +128,7 @@ void CmdState::init() {
Command::Command(QueenEngine *vm)
: _vm(vm) {
+ _cmdText._isReversed = (vm->resource()->getLanguage() == HEBREW);
_cmdText._vm = vm;
}