return filename;
}
-char *getDemoAnimInfoFilename()
+char *getHelpAnimFilename()
{
static char *filename = NULL;
if (filename != NULL)
free(filename);
- filename = getPath2(getCurrentLevelDir(), DEMOANIMINFO_FILENAME);
+ filename = getPath2(getCurrentLevelDir(), HELPANIM_FILENAME);
return filename;
}
-char *getDemoAnimTextFilename()
+char *getHelpTextFilename()
{
static char *filename = NULL;
if (filename != NULL)
free(filename);
- filename = getPath2(getCurrentLevelDir(), DEMOANIMTEXT_FILENAME);
+ filename = getPath2(getCurrentLevelDir(), HELPTEXT_FILENAME);
return filename;
}
+char *getLevelSetInfoFilename()
+{
+ static char *filename = NULL;
+ char *basenames[] =
+ {
+ "readme",
+ "readme.txt",
+ "README",
+ "README.txt",
+ "README.TXT",
+
+ NULL
+ };
+ int i;
+
+ for (i = 0; basenames[i] != NULL; i++)
+ {
+ if (filename != NULL)
+ free(filename);
+
+ filename = getPath2(getCurrentLevelDir(), basenames[i]);
+ if (fileExists(filename))
+ return filename;
+ }
+
+ return NULL;
+}
+
static char *getCorrectedArtworkBasename(char *basename)
{
char *basename_corrected = basename;
while (node)
{
- for (i=0; i<(depth + 1) * 3; i++)
+ for (i = 0; i < (depth + 1) * 3; i++)
printf(" ");
#if 1
compare_function);
/* update the linkage of list elements with the sorted node array */
- for (i=0; i<num_nodes - 1; i++)
+ for (i = 0; i < num_nodes - 1; i++)
sort_array[i]->next = sort_array[i + 1];
sort_array[num_nodes - 1]->next = NULL;
/* start with the token and some spaces to format output line */
sprintf(entry, "%s:", token);
- for (i=strlen(entry); i<TOKEN_VALUE_POSITION; i++)
+ for (i = strlen(entry); i < TOKEN_VALUE_POSITION; i++)
strcat(entry, " ");
/* continue with the token's value */
return NULL;
}
- while(!feof(file))
+ while (!feof(file))
{
/* read next line of input file */
if (!fgets(line, MAX_LINE_LEN, file))
/* set all structure fields according to the token/value pairs */
ldi = *leveldir_new;
- for (i=0; i<NUM_LEVELINFO_TOKENS; i++)
+ for (i = 0; i < NUM_LEVELINFO_TOKENS; i++)
setSetupInfo(levelinfo_tokens, i,
getHashEntry(setup_file_hash, levelinfo_tokens[i].text));
*leveldir_new = ldi;
/* set all structure fields according to the token/value pairs */
ldi = *artwork_new;
- for (i=0; i<NUM_LEVELINFO_TOKENS; i++)
+ for (i = 0; i < NUM_LEVELINFO_TOKENS; i++)
setSetupInfo(levelinfo_tokens, i,
getHashEntry(setup_file_hash, levelinfo_tokens[i].text));
*artwork_new = ldi;
getCookie("LEVELINFO")));
ldi = *level_info;
- for (i=0; i<NUM_LEVELINFO_TOKENS; i++)
+ for (i = 0; i < NUM_LEVELINFO_TOKENS; i++)
if (i != LEVELINFO_TOKEN_IDENTIFIER &&
i != LEVELINFO_TOKEN_NAME_SORTING &&
i != LEVELINFO_TOKEN_IMPORTED_FROM)
{
/* add at least one whitespace */
strcat(line, " ");
- for (i=strlen(line); i<TOKEN_COMMENT_POSITION; i++)
+ for (i = strlen(line); i < TOKEN_COMMENT_POSITION; i++)
strcat(line, " ");
strcat(line, "# ");