+2013-11-13
+ * fixed problem with R'n'D restarting with same level set that may have
+ caused a problem (and therefore failing again and again); after an
+ error, the last level set is now deactivated in file "levelsetup.conf"
+ to restart with default level set (which should work without error)
+
+2013-11-07
+ * fixed determining main game data directory on Mac OS X "Mavericks"
+
+2013-11-04
+ * version number set to 3.3.1.2
+
2013-11-04
* version 3.3.1.1 released
backup-net-copy:
./Scripts/make_backup.sh src scp
-backup-net: backup backup-net-copy
+backup-all: backup backup-net-copy
backup_lev:
./Scripts/make_backup.sh lev
CONFIG_GAME = $(CONFIG_GAME_DIR) $(CONFIG_SCORE_ENTRIES) $(CONFIG_SPECIAL)
CONFIG = $(CONFIG_GAME) $(JOYSTICK)
-# DEBUG = -DDEBUG -g
+DEBUG = -DDEBUG -g
# PROFILING = $(PROFILING_FLAGS)
# OPTIONS = $(DEBUG) -Wall # only for debugging purposes
{
static char *program_init_string = NULL;
+#if 1
+ // do not display compile target anymore, as it is almost always "SDL" now
if (program_init_string == NULL)
{
program_init_string = checked_malloc(strlen(PROGRAM_TITLE_STRING) + 1 +
- strlen(getProgramVersionString()) +1 +
+ strlen(getProgramVersionString()) + 1);
+
+ sprintf(program_init_string, "%s %s",
+ PROGRAM_TITLE_STRING, getProgramVersionString());
+ }
+#else
+ if (program_init_string == NULL)
+ {
+ program_init_string = checked_malloc(strlen(PROGRAM_TITLE_STRING) + 1 +
+ strlen(getProgramVersionString()) + 1 +
strlen(TARGET_STRING) + 1);
sprintf(program_init_string, "%s %s %s",
PROGRAM_TITLE_STRING, getProgramVersionString(), TARGET_STRING);
}
+#endif
return program_init_string;
}
-#define COMPILE_DATE_STRING "2013-11-04 00:44"
+#define COMPILE_DATE_STRING "2013-11-13 01:14"
ClosePlatformDependentStuff();
if (exit_value != 0)
+ {
+ /* fall back to default level set (current set may have caused an error) */
+ SaveLevelSetup_LastSeries_Deactivate();
+
+ /* tell user where to find error log file which may contain more details */
NotifyUserAboutErrorFile();
+ }
exit(exit_value);
}
#define MACOSX_H
+/* define some Mac OS X specific paths */
+
+#define MAC_APP_BINARY_SUBDIR "Contents/MacOS"
+
+
/* some symbols are already defined on Mac OS X */
#define Delay Delay_internal
#define DrawLine DrawLine_internal
return basepath;
}
+static char *getProgramMainDataPath()
+{
+ char *main_data_path = getStringCopy(program.command_basepath);
+
+#if defined(PLATFORM_MACOSX)
+ static char *main_data_binary_subdir = NULL;
+
+ if (main_data_binary_subdir == NULL)
+ {
+ main_data_binary_subdir = checked_malloc(strlen(program.program_title) + 1 +
+ strlen("app") + 1 +
+ strlen(MAC_APP_BINARY_SUBDIR) + 1);
+
+ sprintf(main_data_binary_subdir, "%s.app/%s",
+ program.program_title, MAC_APP_BINARY_SUBDIR);
+ }
+
+ // cut relative path to Mac OS X application binary directory from path
+ if (strSuffix(main_data_path, main_data_binary_subdir))
+ main_data_path[strlen(main_data_path) -
+ strlen(main_data_binary_subdir)] = '\0';
+
+ // cut trailing path separator from path (but not if path is root directory)
+ if (strSuffix(main_data_path, "/") && !strEqual(main_data_path, "/"))
+ main_data_path[strlen(main_data_path) - 1] = '\0';
+#endif
+
+ return main_data_path;
+}
+
/* ------------------------------------------------------------------------- */
/* various string functions */
char *rw_base_path = RW_BASE_PATH;
char **options_left = &argv[1];
+#if 1
+ /* if the program is configured to start from current directory (default),
+ determine program package directory from program binary (some versions
+ of KDE/Konqueror and Mac OS X (especially "Maverick") apparently do not
+ set the current working directory to the program package directory) */
+
+ if (strEqual(ro_base_path, "."))
+ ro_base_path = getProgramMainDataPath();
+ if (strEqual(rw_base_path, "."))
+ rw_base_path = getProgramMainDataPath();
+#else
+
#if !defined(PLATFORM_MACOSX)
/* if the program is configured to start from current directory (default),
determine program package directory (KDE/Konqueror does not do this by
ro_base_path = program.command_basepath;
if (strEqual(rw_base_path, "."))
rw_base_path = program.command_basepath;
+#endif
+
#endif
/* initialize global program options */
static boolean last_line_was_separator = FALSE;
char *process_name = "";
+#if 1
/* display warnings only when running in verbose mode */
if (mode & ERR_WARN && !options.verbose)
return;
+#endif
if (mode == ERR_INFO_LINE)
{
free(filename);
}
-void SaveLevelSetup_LastSeries()
+static void SaveLevelSetup_LastSeries_Ext(boolean deactivate_last_level_series)
{
/* ----------------------------------------------------------------------- */
/* ~/.<program>/levelsetup.conf */
fprintf(file, "%s\n\n", getFormattedSetupEntry(TOKEN_STR_FILE_IDENTIFIER,
getCookie("LEVELSETUP")));
+
+ if (deactivate_last_level_series)
+ fprintf(file, "# %s\n# ", "the following level set may have caused a problem and was deactivated");
+
fprintf(file, "%s\n", getFormattedSetupEntry(TOKEN_STR_LAST_LEVEL_SERIES,
level_subdir));
free(filename);
}
+void SaveLevelSetup_LastSeries()
+{
+ SaveLevelSetup_LastSeries_Ext(FALSE);
+}
+
+void SaveLevelSetup_LastSeries_Deactivate()
+{
+ SaveLevelSetup_LastSeries_Ext(TRUE);
+}
+
static void checkSeriesInfo()
{
static char *level_directory = NULL;
void LoadLevelSetup_LastSeries(void);
void SaveLevelSetup_LastSeries(void);
+void SaveLevelSetup_LastSeries_Deactivate();
void LoadLevelSetup_SeriesInfo(void);
void SaveLevelSetup_SeriesInfo(void);
updateUserGameDataDir();
#endif
+#if 1
+ openErrorFile();
+#else
#if !defined(PLATFORM_UNIX) || defined(PLATFORM_MACOSX)
openErrorFile();
#endif
+#endif
#if defined(TARGET_SDL)
if (SDL_Init(SDL_INIT_EVENTTHREAD | SDL_INIT_NOPARACHUTE) < 0)
struct ProgramInfo
{
- char *command_basepath; /* directory that contains the program */
+ char *command_basepath; /* path to the program binary */
char *command_basename; /* base filename of the program binary */
+ char *maindata_path; /* main game data (installation) directory */
+
char *userdata_subdir; /* personal user game data directory */
char *userdata_subdir_unix; /* personal user game data directory (Unix) */
char *userdata_path; /* resulting full path to game data directory */
#define PROGRAM_VERSION_MAJOR 3
#define PROGRAM_VERSION_MINOR 3
#define PROGRAM_VERSION_PATCH 1
-#define PROGRAM_VERSION_BUILD 1
+#define PROGRAM_VERSION_BUILD 2
#define PROGRAM_TITLE_STRING "Rocks'n'Diamonds"
#define PROGRAM_AUTHOR_STRING "Holger Schemel"