summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSavely Skresanov <savask@yandex.ru>2012-05-16 14:43:49 (GMT)
committer Savely Skresanov <savask@yandex.ru>2012-05-16 14:46:36 (GMT)
commit66b946d5c6bdbd72afd66e625a7e1d151db95c1f (patch)
tree67d8e67bef2b2351c371d6d85a955ec77d820cec /src
parenta4d952a5c110c33f272e1208a71e8035c89a1cb1 (diff)
downloadpowder-66b946d5c6bdbd72afd66e625a7e1d151db95c1f.zip
powder-66b946d5c6bdbd72afd66e625a7e1d151db95c1f.tar.gz
Move SDL_GetVideoInfo before SDL_SetVideoMode so it will probably fix
sizing issues for people.
Diffstat (limited to 'src')
-rw-r--r--src/graphics.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/graphics.c b/src/graphics.c
index 488a7b8..3916ffd 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -3878,6 +3878,7 @@ void render_cursor(pixel *vid, int x, int y, int t, int rx, int ry)
#endif
}
+SDL_VideoInfo info;
int sdl_opened = 0;
int sdl_open(void)
{
@@ -3915,6 +3916,16 @@ int sdl_open(void)
SDL_WM_SetCaption("The Powder Toy", "Powder Toy");
atexit(SDL_Quit);
+
+ if(!sdl_opened)
+ info = *SDL_GetVideoInfo();
+
+ if (info.current_w<((XRES+BARSIZE)*sdl_scale) || info.current_h<((YRES+MENUSIZE)*sdl_scale))
+ {
+ sdl_scale = 1;
+ screen_err = 1;
+ fprintf(stderr, "Can't change scale factor, because screen resolution is too small");
+ }
#if defined(OGLR)
sdl_scrn=SDL_SetVideoMode(XRES*sdl_scale + BARSIZE*sdl_scale,YRES*sdl_scale + MENUSIZE*sdl_scale,32,SDL_OPENGL);
SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1);
@@ -4095,13 +4106,6 @@ 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;
- screen_err = 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);