Patch #712493: CMI: Object line

svn-id: r6930
This commit is contained in:
Max Horn 2003-04-07 16:04:30 +00:00
parent df9ccab935
commit ca7c8081a1
5 changed files with 36 additions and 10 deletions

View File

@ -361,7 +361,7 @@ int32 Bundle::decompressVoiceSampleByName(char *name, byte **comp_final) {
return final_size;
}
}
warning("Failed finding voice %s", name);
debug(2, "Failed finding voice %s", name);
return final_size;
}

View File

@ -2346,7 +2346,7 @@ void Scumm_v5::o5_walkActorToObject() {
int Scumm_v5::getWordVararg(int *ptr) {
int i;
for (i = 0; i < 16; i++)
for (i = 0; i < 15; i++)
ptr[i] = 0;
i = 0;
@ -2494,6 +2494,7 @@ void Scumm_v5::o5_oldRoomEffect() {
// that something is missing here :-)
if (a == 4) {
printf("o5_oldRoomEffect ODDBALL: _opcode = 0x%x, a = 0x%x\n", _opcode, a);
// No idea what byte_2FCCF is, but it's a globale boolean flag.
// I only add it here as a temporary hack to make the pseudo code compile.
int byte_2FCCF = 0;

View File

@ -515,11 +515,14 @@ void Scumm_v8::decodeParseString(int m, int n) {
}
pointer[j] = 0;
// Stop any talking that's still going on
if (_sound->_talkChannel > -1)
_mixer->stop(_sound->_talkChannel);
int new_sound = _sound->playBundleSound(pointer);
if (new_sound != -1) {
// Stop any talking that's still going on
if (_sound->_talkChannel > -1)
_mixer->stop(_sound->_talkChannel);
_sound->_talkChannel = new_sound;
}
_sound->_talkChannel = _sound->playBundleSound(pointer);
_messagePtr = _transText;
}
@ -607,10 +610,24 @@ void Scumm::drawBlastTexts() {
_charset->_nextTop = _charset->_top;
}
} while (c);
_blastTextQueue[i].left = _charset->_strLeft;
_blastTextQueue[i].right = _charset->_strRight;
_blastTextQueue[i].top = _charset->_strTop;
_blastTextQueue[i].bottom = _charset->_strBottom;
}
_charset->_ignoreCharsetMask = false;
}
void Scumm::removeBlastTexts() {
int i;
for (i = 0; i < _blastTextQueuePos; i++) {
restoreBG(_blastTextQueue[i].left, _blastTextQueue[i].top, _blastTextQueue[i].right, _blastTextQueue[i].bottom);
}
_blastTextQueuePos = 0;
}
void Scumm_v8::o8_mod() {
int a = pop();
push(pop() % a);
@ -1614,7 +1631,7 @@ void Scumm_v8::o8_kernelGetFunctions() {
// scripts. Probably a wrong push/pop somewhere. For now override to correct value.
array = 658;
ArrayHeader *ah = (ArrayHeader *)getResourceAddress(rtString, readVar(array));
if (!strcmp((char *)ah->data, "Saveload Page"))
if (!strcmp((char *)ah->data, "Saveload Page") || !strcmp((char *)ah->data, "Object Names"))
push(1);
else
push(0);

View File

@ -116,6 +116,7 @@ struct NestedScript {
struct BlastText {
int16 xpos, ypos;
int16 left, right, top, bottom;
byte color;
byte charset;
bool center;
@ -877,7 +878,7 @@ public:
void enqueueText(byte *text, int x, int y, byte color, byte charset, bool center);
void drawBlastTexts();
void removeBlastTexts() { _blastTextQueuePos = 0; }
void removeBlastTexts();
void enqueueObject(int objectNumber, int objectX, int objectY, int objectWidth,
int objectHeight, int scaleX, int scaleY, int image, int mode);

View File

@ -857,15 +857,22 @@ void Scumm::translateText(byte *text, byte *trans_buff) {
if (_gameId == GID_CMI) {
if ((text[0] == '/') && (_existLanguageFile == true)) {
struct langIndexNode target;
struct langIndexNode *found;
struct langIndexNode *found = NULL;
// copy name from text /..../
for (l = 0; (l < 8) && (text[l + 1] != '/'); l++)
target.tag[l] = toupper(text[l + 1]);
target.tag[l] = 0;
found = (struct langIndexNode *)bsearch(&target, _languageIndex, _languageStrCount, sizeof(struct langIndexNode), indexCompare);
// HACK: These are used for the object line when
// using one object on another. I don't know if the
// text in the language file is a placeholder or if
// we're supposed to use it, but at least in the
// English version things will work so much better if
// we can't find translations for these.
if (strcmp(target.tag, "PU_M001") != 0 && strcmp(target.tag, "PU_M002") != 0)
found = (struct langIndexNode *)bsearch(&target, _languageIndex, _languageStrCount, sizeof(struct langIndexNode), indexCompare);
if (found != NULL) {
File file;