diff options
Diffstat (limited to 'engines/agos/script.cpp')
-rw-r--r-- | engines/agos/script.cpp | 252 |
1 files changed, 0 insertions, 252 deletions
diff --git a/engines/agos/script.cpp b/engines/agos/script.cpp index 3ebe92518e..6a6a488ed0 100644 --- a/engines/agos/script.cpp +++ b/engines/agos/script.cpp @@ -95,8 +95,6 @@ void AGOSEngine::setupCommonOpcodes(OpcodeProc *op) { op[80] = &AGOSEngine::o_is; op[82] = &AGOSEngine::o_debug; op[87] = &AGOSEngine::o_comment; - op[88] = &AGOSEngine::o_haltAnimation; - op[89] = &AGOSEngine::o_restartAnimation; op[90] = &AGOSEngine::o_getParent; op[91] = &AGOSEngine::o_getNext; op[92] = &AGOSEngine::o_getChildren; @@ -516,44 +514,6 @@ void AGOSEngine::o_msg() { showMessageFormat("%s", getStringPtrByID(getNextStringID())); } -void AGOSEngine::o_addTextBox() { - // 65: add hit area - uint id = getVarOrWord(); - uint x = getVarOrWord(); - uint y = getVarOrWord(); - uint w = getVarOrWord(); - uint h = getVarOrWord(); - uint number = getVarOrByte(); - if (number < _numTextBoxes) - defineBox(id, x, y, w, h, (number << 8) + 129, 208, _dummyItem2); -} - -void AGOSEngine::o_setShortText() { - // 66: set item name - uint var = getVarOrByte(); - uint stringId = getNextStringID(); - if (var < _numTextBoxes) { - _shortText[var] = stringId; - } -} - -void AGOSEngine::o_setLongText() { - // 67: set item description - uint var = getVarOrByte(); - uint stringId = getNextStringID(); - if (getFeatures() & GF_TALKIE) { - uint speechId = getNextWord(); - if (var < _numTextBoxes) { - _longText[var] = stringId; - _longSound[var] = speechId; - } - } else { - if (var < _numTextBoxes) { - _longText[var] = stringId; - } - } -} - void AGOSEngine::o_end() { // 68: exit interpreter shutdown(); @@ -1084,218 +1044,6 @@ void AGOSEngine::o_ink() { setTextColor(getVarOrByte()); } -void AGOSEngine::o_screenTextBox() { - // 161: setup text - TextLocation *tl = getTextLocation(getVarOrByte()); - - tl->x = getVarOrWord(); - tl->y = getVarOrByte(); - tl->width = getVarOrWord(); -} - -void AGOSEngine::o_screenTextMsg() { - // 162: print string - uint vgaSpriteId = getVarOrByte(); - uint color = getVarOrByte(); - uint stringId = getNextStringID(); - const byte *string_ptr = NULL; - uint speechId = 0; - TextLocation *tl; - - if (stringId != 0xFFFF) - string_ptr = getStringPtrByID(stringId); - - if (getFeatures() & GF_TALKIE) { - if (getGameType() == GType_FF || getGameType() == GType_PP) - speechId = (uint16)getVarOrWord(); - else - speechId = (uint16)getNextWord(); - } - - if (getGameType() == GType_FF || getGameType() == GType_PP) - vgaSpriteId = 1; - - tl = getTextLocation(vgaSpriteId); - if (_speech && speechId != 0) - playSpeech(speechId, vgaSpriteId); - if (((getGameType() == GType_SIMON2 && (getFeatures() & GF_TALKIE)) || getGameType() == GType_FF) && - speechId == 0) { - stopAnimateSimon2(2, vgaSpriteId + 2); - } - - if (string_ptr != NULL && (speechId == 0 || _subtitles)) - printScreenText(vgaSpriteId, color, (const char *)string_ptr, tl->x, tl->y, tl->width); - -} - -void AGOSEngine::o_playEffect() { - // 163: play sound - uint soundId = getVarOrWord(); - - if (getGameId() == GID_SIMON1DOS) - playSting(soundId); - else - _sound->playEffects(soundId); -} - -void AGOSEngine::o_getDollar2() { - // 164 - _showPreposition = true; - - setup_cond_c_helper(); - - _objectItem = _hitAreaObjectItem; - - if (_objectItem == _dummyItem2) - _objectItem = me(); - - if (_objectItem == _dummyItem3) - _objectItem = derefItem(me()->parent); - - if (_objectItem != NULL) { - _scriptNoun2 = _objectItem->noun; - _scriptAdj2 = _objectItem->adjective; - } else { - _scriptNoun2 = -1; - _scriptAdj2 = -1; - } - - _showPreposition = false; -} - -void AGOSEngine::o_isAdjNoun() { - // 165: item unk1 unk2 is - Item *item = getNextItemPtr(); - int16 a = getNextWord(), b = getNextWord(); - setScriptCondition(item->adjective == a && item->noun == b); -} - -void AGOSEngine::o_b2Set() { - // 166: set bit2 - uint bit = getVarOrByte(); - _bitArrayTwo[bit / 16] |= (1 << (bit & 15)); -} - -void AGOSEngine::o_b2Clear() { - // 167: clear bit2 - uint bit = getVarOrByte(); - _bitArrayTwo[bit / 16] &= ~(1 << (bit & 15)); -} - -void AGOSEngine::o_b2Zero() { - // 168: is bit2 clear - uint bit = getVarOrByte(); - setScriptCondition((_bitArrayTwo[bit / 16] & (1 << (bit & 15))) == 0); -} - -void AGOSEngine::o_b2NotZero() { - // 169: is bit2 set - uint bit = getVarOrByte(); - setScriptCondition((_bitArrayTwo[bit / 16] & (1 << (bit & 15))) != 0); -} - -void AGOSEngine::o_lockZones() { - // 175: vga pointer op 1 - _vgaMemBase = _vgaMemPtr; -} - -void AGOSEngine::o_unlockZones() { - // 176: vga pointer op 2 - _vgaMemPtr = _vgaFrozenBase; - _vgaMemBase = _vgaFrozenBase; -} - -void AGOSEngine::o_getPathPosn() { - // 178: path find - uint x = getVarOrWord(); - uint y = getVarOrWord(); - uint var_1 = getVarOrByte(); - uint var_2 = getVarOrByte(); - - const uint16 *p; - uint i, j; - uint prev_i; - uint x_diff, y_diff; - uint best_i = 0, best_j = 0, best_dist = 0xFFFFFFFF; - uint maxPath = (getGameType() == GType_FF || getGameType() == GType_PP) ? 100 : 20; - - if (getGameType() == GType_FF || getGameType() == GType_PP) { - x += _scrollX; - y += _scrollY; - } else if (getGameType() == GType_SIMON2) { - x += _scrollX * 8; - } - - int end = (getGameType() == GType_FF) ? 9999 : 999; - prev_i = maxPath + 1 - readVariable(12); - for (i = maxPath; i != 0; --i) { - p = (const uint16 *)_pathFindArray[maxPath - i]; - if (!p) - continue; - for (j = 0; readUint16Wrapper(&p[0]) != end; j++, p += 2) { - x_diff = ABS((int16)(readUint16Wrapper(&p[0]) - x)); - y_diff = ABS((int16)(readUint16Wrapper(&p[1]) - 12 - y)); - - if (x_diff < y_diff) { - x_diff /= 4; - y_diff *= 4; - } - x_diff += y_diff /= 4; - - if (x_diff < best_dist || x_diff == best_dist && prev_i == i) { - best_dist = x_diff; - best_i = maxPath + 1 - i; - best_j = j; - } - } - } - - writeVariable(var_1, best_i); - writeVariable(var_2, best_j); -} - -void AGOSEngine::o_scnTxtLongText() { - // 179: conversation responses and room descriptions - uint vgaSpriteId = getVarOrByte(); - uint color = getVarOrByte(); - uint stringId = getVarOrByte(); - uint speechId = 0; - TextLocation *tl; - - const char *string_ptr = (const char *)getStringPtrByID(_longText[stringId]); - if (getFeatures() & GF_TALKIE) - speechId = _longSound[stringId]; - - if (getGameType() == GType_FF || getGameType() == GType_PP) - vgaSpriteId = 1; - tl = getTextLocation(vgaSpriteId); - - if (_speech && speechId != 0) - playSpeech(speechId, vgaSpriteId); - if (string_ptr != NULL && _subtitles) - printScreenText(vgaSpriteId, color, string_ptr, tl->x, tl->y, tl->width); -} - -void AGOSEngine::o_mouseOn() { - // 180: force mouseOn - scriptMouseOn(); -} - -void AGOSEngine::o_unloadZone() { - // 184: clear vgapointer entry - uint a = getVarOrWord(); - VgaPointersEntry *vpe = &_vgaBufferPointers[a]; - - vpe->sfxFile = NULL; - vpe->vgaFile1 = NULL; - vpe->vgaFile2 = NULL; -} - -void AGOSEngine::o_unfreezeZones() { - // 186: vga pointer op 3 - unfreezeBottom(); -} - // ----------------------------------------------------------------------- byte AGOSEngine::getByte() { |