#include "zelda.h"
#include "gfx.h"
#include "bitmap.h"
#include "datafile.h"
#include "sound.h"
#include "intro.h"
#include "dat\\intro.h"

void IntroBlit(int x,int y,int w,int h);


void ShowIntro()
{
   if(noIntro==TRUE)
   {
     noIntro=FALSE;
     return;
   }
   fade_out(fadeSpeed);
   clear(screen);
   set_palette(intro[PAL].dat);
   rest(500);
   IntroBlit(160,0,0,240);
   IntroBlit(128,0,64,240);
   IntroBlit(96,0,128,240);
   IntroBlit(64,0,192,240);
   IntroBlit(32,0,256,240);
   IntroBlit(0,0,320,240);
   rest(800);
   PlaySample(intro[CLAP].dat,255,128,1000,0);
   rest(5000);
   if(info==TRUE)
   {
     clear(buffer);
     draw_sprite(buffer,intro[NOSMOKING].dat,70,80);
     if(svga==TRUE)
      blit(buffer,screen,0,0,160,120,320,240);
       else if(svgaStretch==TRUE)
        stretch_blit(buffer,screen,0,0,320,240,0,0,640,480);
         else
          blit(buffer,screen,0,0,0,0,320,240);
     PlaySample(intro[CLAP].dat,255,128,1000,0);
     rest(5000);
   }
   fade_out(fadeSpeed);
}

void IntroBlit(int x,int y,int w,int h)
{
  clear(buffer);
  stretch_sprite(buffer,intro[SPEED].dat,x,y,w,h);
  if(svga==TRUE)
   blit(buffer,screen,0,0,160,120,320,240);
    else if(svgaStretch==TRUE)
     stretch_blit(buffer,screen,0,0,320,240,0,0,640,480);
      else
       blit(buffer,screen,0,0,0,0,320,240);
  PlaySample(intro[CLICK].dat,255,128,1000,0);
  rest(300);
}



