diff options
author | Bardur Arantsson <bardur@scientician.net> | 2013-10-31 16:28:53 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2013-10-31 16:28:53 +0100 |
commit | 610a2e1502ea39e28f23daff7a39cc9c2c254944 (patch) | |
tree | 56709381dd7504ba88803eb3089c4d7e87185b59 /src/main-sdl.c | |
parent | e6ad7d2dd9b8dd992461f37ca78a441e12f14788 (diff) |
Revert "SDL: make window sizing automatic depending on font size"
This reverts commit fe5dd7b9e92838bd0116270a884ef034e52237ce.
Diffstat (limited to 'src/main-sdl.c')
-rw-r--r-- | src/main-sdl.c | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/src/main-sdl.c b/src/main-sdl.c index b34325be..840859e9 100644 --- a/src/main-sdl.c +++ b/src/main-sdl.c @@ -35,13 +35,19 @@ /************************************************* GLOBAL SDL-ToME PROPERTIES *************************************************/ + +/* Default window properties - used if none are available +from other places*/ +#define DEF_SCREEN_WIDTH 800 +#define DEF_SCREEN_HEIGHT 600 +#define DEF_SCREEN_BPP 16 /*Main window properties that may be loaded at runtime from a preference file or environmental variables. However, default values (defined above) can be used. */ -static int arg_width = 0; -static int arg_height = 0; -static int arg_bpp = 16; +static int arg_width = DEF_SCREEN_WIDTH; +static int arg_height = DEF_SCREEN_HEIGHT; +static int arg_bpp = DEF_SCREEN_BPP; /**************/ @@ -2131,26 +2137,6 @@ errr init_sdl(int argc, char **argv) else videoFlags = SDL_SWSURFACE; - /* Now ready the fonts! */ - - DB("initializing SDL_ttf"); - if(TTF_Init()==-1) { - printf("TTF_Init: %s\n", TTF_GetError()); - sdl_quit("Bah"); - } - - DB("loading font..."); - - /* load and render the font */ - loadAndRenderFont(arg_font_name,arg_font_size); - - /* Make the window a nice default size if none is specified */ - if (arg_width < 1 || arg_height < 1) - { - arg_width = 80 * t_width; - arg_height = 24 * t_height; - } - /* now set the video mode that has been configured */ screen = SDL_SetVideoMode( arg_width, arg_height, arg_bpp, videoFlags ); @@ -2169,6 +2155,19 @@ errr init_sdl(int argc, char **argv) DB("SDL Window Created!"); + /* Now ready the fonts! */ + + DB("initializing SDL_ttf"); + if(TTF_Init()==-1) { + printf("TTF_Init: %s\n", TTF_GetError()); + sdl_quit("Bah"); + } + + DB("loading font..."); + + /* load and render the font */ + loadAndRenderFont(arg_font_name,arg_font_size); + /* Graphics! ---- If graphics are selected, then load graphical tiles! */ if (arg_graphics_type != NO_GRAPHICS) |