SDL_EnableUNICODE(1);
static void Init	(	){	Uint32 init_flags = SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_AUDIO;#ifdef NO_SDL_PARACHUTE	init_flags |= SDL_INIT_NOPARACHUTE;#endif	if (SDL_Init(init_flags) < 0)	{		cerr << "Unable to initialize SDL: " << SDL_GetError() << endl;		exit(-1);	}	atexit(SDL_Quit);		SDL_SysWMinfo info;		// Get system info.        SDL_GetWMInfo(&info);#ifdef XWIN					// Want drag-and-drop events.	SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE);#endif	SDL_ShowCursor(0);	SDL_VERSION(&info.version);	SDL_EnableUNICODE(1);	// Activate unicode translation for keypresses		int w, h, sc;#ifdef BLACKGATE_DIGITAL_CAMERA	// create 2048x2048 screenshots of the full Ultima 7 map.	// WARNING!! Takes up lots of memory and diskspace!	h = w = c_tilesize * c_tiles_per_schunk; sc = 1;	Image_window8::set_gamma(1, 1, 1);	gwin = new Game_window(w, h, sc);	current_res = find_resolution(w, h, sc);	Game::create_game(BLACK_GATE);	gwin->init_files();		for (int x = 0; x < c_num_chunks / c_chunks_per_schunk; x++) {		for (int y = 0; y < c_num_chunks / c_chunks_per_schunk; y++) {			gwin->paint_map_at_tile(0,0,w,h,x * c_tiles_per_schunk, y * c_tiles_per_schunk, 15);			char fn[15];			snprintf(fn, 15, "u7map%x%x.pcx", x, y);			SDL_RWops *dst = SDL_RWFromFile(fn, "wb");			cerr << x << "," << y << ": ";			gwin->get_win()->screenshot(dst);		}	}	exit(0);#endif	// Default resolution is 320x200 with 2x scaling	w = 320;	h = 200;	sc = 2;	int sw, sh, scaleval;	string gr, gg, gb;	config->value("config/video/width", sw, w);	config->value("config/video/height", sh, h);	config->value("config/video/scale", scaleval, sc);	config->value("config/video/gamma/red", gr, "1.0");	config->value("config/video/gamma/green", gg, "1.0");	config->value("config/video/gamma/blue", gb, "1.0");	Image_window8::set_gamma(atof(gr.c_str()), atof(gg.c_str()), atof(gb.c_str()));		gwin = new Game_window(sw, sh, scaleval);	current_res = find_resolution(sw, sh, scaleval);	Audio::get_ptr();	string disable_fades;	config->value("config/video/disable_fades", disable_fades, "no");	if (disable_fades == "yes")		gwin->set_fades_enabled(false);#ifdef WIN32	//enable unknown (to SDL) window messages, including MM_MCINOTIFY	//(for MIDI repeats)	//SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE);#endif //WIN32	SDL_SetEventFilter(0);	// Show the banner	ExultMenu exult_menu(gwin);	Exult_Game mygame = exult_menu.run();	Game::create_game(mygame);	string yn;	gwin->init_files();					// Skip splash screen?	config->value("config/gameplay/skip_splash", yn, "no");	if(yn == "no") 		game->play_intro();	game->show_menu();	gwin->set_mode(Game_window::normal);	SDL_SetEventFilter(Filter_intro_events);	gwin->setup_game();		// This will start the scene.					// Get scale factor for mouse.	if (gwin->get_win())		scale = Log2( gwin->get_win()->get_scale() );#ifdef XWIN        SDL_GetWMInfo(&info);        xfd = ConnectionNumber(info.info.x11.display);	xdnd = new Xdnd(info.info.x11.display, info.info.x11.wmwindow,				info.info.x11.window, Drop_dragged_shape);#endif}