Ticket #8612: kyra2_intro2.diff

File kyra2_intro2.diff, 9.0 KB (added by bluegr, 17 years ago)

Improved fixes to the intro, now all of it is shown but with glitches

  • kyra2.cpp

     
    112112                        case 0:
    113113                                break;
    114114                        case 1:
    115                                 seq_playSequences(kSequenceOverview, kSequenceLibrary);
     115                                seq_playSequences(kSequenceOverview, kSequenceZanFaun);
    116116                                break;
    117117                        case 2:
    118118                                break;
  • kyra2.h

     
    3131        kSequenceTitle = 2,
    3232        kSequenceOverview = 3,
    3333        kSequenceLibrary = 4,
    34         kSequenceHand = 5
     34        kSequenceHand = 5,
     35        kSequenceZanFaun = 6
    3536};
    3637
    3738class WSAMovieV2;
     
    8788        int seq_introOverview(int seqNum);
    8889        int seq_introLibrary(int seqNum);       
    8990        int seq_introHand(int seqNum);
     91        int seq_introZanFaun(int seqNum);
    9092
    9193        void seq_introOverviewOver1(int currentFrame);
    9294        void seq_introOverviewForest(int currentFrame);
  • screen.cpp

     
    328328        fadePalette(blackPal, delay);
    329329}
    330330
     331void Screen::fadeToGrey(int delay) {
     332        debugC(9, kDebugLevelScreen, "Screen::fadeToGreyScale()");
     333        for (int i = 0; i < 256; ++i) {
     334                _currentPalette[4 * i + 0] = (_currentPalette[4 * i + 0] + _currentPalette[4 * i + 1] + _currentPalette[4 * i + 2]) / 3;
     335                _currentPalette[4 * i + 1] = _currentPalette[4 * i + 0];
     336                _currentPalette[4 * i + 2] = _currentPalette[4 * i + 0];
     337        }
     338        fadePalette(_currentPalette, delay);
     339}
     340
    331341void Screen::fadeSpecialPalette(int palIndex, int startIndex, int size, int fadeTime) {
    332342        debugC(9, kDebugLevelScreen, "fadeSpecialPalette(%d, %d, %d, %d)", palIndex, startIndex, size, fadeTime);
    333343        assert(_vm->palTable1()[palIndex]);
  • screen.h

     
    131131        void fadeFromBlack(int delay=0x54);
    132132        void fadeToBlack(int delay=0x54);
    133133
     134        void fadeToGrey(int delay=0x54);
     135
    134136        void fadeSpecialPalette(int palIndex, int startIndex, int size, int fadeTime);
    135137        void fadePalette(const uint8 *palData, int delay);
    136138
  • sequences_v2.cpp

     
    4646                {1, "title.wsa",    &KyraEngine_v2::seq_introTitle,    6,   10,  26, false, false},
    4747                {2, "over.cps",     &KyraEngine_v2::seq_introOverview, 16,  30,  1,  false, true},
    4848                {2, "library.cps",  &KyraEngine_v2::seq_introLibrary,  16,  30,  1,  false, true},
    49                 {2, "hand.cps",     &KyraEngine_v2::seq_introHand,     16,  90,  1,  false, true}
     49                {2, "hand.cps",     &KyraEngine_v2::seq_introHand,     16,  90,  1,  false, true},
     50                {1, "zanfaun.wsa",  &KyraEngine_v2::seq_introZanFaun,  16,  90,  1,  false, true}
    5051        };
    5152
    5253        assert(startSeq >= 0 && endSeq < ARRAYSIZE(sequences) && startSeq <= endSeq);
     
    137138        delete[] _activeChat;
    138139}
    139140
     141// FIXME: This part needs game dialogs, as it's not part of the intro, but
     142// rather a game video. It has speech only in the CD version
     143int KyraEngine_v2::seq_introZanFaun(int seqNum) {
     144        debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_introZanFaun(%i)", seqNum);
     145
     146        switch (seqNum) {
     147                case 0:
     148                        _sound->playTrack(8);
     149                        //XXX: palette stuff
     150                        //XXX: load dialogs
     151                        break;
     152                case 1:
     153                        seq_loadWSA(1, "zanfaun.wsa", 9);
     154                        break;
     155                case 0x294:
     156                        seq_waitForChatsToFinish();
     157                        seq_unloadWSA(1);
     158                        return 0;
     159                default:
     160                        break;
     161        }
     162
     163        return -1;
     164}
     165
    140166int KyraEngine_v2::seq_introHand(int seqNum) {
    141167        debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_introHand(%i)", seqNum);
    142         static const SequenceControl hand1bWSAControl[] = {
     168        // XXX: commented out to prevent compiler warnings
     169        /*static const SequenceControl hand1bWSAControl[] = {
    143170                {0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, {5, 6}, {6, 6}, {7, 6},
    144171                {8, 6}, {9, 6}, {10, 6}, {11, 6}, {11, 12}, {12, 12}, {13, 12},
    145172                {12, 12}, {11, 12}, {-1, -1} };
    146173       
    147174        static const SequenceControl hand1cWSAControl[] = {
    148175                {0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, {3, 6},
    149                 {4, 6}, {5, 64}, {5, 6}, {-1, -1} };
     176                {4, 6}, {5, 64}, {5, 6}, {-1, -1} };*/
    150177       
    151178        static const SequenceControl hand2WSAControl[] = {
    152179                {0, 6}, {1, 6}, {0, 6}, {1, 6}, {0, 6}, {1, 6},
    153180                {0, 6}, {1, 6}, {0, 6}, {1, 6}, {0, 6}, {1, 6},
    154                 {0, 6}, {1, 6}, {0, 6}, {1, 6}, {-1, -1} };
     181                {0, 6}, {1, 6}, {0, 6}, {1, 6}, {0, 6}, {1, 6},
     182                {0, 6}, {1, 6}, {0, 6}, {1, 6}, {0, 6}, {1, 6}, {-1, -1} };
    155183
    156184        static const SequenceControl hand3WSAControl[] = {
    157185                {0, 6}, {1, 6}, {2, 6}, {1, 6},
     186                {0, 6}, {1, 6}, {2, 6}, {1, 6},
     187                {0, 6}, {1, 6}, {2, 6}, {1, 6},
     188                {0, 6}, {1, 6}, {2, 6}, {1, 6},
     189                {0, 6}, {1, 6}, {2, 6}, {1, 6},
     190                {0, 6}, {1, 6}, {2, 6}, {1, 6},
     191                {0, 6}, {1, 6}, {2, 6}, {1, 6},
     192                {0, 6}, {1, 6}, {2, 6}, {1, 6},
     193                {0, 6}, {1, 6}, {2, 6}, {1, 6},
     194                {0, 6}, {1, 6}, {2, 6}, {1, 6},
     195                {0, 6}, {1, 6}, {2, 6}, {1, 6},
     196                {0, 6}, {1, 6}, {2, 6}, {1, 6},
    158197                {0, 6}, {-1, -1} };
    159198
    160199        static const SequenceControl hand4WSAControl[] = {
    161200                {0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6},
    162                 {3, 6}, {2, 6}, {1, 6}, {-1, -1} };
     201                {3, 6}, {2, 6}, {1, 6}, {0, 6},
     202                {0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6},
     203                {3, 6}, {2, 6}, {1, 6}, {0, 6},
     204                {0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6},
     205                {3, 6}, {2, 6}, {1, 6}, {0, 6},
     206                {0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6},
     207                {3, 6}, {2, 6}, {1, 6}, {0, 6},
     208                {0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6},
     209                {3, 6}, {2, 6}, {1, 6}, {0, 6},
     210                {0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6},
     211                {3, 6}, {2, 6}, {1, 6}, {0, 6},
     212                {0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6},
     213                {3, 6}, {2, 6}, {1, 6}, {0, 6},
     214                {0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6},
     215                {3, 6}, {2, 6}, {1, 6}, {0, 6},
     216                {-1, -1} };
    163217       
    164218        switch (seqNum) {
    165219                case 0:
     220                        seq_waitForChatsToFinish();
    166221                        _sound->playTrack(6);
    167                         seq_playIntroChat(7);
     222                        seq_playIntroChat(7); // "Luckily, the Hand was experienced in these matters"
    168223                        //palette stuff
    169224                        break;
    170225                case 1:
    171226                        // XXX: these show as garbage. New frame encode?
    172                         seq_loadWSA(1, "hand1a.wsa", 9);
     227                        /*seq_loadWSA(1, "hand1a.wsa", 9);
    173228                        seq_loadWSA(2, "hand1b.wsa", 9, 0, hand1bWSAControl);
    174                         seq_loadWSA(3, "hand1c.wsa", 9, 0, hand1cWSAControl);
     229                        seq_loadWSA(3, "hand1c.wsa", 9, 0, hand1cWSAControl);*/
    175230                        break;
    176231                case 0xc9:
    177232                        // palette stuff
    178233                        seq_loadWSA(4, "hand2.wsa", 9, 0, hand2WSAControl);
    179                         seq_playIntroChat(8);
     234                        seq_playIntroChat(8); // "and finally, a plan was approved"
    180235                        break;
    181236                case 0x18b:
    182237                        seq_waitForChatsToFinish();
    183238                        seq_loadWSA(5, "hand3.wsa", 9, 0, hand3WSAControl);
     239                        seq_playIntroChat(9); // "which required a magic anchorstone"
    184240                        break;
    185241                case 0x1f4:
    186242                        seq_waitForChatsToFinish();
    187243                        seq_loadWSA(6, "hand4.wsa", 9, 0, hand4WSAControl);
     244                        seq_playIntroChat(10); // "to be retrieved from the center of the world"
    188245                        break;
    189                 case 0x21c:
    190                         seq_playIntroChat(10);
     246                case 0x258: //0x21c:
     247                        seq_waitForChatsToFinish();
     248                        _sound->playTrack(7);
     249                        seq_loadWSA(7, "point.wsa", 9);
     250                        seq_playIntroChat(11); // "Zanthia, youngest of the royal mystics has been selected"
    191251                        break;
    192                 case 0x276:
     252                case 0x320: //0x276:
    193253                        seq_waitForChatsToFinish();
    194254                        seq_unloadWSA(1);
    195255                        seq_unloadWSA(2);       
     
    197257                        seq_unloadWSA(4);
    198258                        seq_unloadWSA(5);
    199259                        seq_unloadWSA(6);                                               
     260                        seq_unloadWSA(7);       
    200261                        return 0;
    201262        }
    202263       
     
    214275        switch (seqNum) {
    215276                case 0:
    216277                        _sound->playTrack(5);
    217                         seq_playIntroChat(4);
     278                        seq_playIntroChat(4); // "The royal mystics are baffled"
    218279                        //XXX: palette stuff
    219280                        break;
    220281                case 1:
     
    227288                        seq_loadWSA(2, "darm.wsa", 9);
    228289                        break;
    229290                case 0x68:
    230                         seq_playIntroChat(5);
     291                        seq_playIntroChat(5);  // "Every reference has been consulted"
    231292                        break;
    232293                case 0xF0:
    233294                        seq_waitForChatsToFinish();
     
    236297                case 0x154:
    237298                        // palette stuff
    238299                        seq_loadWSA(4, "marco.wsa", 9);
    239                         seq_playIntroChat(6);
     300                        seq_playIntroChat(6); // "Even Marko and his new valet have been allowed"
    240301                        break;
    241302                case 0x294:
    242303                        seq_waitForChatsToFinish();
     
    266327                        seq_loadWSA(2, "over2.wsa", 9);
    267328                        break;
    268329                case 120:
    269                         seq_playIntroChat(0);
     330                        seq_playIntroChat(0); // "Kyrandia is disappearing!"
    270331                        break;
    271332                case 200:
    272333                        seq_waitForChatsToFinish();
    273334                        // XXX: fade to grey
     335                        //_screen->fadeToGrey(40);
    274336                        break;
    275337                case 201:
    276338                        // XXX
    277339                        break;
    278340                case 282:
    279341                        seq_loadWSA(3, "forest.wsa", 6,  &KyraEngine_v2::seq_introOverviewForest);
    280                         seq_playIntroChat(1);
     342                        seq_playIntroChat(1); // "Rock by rock..."
    281343                        break;
    282344                case 434:
    283345                        seq_loadWSA(4, "dragon.wsa", 6,  &KyraEngine_v2::seq_introOverviewDragon);
     
    311373                seq_waitForChatsToFinish();
    312374        else if(currentFrame == 12) {
    313375                delay(25);
    314                 seq_playIntroChat(2);
     376                seq_playIntroChat(2); // "...and tree by tree..."
    315377        }
    316378}
    317379
     
    319381        debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_introOverviewDragon(%i)", currentFrame);
    320382       
    321383        if (currentFrame == 3)
    322                 seq_playIntroChat(3);
     384                seq_playIntroChat(3); // "Kyrandia ceases to exist!"
    323385        else if(currentFrame == 11)
    324386                seq_waitForChatsToFinish();
    325387}