diff options
author | Torbjörn Andersson | 2006-04-10 08:09:49 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2006-04-10 08:09:49 +0000 |
commit | 2ee9a343494d9f374e1e8978946aa5b358f307b4 (patch) | |
tree | d4e7f33ab9a3c5939fc288ba1ea48335c15d9790 | |
parent | 28c34673dcb7063797efac0dad28223ef0ddc80c (diff) | |
download | scummvm-rg350-2ee9a343494d9f374e1e8978946aa5b358f307b4.tar.gz scummvm-rg350-2ee9a343494d9f374e1e8978946aa5b358f307b4.tar.bz2 scummvm-rg350-2ee9a343494d9f374e1e8978946aa5b358f307b4.zip |
Merged o_inventory_descriptions() into o1_screenTextPObj().
svn-id: r21754
-rw-r--r-- | engines/simon/items.cpp | 168 | ||||
-rw-r--r-- | engines/simon/simon.h | 2 |
2 files changed, 82 insertions, 88 deletions
diff --git a/engines/simon/items.cpp b/engines/simon/items.cpp index ed3d773d42..ba6e85e669 100644 --- a/engines/simon/items.cpp +++ b/engines/simon/items.cpp @@ -1339,7 +1339,88 @@ void SimonEngine::o1_unlockZones() { void SimonEngine::o1_screenTextPObj() { // 177: inventory descriptions - o_inventory_descriptions(); + uint vgaSpriteId = getVarOrByte(); + uint color = getVarOrByte(); + const char *string_ptr = NULL; + TextLocation *tl = NULL; + char buf[256]; + + SubObject *subObject = (SubObject *)findChildOfType(getNextItemPtr(), 2); + if (subObject != NULL && subObject->objectFlags & kOFText) { + string_ptr = (const char *)getStringPtrByID(subObject->objectFlagValue[0]); + tl = getTextLocation(vgaSpriteId); + } + + if ((getGameType() == GType_SIMON2) && (getFeatures() & GF_TALKIE)) { + if (subObject != NULL && subObject->objectFlags & kOFVoice) { + uint speechId = subObject->objectFlagValue[getOffsetOfChild2Param(subObject, kOFVoice)]; + + if (subObject->objectFlags & kOFNumber) { + uint speechIdOffs = subObject->objectFlagValue[getOffsetOfChild2Param(subObject, kOFNumber)]; + + if (speechId == 116) + speechId = speechIdOffs + 115; + if (speechId == 92) + speechId = speechIdOffs + 98; + if (speechId == 99) + speechId = 9; + if (speechId == 97) { + switch (speechIdOffs) { + case 12: + speechId = 109; + break; + case 14: + speechId = 108; + break; + case 18: + speechId = 107; + break; + case 20: + speechId = 106; + break; + case 22: + speechId = 105; + break; + case 28: + speechId = 104; + break; + case 90: + speechId = 103; + break; + case 92: + speechId = 102; + break; + case 100: + speechId = 51; + break; + default: + error("o_177: invalid case %d", speechIdOffs); + } + } + } + + if (_speech) + playSpeech(speechId, vgaSpriteId); + } + + } else if (getFeatures() & GF_TALKIE) { + if (subObject != NULL && subObject->objectFlags & kOFVoice) { + uint offs = getOffsetOfChild2Param(subObject, kOFVoice); + playSpeech(subObject->objectFlagValue[offs], vgaSpriteId); + } else if (subObject != NULL && subObject->objectFlags & kOFNumber) { + uint offs = getOffsetOfChild2Param(subObject, kOFNumber); + playSpeech(subObject->objectFlagValue[offs] + 3550, vgaSpriteId); + } + } + + if (subObject != NULL && (subObject->objectFlags & kOFText) && _subtitles) { + if (subObject->objectFlags & kOFNumber) { + sprintf(buf, "%d%s", subObject->objectFlagValue[getOffsetOfChild2Param(subObject, kOFNumber)], string_ptr); + string_ptr = buf; + } + if (string_ptr != NULL) + printScreenText(vgaSpriteId, color, string_ptr, tl->x, tl->y, tl->width); + } } void SimonEngine::o1_getPathPosn() { @@ -1826,91 +1907,6 @@ void SimonEngine::o_waitForMark(uint i) { } } -void SimonEngine::o_inventory_descriptions() { - uint vgaSpriteId = getVarOrByte(); - uint color = getVarOrByte(); - const char *string_ptr = NULL; - TextLocation *tl = NULL; - char buf[256]; - - SubObject *subObject = (SubObject *)findChildOfType(getNextItemPtr(), 2); - if (subObject != NULL && subObject->objectFlags & kOFText) { - string_ptr = (const char *)getStringPtrByID(subObject->objectFlagValue[0]); - tl = getTextLocation(vgaSpriteId); - } - - if ((getGameType() == GType_SIMON2) && (getFeatures() & GF_TALKIE)) { - if (subObject != NULL && subObject->objectFlags & kOFVoice) { - uint speechId = subObject->objectFlagValue[getOffsetOfChild2Param(subObject, kOFVoice)]; - - if (subObject->objectFlags & kOFNumber) { - uint speechIdOffs = subObject->objectFlagValue[getOffsetOfChild2Param(subObject, kOFNumber)]; - - if (speechId == 116) - speechId = speechIdOffs + 115; - if (speechId == 92) - speechId = speechIdOffs + 98; - if (speechId == 99) - speechId = 9; - if (speechId == 97) { - switch (speechIdOffs) { - case 12: - speechId = 109; - break; - case 14: - speechId = 108; - break; - case 18: - speechId = 107; - break; - case 20: - speechId = 106; - break; - case 22: - speechId = 105; - break; - case 28: - speechId = 104; - break; - case 90: - speechId = 103; - break; - case 92: - speechId = 102; - break; - case 100: - speechId = 51; - break; - default: - error("o_177: invalid case %d", speechIdOffs); - } - } - } - - if (_speech) - playSpeech(speechId, vgaSpriteId); - } - - } else if (getFeatures() & GF_TALKIE) { - if (subObject != NULL && subObject->objectFlags & kOFVoice) { - uint offs = getOffsetOfChild2Param(subObject, kOFVoice); - playSpeech(subObject->objectFlagValue[offs], vgaSpriteId); - } else if (subObject != NULL && subObject->objectFlags & kOFNumber) { - uint offs = getOffsetOfChild2Param(subObject, kOFNumber); - playSpeech(subObject->objectFlagValue[offs] + 3550, vgaSpriteId); - } - } - - if (subObject != NULL && (subObject->objectFlags & kOFText) && _subtitles) { - if (subObject->objectFlags & kOFNumber) { - sprintf(buf, "%d%s", subObject->objectFlagValue[getOffsetOfChild2Param(subObject, kOFNumber)], string_ptr); - string_ptr = buf; - } - if (string_ptr != NULL) - printScreenText(vgaSpriteId, color, string_ptr, tl->x, tl->y, tl->width); - } -} - void SimonEngine::o_confirmQuit() { // If all else fails, use English as fallback. byte keyYes = 'y'; diff --git a/engines/simon/simon.h b/engines/simon/simon.h index e7adc346d9..235896eab7 100644 --- a/engines/simon/simon.h +++ b/engines/simon/simon.h @@ -592,8 +592,6 @@ protected: void o_setup_cond_c(); void setup_cond_c_helper(); - void o_inventory_descriptions(); - void checkLinkBox(); void hyperLinkOn(uint16 x); void hyperLinkOff(); |