#include <time.h>
#include <sys/time.h>
#include <sys/types.h>
-/*
-#include <sys/stat.h>
-*/
#include <stdarg.h>
#include <ctype.h>
#include <string.h>
boolean do_busy_waiting = (milliseconds_delay < 5 ? TRUE : FALSE);
#if defined(PLATFORM_MSDOS)
- /* don't use select() to perform waiting operations under DOS/Windows
+ /* don't use select() to perform waiting operations under DOS
environment; always use a busy loop for waiting instead */
do_busy_waiting = TRUE;
#endif
options.network = FALSE;
options.verbose = FALSE;
options.debug = FALSE;
+ options.debug_command = NULL;
while (*options_left)
{
Error(ERR_EXIT_HELP, "unrecognized option '%s'", option);
else if (strncmp(option, "-help", option_len) == 0)
{
- printf("Usage: %s [options] [server.name [port]]\n"
+ printf("Usage: %s [options] [<server host> [<server port>]]\n"
"Options:\n"
" -d, --display <host>[:<scr>] X server display\n"
" -b, --basepath <directory> alternative base directory\n"
" -l, --level <directory> alternative level directory\n"
" -g, --graphics <directory> alternative graphics directory\n"
- " -s, --sounds <directory> alternative graphics directory\n"
- " -m, --music <directory> alternative graphics directory\n"
+ " -s, --sounds <directory> alternative sounds directory\n"
+ " -m, --music <directory> alternative music directory\n"
" -n, --network network multiplayer game\n"
" --serveronly only start network server\n"
" -v, --verbose verbose mode\n"
" --debug display debugging information\n",
program.command_basename);
+
+ if (options.debug)
+ printf(" --debug-command <command> execute special command\n");
+
exit(0);
}
else if (strncmp(option, "-display", option_len) == 0)
{
options.debug = TRUE;
}
+ else if (strncmp(option, "-debug-command", option_len) == 0)
+ {
+ if (option_arg == NULL)
+ Error(ERR_EXIT_HELP, "option '%s' requires an argument", option_str);
+
+ options.debug_command = option_arg;
+ if (option_arg == next_option)
+ options_left++;
+ }
else if (*option == '-')
{
Error(ERR_EXIT_HELP, "unrecognized option '%s'", option_str);
return FALSE;
}
+boolean FileIsArtworkType(char *basename, int type)
+{
+ if ((type == TREE_TYPE_GRAPHICS_DIR && FileIsGraphic(basename)) ||
+ (type == TREE_TYPE_SOUNDS_DIR && FileIsSound(basename)) ||
+ (type == TREE_TYPE_MUSIC_DIR && FileIsMusic(basename)))
+ return TRUE;
+
+ return FALSE;
+}
+
+
/* ========================================================================= */
/* functions only needed for non-Unix (non-command-line) systems */
/* ========================================================================= */