comparison src/video/x11/SDL_x11modes.c @ 1318:f95502c6fc72

Eliminate duplicate modes with different refresh rates
author Sam Lantinga <slouken@libsdl.org>
date Wed, 01 Feb 2006 09:28:42 +0000
parents c9b51268668f
children 3692456e7b0f
comparison
equal deleted inserted replaced
1317:6c7b69218276 1318:f95502c6fc72
363 SDL_modelist = (SDL_Rect **)malloc((nmodes+2)*sizeof(SDL_Rect *)); 363 SDL_modelist = (SDL_Rect **)malloc((nmodes+2)*sizeof(SDL_Rect *));
364 if ( SDL_modelist ) { 364 if ( SDL_modelist ) {
365 n = 0; 365 n = 0;
366 for ( i=0; i<nmodes; ++i ) { 366 for ( i=0; i<nmodes; ++i ) {
367 int w, h; 367 int w, h;
368
369 /* Eliminate duplicate modes with different refresh rates */
370 if ( i > 0 &&
371 modes[i]->hdisplay == modes[i-1]->hdisplay &&
372 modes[i]->vdisplay == modes[i-1]->vdisplay ) {
373 continue;
374 }
368 375
369 /* Check to see if we should add the screen size (Xinerama) */ 376 /* Check to see if we should add the screen size (Xinerama) */
370 w = modes[i]->hdisplay; 377 w = modes[i]->hdisplay;
371 h = modes[i]->vdisplay; 378 h = modes[i]->vdisplay;
372 if ( (screen_w * screen_h) >= (w * h) ) { 379 if ( (screen_w * screen_h) >= (w * h) ) {