From 97f03ad86e7458be79933d91363a38c4d2e35deb Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Wed, 27 Aug 2014 23:56:46 +0200 Subject: [PATCH] rnd-20140827-1-src * error file set to unbuffered to prevent truncation in case of crashes --- ChangeLog | 3 +++ src/Makefile | 10 ++++++---- src/conftime.h | 2 +- src/libgame/misc.c | 3 +++ src/libgame/sdl.c | 9 +++++++++ 5 files changed, 22 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index cec3597a..b58b9423 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2014-08-27 + * error file set to unbuffered to prevent truncation in case of crashes + 2014-08-19 * fixed bug causing wrong screen updates while playing (whole screen update from backbuffer instead of playfield buffer if REDRAW_ALL set) diff --git a/src/Makefile b/src/Makefile index 2a02d816..265bf992 100644 --- a/src/Makefile +++ b/src/Makefile @@ -259,7 +259,8 @@ conf_snd.h: conf_snd.c conf_mus.h: conf_mus.c @$(MAKE) auto-conf -$(TIMESTAMP_FILE): $(SRCS) $(LIBGAME) $(GAME_EM) $(GAME_SP) +# $(TIMESTAMP_FILE): $(SRCS) $(LIBGAME) $(GAME_EM) $(GAME_SP) +$(TIMESTAMP_FILE): $(SRCS) $(RNDLIBS) @date '+"%Y-%m-%d %H:%M"' \ | sed -e 's/^/#define COMPILE_DATE_STRING /' \ > $(TIMESTAMP_FILE) @@ -277,9 +278,10 @@ clean-obj: $(MAKE) -C $(GAME_EM_DIR) clean $(MAKE) -C $(GAME_SP_DIR) clean $(RM) $(OBJS) - $(RM) $(LIBGAME) - $(RM) $(GAME_EM) - $(RM) $(GAME_SP) + $(RM) $(RNDLIBS) +# $(RM) $(LIBGAME) +# $(RM) $(GAME_EM) +# $(RM) $(GAME_SP) clean-ico: $(RM) $(ICONBASE).ico diff --git a/src/conftime.h b/src/conftime.h index 590154cf..9a502daa 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2014-08-19 21:46" +#define COMPILE_DATE_STRING "2014-08-27 13:39" diff --git a/src/libgame/misc.c b/src/libgame/misc.c index 5fdbe85b..39a55435 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -3691,6 +3691,9 @@ void openErrorFile() Error(ERR_WARN, "cannot open file '%s' for writing: %s", program.error_filename, strerror(errno)); } + + /* error output should be unbuffered so it is not truncated in a crash */ + setbuf(program.error_file, NULL); } void closeErrorFile() diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index 0b27fafb..b6fd5b40 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -515,8 +515,17 @@ static SDL_Surface *SDLCreateScreen(DrawBuffer **backbuffer, if (sdl_window != NULL) { +#if 0 + /* if SDL_CreateRenderer() is called from within a VirtualBox Windows VM + *without* enabling 2D/3D acceleration and/or guest additions installed, + it will crash if flags are *not* set to SDL_RENDERER_SOFTWARE (because + it will try to use accelerated graphics and apparently fails miserably) */ + if (sdl_renderer == NULL) + sdl_renderer = SDL_CreateRenderer(sdl_window, -1, SDL_RENDERER_SOFTWARE); +#else if (sdl_renderer == NULL) sdl_renderer = SDL_CreateRenderer(sdl_window, -1, 0); +#endif if (sdl_renderer != NULL) { -- 2.34.1