- static SDL_Rect *resolutions_block = NULL;
- resolutions_block = (SDL_Rect*) realloc(resolutions_block, sizeof (SDL_Rect) * count);
- resolutions = (SDL_Rect**) realloc(resolutions, sizeof (SDL_Rect *) * (count + 1));
- if ((resolutions_block == NULL) || (resolutions == NULL)) {
- SDL_Quit();
- fprintf(stderr, "Out of memory!\n");
- return false;
- }
-
- resolutions[count--] = NULL;
- for (int i = 0; count >= 0; i++, count--) {
- /* FIXME - Pretty sure this should use nummodes and not count */
- SDL_DisplayMode mode;
- if (SDL_GetDisplayMode(displayIdx, i, &mode) == -1)
- continue;
- if ((mode.w < 640) || (mode.h < 480))
- continue; // sane lower limit.
- resolutions_block[count].x = resolutions_block[count].y = 0;
- resolutions_block[count].w = mode.w;
- resolutions_block[count].h = mode.h;
- resolutions[count] = &resolutions_block[count];
- }
-