src/video/SDL_video.c
changeset 7440 9817477202d1
parent 7439 f52afd324ec7
child 7441 468877c2135a
equal deleted inserted replaced
7439:f52afd324ec7 7440:9817477202d1
   358 
   358 
   359 
   359 
   360 static int
   360 static int
   361 cmpmodes(const void *A, const void *B)
   361 cmpmodes(const void *A, const void *B)
   362 {
   362 {
   363     SDL_DisplayMode a = *(const SDL_DisplayMode *) A;
   363     const SDL_DisplayMode *a = (const SDL_DisplayMode *) A;
   364     SDL_DisplayMode b = *(const SDL_DisplayMode *) B;
   364     const SDL_DisplayMode *b = (const SDL_DisplayMode *) B;
   365 
   365     if (a == b) {
   366     if (a.w != b.w) {
   366         return 0;
   367         return b.w - a.w;
   367     } else if (a->w != b->w) {
   368     }
   368         return b->w - a->w;
   369     if (a.h != b.h) {
   369     } else if (a->h != b->h) {
   370         return b.h - a.h;
   370         return b->h - a->h;
   371     }
   371     } else if (SDL_BITSPERPIXEL(a->format) != SDL_BITSPERPIXEL(b->format)) {
   372     if (SDL_BITSPERPIXEL(a.format) != SDL_BITSPERPIXEL(b.format)) {
   372         return SDL_BITSPERPIXEL(b->format) - SDL_BITSPERPIXEL(a->format);
   373         return SDL_BITSPERPIXEL(b.format) - SDL_BITSPERPIXEL(a.format);
   373     } else if (SDL_PIXELLAYOUT(a->format) != SDL_PIXELLAYOUT(b->format)) {
   374     }
   374         return SDL_PIXELLAYOUT(b->format) - SDL_PIXELLAYOUT(a->format);
   375     if (SDL_PIXELLAYOUT(a.format) != SDL_PIXELLAYOUT(b.format)) {
   375     } else if (a->refresh_rate != b->refresh_rate) {
   376         return SDL_PIXELLAYOUT(b.format) - SDL_PIXELLAYOUT(a.format);
   376         return b->refresh_rate - a->refresh_rate;
   377     }
       
   378     if (a.refresh_rate != b.refresh_rate) {
       
   379         return b.refresh_rate - a.refresh_rate;
       
   380     }
   377     }
   381     return 0;
   378     return 0;
   382 }
   379 }
   383 
   380 
   384 static int
   381 static int