[Scummvm-cvs-logs] SF.net SVN: scummvm: [21754] scummvm/trunk/engines/simon
eriktorbjorn at users.sourceforge.net
eriktorbjorn at users.sourceforge.net
Mon Apr 10 01:10:05 CEST 2006
Revision: 21754
Author: eriktorbjorn
Date: 2006-04-10 01:09:49 -0700 (Mon, 10 Apr 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=21754&view=rev
Log Message:
-----------
Merged o_inventory_descriptions() into o1_screenTextPObj().
Modified Paths:
--------------
scummvm/trunk/engines/simon/items.cpp
scummvm/trunk/engines/simon/simon.h
Modified: scummvm/trunk/engines/simon/items.cpp
===================================================================
--- scummvm/trunk/engines/simon/items.cpp 2006-04-10 08:04:45 UTC (rev 21753)
+++ scummvm/trunk/engines/simon/items.cpp 2006-04-10 08:09:49 UTC (rev 21754)
@@ -1339,7 +1339,88 @@
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_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';
Modified: scummvm/trunk/engines/simon/simon.h
===================================================================
--- scummvm/trunk/engines/simon/simon.h 2006-04-10 08:04:45 UTC (rev 21753)
+++ scummvm/trunk/engines/simon/simon.h 2006-04-10 08:09:49 UTC (rev 21754)
@@ -592,8 +592,6 @@
void o_setup_cond_c();
void setup_cond_c_helper();
- void o_inventory_descriptions();
-
void checkLinkBox();
void hyperLinkOn(uint16 x);
void hyperLinkOff();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list