projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
deactivated some debug messages
[rocksndiamonds.git]
/
src
/
libgame
/
setup.c
diff --git
a/src/libgame/setup.c
b/src/libgame/setup.c
index bbfbe9c3d9063057f2d044e94e2401111705a550..de23a94035ee2ef5da704d97a06e53ec43f21b8a 100644
(file)
--- a/
src/libgame/setup.c
+++ b/
src/libgame/setup.c
@@
-31,6
+31,7
@@
#define ENABLE_UNUSED_CODE FALSE /* for currently unused functions */
#define ENABLE_UNUSED_CODE FALSE /* for currently unused functions */
+#define DEBUG_NO_CONFIG_FILE FALSE /* for extra-verbose debug output */
#define NUM_LEVELCLASS_DESC 8
#define NUM_LEVELCLASS_DESC 8
@@
-1575,7
+1576,7
@@
char *getCookie(char *file_type)
sprintf(cookie, "%s_%s_FILE_VERSION_%d.%d",
program.cookie_prefix, file_type,
sprintf(cookie, "%s_%s_FILE_VERSION_%d.%d",
program.cookie_prefix, file_type,
- program.version_
major, program.version_min
or);
+ program.version_
super, program.version_maj
or);
return cookie;
}
return cookie;
}
@@
-1600,7
+1601,7
@@
int getFileVersionFromCookieString(const char *cookie)
const int len_pattern1 = strlen(pattern1);
const int len_pattern2 = strlen(pattern2);
const int len_pattern = len_pattern1 + len_pattern2;
const int len_pattern1 = strlen(pattern1);
const int len_pattern2 = strlen(pattern2);
const int len_pattern = len_pattern1 + len_pattern2;
- int version_
major, version_min
or;
+ int version_
super, version_maj
or;
if (len_cookie <= len_pattern)
return -1;
if (len_cookie <= len_pattern)
return -1;
@@
-1616,10
+1617,10
@@
int getFileVersionFromCookieString(const char *cookie)
ptr_cookie2[2] < '0' || ptr_cookie2[2] > '9')
return -1;
ptr_cookie2[2] < '0' || ptr_cookie2[2] > '9')
return -1;
- version_
majo
r = ptr_cookie2[0] - '0';
- version_m
in
or = ptr_cookie2[2] - '0';
+ version_
supe
r = ptr_cookie2[0] - '0';
+ version_m
aj
or = ptr_cookie2[2] - '0';
- return VERSION_IDENT(version_
major, version_min
or, 0, 0);
+ return VERSION_IDENT(version_
super, version_maj
or, 0, 0);
}
boolean checkCookieString(const char *cookie, const char *template)
}
boolean checkCookieString(const char *cookie, const char *template)
@@
-2024,7
+2025,9
@@
static boolean loadSetupFileData(void *setup_file_data, char *filename,
if (!(file = openFile(filename, MODE_READ)))
{
if (!(file = openFile(filename, MODE_READ)))
{
+#if DEBUG_NO_CONFIG_FILE
Error(ERR_DEBUG, "cannot open configuration file '%s'", filename);
Error(ERR_DEBUG, "cannot open configuration file '%s'", filename);
+#endif
return FALSE;
}
return FALSE;
}
@@
-2629,6
+2632,10
@@
void setSetupInfo(struct TokenInfo *token_info,
*(char **)setup_value = getStringCopy(token_value);
break;
*(char **)setup_value = getStringCopy(token_value);
break;
+ case TYPE_PLAYER:
+ *(int *)setup_value = get_player_nr_from_string(token_value);
+ break;
+
default:
break;
}
default:
break;
}
@@
-2962,7
+2969,9
@@
static boolean LoadLevelInfoFromLevelConf(TreeInfo **node_first,
if (setup_file_hash == NULL)
{
if (setup_file_hash == NULL)
{
+#if DEBUG_NO_CONFIG_FILE
Error(ERR_WARN, "ignoring level directory '%s'", directory_path);
Error(ERR_WARN, "ignoring level directory '%s'", directory_path);
+#endif
free(directory_path);
free(filename);
free(directory_path);
free(filename);
@@
-3200,8
+3209,10
@@
static boolean LoadArtworkInfoFromArtworkConf(TreeInfo **node_first,
if (!valid_file_found)
{
if (!valid_file_found)
{
+#if DEBUG_NO_CONFIG_FILE
if (!strEqual(directory_name, "."))
Error(ERR_WARN, "ignoring artwork directory '%s'", directory_path);
if (!strEqual(directory_name, "."))
Error(ERR_WARN, "ignoring artwork directory '%s'", directory_path);
+#endif
free(directory_path);
free(filename);
free(directory_path);
free(filename);
@@
-3872,6
+3883,10
@@
char *getSetupValue(int type, void *value)
strcpy(value_string, *(char **)value);
break;
strcpy(value_string, *(char **)value);
break;
+ case TYPE_PLAYER:
+ sprintf(value_string, "player_%d", *(int *)value + 1);
+ break;
+
default:
value_string[0] = '\0';
break;
default:
value_string[0] = '\0';
break;