Ticket #8769: sequencesFlags.patch
File sequencesFlags.patch, 11.5 KB (added by , 17 years ago) |
---|
-
kyra_v2.h
232 232 void seq_printCreditsString(uint16 strIndex, int x, int y, uint8 * colorMap, uint8 textcolor); 233 233 void seq_playWsaSyncDialogue(uint16 strIndex, uint16 vocIndex, int textColor, int x, int y, int width, 234 234 WSAMovieV2 * wsa, int firstframe, int lastframe, int wsaXpos, int wsaYpos); 235 int seq_generateFixedRandomValue(int rangeFirst, int rangeLast);236 235 void seq_showStarcraftLogo(); 237 236 238 237 void seq_init(); … … 875 874 int _seqFrameCounter; 876 875 int _seqWsaCurrentFrame; 877 876 bool _seqSpecialFlag; 878 int _seqRandomizeBase;879 877 bool _seqSubframePlaying; 880 878 uint8 _seqTextColor[2]; 881 879 uint8 _seqTextColorMap[16]; -
sequences_v2.cpp
420 420 421 421 case 354: 422 422 case 434: 423 if (!((_seqFrameCounter == 354 && !_flags.isTalkie) || (_seqFrameCounter == 434 && _flags.isTalkie)))423 if (!((_seqFrameCounter == 354 && (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)) || (_seqFrameCounter == 434 && _flags.platform == Common::kPlatformPC))) 424 424 break; 425 425 426 426 seq_resetActiveWSA(0); … … 429 429 430 430 case 400: 431 431 case 540: 432 if (!((_seqFrameCounter == 400 && !_flags.isTalkie) || (_seqFrameCounter == 540 && _flags.isTalkie)))432 if (!((_seqFrameCounter == 400 && (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)) || (_seqFrameCounter == 540 && _flags.platform == Common::kPlatformPC))) 433 433 break; 434 434 435 435 seq_waitForTextsTimeout(); … … 503 503 504 504 case 480: 505 505 case 660: 506 if (!((_seqFrameCounter == 480 && !_flags.isTalkie) || (_seqFrameCounter == 660 && _flags.isTalkie)))506 if (!((_seqFrameCounter == 480 && (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)) || (_seqFrameCounter == 660 && _flags.platform == Common::kPlatformPC))) 507 507 break; 508 508 509 509 _screen->copyPage(2, 12); … … 560 560 561 561 case 260: 562 562 case 395: 563 if (!((_seqFrameCounter == 260 && !_flags.isTalkie) || (_seqFrameCounter == 395 && _flags.isTalkie)))563 if (!((_seqFrameCounter == 260 && (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)) || (_seqFrameCounter == 395 && _flags.platform == Common::kPlatformPC))) 564 564 break; 565 565 566 566 seq_waitForTextsTimeout(); … … 571 571 572 572 case 365: 573 573 case 500: 574 if (!((_seqFrameCounter == 365 && !_flags.isTalkie) || (_seqFrameCounter == 500 && _flags.isTalkie)))574 if (!((_seqFrameCounter == 365 && (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)) || (_seqFrameCounter == 500 && _flags.platform == Common::kPlatformPC))) 575 575 break; 576 576 577 577 seq_waitForTextsTimeout(); … … 581 581 582 582 case 405: 583 583 case 540: 584 if (!((_seqFrameCounter == 405 && !_flags.isTalkie) || (_seqFrameCounter == 540 && _flags.isTalkie)))584 if (!((_seqFrameCounter == 405 && (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)) || (_seqFrameCounter == 540 && _flags.platform == Common::kPlatformPC))) 585 585 break; 586 586 587 587 seq_playTalkText(10); … … 589 589 590 590 case 484: 591 591 case 630: 592 if (!((_seqFrameCounter == 484 && !_flags.isTalkie) || (_seqFrameCounter == 630 && _flags.isTalkie)))592 if (!((_seqFrameCounter == 484 && (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)) || (_seqFrameCounter == 630 && _flags.platform == Common::kPlatformPC))) 593 593 break; 594 594 595 595 seq_waitForTextsTimeout(); … … 660 660 if (_flags.isTalkie) { 661 661 seq_playWsaSyncDialogue(21, 13, -1, 140, 70, 160, wsaObj, 0, 8, x, y); 662 662 } else { 663 seq_setTextEntry(21, 140, 70, 20 , 160);663 seq_setTextEntry(21, 140, 70, 200, 160); 664 664 _seqFrameDelay = 200; 665 665 } 666 666 break; … … 699 699 700 700 case 20: 701 701 if (!_flags.isTalkie) { 702 seq_setTextEntry(18, 160, 50, _sequenceStringsDuration[17], 160); 702 seq_waitForTextsTimeout(); 703 seq_setTextEntry(18, 160, 50, _sequenceStringsDuration[18], 160); 703 704 _seqFrameDelay = 200; 704 705 } 705 706 break; 706 707 707 case 19:708 708 case 26: 709 709 seq_waitForTextsTimeout(); 710 710 break; … … 838 838 _seqTextColor[0] = 1; 839 839 840 840 if (_flags.isTalkie) { 841 if (_flags.lang == Common::FR_FRA) { 842 chatX = 84; 843 chatY = 70; 844 } else { 845 chatX = 88; 846 chatY = 78; 847 } 841 chatY = (_flags.lang == Common::FR_FRA) ? 70 : 78; 848 842 chatFirstFrame = 9; 849 843 chatLastFrame = 15; 850 844 voiceIndex = 34; 851 845 } else { 852 chatX = 88; 853 chatY = 70; 846 chatY = (_flags.lang == Common::FR_FRA) ? 78 : 70; 854 847 chatFirstFrame = 0; 855 848 chatLastFrame = 8; 856 849 } 850 chatX = (_flags.lang == Common::FR_FRA) ? 84 : 88; 857 851 chatW = 100; 858 852 859 853 seq_playWsaSyncDialogue(22, voiceIndex, 187, chatX, chatY, chatW, wsaObj, chatFirstFrame, chatLastFrame, x, y); … … 866 860 867 861 _seqFrameDelay = 12; 868 862 863 if (_flags.lang == Common::FR_FRA) { 864 chatX = 80; 865 chatW = 112; 866 } else { 867 chatX = (_flags.lang == Common::DE_DEU) ? 84 : 96; 868 chatW = 100; 869 } 870 869 871 if (_flags.isTalkie) { 870 if (_flags.lang == Common::FR_FRA) {871 chatW = 112;872 chatX = 80;873 } else {874 chatW = 100;875 chatX = (_flags.lang == Common::DE_DEU) ? 84 : 96;876 }877 872 chatFirstFrame = 0; 878 873 chatLastFrame = 8; 879 874 voiceIndex = 35; 880 } else { 881 chatX = 96; 882 chatW = 100; 875 } else { 883 876 chatFirstFrame = 9; 884 877 chatLastFrame = 15; 885 878 } … … 958 951 seq_playTalkText(_flags.isTalkie ? 23 : 19); 959 952 _seqFrameDelay = _flags.isTalkie ? 20 : 16; 960 953 961 if (_flags.isTalkie) { 962 if (_flags.lang == Common::FR_FRA) { 963 chatY = 48; 964 chatW = 88; 965 } else { 966 chatY = 60; 967 chatW = 100; 968 } 969 voiceIndex = 36; 954 if (_flags.lang == Common::FR_FRA) { 955 chatY = 48; 956 chatW = 88; 970 957 } else { 971 958 chatY = 60; 972 959 chatW = 100; 973 960 } 974 961 chatX = 60; 975 962 963 if (_flags.isTalkie) 964 voiceIndex = 36; 965 976 966 seq_playWsaSyncDialogue(25, voiceIndex, 143, chatX, chatY, chatW, wsaObj, 16, 25, x, y); 977 967 _seqFrameDelay = 16; 978 968 break; … … 1033 1023 break; 1034 1024 1035 1025 case 29: 1026 chatX = (_flags.lang == Common::DE_DEU) ? 82 : ((_flags.lang == Common::FR_FRA) ? 92 : 88); 1027 chatY = 40; 1028 chatW = 100; 1029 1036 1030 if (_flags.isTalkie) { 1037 if (_flags.lang == Common::DE_DEU) { 1038 chatX = 82; 1031 if (_flags.lang == Common::DE_DEU) 1039 1032 chatY = 35; 1040 } else {1041 chatX = (_flags.lang == Common::FR_FRA) ? 92 : 88;1042 chatY = 40;1043 }1044 1033 voiceIndex = 38; 1045 } else {1046 chatX = 88;1047 chatY = 40;1048 1034 } 1049 chatW = 100;1050 1035 1051 1036 seq_playWsaSyncDialogue(27, voiceIndex, 187, chatX, chatY, chatW, wsaObj, 28, 34, x, y); 1052 1037 break; … … 1113 1098 case 2: 1114 1099 seq_playTalkText(_flags.isTalkie ? 25 : 21); 1115 1100 1101 if (_flags.lang == Common::FR_FRA) { 1102 chatX = 92; 1103 chatY = 72; 1104 } else { 1105 chatX = (_flags.lang == Common::DE_DEU) ? 90 : 98; 1106 chatY = 84; 1107 } 1108 1116 1109 if (_flags.isTalkie) { 1117 if (_flags.lang == Common::FR_FRA) {1118 chatX = 92;1119 chatY = 72;1120 } else {1121 chatX = (_flags.lang == Common::DE_DEU) ? 90 : 98;1122 chatY = 84;1123 }1124 1110 chatFirstFrame = 8; 1125 1111 chatLastFrame = 9; 1126 1112 voiceIndex = 39; 1127 1113 } else { 1128 chatX = 98;1129 chatY = 84;1130 1114 chatFirstFrame = 2; 1131 1115 chatLastFrame = -8; 1132 1116 } … … 1197 1181 if (!_flags.isTalkie) 1198 1182 seq_playTalkText(14); 1199 1183 1184 chatX = 90; 1185 chatY = 30; 1186 chatW = 100; 1187 1200 1188 if (_flags.isTalkie) { 1201 1189 if (_flags.lang == Common::FR_FRA || _flags.lang == Common::DE_DEU) { 1202 1190 chatX = 75; 1203 1191 chatY = 25; 1204 } else {1205 chatX = 90;1206 chatY = 30;1207 1192 } 1208 1193 voiceIndex = 40; 1209 } else {1210 chatX = 90;1211 chatY = 30;1212 1194 } 1213 chatW = 100;1214 1195 1215 1196 seq_playWsaSyncDialogue(29, voiceIndex, 150, chatX, chatY, chatW, wsaObj, 12, -21, x, y); 1216 1197 break; … … 1271 1252 1272 1253 if (_flags.isTalkie) { 1273 1254 chatX = 82; 1274 chatY = (_flags.lang == Common::FR_FRA || _flags.lang == Common::DE_DEU) ? 88 :100;1275 1255 textCol = 143; 1276 1256 chatFirstFrame = 16; 1277 1257 chatLastFrame = 21; 1278 1258 voiceIndex = 41; 1279 1259 } else { 1280 1260 chatX = 62; 1281 chatY = 100;1282 1261 textCol = 137; 1283 1262 chatFirstFrame = 9; 1284 1263 chatLastFrame = 13; 1285 1264 } 1265 chatY = (_flags.lang == Common::FR_FRA || _flags.lang == Common::DE_DEU) ? 88 :100; 1286 1266 chatW = 80; 1287 1267 1288 1268 seq_playWsaSyncDialogue(30, voiceIndex, 137, chatX, chatY, chatW, wsaObj, chatFirstFrame, chatLastFrame, x, y); … … 1369 1349 1370 1350 seq_playTalkText(_flags.isTalkie ? 31 : 27); 1371 1351 1372 if (_flags.isTalkie) { 1373 if (_flags.lang == Common::DE_DEU) { 1374 chatX = 82; 1375 chatY = 84; 1376 chatW = 140; 1377 } else { 1378 chatX = 74; 1379 chatY = (_flags.lang == Common::FR_FRA) ? 96: 108; 1380 chatW = 80; 1381 } 1382 voiceIndex = 43; 1352 if (_flags.lang == Common::DE_DEU) { 1353 chatX = 82; 1354 chatY = 84; 1355 chatW = 140; 1383 1356 } else { 1384 1357 chatX = 74; 1385 chatY = 108;1358 chatY = (_flags.lang == Common::FR_FRA) ? 96: 108; 1386 1359 chatW = 80; 1387 1360 } 1388 1361 1362 if (_flags.isTalkie) 1363 voiceIndex = 43; 1364 1389 1365 seq_playWsaSyncDialogue(32, voiceIndex, 137, chatX, chatY, chatW, wsaObj, 14, 16, x, y); 1390 1366 break; 1391 1367 … … 1398 1374 break; 1399 1375 1400 1376 case 31: 1401 if (_flags.isTalkie) { 1402 chatY = (_flags.lang == Common::DE_DEU) ? 60 : 76; 1377 if (_flags.isTalkie) 1403 1378 voiceIndex = 44; 1404 } else { 1405 chatY = 76; 1406 } 1379 1407 1380 chatX = 90; 1381 chatY = (_flags.lang == Common::DE_DEU) ? 60 : 76; 1408 1382 chatW = 80; 1409 1383 1410 1384 seq_playWsaSyncDialogue(33, voiceIndex, 143, chatX, chatY, chatW, wsaObj, 31, 34, x, y); … … 1440 1414 // if (_flags.isTalkie) 1441 1415 // seq_finaleActorScreen(); 1442 1416 _seqSpecialFlag = _flags.isTalkie; 1443 _seqRandomizeBase = 1;1444 1417 break; 1445 1418 1446 1419 case 0: … … 1458 1431 if (_seqFrameCounter < 20 && _seqSpecialFlag) { 1459 1432 _seqWsaCurrentFrame = 0; 1460 1433 } else { 1461 _seqFrameDelay = _flags.isTalkie ? 500 : (300 + seq_generateFixedRandomValue(1, 300));1434 _seqFrameDelay = _flags.isTalkie ? 500 : (300 + _rnd.getRandomNumberRng(1, 300)); 1462 1435 seq_playTalkText(_flags.isTalkie ? 26 : 22); 1463 1436 if (_seqSpecialFlag) { 1464 1437 _seqFrameCounter = 3; … … 1473 1446 1474 1447 case 3: 1475 1448 seq_playTalkText(_flags.isTalkie ? 27 : 23); 1476 _seqFrameDelay = _flags.isTalkie ? 500 : (300 + seq_generateFixedRandomValue(1, 300));1449 _seqFrameDelay = _flags.isTalkie ? 500 : (300 + _rnd.getRandomNumberRng(1, 300)); 1477 1450 break; 1478 1451 1479 1452 case 4: … … 1484 1457 seq_playTalkText(_flags.isTalkie ? 27 : 23); 1485 1458 tmp = _seqFrameCounter / 6; 1486 1459 if (tmp == 2) 1487 _seqFrameDelay = _flags.isTalkie ? 7 : (1 + seq_generateFixedRandomValue(1, 10));1460 _seqFrameDelay = _flags.isTalkie ? 7 : (1 + _rnd.getRandomNumberRng(1, 10)); 1488 1461 else if (tmp < 2) 1489 _seqFrameDelay = _flags.isTalkie ? 500 : (300 + seq_generateFixedRandomValue(1, 300));1462 _seqFrameDelay = _flags.isTalkie ? 500 : (300 + _rnd.getRandomNumberRng(1, 300)); 1490 1463 break; 1491 1464 1492 1465 case 6: … … 2127 2100 _seqWsaCurrentFrame = curframe; 2128 2101 } 2129 2102 2130 int KyraEngine_v2::seq_generateFixedRandomValue(int rangeFirst, int rangeLast) {2131 int result = 0;2132 if (rangeFirst > rangeFirst)2133 SWAP(rangeFirst, rangeLast);2134 int range = (rangeLast - rangeFirst) + 1;2135 2136 do {2137 _seqRandomizeBase = _seqRandomizeBase * 1103515245 + 12345;2138 result = ((range * ((_seqRandomizeBase % 0x7fffffff) & 0x7fff)) / 32768) + rangeFirst;2139 } while (rangeLast < result);2140 2141 return result;2142 }2143 2144 2103 void KyraEngine_v2::seq_showStarcraftLogo() { 2145 2104 WSAMovieV2 * ci = new WSAMovieV2(this); 2146 2105 assert(ci);