SHERLOCK: fixed text class: Common::String to char

This commit is contained in:
Martin Kiewitz 2015-06-16 10:23:54 +02:00
parent 41575ad74e
commit f18dbd4496
2 changed files with 23 additions and 23 deletions

View file

@ -25,7 +25,7 @@
namespace Sherlock { namespace Sherlock {
static const Common::String fixedTextEN[] = { static const char *fixedTextEN[] = {
// Window buttons // Window buttons
"Exit", "Exit",
"Up", "Up",
@ -72,7 +72,7 @@ static const Common::String fixedTextEN[] = {
// small a-umlaut: 0x84 / octal 204 // small a-umlaut: 0x84 / octal 204
// small o-umlaut: 0x94 / octal 224 // small o-umlaut: 0x94 / octal 224
// small u-umlaut: 0x81 / octal 201 // small u-umlaut: 0x81 / octal 201
static const Common::String fixedTextDE[] = { static const char *fixedTextDE[] = {
// Window buttons // Window buttons
"Zur\201ck", "Zur\201ck",
"Hoch", "Hoch",
@ -118,7 +118,7 @@ static const Common::String fixedTextDE[] = {
// up-side down exclamation mark - 0xAD / octal 255 // up-side down exclamation mark - 0xAD / octal 255
// up-side down question mark - 0xA8 / octal 250 // up-side down question mark - 0xA8 / octal 250
// n with a wave on top - 0xA4 / octal 244 // n with a wave on top - 0xA4 / octal 244
static const Common::String fixedTextES[] = { static const char *fixedTextES[] = {
// Window buttons // Window buttons
"Exit", "Exit",
"Subir", "Subir",
@ -163,7 +163,7 @@ static const Common::String fixedTextES[] = {
// ========================================= // =========================================
static const Common::String fixedTextEN_ActionOpen[] = { static const char *fixedTextEN_ActionOpen[] = {
"This cannot be opened", "This cannot be opened",
"It is already open", "It is already open",
"It is locked", "It is locked",
@ -172,7 +172,7 @@ static const Common::String fixedTextEN_ActionOpen[] = {
"." "."
}; };
static const Common::String fixedTextDE_ActionOpen[] = { static const char *fixedTextDE_ActionOpen[] = {
"Das kann man nicht \224ffnen", "Das kann man nicht \224ffnen",
"Ist doch schon offen!", "Ist doch schon offen!",
"Leider verschlossen", "Leider verschlossen",
@ -181,7 +181,7 @@ static const Common::String fixedTextDE_ActionOpen[] = {
"." "."
}; };
static const Common::String fixedTextES_ActionOpen[] = { static const char *fixedTextES_ActionOpen[] = {
"No puede ser abierto", "No puede ser abierto",
"Ya esta abierto", "Ya esta abierto",
"Esta cerrado", "Esta cerrado",
@ -190,25 +190,25 @@ static const Common::String fixedTextES_ActionOpen[] = {
"." "."
}; };
static const Common::String fixedTextEN_ActionClose[] = { static const char *fixedTextEN_ActionClose[] = {
"This cannot be closed", "This cannot be closed",
"It is already closed", "It is already closed",
"The safe door is in the way" "The safe door is in the way"
}; };
static const Common::String fixedTextDE_ActionClose[] = { static const char *fixedTextDE_ActionClose[] = {
"Das kann man nicht schlie\341en", "Das kann man nicht schlie\341en",
"Ist doch schon zu!", "Ist doch schon zu!",
"Die safet\201r ist Weg" "Die safet\201r ist Weg"
}; };
static const Common::String fixedTextES_ActionClose[] = { static const char *fixedTextES_ActionClose[] = {
"No puede ser cerrado", "No puede ser cerrado",
"Ya esta cerrado", "Ya esta cerrado",
"La puerta de seguridad esta entre medias" "La puerta de seguridad esta entre medias"
}; };
static const Common::String fixedTextEN_ActionMove[] = { static const char *fixedTextEN_ActionMove[] = {
"This cannot be moved", "This cannot be moved",
"It is bolted to the floor", "It is bolted to the floor",
"It is too heavy", "It is too heavy",
@ -216,21 +216,21 @@ static const Common::String fixedTextEN_ActionMove[] = {
}; };
static const Common::String fixedTextDE_ActionMove[] = { static const char *fixedTextDE_ActionMove[] = {
"L\204\341t sich nicht bewegen", "L\204\341t sich nicht bewegen",
"Festged\201belt in der Erde...", "Festged\201belt in der Erde...",
"Oha, VIEL zu schwer", "Oha, VIEL zu schwer",
"Der andere Kiste ist im Weg" // [sic] "Der andere Kiste ist im Weg" // [sic]
}; };
static const Common::String fixedTextES_ActionMove[] = { static const char *fixedTextES_ActionMove[] = {
"No puede moverse", "No puede moverse",
"Esta sujeto a la pared", "Esta sujeto a la pared",
"Es demasiado pesado", "Es demasiado pesado",
"El otro cajon esta en mitad" "El otro cajon esta en mitad"
}; };
static const Common::String fixedTextEN_ActionPick[] = { static const char *fixedTextEN_ActionPick[] = {
"Nothing of interest here", "Nothing of interest here",
"It is bolted down", "It is bolted down",
"It is too big to carry", "It is too big to carry",
@ -242,7 +242,7 @@ static const Common::String fixedTextEN_ActionPick[] = {
"Government property for official use only" "Government property for official use only"
}; };
static const Common::String fixedTextDE_ActionPick[] = { static const char *fixedTextDE_ActionPick[] = {
"Nichts Interessantes da", "Nichts Interessantes da",
"Zu gut befestigt", "Zu gut befestigt",
"Ist ja wohl ein bi\341chen zu gro\341, oder ?", "Ist ja wohl ein bi\341chen zu gro\341, oder ?",
@ -254,7 +254,7 @@ static const Common::String fixedTextDE_ActionPick[] = {
"Staatseigentum - Nur für den Dienstgebrauch !" "Staatseigentum - Nur für den Dienstgebrauch !"
}; };
static const Common::String fixedTextES_ActionPick[] = { static const char *fixedTextES_ActionPick[] = {
"No hay nada interesante", "No hay nada interesante",
"Esta anclado al suelo", "Esta anclado al suelo",
"Es muy grande para llevarlo", "Es muy grande para llevarlo",
@ -266,7 +266,7 @@ static const Common::String fixedTextES_ActionPick[] = {
"Propiedad del gobierno para uso oficial" "Propiedad del gobierno para uso oficial"
}; };
static const Common::String fixedTextEN_ActionUse[] = { static const char *fixedTextEN_ActionUse[] = {
"You can't do that", "You can't do that",
"It had no effect", "It had no effect",
"You can't reach it", "You can't reach it",
@ -274,7 +274,7 @@ static const Common::String fixedTextEN_ActionUse[] = {
"Doors don't smoke" "Doors don't smoke"
}; };
static const Common::String fixedTextDE_ActionUse[] = { static const char *fixedTextDE_ActionUse[] = {
"Nein, das geht wirklich nicht", "Nein, das geht wirklich nicht",
"Tja keinerlei Wirkung", "Tja keinerlei Wirkung",
"Da kommst du nicht dran", "Da kommst du nicht dran",
@ -282,7 +282,7 @@ static const Common::String fixedTextDE_ActionUse[] = {
"Türen sind Nichtraucher!" "Türen sind Nichtraucher!"
}; };
static const Common::String fixedTextES_ActionUse[] = { static const char *fixedTextES_ActionUse[] = {
"No puedes hacerlo", "No puedes hacerlo",
"No tuvo ningun efecto", "No tuvo ningun efecto",
"No puedes alcanzarlo", "No puedes alcanzarlo",
@ -290,7 +290,7 @@ static const Common::String fixedTextES_ActionUse[] = {
"Las puertas no fuman" "Las puertas no fuman"
}; };
#define FIXEDTEXT_GETCOUNT(_name_) sizeof(_name_) / sizeof(Common::String) #define FIXEDTEXT_GETCOUNT(_name_) sizeof(_name_) / sizeof(byte *)
#define FIXEDTEXT_ENTRY(_name_) _name_, FIXEDTEXT_GETCOUNT(_name_) #define FIXEDTEXT_ENTRY(_name_) _name_, FIXEDTEXT_GETCOUNT(_name_)
static const FixedTextActionEntry fixedTextEN_Actions[] = { static const FixedTextActionEntry fixedTextEN_Actions[] = {
@ -345,7 +345,7 @@ FixedText::FixedText(SherlockEngine *vm) : _vm(vm) {
} }
const Common::String FixedText::getText(FixedTextId fixedTextId) { const Common::String FixedText::getText(FixedTextId fixedTextId) {
return _curLanguageEntry->fixedTextArray[fixedTextId]; return Common::String(_curLanguageEntry->fixedTextArray[fixedTextId]);
} }
const Common::String FixedText::getActionMessage(FixedTextActionId actionId, int messageIndex) { const Common::String FixedText::getActionMessage(FixedTextActionId actionId, int messageIndex) {
@ -354,7 +354,7 @@ const Common::String FixedText::getActionMessage(FixedTextActionId actionId, int
const FixedTextActionEntry *curActionEntry = &_curLanguageEntry->actionArray[actionId]; const FixedTextActionEntry *curActionEntry = &_curLanguageEntry->actionArray[actionId];
assert(messageIndex < curActionEntry->fixedTextArrayCount); assert(messageIndex < curActionEntry->fixedTextArrayCount);
return curActionEntry->fixedTextArray[messageIndex]; return Common::String(curActionEntry->fixedTextArray[messageIndex]);
} }
} // End of namespace Sherlock } // End of namespace Sherlock

View file

@ -81,13 +81,13 @@ enum FixedTextActionId {
}; };
struct FixedTextActionEntry { struct FixedTextActionEntry {
const Common::String *fixedTextArray; const char **fixedTextArray;
int fixedTextArrayCount; int fixedTextArrayCount;
}; };
struct FixedTextLanguageEntry { struct FixedTextLanguageEntry {
Common::Language language; Common::Language language;
const Common::String *fixedTextArray; const char **fixedTextArray;
const FixedTextActionEntry *actionArray; const FixedTextActionEntry *actionArray;
}; };