summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main-sdl.c49
1 files changed, 23 insertions, 26 deletions
diff --git a/src/main-sdl.c b/src/main-sdl.c
index da26e9a5..7a534ad5 100644
--- a/src/main-sdl.c
+++ b/src/main-sdl.c
@@ -39,13 +39,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;
/**************/
@@ -487,9 +493,7 @@ void handleEvent(SDL_Event *event)
/* handle quit requests */
DB("Emergency Blit");
redrawAllTerminals();
- save_player();
- save_dungeon();
- sdl_quit("Quitting!\n");
+ /*sdl_quit("Quitting!\n");*/
break;
}
default:
@@ -2028,26 +2032,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 );
@@ -2066,6 +2050,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);
+
/* Initialize the working surface and crayon surface used for rendering
text in different colors. */