diff options
author | Andrey Nazarov <skuller@skuller.net> | 2007-12-02 10:54:41 +0000 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2007-12-02 10:54:41 +0000 |
commit | 8d8f708b11f47c2a45cc71e256797139e75fb847 (patch) | |
tree | ac2b916b2b3bf3c390295ebbc9d148ee38da01f5 /source/cl_ref.c | |
parent | e73c5000d53a37a1700862d270ea78723afec686 (diff) |
Avoid black bars along sides of OpenGL window.
This also prevents GL_Screenshot_f crash due to
underestimating amount of memory to be allocated for pixel data.
Diffstat (limited to 'source/cl_ref.c')
-rw-r--r-- | source/cl_ref.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/cl_ref.c b/source/cl_ref.c index d9e500a..0d5467a 100644 --- a/source/cl_ref.c +++ b/source/cl_ref.c @@ -98,7 +98,7 @@ void Video_GetModeFS( vrect_t *rc, int *freq, int *depth ) { } // sanity check - if( w < 1 || w > 8192 || h < 1 || h > 8192 ) { + if( w < 64 || w > 8192 || h < 64 || h > 8192 ) { Com_DPrintf( "Mode %dx%d doesn't look sane\n", w, h ); malformed: w = 640; @@ -109,8 +109,8 @@ malformed: rc->x = 0; rc->y = 0; - rc->width = w; - rc->height = h; + rc->width = w & ~7; + rc->height = h & ~1; if( freq ) { *freq = hz; @@ -145,7 +145,7 @@ void Video_GetPlacement( vrect_t *rc ) { x = 0; y = 0; } - if( w < 1 || w > 8192 || h < 1 || h > 8192 ) { + if( w < 64 || w > 8192 || h < 64 || h > 8192 ) { malformed: w = 640; h = 480; @@ -153,8 +153,8 @@ malformed: rc->x = x; rc->y = y; - rc->width = w; - rc->height = h; + rc->width = w & ~7; + rc->height = h & ~1; } |