1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
|
/***************************************************************************
* Pachi el marciano *
* ----------------- *
* (c) Santiago Radeff (coding) *
* (c) Nicolas Radeff (graphics) *
* (c) Peter Hajba (music) *
* *
* T-1000@Bigfoot.com *
****************************************************************************
*******************************************************************
* *
* 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. *
* *
*******************************************************************/
void init_intro()
{
SDL_Surface *temp;
dragontech=LoadT8(DATADIR"/Tgfx/dragontech.T8");
line1=LoadT8(DATADIR"/Tgfx/line1.T8");
line2=LoadT8(DATADIR"/Tgfx/line2.T8");
SDL_SetColorKey(dragontech, SDL_SRCCOLORKEY,SDL_MapRGB(dragontech->format,0,255,0));
SDL_SetColorKey(line1, SDL_SRCCOLORKEY,SDL_MapRGB(line1->format,0,0,0));
SDL_SetColorKey(line2, SDL_SRCCOLORKEY,SDL_MapRGB(line2->format,0,0,0));
comic_01=LoadT8(DATADIR"/Tgfx/comic_01.T8");
temp=SDL_CreateRGBSurface(SDL_SWSURFACE, screen_w, screen_h, screen_bpp, 255, 255, 255, 0);
SDL_FillRect(temp, NULL, SDL_MapRGB(temp->format,0,0,0));
black = SDL_DisplayFormat(temp);
SDL_FreeSurface(temp);
SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format,0,0,0));
}
void end_intro()
{
SDL_FreeSurface(dragontech);
SDL_FreeSurface(line1);
SDL_FreeSurface(line2);
SDL_FreeSurface(comic_01);
SDL_FreeSurface(black);
}
void intro()
{
init_intro();
double introtime=0;
escape_exit=0;
float title_alpha=0;
int n=1;
while(escape_exit==0)
{
if(n<=4) // 4 son los pasos a realizar en la primer parte de la intro
{
if(title_alpha<255)
{
switch(n)
{
case 1:
title_alpha=intro_blit(dragontech, 160, 100, 480, 170, title_alpha, 80, 1);
break;
case 2:
title_alpha=intro_blit(line1, 60, 300, 600, 40, title_alpha, 80, 1);
break;
case 3:
title_alpha=intro_blit(line2, 160, 350, 600, 40, title_alpha, 80, 1);
break;
case 4:
if(introtime>15)
title_alpha=intro_blit(black, 0,0,800,600, title_alpha, 80, 0);
break;
}
}
else
{
title_alpha=0;
n++;
}
}
credits_events();
delta_time();
introtime+=imove;
SDL_Delay(1);
if(introtime>20)
escape_exit=1;
}
escape_exit=0; n=1; title_alpha=0; introtime=0;
while(escape_exit==0)
{
if(title_alpha<255)
{
title_alpha=intro_blit(comic_01, 0, 0, 800, 600, title_alpha, 60, 0);
}
else
{
title_alpha=0;
n++;
}
credits_events();
delta_time();
introtime+=imove;
SDL_Delay(1);
if(introtime>25)
escape_exit=1;
}
end_intro();
}
|