X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsetup.c;h=6b10a51ec9d4d7248eb6ad54eee66a65433c9c6f;hb=a30a27ce6c313e56cc92dc7183d599f63f8ca1f2;hp=fa696c581e2d1a69c966a0d4fe54d3c153aaf010;hpb=ba3f6a6c4f34631773dc5a7cfdc5b4089cd16da5;p=rocksndiamonds.git diff --git a/src/libgame/setup.c b/src/libgame/setup.c index fa696c58..6b10a51e 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -47,8 +47,6 @@ static char *levelclass_desc[NUM_LEVELCLASS_DESC] = #define TOKEN_VALUE_POSITION_DEFAULT 40 #define TOKEN_COMMENT_POSITION_DEFAULT 60 -#define MAX_COOKIE_LEN 256 - #define TREE_NODE_TYPE_DEFAULT 0 #define TREE_NODE_TYPE_PARENT 1 #define TREE_NODE_TYPE_GROUP 2 @@ -2003,21 +2001,6 @@ void SetFilePermissions(char *filename, int permission_class) chmod(filename, perms); } -char *getCookie(char *file_type) -{ - static char cookie[MAX_COOKIE_LEN + 1]; - - if (strlen(program.cookie_prefix) + 1 + - strlen(file_type) + strlen("_FILE_VERSION_x.x") > MAX_COOKIE_LEN) - return "[COOKIE ERROR]"; // should never happen - - sprintf(cookie, "%s_%s_FILE_VERSION_%d.%d", - program.cookie_prefix, file_type, - program.version_super, program.version_major); - - return cookie; -} - void fprintFileHeader(FILE *file, char *basename) { char *prefix = "# "; @@ -2730,10 +2713,11 @@ SetupFileHash *loadSetupFileHash(char *filename) #define LEVELINFO_TOKEN_EMPTY_LEVEL_NAME 27 #define LEVELINFO_TOKEN_FORCE_LEVEL_NAME 28 #define LEVELINFO_TOKEN_HANDICAP 29 -#define LEVELINFO_TOKEN_SKIP_LEVELS 30 -#define LEVELINFO_TOKEN_USE_EMC_TILES 31 +#define LEVELINFO_TOKEN_TIME_LIMIT 30 +#define LEVELINFO_TOKEN_SKIP_LEVELS 31 +#define LEVELINFO_TOKEN_USE_EMC_TILES 32 -#define NUM_LEVELINFO_TOKENS 32 +#define NUM_LEVELINFO_TOKENS 33 static LevelDirTree ldi; @@ -2770,6 +2754,7 @@ static struct TokenInfo levelinfo_tokens[] = { TYPE_STRING, &ldi.empty_level_name, "empty_level_name" }, { TYPE_BOOLEAN, &ldi.force_level_name, "force_level_name" }, { TYPE_BOOLEAN, &ldi.handicap, "handicap" }, + { TYPE_BOOLEAN, &ldi.time_limit, "time_limit" }, { TYPE_BOOLEAN, &ldi.skip_levels, "skip_levels" }, { TYPE_BOOLEAN, &ldi.use_emc_tiles, "use_emc_tiles" } }; @@ -2876,6 +2861,7 @@ static void setTreeInfoToDefaults(TreeInfo *ti, int type) ti->handicap_level = 0; ti->readonly = TRUE; ti->handicap = TRUE; + ti->time_limit = TRUE; ti->skip_levels = FALSE; ti->use_emc_tiles = FALSE; @@ -2961,6 +2947,7 @@ static void setTreeInfoToDefaultsFromParent(TreeInfo *ti, TreeInfo *parent) ti->handicap_level = parent->handicap_level; ti->readonly = parent->readonly; ti->handicap = parent->handicap; + ti->time_limit = parent->time_limit; ti->skip_levels = parent->skip_levels; ti->use_emc_tiles = parent->use_emc_tiles; @@ -3033,6 +3020,7 @@ static TreeInfo *getTreeInfoCopy(TreeInfo *ti) ti_copy->user_defined = ti->user_defined; ti_copy->readonly = ti->readonly; ti_copy->handicap = ti->handicap; + ti_copy->time_limit = ti->time_limit; ti_copy->skip_levels = ti->skip_levels; ti_copy->use_emc_tiles = ti->use_emc_tiles;