/[projet1]/public/pc/emulators/caloric/src/sdl.c
Defence Force logotype

Diff of /public/pc/emulators/caloric/src/sdl.c

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

revision 146 by Jede, Thu May 28 16:32:59 2009 UTC revision 147 by Jede, Sun Aug 23 11:20:36 2009 UTC
# Line 81  int sdl_start() Line 81  int sdl_start()
81      /* Init video blah */      /* Init video blah */
82      /*Get some infos from video card and resolution*/      /*Get some infos from video card and resolution*/
83    
84   zoom=2;   //zoom=2;
85      if(fullScreen) {      if(fullScreen) {
86          flags |= SDL_FULLSCREEN;          flags |= SDL_FULLSCREEN;
87          flags_video ^= SDL_FULLSCREEN;          flags_video ^= SDL_FULLSCREEN;
# Line 136  else{ Line 136  else{
136    printf("Available Modes\n");    printf("Available Modes\n");
137    for(i=0;modes[i];++i)    for(i=0;modes[i];++i)
138      printf("  %d x %d\n", modes[i]->w, modes[i]->h);      printf("  %d x %d\n", modes[i]->w, modes[i]->h);
139    
140  }  }
141    
142  #endif  #endif
143    
144        // calculate the best full screen mode
145        //zoom=modes[0]->h/VIDEO_HEIGHT;
146    
147        /* 320x240x32 */
148    
     /* 320x240x32 */  
149      screen = SDL_SetVideoMode(VIDEO_WIDTH*zoom, VIDEO_HEIGHT*zoom+border, 8, flags_video); //      screen = SDL_SetVideoMode(VIDEO_WIDTH*zoom, VIDEO_HEIGHT*zoom+border, 8, flags_video); //
150      if ( screen == NULL ) {      if ( screen == NULL ) {
151          fprintf(stderr, "Unable to set %dx%dx32 video: %s\n", VIDEO_WIDTH*zoom, VIDEO_HEIGHT*zoom, SDL_GetError());          fprintf(stderr, "Unable to set %dx%dx32 video: %s\n", VIDEO_WIDTH*zoom, VIDEO_HEIGHT*zoom, SDL_GetError());
# Line 170  void sdl_display (void) Line 175  void sdl_display (void)
175      SDL_Flip(screen);      SDL_Flip(screen);
176      windowChanging=0;      windowChanging=0;
177  }  }
178    
179    
180    
181  void Reset_Screen (void)  void Reset_Screen (void)
182  {  {
183    
184        //initialised=1;
185      display_frame ();      display_frame ();
186  }  }
187    
# Line 414  previoustime=timenow; Line 423  previoustime=timenow;
423      }      }
424    
425  void displaySDL_run(void)  void displaySDL_run(void)
426  {      {
427        int x=0;
428  int x=0;      int y=0;
429  int y=0;      int calcul=0;
430  int calcul=0;      int move_x=0;
431  int move_x=0;      int move_y=0;
432  int move_y=0;      render_frame ();
 render_frame ();  
 zoom=2;  
433          if (frametouched) // if frame is modified let's go !          if (frametouched) // if frame is modified let's go !
434          {          {
435      lockscreenSDL_Display(screen);      lockscreenSDL_Display(screen);
# Line 446  zoom=2; Line 453  zoom=2;
453                      {                      {
454                      for (x=0;x<VIDEO_WIDTH;x++)                      for (x=0;x<VIDEO_WIDTH;x++)
455                          {                          {
                         //DrawRect(SDL_Surface *screen, int x, int y, Uint8 R, Uint8 G, Uint8 B, zoom)  
456                          DrawRect(screen, move_x, move_y+border,oriccolors[buf[calcul+x]].red, oriccolors[buf[calcul+x]].green, oriccolors[buf[calcul+x]].blue,zoom);                          DrawRect(screen, move_x, move_y+border,oriccolors[buf[calcul+x]].red, oriccolors[buf[calcul+x]].green, oriccolors[buf[calcul+x]].blue,zoom);
457                          move_x+=zoom;                          move_x+=zoom;
458                          }                          }
# Line 494  void display_frame (void) Line 500  void display_frame (void)
500      */      */
501      if(setfullScreen != fullScreen) {      if(setfullScreen != fullScreen) {
502          fullScreen = setfullScreen;          fullScreen = setfullScreen;
503          sdl_end();  
504          sdl_start();          sdl_end();
505    
506            sdl_start();
507        render_frame_init();
508    
509    
510      }      }
511   // comment this 3 lines to use jylam method and uncoment from render_frame() to SDL_Delay(20); included   // comment this 3 lines to use jylam method and uncoment from render_frame() to SDL_Delay(20); included
512      displaySDL_run();      displaySDL_run();

Legend:
Removed from v.146  
changed lines
  Added in v.147

  ViewVC Help
Powered by ViewVC 1.1.26