Esempio n. 1
0
void setup(void) {
	init_messages();
	init_motors();
	init_inertial_sensors();
	init_control();
	initTime();
}
Esempio n. 2
0
int gui_messages_log_proc(int msg, DIALOG *d, int c __attribute__((unused)))
{
    switch (msg) {
        case MSG_START:
            init_messages(d);
            break;

        case MSG_END:
            uninit_messages();
            break;

        case MSG_NEW_LOG_TEXT:
            /*
             * Message indicating that there is a new message to be processed
             * and displayed.
             */
            print_messages(d);
            break;

        case MSG_CLEAR_LOG_TEXT:
            clear_messages(d);
            break;
    }

    return D_O_K;
}
Esempio n. 3
0
void sound_reinit_after_load(void)
{
    stop_all_things_playing_samples();
    stop_any_speech_sample();
    if (Non3DEmitter != 0)
    {
        S3DDestroySoundEmitterAndSamples(Non3DEmitter);
        Non3DEmitter = 0;
    }
    ambient_sound_stop();
    StartMusic(1, 127);
    init_messages();
    randomize_sound_font();
}
Esempio n. 4
0
int init() {
  if(SDL_Init(SDL_INIT_EVERYTHING) == -1) {
    return FALSE;
  }

  screen = SDL_SetVideoMode(
    screen_width, screen_height, screen_bpp, SDL_SWSURFACE | SDL_RESIZABLE
  );
  if (screen == NULL) {
    return FALSE;
  }

  if (TTF_Init() == -1) {
    return FALSE;
  }

  font = TTF_OpenFont(font_file, font_size);
  if (font == NULL) {
    return FALSE;
  }

  char wt_temp[256] = "";
  strcat(wt_temp, window_header_str);
  strcat(wt_temp, " - ");
  strcat(wt_temp, window_footer_str);
  SDL_WM_SetCaption(wt_temp, NULL);

  input_init();

  textlist_init();
  textlist_set_random_pos();

  scorelist_load();

  espeak_init();

  timer_start();

  return init_messages();
}
Esempio n. 5
0
int
main(int argc, char **argv)
{
	int c;
	char *lfname = NULL;
	char *cfname = NULL;
	char *wfname = NULL;
	DIR *dir;

	init_charmap();
	init_collate();
	init_ctype();
	init_messages();
	init_monetary();
	init_numeric();
	init_time();

	yydebug = 0;

	(void) setlocale(LC_ALL, "");

	while ((c = getopt(argc, argv, "w:i:cf:u:vUD")) != -1) {
		switch (c) {
		case 'D':
			dragonfly = 1;
			break;
		case 'v':
			verbose++;
			break;
		case 'i':
			lfname = optarg;
			break;
		case 'u':
			set_wide_encoding(optarg);
			break;
		case 'f':
			cfname = optarg;
			break;
		case 'U':
			undefok++;
			break;
		case 'c':
			warnok++;
			break;
		case 'w':
			wfname = optarg;
			break;
		case '?':
			usage();
			break;
		}
	}

	if ((argc - 1) != (optind)) {
		usage();
	}
	locname = argv[argc - 1];
	if (verbose) {
		(void) printf("Processing locale %s.\n", locname);
	}

	if (cfname) {
		if (verbose)
			(void) printf("Loading charmap %s.\n", cfname);
		reset_scanner(cfname);
		(void) yyparse();
	}

	if (wfname) {
		if (verbose)
			(void) printf("Loading widths %s.\n", wfname);
		reset_scanner(wfname);
		(void) yyparse();
	}

	if (verbose) {
		(void) printf("Loading POSIX portable characters.\n");
	}
	add_charmap_posix();

	if (lfname) {
		reset_scanner(lfname);
	} else {
		reset_scanner(NULL);
	}

	/* make the directory for the locale if not already present */
	if (!dragonfly) {
		while ((dir = opendir(locname)) == NULL) {
			if ((errno != ENOENT) ||
			    (mkdir(locname, 0755) <  0)) {
				errf(strerror(errno));
			}
		}
		(void) closedir(dir);
		(void) mkdir(dirname(category_file()), 0755);
	}

	(void) yyparse();
	if (verbose) {
		(void) printf("All done.\n");
	}
	return (warnings ? 1 : 0);
}
Esempio n. 6
0
Context::Context(bool use_messages) : context(gp_context_new()) {
	if (use_messages)
		init_messages();
}