src/video/bwindow/SDL_sysvideo.cc
changeset 2081 34a4d02b8db1
parent 2080 c611cb0638b2
child 2120 2c835d58faad
equal deleted inserted replaced
2080:c611cb0638b2 2081:34a4d02b8db1
   368         bscreen.GetMode(&current);
   368         bscreen.GetMode(&current);
   369         current_refresh = (1000 * current.timing.pixel_clock) /
   369         current_refresh = (1000 * current.timing.pixel_clock) /
   370             (current.timing.h_total * current.timing.v_total);
   370             (current.timing.h_total * current.timing.v_total);
   371 
   371 
   372         modes = SDL_modelist[((bpp + 7) / 8) - 1];
   372         modes = SDL_modelist[((bpp + 7) / 8) - 1];
   373         for (i = 0; modes[i] && (modes[i]->w > width) &&
   373 
   374              (modes[i]->h > height); ++i) {
   374         bool exactmatch = false;
   375             /* still looking */
   375         for ( uint32 x = 0; modes[x]; x++ ) {
   376         }
   376             if (modes[x]->w == width && modes[x]->h == height) {
   377         if (!modes[i] || (modes[i]->w < width) || (modes[i]->h < height)) {
   377                 exactmatch = true;
   378             --i;                /* We went too far */
   378                 i = x;
       
   379                 break;
       
   380             }
       
   381         }
       
   382         if (!exactmatch) {
       
   383             for (i = 0; modes[i] && (modes[i]->w > width) &&
       
   384                  (modes[i]->h > height); ++i) {
       
   385                 /* still looking */
       
   386             }
       
   387             if (!modes[i] || (modes[i]->w < width) || (modes[i]->h < height)) {
       
   388                 --i;                /* We went too far */
       
   389             }
   379         }
   390         }
   380         width = modes[i]->w;
   391         width = modes[i]->w;
   381         height = modes[i]->h;
   392         height = modes[i]->h;
   382         bscreen.GetModeList(&dmodes, &nmodes);
   393         bscreen.GetModeList(&dmodes, &nmodes);
   383         for (i = 0; i < nmodes; ++i) {
   394         for (i = 0; i < nmodes; ++i) {