Ticket #8561: sequences_v2.cpp

File sequences_v2.cpp, 2.3 KB (added by eriktorbjorn, 18 years ago)

New file for Kyra 2 sequences

Line 
1/* ScummVM - Scumm Interpreter
2 * Copyright (C) 2005-2006 The ScummVM project
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 *
18 * $URL$
19 * $Id$
20 *
21 */
22
23#include "kyra/kyra.h"
24#include "kyra/kyra2.h"
25#include "kyra/screen.h"
26#include "kyra/wsamovie.h"
27
28#include "common/system.h"
29
30namespace Kyra {
31
32void KyraEngine_v2::seq_menu() {
33 debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_menu()");
34
35 _screen->loadBitmap("VIRGIN.CPS", 7, 7, _screen->_currentPalette);
36 _screen->copyRegion(0, 0, 0, 0, 320, 200, 6, 0);
37 _screen->updateScreen();
38 _screen->fadeFromBlack();
39 delay(60 * _tickLength);
40 _screen->fadeToBlack();
41 _screen->clearCurPage();
42
43 if (_quitFlag)
44 return;
45
46 uint8 pal[768];
47 int i;
48 WSAMovieV2 *title = new WSAMovieV2(this);
49 title->setDrawPage(0);
50
51 title->open("WESTWOOD.WSA", 0, pal);
52 assert(title->opened());
53
54 title->setX(0); title->setY(0);
55 title->displayFrame(0);
56 _screen->updateScreen();
57 _screen->fadePalette(pal, 0x54);
58
59 for (i = 1; i < 18 && !_quitFlag; ++i) {
60 uint32 nextRun = _system->getMillis() + 6 * _tickLength;
61 title->displayFrame(i);
62 _screen->updateScreen();
63 delayUntil(nextRun);
64 }
65
66 title->close();
67
68 _screen->fadeToBlack();
69 _screen->clearCurPage();
70
71 if (_quitFlag) {
72 delete title;
73 return;
74 }
75
76 title->open("TITLE.WSA", 0, pal);
77 assert(title->opened());
78
79 title->setX(0); title->setY(0);
80 title->displayFrame(0);
81 _screen->updateScreen();
82 _screen->fadePalette(pal, 0x54);
83
84 for (i = 1; i < 26 && !_quitFlag; ++i) {
85 uint32 nextRun = _system->getMillis() + 6 * _tickLength;
86 title->displayFrame(i);
87 _screen->updateScreen();
88 delayUntil(nextRun);
89 }
90
91 title->close();
92
93 delete title;
94}
95
96} // end of namespace Kyra