2007-05-30 21:56:52 +00:00
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers , whose names
* are too numerous to list here . Please refer to the COPYRIGHT
* file distributed with this source distribution .
2007-01-14 21:29:12 +00:00
*
* This program is free software ; you can redistribute it and / or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation ; either version 2
* of the License , or ( at your option ) any later version .
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software
* Foundation , Inc . , 51 Franklin Street , Fifth Floor , Boston , MA 02110 - 1301 , USA .
*
* $ URL $
* $ Id $
*
*/
2007-04-07 10:02:59 +00:00
# include "common/stdafx.h"
# include "common/system.h"
# include "common/file.h"
2007-07-29 16:42:29 +00:00
# include "graphics/primitives.h" // for Graphics::drawLine
2007-01-14 21:29:12 +00:00
# include "parallaction/parallaction.h"
# include "parallaction/menu.h"
2007-05-01 16:21:16 +00:00
# include "parallaction/sound.h"
2007-05-13 14:38:05 +00:00
2007-01-14 21:29:12 +00:00
namespace Parallaction {
2007-07-29 16:42:29 +00:00
/*
game callables data members
*/
2007-01-14 21:29:12 +00:00
2007-07-29 17:06:23 +00:00
static Zone * _moveSarcZone0 = NULL ;
static int16 _introSarcData1 = 0 ;
static Zone * _moveSarcZone1 = NULL ;
2007-01-14 21:29:12 +00:00
2007-07-29 16:42:29 +00:00
// part completion messages
static const char * endMsg0 [ ] = { " COMPLIMENTI! " , " BRAVO! " , " CONGRATULATIONS! " , " PRIMA! " } ;
static const char * endMsg1 [ ] = { " HAI FINITO QUESTA PARTE " , " TU AS COMPLETE' CETTE AVENTURE " , " YOU HAVE COMPLETED THIS PART " , " DU HAST EIN ABENTEUER ERFOLGREICH " } ;
static const char * endMsg2 [ ] = { " ORA COMPLETA IL RESTO " , " AVEC SUCCES. " , " NOW GO ON WITH THE REST OF " , " ZU ENDE GEFUHRT " } ;
static const char * endMsg3 [ ] = { " DELL' AVVENTURA " , " CONTINUE AVEC LES AUTRES " , " THIS ADVENTURE " , " MACH' MIT DEN ANDEREN WEITER " } ;
// game completion messages
static const char * endMsg4 [ ] = { " COMPLIMENTI! " , " BRAVO! " , " CONGRATULATIONS! " , " PRIMA! " } ;
static const char * endMsg5 [ ] = { " HAI FINITO LE TRE PARTI " , " TU AS COMPLETE' LES TROIS PARTIES " , " YOU HAVE COMPLETED THE THREE PARTS " , " DU HAST DREI ABENTEURE ERFOLGREICH " } ;
static const char * endMsg6 [ ] = { " DELL' AVVENTURA " , " DE L'AVENTURE " , " OF THIS ADVENTURE " , " ZU ENDE GEFUHRT " } ;
static const char * endMsg7 [ ] = { " ED ORA IL GRAN FINALE " , " ET MAINTENANT LE GRAND FINAL " , " NOW THE GREAT FINAL " , " UND YETZT DER GROSSE SCHLUSS! " } ;
2007-01-14 21:29:12 +00:00
2007-07-29 16:42:29 +00:00
static uint16 num_foglie = 0 ;
2007-01-14 21:29:12 +00:00
static Zone * _moveSarcZones [ 5 ] ;
static Zone * _moveSarcExaZones [ 5 ] ;
2007-07-29 16:42:29 +00:00
/*
intro callables data members
*/
static Animation * _rightHandAnim ;
static uint16 _rightHandPositions [ 684 ] = {
0x0064 , 0x0046 , 0x006c , 0x0046 , 0x0074 , 0x0046 , 0x007c , 0x0046 ,
0x0084 , 0x0046 , 0x008c , 0x0046 , 0x0094 , 0x0046 , 0x009c , 0x0046 ,
0x00a4 , 0x0046 , 0x00ac , 0x0046 , 0x00b4 , 0x0046 , 0x00bc , 0x0046 ,
0x00c4 , 0x0046 , 0x00cc , 0x0046 , 0x00d4 , 0x0046 , 0x00dc , 0x0046 ,
0x00e4 , 0x0046 , 0x00ec , 0x0046 , 0x00f4 , 0x0046 , 0x00fc , 0x0046 ,
0x0104 , 0x0046 , 0x00ff , 0x0042 , 0x00ff , 0x004a , 0x00ff , 0x0052 ,
0x00ff , 0x005a , 0x00ff , 0x0062 , 0x00ff , 0x006a , 0x00ff , 0x0072 ,
0x00ff , 0x007a , 0x00ff , 0x0082 , 0x00ff , 0x008a , 0x00ff , 0x0092 ,
0x00ff , 0x009a , 0x00ff , 0x00a2 , 0x0104 , 0x0097 , 0x00fc , 0x0097 ,
0x00f4 , 0x0097 , 0x00ec , 0x0097 , 0x00e4 , 0x0097 , 0x00dc , 0x0097 ,
0x00d4 , 0x0097 , 0x00cc , 0x0097 , 0x00c4 , 0x0097 , 0x00bc , 0x0097 ,
0x00b4 , 0x0097 , 0x00ac , 0x0097 , 0x00a4 , 0x0097 , 0x009c , 0x0097 ,
0x0094 , 0x0097 , 0x008c , 0x0097 , 0x0084 , 0x0097 , 0x007c , 0x0097 ,
0x0074 , 0x0097 , 0x006c , 0x0097 , 0x0064 , 0x0097 , 0x0066 , 0x0042 ,
0x0066 , 0x004a , 0x0066 , 0x0052 , 0x0066 , 0x005a , 0x0066 , 0x0062 ,
0x0066 , 0x006a , 0x0066 , 0x0072 , 0x0066 , 0x007a , 0x0066 , 0x0082 ,
0x0066 , 0x008a , 0x0066 , 0x0092 , 0x0066 , 0x009a , 0x0066 , 0x00a2 ,
0x008c , 0x0091 , 0x0099 , 0x0042 , 0x0099 , 0x004a , 0x0099 , 0x0052 ,
0x0099 , 0x005a , 0x0099 , 0x0062 , 0x0099 , 0x006a , 0x0099 , 0x0072 ,
0x0099 , 0x007a , 0x0099 , 0x0082 , 0x0099 , 0x008a , 0x0099 , 0x0092 ,
0x0099 , 0x009a , 0x0099 , 0x00a2 , 0x00a0 , 0x004d , 0x00cc , 0x0042 ,
0x00cc , 0x004a , 0x00cc , 0x0052 , 0x00cc , 0x005a , 0x00cc , 0x0062 ,
0x00cc , 0x006a , 0x00cc , 0x0072 , 0x00cc , 0x007a , 0x00cc , 0x0082 ,
0x00cc , 0x008a , 0x00cc , 0x0092 , 0x00cc , 0x009a , 0x00cc , 0x00a2 ,
0x00ca , 0x0050 , 0x00b1 , 0x0050 , 0x0081 , 0x0052 , 0x007e , 0x0052 ,
0x007c , 0x0055 , 0x007c , 0x005c , 0x007e , 0x005e , 0x0080 , 0x005e ,
0x0082 , 0x005c , 0x0082 , 0x0054 , 0x0080 , 0x0052 , 0x0078 , 0x0052 ,
0x007c , 0x005e , 0x0077 , 0x0061 , 0x0074 , 0x006e , 0x0074 , 0x0078 ,
0x0076 , 0x007a , 0x0079 , 0x0078 , 0x0079 , 0x0070 , 0x0078 , 0x0070 ,
0x0078 , 0x006b , 0x007b , 0x0066 , 0x007a , 0x006f , 0x0084 , 0x006f ,
0x0085 , 0x0066 , 0x0086 , 0x0070 , 0x0085 , 0x0070 , 0x0085 , 0x0079 ,
0x0088 , 0x0079 , 0x008a , 0x0078 , 0x008a , 0x006c , 0x0087 , 0x0061 ,
0x0085 , 0x005f , 0x0082 , 0x005f , 0x0080 , 0x0061 , 0x007e , 0x0061 ,
0x007b , 0x005f , 0x007c , 0x006f , 0x007c , 0x0071 , 0x0079 , 0x0074 ,
0x0079 , 0x0089 , 0x0076 , 0x008c , 0x0076 , 0x008e , 0x007a , 0x008e ,
0x007f , 0x0089 , 0x007f , 0x0083 , 0x007e , 0x0083 , 0x007e , 0x0077 ,
0x0080 , 0x0077 , 0x0080 , 0x0083 , 0x0080 , 0x008b , 0x0084 , 0x0090 ,
0x0088 , 0x0090 , 0x0088 , 0x008e , 0x0085 , 0x008b , 0x0085 , 0x0074 ,
0x0082 , 0x0071 , 0x00b2 , 0x0052 , 0x00b0 , 0x0054 , 0x00b0 , 0x0056 ,
0x00ae , 0x0058 , 0x00af , 0x0059 , 0x00af , 0x005e , 0x00b2 , 0x0061 ,
0x00b5 , 0x0061 , 0x00b8 , 0x005e , 0x00b8 , 0x005a , 0x00b9 , 0x0059 ,
0x00b9 , 0x0058 , 0x00b7 , 0x0056 , 0x00b7 , 0x0054 , 0x00b5 , 0x0052 ,
0x00b2 , 0x0052 , 0x00ae , 0x005a , 0x00ab , 0x005b , 0x00ab , 0x006d ,
0x00ae , 0x0072 , 0x00b8 , 0x0072 , 0x00bc , 0x006d , 0x00bc , 0x005b ,
0x00b9 , 0x005a , 0x00bc , 0x005c , 0x00be , 0x005c , 0x00c1 , 0x005f ,
0x00c4 , 0x0067 , 0x00c4 , 0x006d , 0x00c1 , 0x0076 , 0x00c0 , 0x0077 ,
0x00bd , 0x0077 , 0x00bb , 0x0075 , 0x00bd , 0x0073 , 0x00bb , 0x0072 ,
0x00be , 0x0070 , 0x00be , 0x006a , 0x00a9 , 0x006a , 0x00a9 , 0x0070 ,
0x00ac , 0x0072 , 0x00aa , 0x0073 , 0x00ac , 0x0075 , 0x00aa , 0x0077 ,
0x00a7 , 0x0077 , 0x00a3 , 0x006d , 0x00a3 , 0x0067 , 0x00a6 , 0x005f ,
0x00a9 , 0x005c , 0x00ab , 0x005c , 0x00ac , 0x0077 , 0x00ac , 0x007c ,
0x00ab , 0x007c , 0x00ab , 0x0084 , 0x00ac , 0x0084 , 0x00ac , 0x008b ,
0x00a9 , 0x008e , 0x00a9 , 0x0090 , 0x00ae , 0x0090 , 0x00ae , 0x008d ,
0x00b2 , 0x008c , 0x00b2 , 0x0087 , 0x00b1 , 0x0086 , 0x00b1 , 0x007b ,
0x00b2 , 0x0079 , 0x00b4 , 0x0079 , 0x00b4 , 0x007d , 0x00b5 , 0x007d ,
0x00b5 , 0x0087 , 0x00b4 , 0x0087 , 0x00b4 , 0x008c , 0x00b6 , 0x008c ,
0x00b9 , 0x0091 , 0x00b4 , 0x0091 , 0x00bd , 0x008f , 0x00ba , 0x008c ,
0x00ba , 0x0083 , 0x00bb , 0x0082 , 0x00bb , 0x0075 , 0x00cc , 0x006e ,
0x00d4 , 0x006c , 0x00db , 0x0069 , 0x00d9 , 0x0068 , 0x00d9 , 0x0064 ,
0x00dc , 0x0064 , 0x00dc , 0x0060 , 0x00df , 0x0056 , 0x00e5 , 0x0052 ,
0x00e7 , 0x0052 , 0x00ec , 0x0056 , 0x00ef , 0x005d , 0x00f1 , 0x0065 ,
0x00f3 , 0x0064 , 0x00f3 , 0x0069 , 0x00f0 , 0x0069 , 0x00ec , 0x0065 ,
0x00ec , 0x005e , 0x00e9 , 0x005f , 0x00e9 , 0x005a , 0x00e7 , 0x0058 ,
0x00e4 , 0x0058 , 0x00e3 , 0x0054 , 0x00e3 , 0x0058 , 0x00e1 , 0x005c ,
0x00e4 , 0x0061 , 0x00e7 , 0x0061 , 0x00e9 , 0x005f , 0x00eb , 0x005d ,
0x00e4 , 0x0062 , 0x00e0 , 0x0064 , 0x00e0 , 0x0069 , 0x00e2 , 0x006b ,
0x00e0 , 0x0072 , 0x00e0 , 0x0077 , 0x00ec , 0x0077 , 0x00ec , 0x0071 ,
0x00ea , 0x006b , 0x00ec , 0x006a , 0x00ec , 0x0063 , 0x00e7 , 0x0063 ,
0x00e7 , 0x0065 , 0x00e1 , 0x0069 , 0x00e3 , 0x0068 , 0x00e6 , 0x0069 ,
0x00ec , 0x005e , 0x00ea , 0x006b , 0x00e7 , 0x006b , 0x00e7 , 0x006a ,
0x00e5 , 0x006a , 0x00e5 , 0x006b , 0x00e2 , 0x006b , 0x00df , 0x006c ,
0x00dc , 0x006f , 0x00dc , 0x0071 , 0x00da , 0x0073 , 0x00d8 , 0x0073 ,
0x00d8 , 0x006f , 0x00dc , 0x006b , 0x00dc , 0x0069 , 0x00dd , 0x0068 ,
0x00ef , 0x0068 , 0x00f0 , 0x0069 , 0x00f0 , 0x006b , 0x00f4 , 0x006f ,
0x00f4 , 0x0072 , 0x00f3 , 0x0073 , 0x00f2 , 0x0073 , 0x00f0 , 0x0071 ,
0x00f0 , 0x006f , 0x00ec , 0x006b , 0x00ec , 0x007a , 0x00eb , 0x007b ,
0x00eb , 0x007f , 0x00ec , 0x0080 , 0x00ec , 0x0084 , 0x00eb , 0x0085 ,
0x00eb , 0x008b , 0x00ec , 0x008c , 0x00ec , 0x008f , 0x00ed , 0x0091 ,
0x00e9 , 0x0091 , 0x00e9 , 0x008f , 0x00e7 , 0x008d , 0x00e7 , 0x0090 ,
0x00e7 , 0x0089 , 0x00e8 , 0x0088 , 0x00e8 , 0x0086 , 0x00e7 , 0x0085 ,
0x00e7 , 0x007d , 0x00e6 , 0x007c , 0x00e6 , 0x0078 , 0x00e5 , 0x007d ,
0x00e5 , 0x0085 , 0x00e4 , 0x0086 , 0x00e4 , 0x0088 , 0x00e5 , 0x0089 ,
0x00e5 , 0x0090 , 0x00e5 , 0x008b , 0x00e3 , 0x0091 , 0x00df , 0x0091 ,
0x00e0 , 0x0090 , 0x00e0 , 0x008c , 0x00e2 , 0x008b , 0x00e1 , 0x0085 ,
0x00e0 , 0x0084 , 0x00e0 , 0x0080 , 0x00e1 , 0x007f , 0x00e1 , 0x007c ,
0x00e0 , 0x007b , 0x00e0 , 0x0077
} ;
struct Credit {
const char * _role ;
const char * _name ;
} _credits [ ] = {
{ " Music and Sound Effects " , " MARCO CAPRELLI " } ,
{ " PC Version " , " RICCARDO BALLARINO " } ,
{ " Project Manager " , " LOVRANO CANEPA " } ,
{ " Production " , " BRUNO BOZ " } ,
{ " Special Thanks to " , " LUIGI BENEDICENTI - GILDA and DANILO " } ,
{ " Copyright 1992 Euclidea s.r.l ITALY " , " All rights reserved " }
} ;
/*
game callables
*/
2007-07-29 17:02:08 +00:00
void Parallaction_ns : : _c_null ( void * parm ) {
2007-01-14 21:29:12 +00:00
return ;
}
2007-07-29 17:02:08 +00:00
void Parallaction_ns : : _c_play_boogie ( void * parm ) {
2007-01-14 21:29:12 +00:00
static uint16 flag = 1 ;
2007-02-17 15:37:49 +00:00
if ( flag = = 0 )
return ;
2007-01-14 21:29:12 +00:00
flag = 0 ;
2007-07-29 17:06:23 +00:00
_soundMan - > setMusicFile ( " boogie2 " ) ;
_soundMan - > playMusic ( ) ;
2007-01-14 21:29:12 +00:00
return ;
}
2007-07-29 17:02:08 +00:00
void Parallaction_ns : : _c_score ( void * parm ) {
2007-01-14 21:29:12 +00:00
_score + = 5 ;
return ;
}
2007-07-29 17:02:08 +00:00
void Parallaction_ns : : _c_fade ( void * parm ) {
2007-06-15 21:40:02 +00:00
2007-08-09 18:02:37 +00:00
Palette pal ;
_gfx - > setPalette ( pal ) ;
2007-06-15 21:40:02 +00:00
2007-01-14 21:29:12 +00:00
for ( uint16 _di = 0 ; _di < 64 ; _di + + ) {
2007-08-09 18:02:37 +00:00
pal . fadeTo ( _gfx - > _palette , 1 ) ;
2007-07-29 17:06:23 +00:00
_gfx - > setPalette ( pal ) ;
2007-01-14 21:29:12 +00:00
2007-07-29 17:06:23 +00:00
_gfx - > updateScreen ( ) ;
2007-07-31 19:33:36 +00:00
g_system - > delayMillis ( 20 ) ;
2007-05-13 12:39:32 +00:00
}
2007-01-14 21:29:12 +00:00
return ;
}
2007-07-29 16:42:29 +00:00
2007-01-14 21:29:12 +00:00
2007-07-29 17:02:08 +00:00
void Parallaction_ns : : _c_moveSarc ( void * parm ) {
2007-01-14 21:29:12 +00:00
Animation * a ;
if ( _introSarcData2 ! = 0 ) {
_introSarcData2 = 0 ;
if ( _moveSarcZones [ 0 ] = = NULL ) {
2007-07-29 17:06:23 +00:00
_moveSarcZones [ 0 ] = findZone ( " sarc1 " ) ;
_moveSarcZones [ 1 ] = findZone ( " sarc2 " ) ;
_moveSarcZones [ 2 ] = findZone ( " sarc3 " ) ;
_moveSarcZones [ 3 ] = findZone ( " sarc4 " ) ;
_moveSarcZones [ 4 ] = findZone ( " sarc5 " ) ;
2007-03-18 19:35:54 +00:00
2007-07-29 17:06:23 +00:00
_moveSarcExaZones [ 0 ] = findZone ( " sarc1exa " ) ;
_moveSarcExaZones [ 1 ] = findZone ( " sarc2exa " ) ;
_moveSarcExaZones [ 2 ] = findZone ( " sarc3exa " ) ;
_moveSarcExaZones [ 3 ] = findZone ( " sarc4exa " ) ;
_moveSarcExaZones [ 4 ] = findZone ( " sarc5exa " ) ;
2007-01-14 21:29:12 +00:00
}
2007-07-29 17:06:23 +00:00
a = findAnimation ( " sposta " ) ;
2007-01-14 21:29:12 +00:00
_moveSarcZone1 = ( Zone * ) parm ;
for ( uint16 _si = 0 ; _si < 5 ; _si + + ) {
if ( _moveSarcZones [ _si ] = = _moveSarcZone1 ) {
_moveSarcZone0 = _moveSarcExaZones [ _si ] ;
}
}
2007-03-17 19:48:48 +00:00
_introSarcData1 = _introSarcData3 - _moveSarcZone1 - > _left ;
2007-01-14 21:29:12 +00:00
a - > _z = _introSarcData3 ;
2007-03-17 19:48:48 +00:00
a - > _frame = _moveSarcZone1 - > _top - ( _introSarcData1 / 20 ) ;
_introSarcData3 = _moveSarcZone1 - > _left ;
2007-01-14 21:29:12 +00:00
if ( _introSarcData1 > 0 ) {
2007-03-19 21:49:41 +00:00
a - > _left = _introSarcData1 / 2 ;
2007-01-14 21:29:12 +00:00
} else {
2007-03-19 21:49:41 +00:00
a - > _left = - _introSarcData1 / 2 ;
2007-01-14 21:29:12 +00:00
}
if ( _introSarcData1 > 0 ) {
2007-03-19 21:49:41 +00:00
a - > _top = 2 ;
2007-01-14 21:29:12 +00:00
} else {
2007-03-19 21:49:41 +00:00
a - > _top = - 2 ;
2007-01-14 21:29:12 +00:00
}
return ;
}
_introSarcData2 = 1 ;
2007-03-17 21:06:19 +00:00
_moveSarcZone1 - > translate ( _introSarcData1 , - _introSarcData1 / 20 ) ;
_moveSarcZone0 - > translate ( _introSarcData1 , - _introSarcData1 / 20 ) ;
2007-01-14 21:29:12 +00:00
2007-03-17 19:48:48 +00:00
if ( _moveSarcZones [ 0 ] - > _left = = 35 & &
_moveSarcZones [ 1 ] - > _left = = 68 & &
_moveSarcZones [ 2 ] - > _left = = 101 & &
_moveSarcZones [ 3 ] - > _left = = 134 & &
_moveSarcZones [ 4 ] - > _left = = 167 ) {
2007-01-14 21:29:12 +00:00
2007-07-29 17:06:23 +00:00
a = findAnimation ( " finito " ) ;
2007-01-14 21:29:12 +00:00
2007-03-19 21:49:41 +00:00
a - > _flags | = ( kFlagsActive | kFlagsActing ) ;
2007-07-29 17:06:23 +00:00
_localFlags [ _currentLocationIndex ] | = 0x20 ; // GROSS HACK: activates 'finito' flag in dinoit_museo.loc
2007-01-14 21:29:12 +00:00
}
return ;
}
2007-07-29 16:42:29 +00:00
2007-01-14 21:29:12 +00:00
2007-07-29 17:02:08 +00:00
void Parallaction_ns : : _c_contaFoglie ( void * parm ) {
2007-01-14 21:29:12 +00:00
num_foglie + + ;
2007-02-17 15:37:49 +00:00
if ( num_foglie ! = 6 )
return ;
2007-01-14 21:29:12 +00:00
_commandFlags | = 0x1000 ;
return ;
}
2007-07-29 17:02:08 +00:00
void Parallaction_ns : : _c_zeroFoglie ( void * parm ) {
2007-01-14 21:29:12 +00:00
num_foglie = 0 ;
return ;
}
2007-07-29 17:02:08 +00:00
void Parallaction_ns : : _c_trasformata ( void * parm ) {
2007-03-10 22:56:32 +00:00
_engineFlags ^ = kEngineTransformedDonna ;
2007-01-14 21:29:12 +00:00
return ;
}
2007-07-29 17:02:08 +00:00
void Parallaction_ns : : _c_offMouse ( void * parm ) {
2007-07-29 17:06:23 +00:00
showCursor ( false ) ;
2007-06-18 20:11:49 +00:00
_engineFlags | = kEngineBlockInput ;
2007-01-14 21:29:12 +00:00
return ;
}
2007-07-29 17:02:08 +00:00
void Parallaction_ns : : _c_onMouse ( void * parm ) {
2007-06-18 20:11:49 +00:00
_engineFlags & = ~ kEngineBlockInput ;
2007-07-29 17:06:23 +00:00
showCursor ( true ) ;
2007-01-14 21:29:12 +00:00
return ;
}
2007-07-29 17:02:08 +00:00
void Parallaction_ns : : _c_setMask ( void * parm ) {
2007-01-14 21:29:12 +00:00
2007-08-12 09:10:10 +00:00
memset ( _backgroundInfo - > mask . data + 3600 , 0 , 3600 ) ;
_gfx - > _bgLayers [ 1 ] = 500 ;
2007-01-14 21:29:12 +00:00
return ;
}
2007-07-29 17:02:08 +00:00
void Parallaction_ns : : _c_endComment ( void * param ) {
2007-01-14 21:29:12 +00:00
2007-08-11 17:25:57 +00:00
showLocationComment ( _location . _endComment , true ) ;
2007-03-28 20:12:00 +00:00
2007-08-09 18:02:37 +00:00
Palette pal ( _gfx - > _palette ) ;
pal . makeGrayscale ( ) ;
2007-03-28 20:12:00 +00:00
2007-07-31 19:33:36 +00:00
for ( uint di = 0 ; di < 64 ; di + + ) {
2007-08-09 18:02:37 +00:00
_gfx - > _palette . fadeTo ( pal , 1 ) ;
2007-07-31 19:33:36 +00:00
_gfx - > setPalette ( _gfx - > _palette ) ;
2007-03-28 20:12:00 +00:00
2007-07-29 17:06:23 +00:00
_gfx - > updateScreen ( ) ;
2007-07-31 19:33:36 +00:00
g_system - > delayMillis ( 20 ) ;
2007-01-14 21:29:12 +00:00
}
2007-03-28 20:12:00 +00:00
waitUntilLeftClick ( ) ;
return ;
}
2007-07-29 17:02:08 +00:00
void Parallaction_ns : : _c_frankenstein ( void * parm ) {
2007-06-15 21:40:02 +00:00
2007-08-09 18:02:37 +00:00
Palette pal0 ( _gfx - > _palette ) ;
Palette pal1 ;
2007-06-15 21:40:02 +00:00
2007-08-09 18:02:37 +00:00
for ( uint16 i = 0 ; i < = 32 ; i + + ) {
pal0 . setEntry ( i , - 1 , 0 , 0 ) ; // leaves reds unchanged while zeroing other components
2007-03-28 20:12:00 +00:00
}
2007-01-14 21:29:12 +00:00
for ( uint16 _di = 0 ; _di < 30 ; _di + + ) {
g_system - > delayMillis ( 20 ) ;
2007-08-09 18:02:37 +00:00
_gfx - > setPalette ( pal0 ) ;
2007-07-29 17:06:23 +00:00
_gfx - > updateScreen ( ) ;
2007-05-18 21:07:42 +00:00
g_system - > delayMillis ( 20 ) ;
2007-08-09 18:02:37 +00:00
_gfx - > setPalette ( pal1 ) ;
2007-07-29 17:06:23 +00:00
_gfx - > updateScreen ( ) ;
2007-01-14 21:29:12 +00:00
}
2007-07-29 17:06:23 +00:00
_gfx - > setPalette ( _gfx - > _palette ) ;
_gfx - > updateScreen ( ) ;
2007-01-14 21:29:12 +00:00
return ;
}
2007-07-29 17:02:08 +00:00
void Parallaction_ns : : _c_finito ( void * parm ) {
2007-01-14 21:29:12 +00:00
const char * * v8C = endMsg0 ;
const char * * v7C = endMsg1 ;
const char * * v6C = endMsg2 ;
const char * * v5C = endMsg3 ;
const char * * v4C = endMsg4 ;
const char * * v3C = endMsg5 ;
const char * * v2C = endMsg6 ;
const char * * v1C = endMsg7 ;
Common : : File stream ;
2007-07-29 17:06:23 +00:00
stream . open ( _characterName , Common : : File : : kFileWriteMode ) ;
2007-02-17 15:37:49 +00:00
if ( stream . isOpen ( ) )
stream . close ( ) ;
2007-01-14 21:29:12 +00:00
Common : : File streamDino , streamDough , streamDonna ;
streamDino . open ( " dino " ) ;
streamDough . open ( " dough " ) ;
streamDonna . open ( " donna " ) ;
bool gameCompleted = streamDino . isOpen ( ) & & streamDough . isOpen ( ) & & streamDonna . isOpen ( ) ;
streamDino . close ( ) ;
streamDough . close ( ) ;
streamDonna . close ( ) ;
cleanInventory ( ) ;
2007-07-29 17:06:23 +00:00
_gfx - > setPalette ( _gfx - > _palette ) ;
2007-01-14 21:29:12 +00:00
if ( gameCompleted ) {
2007-08-11 17:25:57 +00:00
_gfx - > setFont ( _menuFont ) ;
2007-07-29 17:06:23 +00:00
_gfx - > displayCenteredString ( 70 , v4C [ _language ] ) ;
_gfx - > displayCenteredString ( 100 , v3C [ _language ] ) ;
_gfx - > displayCenteredString ( 130 , v2C [ _language ] ) ;
_gfx - > displayCenteredString ( 160 , v1C [ _language ] ) ;
2007-03-12 20:41:25 +00:00
2007-07-29 17:06:23 +00:00
_gfx - > updateScreen ( ) ;
2007-01-14 21:29:12 +00:00
waitUntilLeftClick ( ) ;
2007-07-29 17:06:23 +00:00
strcpy ( _location . _name , " estgrotta.drki " ) ;
2007-01-14 21:29:12 +00:00
_engineFlags | = kEngineChangeLocation ;
} else {
2007-08-11 17:25:57 +00:00
_gfx - > setFont ( _menuFont ) ;
2007-07-29 17:06:23 +00:00
_gfx - > displayCenteredString ( 70 , v8C [ _language ] ) ;
_gfx - > displayCenteredString ( 100 , v7C [ _language ] ) ;
_gfx - > displayCenteredString ( 130 , v6C [ _language ] ) ;
_gfx - > displayCenteredString ( 160 , v5C [ _language ] ) ;
2007-03-12 20:41:25 +00:00
2007-07-29 17:06:23 +00:00
_gfx - > updateScreen ( ) ;
2007-01-14 21:29:12 +00:00
waitUntilLeftClick ( ) ;
2007-07-29 17:06:23 +00:00
_menu - > selectCharacter ( ) ;
2007-01-14 21:29:12 +00:00
}
2007-04-07 09:31:24 +00:00
// this code saves main character animation from being removed from the following code
2007-07-29 17:06:23 +00:00
_animations . remove ( & _char . _ani ) ;
_locationNames [ 0 ] [ 0 ] = ' \0 ' ;
_numLocations = 0 ;
2007-01-14 21:29:12 +00:00
_commandFlags = 0 ;
2007-04-07 09:31:24 +00:00
// this flag tells freeZones to unconditionally remove *all* Zones
2007-01-14 21:29:12 +00:00
_engineFlags | = kEngineQuit ;
2007-07-29 17:06:23 +00:00
freeZones ( ) ;
freeAnimations ( ) ;
2007-01-14 21:29:12 +00:00
2007-04-07 09:31:24 +00:00
// this dangerous flag can now be cleared
2007-01-14 21:29:12 +00:00
_engineFlags & = ~ kEngineQuit ;
2007-04-07 09:31:24 +00:00
// main character animation is restored
2007-07-29 17:06:23 +00:00
_animations . push_front ( & _char . _ani ) ;
2007-01-14 21:29:12 +00:00
_score = 0 ;
return ;
}
2007-07-29 17:02:08 +00:00
void Parallaction_ns : : _c_ridux ( void * parm ) {
2007-07-29 17:06:23 +00:00
changeCharacter ( _minidinoName ) ;
2007-01-14 21:29:12 +00:00
return ;
}
2007-07-29 17:02:08 +00:00
void Parallaction_ns : : _c_testResult ( void * parm ) {
2007-07-29 17:06:23 +00:00
_gfx - > swapBuffers ( ) ;
2007-06-15 21:40:02 +00:00
2007-07-29 17:06:23 +00:00
_disk - > selectArchive ( " disk1 " ) ;
parseLocation ( " common " ) ;
2007-01-14 21:29:12 +00:00
2007-08-11 17:25:57 +00:00
_gfx - > setFont ( _menuFont ) ;
2007-01-14 21:29:12 +00:00
2007-07-29 17:06:23 +00:00
_gfx - > displayCenteredString ( 38 , _slideText [ 0 ] ) ;
_gfx - > displayCenteredString ( 58 , _slideText [ 1 ] ) ;
2007-01-14 21:29:12 +00:00
2007-07-29 17:06:23 +00:00
_gfx - > copyScreen ( Gfx : : kBitFront , Gfx : : kBitBack ) ;
_gfx - > copyScreen ( Gfx : : kBitFront , Gfx : : kBit2 ) ;
2007-01-14 21:29:12 +00:00
return ;
}
2007-07-29 17:02:08 +00:00
void Parallaction_ns : : _c_offSound ( void * ) {
2007-07-29 17:06:23 +00:00
_soundMan - > stopSfx ( 0 ) ;
_soundMan - > stopSfx ( 1 ) ;
_soundMan - > stopSfx ( 2 ) ;
_soundMan - > stopSfx ( 3 ) ;
2007-04-22 09:46:22 +00:00
}
2007-07-29 17:02:08 +00:00
void Parallaction_ns : : _c_startMusic ( void * ) {
2007-07-29 17:06:23 +00:00
_soundMan - > playMusic ( ) ;
2007-04-22 09:46:22 +00:00
}
2007-07-29 17:02:08 +00:00
void Parallaction_ns : : _c_closeMusic ( void * ) {
2007-07-29 17:06:23 +00:00
_soundMan - > stopMusic ( ) ;
2007-04-22 09:46:22 +00:00
}
2007-07-29 16:42:29 +00:00
/*
intro callables
*/
2007-07-29 17:02:08 +00:00
void Parallaction_ns : : _c_startIntro ( void * parm ) {
2007-07-29 17:06:23 +00:00
_rightHandAnim = findAnimation ( " righthand " ) ;
2007-07-29 16:42:29 +00:00
2007-07-29 17:06:23 +00:00
if ( getPlatform ( ) = = Common : : kPlatformPC ) {
_soundMan - > setMusicFile ( " intro " ) ;
_soundMan - > playMusic ( ) ;
2007-07-29 16:42:29 +00:00
}
_engineFlags | = kEngineBlockInput ;
return ;
}
2007-07-29 17:02:08 +00:00
void Parallaction_ns : : _c_endIntro ( void * parm ) {
2007-07-29 16:42:29 +00:00
2007-08-11 17:25:57 +00:00
_gfx - > setFont ( _menuFont ) ;
2007-07-29 16:42:29 +00:00
debugC ( 1 , kDebugLocation , " endIntro() " ) ;
for ( uint16 _si = 0 ; _si < 6 ; _si + + ) {
2007-07-29 17:06:23 +00:00
_gfx - > displayCenteredString ( 80 , _credits [ _si ] . _role ) ;
_gfx - > displayCenteredString ( 100 , _credits [ _si ] . _name ) ;
2007-07-29 16:42:29 +00:00
2007-07-29 17:06:23 +00:00
_gfx - > updateScreen ( ) ;
2007-07-29 16:42:29 +00:00
for ( uint16 v2 = 0 ; v2 < 100 ; v2 + + ) {
_mouseButtons = kMouseNone ;
2007-07-29 17:06:23 +00:00
updateInput ( ) ;
2007-07-29 16:42:29 +00:00
if ( _mouseButtons = = kMouseLeftUp )
break ;
2007-07-29 17:06:23 +00:00
waitTime ( 1 ) ;
2007-07-29 16:42:29 +00:00
}
2007-07-29 17:06:23 +00:00
_gfx - > copyScreen ( Gfx : : kBitBack , Gfx : : kBitFront ) ;
2007-07-29 16:42:29 +00:00
}
debugC ( 1 , kDebugLocation , " endIntro(): done showing credits " ) ;
2007-07-29 17:06:23 +00:00
if ( ( getFeatures ( ) & GF_DEMO ) = = 0 ) {
_gfx - > displayCenteredString ( 80 , " CLICK MOUSE BUTTON TO START " ) ;
_gfx - > updateScreen ( ) ;
2007-07-29 16:42:29 +00:00
waitUntilLeftClick ( ) ;
_engineFlags & = ~ kEngineBlockInput ;
2007-07-29 17:06:23 +00:00
_menu - > selectCharacter ( ) ;
2007-07-29 16:42:29 +00:00
} else {
waitUntilLeftClick ( ) ;
}
return ;
}
2007-07-29 17:02:08 +00:00
void Parallaction_ns : : _c_moveSheet ( void * parm ) {
2007-07-29 16:42:29 +00:00
static uint16 x = 319 ;
if ( x > 66 )
x - = 16 ;
Common : : Rect r ;
r . left = x ;
r . top = 47 ;
r . right = ( x + 32 > 319 ) ? 319 : ( x + 32 ) ;
r . bottom = 199 ;
2007-07-29 17:06:23 +00:00
_gfx - > floodFill ( Gfx : : kBitBack , r , 1 ) ;
_gfx - > floodFill ( Gfx : : kBit2 , r , 1 ) ;
2007-07-29 16:42:29 +00:00
if ( x > = 104 ) return ;
r . left = x + 215 ;
r . top = 47 ;
r . right = ( x + 247 > 319 ) ? 319 : ( x + 247 ) ;
r . bottom = 199 ;
2007-07-29 17:06:23 +00:00
_gfx - > floodFill ( Gfx : : kBitBack , r , 12 ) ;
_gfx - > floodFill ( Gfx : : kBit2 , r , 12 ) ;
2007-07-29 16:42:29 +00:00
return ;
}
2007-08-06 19:13:51 +00:00
void zeroMask ( int x , int y , int color , void * data ) {
2007-08-12 09:10:10 +00:00
//_vm->_gfx->zeroMaskValue(x, y, color);
BackgroundInfo * info = ( BackgroundInfo * ) data ;
2007-08-14 19:53:32 +00:00
/*
if ( x < 0 | | x > 319 | | y < 0 | | y > 199 ) {
printf ( " zeroMask(%i, %i) \n " , x , y ) ;
}
*/
2007-08-12 09:10:10 +00:00
uint16 _ax = x + y * info - > width ;
info - > mask . data [ _ax > > 2 ] & = ~ ( 3 < < ( ( _ax & 3 ) < < 1 ) ) ;
2007-07-29 16:42:29 +00:00
}
2007-07-29 17:02:08 +00:00
void Parallaction_ns : : _c_sketch ( void * parm ) {
2007-07-29 16:42:29 +00:00
static uint16 index = 1 ;
2007-08-14 19:53:32 +00:00
uint16 newx ;
uint16 newy ;
2007-07-29 16:42:29 +00:00
uint16 oldy = _rightHandPositions [ 2 * ( index - 1 ) + 1 ] ;
uint16 oldx = _rightHandPositions [ 2 * ( index - 1 ) ] ;
2007-08-14 19:53:32 +00:00
// WORKAROUND: original code overflowed _rightHandPositions by trying
// to access elements at positions 684 and 685. That used to happen
// when index == 342. Code now checks for this possibility and assigns
// the last valid value to the new coordinates for drawing without
// accessing the array.
if ( index < 342 ) {
newy = oldy ;
newx = oldx ;
} else {
newy = _rightHandPositions [ 2 * index + 1 ] ;
newx = _rightHandPositions [ 2 * index ] ;
}
printf ( " sketch index = %i \n " , index ) ;
2007-08-12 09:10:10 +00:00
Graphics : : drawLine ( oldx , oldy , newx , newy , 0 , zeroMask , _backgroundInfo ) ;
2007-07-29 16:42:29 +00:00
_rightHandAnim - > _left = newx ;
_rightHandAnim - > _top = newy - 20 ;
index + + ;
return ;
}
2007-07-29 17:02:08 +00:00
void Parallaction_ns : : _c_shade ( void * parm ) {
2007-07-29 16:42:29 +00:00
Common : : Rect r (
_rightHandAnim - > _left - 36 ,
_rightHandAnim - > _top - 36 ,
_rightHandAnim - > _left ,
_rightHandAnim - > _top
) ;
2007-08-12 09:10:10 +00:00
uint16 _di = r . left / 4 + r . top * _backgroundInfo - > mask . internalWidth ;
for ( uint16 _si = r . top ; _si < r . bottom ; _si + + ) {
memset ( _backgroundInfo - > mask . data + _di , 0 , r . width ( ) / 4 + 1 ) ;
_di + = _backgroundInfo - > mask . internalWidth ;
}
2007-07-29 16:42:29 +00:00
return ;
}
2007-07-29 17:02:08 +00:00
void Parallaction_ns : : _c_projector ( void * ) {
2007-07-29 16:42:29 +00:00
# ifdef HALFBRITE
static int dword_16032 = 0 ;
// Bitmap bm;
// InitBitMap(&bm);
if ( dword_16032 ! = 0 ) {
/* // keep drawing spotlight in its final place
2007-07-29 17:06:23 +00:00
_gfx - > flatBlitCnv ( & scnv , 110 , 25 , Gfx : : kBitFront ) ;
2007-07-29 16:42:29 +00:00
BltBitMap ( & bm , 0 , 0 , & _screen . _bitMap , 110 , 25 , a3 - > ? ? , a3 - > ? ? , 0x20 , 0x20 ) ;
*/ return ;
}
2007-07-29 17:06:23 +00:00
_gfx - > setHalfbriteMode ( true ) ;
2007-07-29 16:42:29 +00:00
/*
// move spot light around the stage
int d7 , d6 ;
for ( d7 = 0 ; d7 < 150 ; d7 + + ) {
if ( d7 < 100 ) {
int d1 = d7 ;
if ( d1 < 0 )
d1 + + ;
d1 > > = 1 ;
d6 = 50 - d1 ;
} else {
int d1 = d7 / 100 ;
if ( d1 < 0 )
d1 + + ;
d1 > > = 1 ;
d6 = d1 ;
}
BltBitMap ( & bm , 0 , 0 , & _screen . _bitMap , d7 + 20 , d6 , a3 - > ? ? , a3 - > ? ? , 0x20 , 0x20 ) ;
sub_1590C ( d6 + a3 - > ? ? ) ;
BltBitMap ( & bm , 0 , 0 , & _screen . _bitMap , d7 + 20 , d6 , a3 - > ? ? , a3 - > ? ? , 0xFA , 0x20 ) ;
}
for ( d7 = 50 ; d7 > - 10 ; d7 - - ) {
BltBitMap ( & bm , 0 , 0 , & _screen . _bitMap , d7 + 120 , d6 , a3 - > ? ? , a3 - > ? ? , 0x20 , 0x20 ) ;
sub_1590C ( d6 + a3 - > ? ? ) ;
BltBitMap ( & bm , 0 , 0 , & _screen . _bitMap , d7 + 120 , d6 , a3 - > ? ? , a3 - > ? ? , 0xFA , 0x20 ) ;
}
BltBitMap ( & bm , 0 , 0 , & _screen . _bitMap , d7 + 120 , d6 , a3 - > ? ? , a3 - > ? ? , 0x20 , 0x20 ) ;
2007-07-29 17:06:23 +00:00
_gfx - > flatBlitCnv ( & scnv , d7 + 120 , d6 , Gfx : : kBitFront ) ;
2007-07-29 16:42:29 +00:00
*/
dword_16032 = 1 ;
return ;
# endif
}
2007-07-29 17:02:08 +00:00
void Parallaction_ns : : _c_HBOff ( void * ) {
2007-07-29 16:42:29 +00:00
# ifdef HALFBRITE
2007-07-29 17:06:23 +00:00
_gfx - > setHalfbriteMode ( false ) ;
2007-07-29 16:42:29 +00:00
# endif
}
2007-07-29 17:02:08 +00:00
void Parallaction_ns : : _c_HBOn ( void * ) {
2007-07-29 16:42:29 +00:00
# ifdef HALFBRITE
2007-07-29 17:06:23 +00:00
_gfx - > setHalfbriteMode ( true ) ;
2007-07-29 16:42:29 +00:00
# endif
}
2007-01-14 21:29:12 +00:00
} // namespace Parallaction