Esempio n. 1
0
/* --- OK, now we have eight. --- */
void setup(int argc, char * argv[])
{
    /* Read debugging args from command line */
    handle_debug_args(argc, argv);
    /* initialize locale from system settings: */
    initialize_locale("");      
    /* initialize settings and read in config files: */
    /* Note this now only does the global settings   */
    initialize_options();
    /* Command-line code now in own function: */
    handle_command_args(argc, argv);
    /* initialize default user's options (for resolution)*/
    initialize_options_user();
    /* SDL setup in own function:*/
    initialize_SDL();
    /* Read image and sound files: */
    load_data_files();
    /* Generate flipped versions of walking images */
    generate_flipped_images();
    /* Generate blended images (e.g., igloos) */
    generate_blended_images();
    /* Note that the per-user options will be set after the call to
       titlescreen, to allow for user-login to occur. 

       FIXME this means that command-line args will be overridden!
       Is this desirable? */
}
Esempio n. 2
0
int
main (int argc, char *argv[])
{
	int i;

	/* Parse arguments. */
	options.tables = ".";
	for (i = 1; i < argc; i++) {
		if (strcmp (argv[i], "--help") == 0)
			usage (0);

		else if (strcmp (argv[i], "--tables") == 0) {
			if (argv[i + 1] == NULL) {
				fprintf (stderr, "--tables requires a directory name.\n");
				usage (1);
			}
			options.tables = argv[i + 1];
			i++;

		} else {
			fprintf (stderr, "Unknown parameter: %s\n", argv[i]);
			usage (1);
		}
	}

	/* Load data files. */
	load_data_files ();

	/* Initialize server and main loop. */
	return unix_start ();
}