/[bontz]/bontz/bontz.cpp
ViewVC logotype

Diff of /bontz/bontz.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by swerk, Tue Aug 5 14:53:44 2003 UTC revision 1.10 by rickac, Sun Sep 28 01:54:11 2003 UTC
# Line 50  Line 50 
50  #include "lib/CSpriteBase.h"  #include "lib/CSpriteBase.h"
51  #include "lib/textbox.h"  #include "lib/textbox.h"
52    
53  #include "SDL/SDL.h"  #include "SDL.h"
54  #include "SDL/SDL_mixer.h"  #include "SDL_mixer.h"
55  #include "SDL/SDL_image.h"  #include "SDL_image.h"
56    #include "smpeg.h"
57    
58  SDL_Surface *screen, *back, *dialog;  SDL_Surface *screen, *back, *dialog, *movie;
59  //CSpriteBase muckabase;  //CSpriteBase muckabase;
60  //CSprite mucka1;  //CSprite mucka1;
61  CSpriteBase fishbase1;  CSpriteBase fishbase1;
# Line 135  void DrawScene() Line 136  void DrawScene()
136  //  mucka1.clearBG();  //  mucka1.clearBG();
137  //  mucka1.updateBG();  //  mucka1.updateBG();
138    /**/    /**/
139      /*
140    fish1.clearBG();    fish1.clearBG();
141    fish1.updateBG();    fish1.updateBG();
142    fish2.clearBG();    fish2.clearBG();
# Line 162  void DrawScene() Line 163  void DrawScene()
163    bellguy.draw();    bellguy.draw();
164    
165    furgason.draw();    furgason.draw();
166    */
167      SDL_Flip(screen);
168    }
169    
170    void update_smpeg(SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h)
171    {
172      DrawIMG(movie, 150, 270);
173    SDL_Flip(screen);    SDL_Flip(screen);
174  }  }
175    
176    
177  int main(int argc, char *argv[])  int main(int argc, char *argv[])
178  {  {
179    Uint8* keys;    Uint8* keys;
180    
181      SMPEG *mpeg;
182      SMPEG_Info info;
183    
184    an_direction[0][0]=0;    an_direction[0][0]=0;
185    an_direction[1][0]=0;    an_direction[1][0]=0;
186    an_direction[1][1]=1;    an_direction[1][1]=1;
# Line 213  int main(int argc, char *argv[]) Line 224  int main(int argc, char *argv[])
224      exit(1);      exit(1);
225    }    }
226    
227      mpeg = SMPEG_new("media/movies/test-352.mpg", &info, 1);
228    
229      SMPEG_enableaudio(mpeg, 1);
230      SMPEG_enablevideo(mpeg, 1);
231    
232      movie=SDL_CreateRGBSurface(SDL_SWSURFACE,352,100,16,63488,2016,31,0);
233      SDL_DisplayFormat(movie);
234      SMPEG_setdisplay(mpeg,movie ,NULL, update_smpeg);
235      
236      SMPEG_scaleXY(mpeg, movie->w, movie->h);
237      SMPEG_loop(mpeg, 1);
238    
239    
240      if ( info.has_video ) {
241        printf("\tVideo %dx%d resolution\n", info.width, info.height);
242      }
243      if ( info.has_audio ) {
244        printf("\tAudio %s\n", info.audio_string);
245      }
246      if ( info.total_size ) {
247        printf("\tSize: %d\n", info.total_size);
248      }
249      if ( info.total_time ) {
250        printf("\tTotal time: %f\n", info.total_time);
251      }
252    
253    int direction=0;    int direction=0;
254    //this is used to determine whether the person is running or walking    //this is used to determine whether the person is running or walking
255    int multiplier;    int multiplier;
# Line 280  int main(int argc, char *argv[]) Line 317  int main(int argc, char *argv[])
317    InitImages();    InitImages();
318    DrawBG();    DrawBG();
319    
   
320    message.draw();    message.draw();
321    
322    
323      SMPEG_play(mpeg);
324    
325    int done=0;    int done=0;
326    
# Line 304  int main(int argc, char *argv[]) Line 340  int main(int argc, char *argv[])
340        if ( event.type == SDL_KEYDOWN )        if ( event.type == SDL_KEYDOWN )
341        {        {
342          if ( event.key.keysym.sym == SDLK_ESCAPE ) { done = 1; }          if ( event.key.keysym.sym == SDLK_ESCAPE ) { done = 1; }
343            if ( event.key.keysym.sym == SDLK_RETURN) {SMPEG_seek(mpeg, 1);}
344        }        }
345    
346        //rickac added code to print screen        //rickac added code to print screen

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26