if (ldi->type == TREE_TYPE_LEVEL_DIR)
{
ldi->imported_from = NULL;
+
ldi->graphics_set = NULL;
ldi->sounds_set = NULL;
ldi->music_set = NULL;
ldi->graphics_path = getStringCopy(UNDEFINED_FILENAME);
ldi->sounds_path = getStringCopy(UNDEFINED_FILENAME);
ldi->music_path = getStringCopy(UNDEFINED_FILENAME);
+
ldi->levels = 0;
ldi->first_level = 0;
ldi->last_level = 0;
return;
}
+#if 1
+ /* copy all values from the parent structure */
+
+ ldi->type = parent->type;
+
+ ldi->node_top = parent->node_top;
+ ldi->node_parent = parent;
+ ldi->node_group = NULL;
+ ldi->next = NULL;
+
+ ldi->cl_first = -1;
+ ldi->cl_cursor = -1;
+
+ ldi->filename = NULL;
+ ldi->fullpath = NULL;
+ ldi->basepath = NULL;
+ ldi->identifier = NULL;
+ ldi->name = getStringCopy(ANONYMOUS_NAME);
+ ldi->name_sorting = NULL;
+ ldi->author = getStringCopy(parent->author);
+
+ ldi->sort_priority = parent->sort_priority;
+ ldi->parent_link = FALSE;
+ ldi->user_defined = parent->user_defined;
+ ldi->color = parent->color;
+ ldi->class_desc = getStringCopy(parent->class_desc);
+
+ if (ldi->type == TREE_TYPE_LEVEL_DIR)
+ {
+ ldi->imported_from = getStringCopy(parent->imported_from);
+
+ ldi->graphics_set = NULL;
+ ldi->sounds_set = NULL;
+ ldi->music_set = NULL;
+ ldi->graphics_path = getStringCopy(UNDEFINED_FILENAME);
+ ldi->sounds_path = getStringCopy(UNDEFINED_FILENAME);
+ ldi->music_path = getStringCopy(UNDEFINED_FILENAME);
+
+ ldi->levels = 0;
+ ldi->first_level = 0;
+ ldi->last_level = 0;
+ ldi->level_group = FALSE;
+ ldi->handicap_level = 0;
+ ldi->readonly = TRUE;
+ }
+
+
+#else
+
/* first copy all values from the parent structure ... */
*ldi = *parent;
ldi->name = getStringCopy(ANONYMOUS_NAME);
ldi->name_sorting = NULL;
ldi->author = getStringCopy(parent->author);
+
ldi->imported_from = getStringCopy(parent->imported_from);
+ ldi->class_desc = getStringCopy(parent->class_desc);
+
+ ldi->graphics_set = NULL;
+ ldi->sounds_set = NULL;
+ ldi->music_set = NULL;
+ ldi->graphics_path = NULL;
+ ldi->sounds_path = NULL;
+ ldi->music_path = NULL;
ldi->level_group = FALSE;
ldi->parent_link = FALSE;
ldi->node_parent = parent;
ldi->node_group = NULL;
ldi->next = NULL;
+
+#endif
}
void setSetupInfo(struct TokenInfo *token_info,
/* always start with reliable default values */
setTreeInfoToDefaults(&ldi, TREE_TYPE_LEVEL_DIR);
+#if 0
+ /* !!! FIX ME !!! */
+ setString(&ldi.name, getLoginName());
+ setString(&ldi.author, getRealName());
+ ldi.levels = 100;
+ ldi.first_level = 1;
+ ldi.sort_priority = LEVELCLASS_USER_START;
+ ldi.readonly = FALSE;
+ setString(&ldi.graphics_set, GRAPHICS_SUBDIR);
+ setString(&ldi.sounds_set, SOUNDS_SUBDIR);
+ setString(&ldi.music_set, MUSIC_SUBDIR);
+#else
ldi.name = getStringCopy(getLoginName());
ldi.author = getStringCopy(getRealName());
ldi.levels = 100;
ldi.graphics_set = getStringCopy(GRAPHICS_SUBDIR);
ldi.sounds_set = getStringCopy(SOUNDS_SUBDIR);
ldi.music_set = getStringCopy(MUSIC_SUBDIR);
+#endif
fprintf(file, "%s\n\n", getFormattedSetupEntry(TOKEN_STR_FILE_IDENTIFIER,
getCookie("LEVELINFO")));