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 bf02c2276e2a6a2f2227e993705fa64d26ad15f3..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
@@
-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;