return last_separator;
}
-static char *getBaseNamePtr(char *filename)
+char *getBaseNamePtr(char *filename)
{
char *last_separator = getLastPathSeparatorPtr(filename);
/* when doing batch processing, always enable verbose mode (warnings) */
options.verbose = TRUE;
}
+#if 1
+#if DEBUG
+#if defined(TARGET_SDL)
+ else if (strncmp(option, "-SDL_ListModes", option_len) == 0)
+ {
+ SDL_Rect **modes;
+ int i;
+
+ SDL_Init(SDL_INIT_VIDEO);
+
+ /* get available fullscreen/hardware modes */
+ modes=SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_HWSURFACE);
+
+ /* check if there are any modes available */
+ if (modes == (SDL_Rect **)0)
+ {
+ printf("No modes available!\n");
+
+ exit(-1);
+ }
+
+ /* check if our resolution is restricted */
+ if (modes == (SDL_Rect **)-1)
+ {
+ printf("All resolutions available.\n");
+ }
+ else
+ {
+ /* print valid modes */
+ printf("Available Modes:\n");
+ for(i = 0; modes[i]; i++)
+ printf(" %d x %d\n", modes[i]->w, modes[i]->h);
+ }
+
+ exit(0);
+ }
+#endif
+#endif
+#endif
else if (*option == '-')
{
Error(ERR_EXIT_HELP, "unrecognized option '%s'", option_str);
return (feof(file) || ferror(file) ? FALSE : TRUE);
}
-void putFileChunk(FILE *file, char *chunk_name, int chunk_size,
- int byte_order)
+int putFileChunk(FILE *file, char *chunk_name, int chunk_size,
+ int byte_order)
{
+ int num_bytes = 0;
+
/* write chunk name */
- fputs(chunk_name, file);
+ if (file != NULL)
+ fputs(chunk_name, file);
+
+ num_bytes += strlen(chunk_name);
if (chunk_size >= 0)
{
/* write chunk size */
- putFile32BitInteger(file, chunk_size, byte_order);
+ if (file != NULL)
+ putFile32BitInteger(file, chunk_size, byte_order);
+
+ num_bytes += 4;
}
+
+ return num_bytes;
}
int getFileVersion(FILE *file)
version_build);
}
-void putFileVersion(FILE *file, int version)
+int putFileVersion(FILE *file, int version)
{
- int version_major = VERSION_MAJOR(version);
- int version_minor = VERSION_MINOR(version);
- int version_patch = VERSION_PATCH(version);
- int version_build = VERSION_BUILD(version);
+ if (file != NULL)
+ {
+ int version_major = VERSION_MAJOR(version);
+ int version_minor = VERSION_MINOR(version);
+ int version_patch = VERSION_PATCH(version);
+ int version_build = VERSION_BUILD(version);
- fputc(version_major, file);
- fputc(version_minor, file);
- fputc(version_patch, file);
- fputc(version_build, file);
+ fputc(version_major, file);
+ fputc(version_minor, file);
+ fputc(version_patch, file);
+ fputc(version_build, file);
+ }
+
+ return 4;
}
void ReadBytesFromFile(FILE *file, byte *buffer, unsigned long bytes)
string_has_parameter(value, "random") ? ANIM_RANDOM :
string_has_parameter(value, "ce_value") ? ANIM_CE_VALUE :
string_has_parameter(value, "ce_score") ? ANIM_CE_SCORE :
+ string_has_parameter(value, "ce_delay") ? ANIM_CE_DELAY :
string_has_parameter(value, "horizontal") ? ANIM_HORIZONTAL :
string_has_parameter(value, "vertical") ? ANIM_VERTICAL :
ANIM_DEFAULT);