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.)
-#define COMPILE_DATE_STRING "[2006-08-19 18:41]"
+#define COMPILE_DATE_STRING "[2006-08-19 19:17]"
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()
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;
SDL_MapRGB(surface->format, 0x00, 0x00, 0x00));
SDL_WM_SetIcon(surface, NULL);
+#endif
}
void SDLInitVideoDisplay(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))
}
free(userdata_dir_old);
- free(userdata_dir_new);
#endif
}