X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsetup.c;h=240fe67f928bd47524ae85afcc7a3113a5598752;hb=1446af0fb66276d75bd2ce82d368292283e555aa;hp=d5b2b51dc42303f4acbb24c58ddfb6d72f7025a1;hpb=d6877ad6d36ea50b9ae41afe3586c5b539aa60e4;p=rocksndiamonds.git diff --git a/src/libgame/setup.c b/src/libgame/setup.c index d5b2b51d..240fe67f 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -247,6 +247,24 @@ char *getImageFilename(char *basename) return filename; } +char *getCustomImageFilename(char *basename) +{ +#if 0 + if (strcmp(basename, "RocksFont.pcx") == 0) + { + char *dir = options.graphics_directory; + + printf("checking directory '%s' ...\n", dir); + + /* + dir = getPath2(options.graphics_directory); + */ + } +#endif + + return getImageFilename(basename); +} + void InitTapeDirectory(char *level_subdir) { createDirectory(getUserDataDir(), "user data", PERMS_PRIVATE); @@ -989,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) @@ -1366,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