X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Flibgame%2Fsetup.c;h=240fe67f928bd47524ae85afcc7a3113a5598752;hb=1446af0fb66276d75bd2ce82d368292283e555aa;hp=def8fa9e715bad821e011abc843893996707b3d1;hpb=fe158e864d3fa4b0221e9c88d8dfff0157051396;p=rocksndiamonds.git diff --git a/src/libgame/setup.c b/src/libgame/setup.c index def8fa9e..240fe67f 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -1007,16 +1007,16 @@ static struct LevelDirInfo ldi; static struct TokenInfo levelinfo_tokens[] = { /* level directory info */ - { TYPE_STRING, &ldi.name, "name" }, - { TYPE_STRING, &ldi.name_short, "name_short" }, - { TYPE_STRING, &ldi.name_sorting, "name_sorting" }, - { TYPE_STRING, &ldi.author, "author" }, - { TYPE_STRING, &ldi.imported_from, "imported_from" }, - { TYPE_INTEGER, &ldi.levels, "levels" }, - { TYPE_INTEGER, &ldi.first_level, "first_level" }, - { TYPE_INTEGER, &ldi.sort_priority, "sort_priority" }, - { TYPE_BOOLEAN, &ldi.level_group, "level_group" }, - { TYPE_BOOLEAN, &ldi.readonly, "readonly" } + { TYPE_STRING, &ldi.name, "name" }, + { TYPE_STRING, &ldi.name_short, "name_short" }, + { TYPE_STRING, &ldi.name_sorting, "name_sorting" }, + { TYPE_STRING, &ldi.author, "author" }, + { TYPE_STRING, &ldi.imported_from, "imported_from" }, + { TYPE_INTEGER, &ldi.levels, "levels" }, + { TYPE_INTEGER, &ldi.first_level, "first_level" }, + { TYPE_INTEGER, &ldi.sort_priority, "sort_priority" }, + { TYPE_BOOLEAN, &ldi.level_group, "level_group" }, + { TYPE_BOOLEAN, &ldi.readonly, "readonly" } }; static void setLevelDirInfoToDefaults(struct LevelDirInfo *ldi) @@ -1384,66 +1384,78 @@ static void SaveUserLevelInfo() SetFilePermissions(filename, PERMS_PRIVATE); } -char *getSetupLine(struct TokenInfo *token_info, char *prefix, int token_nr) +char *getSetupValue(int type, void *value) { - int i; - static char entry[MAX_LINE_LEN]; - int token_type = token_info[token_nr].type; - void *setup_value = token_info[token_nr].value; - char *token_text = token_info[token_nr].text; - - /* start with the prefix, token and some spaces to format output line */ - sprintf(entry, "%s%s:", prefix, token_text); - for (i=strlen(entry); i