From a4e95e0a6d4b53732ea0a585be0b6df55ae41e42 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Fri, 14 May 2021 18:54:23 +0200 Subject: [PATCH] removed unused code for writable game data directory --- Makefile | 7 ------- src/Makefile | 6 +----- src/libgame/misc.c | 4 ---- src/libgame/system.h | 6 ------ 4 files changed, 1 insertion(+), 22 deletions(-) diff --git a/Makefile b/Makefile index ae6b318d..3e03456b 100644 --- a/Makefile +++ b/Makefile @@ -28,13 +28,6 @@ MAKE = make # use the following setting for Debian / Ubuntu installations: # RO_GAME_DIR = /usr/share/games/rocksndiamonds -# directory for writable game data (like highscore files) -# (if no "scores" directory exists, scores are saved in user data directory) -# default is '.' to be able to run program without installation -# RW_GAME_DIR = . -# use the following setting for Debian / Ubuntu installations: -# RW_GAME_DIR = /var/games/rocksndiamonds - # uncomment if system has no joystick include file # JOYSTICK = -DNO_JOYSTICK diff --git a/src/Makefile b/src/Makefile index f40ada29..5f57dd34 100644 --- a/src/Makefile +++ b/src/Makefile @@ -118,11 +118,7 @@ ifdef RO_GAME_DIR # path to read-only game data specified CONFIG_RO_GAME_DIR = -DRO_GAME_DIR="\"$(RO_GAME_DIR)\"" endif -ifdef RW_GAME_DIR # path to writable game data specified -CONFIG_RW_GAME_DIR = -DRW_GAME_DIR="\"$(RW_GAME_DIR)\"" -endif - -CONFIG = $(CONFIG_RO_GAME_DIR) $(CONFIG_RW_GAME_DIR) $(JOYSTICK) +CONFIG = $(CONFIG_RO_GAME_DIR) $(JOYSTICK) DEBUG = -DDEBUG -g diff --git a/src/libgame/misc.c b/src/libgame/misc.c index 8dda88bc..a81f1553 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -1241,7 +1241,6 @@ void GetOptions(int argc, char *argv[], void (*print_version_function)(void)) { char *ro_base_path = getProgramMainDataPath(argv[0], RO_BASE_PATH); - char *rw_base_path = getProgramMainDataPath(argv[0], RW_BASE_PATH); char **argvplus = checked_calloc((argc + 1) * sizeof(char **)); char **options_left = &argvplus[1]; @@ -1254,7 +1253,6 @@ void GetOptions(int argc, char *argv[], options.server_port = 0; options.ro_base_directory = ro_base_path; - options.rw_base_directory = rw_base_path; options.level_directory = getPath2(ro_base_path, LEVELS_DIRECTORY); options.graphics_directory = getPath2(ro_base_path, GRAPHICS_DIRECTORY); options.sounds_directory = getPath2(ro_base_path, SOUNDS_DIRECTORY); @@ -1334,9 +1332,7 @@ void GetOptions(int argc, char *argv[], if (option_arg == NULL) FailWithHelp("option '%s' requires an argument", option_str); - // this should be extended to separate options for ro and rw data options.ro_base_directory = ro_base_path = getStringCopy(option_arg); - options.rw_base_directory = rw_base_path = getStringCopy(option_arg); if (option_arg == next_option) options_left++; diff --git a/src/libgame/system.h b/src/libgame/system.h index 9d44373c..e93122a8 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -629,12 +629,7 @@ #define RO_GAME_DIR "." #endif -#ifndef RW_GAME_DIR -#define RW_GAME_DIR "." -#endif - #define RO_BASE_PATH RO_GAME_DIR -#define RW_BASE_PATH RW_GAME_DIR // directory names #define GRAPHICS_DIRECTORY "graphics" @@ -1046,7 +1041,6 @@ struct OptionInfo int server_port; char *ro_base_directory; - char *rw_base_directory; char *level_directory; char *graphics_directory; char *sounds_directory; -- 2.34.1