video_setmode(): do nothing if the current mode matches the desired one

In particular, this eliminates an annoying flicker/window recreation after exiting the video options menu without changing the resolution.
This commit is contained in:
Andrei "Akari" Alexeyev 2017-02-04 06:08:34 +02:00
parent 9f96fb7204
commit c46b87718e

View file

@ -102,6 +102,9 @@ static void _video_setmode(int w, int h, int fs, int fallback) {
}
void video_setmode(int w, int h, int fs) {
if(w == video.current.width && h == video.current.height && fs == video_isfullscreen())
return;
_video_setmode(w, h, fs, False);
}