Committing patch #1578: Resolution problem fix.
Fixes bug #15773: in windowed resolution for 1024x600 monitors is 1024x768 if the video card supports it.
This commit is contained in:
parent
a41288cd4a
commit
0e0b0fd70f
3 changed files with 17 additions and 4 deletions
|
@ -82,7 +82,7 @@ bool detect_video_settings(CVideo& video, std::pair<int,int>& resolution, int& b
|
|||
#endif
|
||||
|
||||
bpp = video.modePossible(resolution.first, resolution.second,
|
||||
DefaultBPP, video_flags);
|
||||
DefaultBPP, video_flags, true);
|
||||
|
||||
foreach (const res_t &res, res_list)
|
||||
{
|
||||
|
|
|
@ -354,9 +354,22 @@ void CVideo::make_test_fake(const unsigned width,
|
|||
|
||||
}
|
||||
|
||||
int CVideo::modePossible( int x, int y, int bits_per_pixel, int flags )
|
||||
int CVideo::modePossible( int x, int y, int bits_per_pixel, int flags, bool current_screen_optimal )
|
||||
{
|
||||
return SDL_VideoModeOK( x, y, bits_per_pixel, get_flags(flags) );
|
||||
|
||||
int bpp = SDL_VideoModeOK( x, y, bits_per_pixel, get_flags(flags) );
|
||||
if(current_screen_optimal)
|
||||
{
|
||||
const SDL_VideoInfo* const video_info = SDL_GetVideoInfo();
|
||||
/* if current video_info is smaller than the mode checking and the checked mode is supported
|
||||
(meaning that probably the video card supports higher resolutions than the monitor)
|
||||
that means that we just need to adjust the resolution and the bpp is ok
|
||||
*/
|
||||
if(bpp==0 && video_info->current_h<y && video_info->current_w<x){
|
||||
return bits_per_pixel;
|
||||
}
|
||||
}
|
||||
return bpp;
|
||||
}
|
||||
|
||||
int CVideo::setMode( int x, int y, int bits_per_pixel, int flags )
|
||||
|
|
|
@ -47,7 +47,7 @@ class CVideo : private boost::noncopyable {
|
|||
~CVideo();
|
||||
|
||||
|
||||
int modePossible( int x, int y, int bits_per_pixel, int flags );
|
||||
int modePossible( int x, int y, int bits_per_pixel, int flags ,bool current_screen_optimal=false);
|
||||
int setMode( int x, int y, int bits_per_pixel, int flags );
|
||||
|
||||
//did the mode change, since the last call to the modeChanged() method?
|
||||
|
|
Loading…
Add table
Reference in a new issue