From: Holger Schemel Date: Sun, 20 Aug 2006 12:13:08 +0000 (+0200) Subject: rnd-20060820-1-src X-Git-Tag: 3.2.1^2~2 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=e14251b595dcb8586f57ea78a6a52b3bd03ee272;p=rocksndiamonds.git rnd-20060820-1-src * fixed nasty bugs with handling error message file on Mac OS X systems --- diff --git a/ChangeLog b/ChangeLog index 6ef7fb8a..da91536c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ 2006-08-20 * version 3.2.1 released +2006-08-20 + * fixed nasty bugs with handling error message file on Mac OS X systems + 2006-08-19 * general code cleanup (removing many annoying "#if 0" blocks etc.) diff --git a/src/conftime.h b/src/conftime.h index ca4ade19..c4fef1c5 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2006-08-19 18:41]" +#define COMPILE_DATE_STRING "[2006-08-19 19:17]" diff --git a/src/libgame/misc.c b/src/libgame/misc.c index c4b351e7..f9ec87fe 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -2726,14 +2726,11 @@ char *getErrorFilename(char *basename) void openErrorFile() { - /* always start with reliable default values */ - program.error_file = stderr; + InitUserDataDirectory(); -#if defined(PLATFORM_WIN32) || defined(PLATFORM_MSDOS) if ((program.error_file = fopen(program.error_filename, MODE_WRITE)) == NULL) fprintf_newline(stderr, "ERROR: cannot open file '%s' for writing!", program.error_filename); -#endif } void closeErrorFile() diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index 2395cd04..d06cca94 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -63,6 +63,10 @@ static void setFullscreenParameters() static void SDLSetWindowIcon(char *basename) { + /* (setting the window icon on Mac OS X would replace the high-quality + dock icon with the currently smaller (and uglier) icon from file) */ + +#if !defined(PLATFORM_MACOSX) char *filename = getCustomImageFilename(basename); SDL_Surface *surface; @@ -85,6 +89,7 @@ static void SDLSetWindowIcon(char *basename) SDL_MapRGB(surface->format, 0x00, 0x00, 0x00)); SDL_WM_SetIcon(surface, NULL); +#endif } void SDLInitVideoDisplay(void) diff --git a/src/libgame/setup.c b/src/libgame/setup.c index ff8485bc..4f004494 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -1205,18 +1205,20 @@ char *getPersonalDataDir(void) char *getUserGameDataDir(void) { - if (program.userdata_path == NULL) - program.userdata_path = getPath2(getPersonalDataDir(), - program.userdata_subdir); + static char *user_game_data_dir = NULL; - return program.userdata_path; + if (user_game_data_dir == NULL) + user_game_data_dir = getPath2(getPersonalDataDir(), + program.userdata_subdir); + + return user_game_data_dir; } void updateUserGameDataDir() { #if defined(PLATFORM_MACOSX) char *userdata_dir_old = getPath2(getHomeDir(), program.userdata_subdir_unix); - char *userdata_dir_new = getUserGameDataDir(); + char *userdata_dir_new = getUserGameDataDir(); /* do not free() this */ /* convert old Unix style game data directory to Mac OS X style, if needed */ if (fileExists(userdata_dir_old) && !fileExists(userdata_dir_new)) @@ -1233,7 +1235,6 @@ void updateUserGameDataDir() } free(userdata_dir_old); - free(userdata_dir_new); #endif }