diff --git a/SourceX/storm/storm.cpp b/SourceX/storm/storm.cpp index 99bc309e5..282a4164e 100644 --- a/SourceX/storm/storm.cpp +++ b/SourceX/storm/storm.cpp @@ -623,6 +623,30 @@ void SVidPlayBegin(char *filename, int a2, int a3, int a4, int a5, int flags, HA { const auto *display = SDL_GetVideoSurface(); IsSVidVideoMode = (display->flags & (SDL_FULLSCREEN | SDL_NOFRAME)) != 0; + + if (IsSVidVideoMode) { + /* Get available fullscreen/hardware modes */ + SDL_Rect **modes = SDL_ListModes(NULL, display->flags); + + /* Check is there are any modes available */ + if(modes == (SDL_Rect **)0){ + IsSVidVideoMode = false; + } + + /* Check if our resolution is restricted */ + if(modes != (SDL_Rect **)-1){ + // Search for a usable video mode + bool UsableModeFound = false; + for (int i=0; modes[i]; i++) { + if (modes[i]->w == SVidWidth || modes[i]->h == SVidHeight) { + UsableModeFound = true; + break; + } + } + IsSVidVideoMode = UsableModeFound; + } + } + if (IsSVidVideoMode) { int w, h; if (display->w * SVidWidth > display->h * SVidHeight) {