Audio::get_ptr()->Init_sfx();
Audio *audio = Audio::get_ptr(); MyMidiPlayer *midi = 0;  if (audio) { Audio::get_ptr()->Init_sfx(); midi = audio->get_midi(); }
static void Init	(	){	Uint32 init_flags = SDL_INIT_VIDEO|SDL_INIT_TIMER;#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);	}	std::atexit(SDL_Quit);		SDL_SysWMinfo info;		// Get system info.        SDL_GetWMInfo(&info);#ifdef USE_EXULTSTUDIO					// Want drag-and-drop events.	SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE);#endif					// KBD repeat should be nice.	SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, 						SDL_DEFAULT_REPEAT_INTERVAL);	SDL_ShowCursor(0);	SDL_VERSION(&info.version);#ifndef MACOSX		// Don't set icon on OS X; the external icon is *much* nicer	SetIcon();#endif	int w, h, sc, sclr;	// Default resolution is 320x200 with 2x scaling	w = 320;	h = 200;	sc = 2;	sclr = Image_window::SaI;	int sw, sh, scaleval;	string gr, gg, gb, scaler;	config->value("config/video/width", sw, w);	config->value("config/video/height", sh, h);	config->value("config/video/scale_method", scaler, "---");	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");	config->value("config/video/scale", scaleval, sc);	sclr = Image_window::get_scaler_for_name(scaler);	if (sclr == Image_window::NoScaler) config->set("config/video/scale_method","2xSaI",true);	if (arg_buildmap >= 0)		BuildGameMap();	Image_window8::set_gamma(atof(gr.c_str()), atof(gg.c_str()), atof(gb.c_str()));		gwin = new Game_window(sw, sh, scaleval, sclr);	current_res = find_resolution(sw, sh, scaleval);	Audio::Init();	bool disable_fades;	config->value("config/video/disable_fades", disable_fades, false);	gwin->get_pal()->set_fades_enabled(!disable_fades);	SDL_SetEventFilter(0);	// Show the banner	Exult_Game mygame;	game = 0;	// Figure out all the games' paths, before we store them.  That	// way, we don't have to recalculate them if we come back to the	// main menu and make another selection.	if (arg_gamename != "default") {		// The user gave us a game title, so load that one's		// paths.		get_game_paths(arg_gamename);	}	store_system_paths();	do {		reset_system_paths();		fontManager.reset();		U7FileManager::get_ptr()->reset();		const char *title = 0;		if(game)			delete game;				if (run_bg) {			mygame = BLACK_GATE;			run_bg = false;		} else if (run_si) {			mygame = SERPENT_ISLE;			run_si = false;		} else if (arg_buildmap < 0 && arg_gamename != "default") {			mygame = EXULT_DEVEL_GAME;			title = arg_gamename.c_str();		} else {			ExultMenu exult_menu(gwin);			mygame = exult_menu.run();		}		Game::create_game(mygame, title);		Audio::get_ptr()->Init_sfx();				Setup_text();					// Skip splash screen?		bool skip_splash;		config->value("config/gameplay/skip_splash", skip_splash);		if(!skip_splash && 					// Skip intro. if devel. game.		   (Game::get_game_type() != EXULT_DEVEL_GAME ||					U7exists("<STATIC>/intro.dat")))			game->play_intro();	} while(!game->show_menu(arg_nomenu));	gwin->init_files();	gwin->read_gwin();	gwin->setup_game(arg_edit_mode);	// This will start the scene.					// Get scale factor for mouse.#ifdef USE_EXULTSTUDIO#ifndef WIN32        SDL_GetWMInfo(&info);        xfd = ConnectionNumber(info.info.x11.display);	Server_init();			// Initialize server (for map-editor).	xdnd = new Xdnd(info.info.x11.display, info.info.x11.wmwindow,		info.info.x11.window, Move_dragged_shape, Move_dragged_combo,				Drop_dragged_shape, Drop_dragged_chunk, 							Drop_dragged_combo);#elif !defined(UNDER_CE)	SDL_GetWMInfo(&info);	Server_init();			// Initialize server (for map-editor).	hgwin = info.window;        OleInitialize(NULL);	windnd = new Windnd(hgwin, Move_dragged_shape, Move_dragged_combo,				Drop_dragged_shape, Drop_dragged_chunk,							Drop_dragged_combo);	if (FAILED(RegisterDragDrop(hgwin, windnd))) {	     cout << "Something's wrong with OLE2 ..." << endl;	};#endif#endif}