diff options
| author | savask <savask@savask.(none)> | 2012-05-12 10:55:38 (GMT) |
|---|---|---|
| committer | Savely Skresanov <savask@yandex.ru> | 2012-05-12 11:05:22 (GMT) |
| commit | 9b8e0280eb0389dd93184d668b3ab853a85fbd67 (patch) | |
| tree | 6deec378636d9d6f9cdbf82127a0d3e7936da534 /src | |
| parent | bb6dab940279dbddf1b5a22a7f121fa14663bfc2 (diff) | |
| download | powder-9b8e0280eb0389dd93184d668b3ab853a85fbd67.zip powder-9b8e0280eb0389dd93184d668b3ab853a85fbd67.tar.gz | |
Check screen resolution before scaling game window.
Diffstat (limited to 'src')
| -rw-r--r-- | src/graphics.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/graphics.c b/src/graphics.c index 1b1e8ce..281da0f 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -4094,6 +4094,12 @@ int sdl_open(void) loadShaders(); } #else + SDL_VideoInfo* info = SDL_GetVideoInfo(); + if (info->current_w<((XRES+BARSIZE)*sdl_scale) || info->current_h<((YRES+MENUSIZE)*sdl_scale)) + { + sdl_scale = 1; + fprintf(stderr, "Can't change scale factor, because screen resolution is too small"); + } #ifdef PIX16 if (kiosk_enable) sdl_scrn=SDL_SetVideoMode(XRES*sdl_scale + BARSIZE*sdl_scale,YRES*sdl_scale + MENUSIZE*sdl_scale,16,SDL_FULLSCREEN|SDL_SWSURFACE); |
