Serious-Engine icon indicating copy to clipboard operation
Serious-Engine copied to clipboard

avoid assert when 640x480 resolution not found

Open comicfans opened this issue 8 years ago • 3 comments

original code search 640x480 as fallback resolution, and crash if not found, but this resolution is not always avaible. this fix just return last resolution (which is lowest). this may fix #60 (not confirmed)

comicfans avatar Jul 03 '16 12:07 comicfans

I feel that, instead of removing the assert completely, it should check for extreme cases where no resolutions were given at all, i.e.

ASSERT(_ctResolutions <= 0);

yamgent avatar Jul 04 '16 04:07 yamgent

if no resolution avaible , can SDL video init successful ? (I've not check the whole logic flow, not sure if these resolution detected by SDL)

comicfans avatar Jul 05 '16 13:07 comicfans

The list of resolutions are not generated by SDL afaik.

That's kinda the point of assertions though, no need to second guess the assumptions, just test them :).

yamgent avatar Jul 06 '16 02:07 yamgent