Ejemplo n.º 1
0
//------------------------------------------------------------------------------
void SmackerCtrl::open(const char *name)
{
   if (smk)
      SmackClose(smk);

   if (hSmacker && name)
   {
      char buffer[1024];
      SimResource::get(manager)->getFullPath(name, buffer);
      smk = SmackOpen(buffer, SMACKTRACKS | SMACKNEEDVOLUME | (preload ? SMACKPRELOADALL : 0), SMACKAUTOEXTRA );
      //smk = SmackOpen(buffer, SMACKTRACKS | SMACKNEEDVOLUME | SMACKSIMULATE | (preload ? SMACKPRELOADALL : 0), SMACKAUTOEXTRA );
      if (smk)
      {
         delete bmp;

         // setup rendering into the GFXBitmap
         bmp = GFXBitmap::create(smk->Width,smk->Height);
         memset((void *)bmp->pBits, 0, bmp->imageSize);      
         cBmp.set(bmp);
         SmackToBuffer(smk, 0,0, bmp->getWidth(), bmp->getHeight(), bmp->pBits, 0);
         SmackSoundOnOff(smk, 1);   // turn sound on if present

         //SmackSimulate(300000);
         translate();
         finished = false;
      }
      else
      {
         SimMessageEvent::post(this, -1);
      }   
   }
}   
Ejemplo n.º 2
0
void
SMK_playFlic(char *path)
{
#if 0
     int  frames=0,i;

     if (access(path,F_OK) != 0) {
          return;
     }
     if (!noSoundFlag) {
          smk=SmackOpen(path,SMACKTRACKS,SMACKAUTOEXTRA);
     }
     else {
          smk=SmackOpen(path,0,SMACKAUTOEXTRA);
     }
     if (smk) {
          GFX_fadeOut(255);        // make sure game palette is faded
          walock[SMACKTILE]=200;
          allocache(&waloff[SMACKTILE],320L*200L,&walock[SMACKTILE]);
          tilesizx[SMACKTILE]=200;
          tilesizy[SMACKTILE]=320;
          SmackToBuffer(smk,0L,0L,320L,200L,(void *)waloff[SMACKTILE],0);
          keystatus[1]=0;
          keystatus[28]=0;
          keystatus[57]=0;
          while (1) {
               if (smk->NewPalette) {
                    SMK_loadPalette(smk->Palette);
               }
               SmackDoFrame(smk);
               SmackNextFrame(smk);
               rotatesprite(320L<<15,200L<<15,65536L,512,SMACKTILE,0,0,2+4+64,
                            0L,0L,xdim-1L,ydim-1L);
               nextpage();
               SMK_setPalette();
               while (SmackWait(smk)) {
                    if (keystatus[1] || keystatus[57] || keystatus[28]) {
                         goto done;
                    }
               }
               if (keystatus[1] || keystatus[57] || keystatus[28]) {
                    goto done;
               }
               frames++;
               if (frames == smk->Frames) {
                    goto done;
               }
          }
done:
          walock[SMACKTILE]=1;
          SmackClose(smk);
          for (i = 0 ; i < MAXRADBUFFS ; i++) {
               radbuf[i].cache_lock=1;
          }
     }
#endif
}
Ejemplo n.º 3
0
//------------------------------------------------------------------------------
void SmackerCtrl::close()
{
   if (smk)   
   {
      SmackSoundOnOff(smk, 0);   // turn sound off
      SmackClose(smk);
   }
   smk    = NULL;
   
   finished = true;
}