config->value("config/debug/trace/combat",combat_trace);
int exult_main(const char *runpath){	string data_path;	string music_path;	// output version info	getVersionInfo(cout);	// Read in configuration file	config = new Configuration;	if (arg_configfile != "") {		config->read_abs_config_file(arg_configfile);	} else {		config->read_config_file(USER_CONFIGURATION_FILE);	}	// Setup virtual directories	config->value("config/disk/data_path",data_path,EXULT_DATADIR);	add_system_path("<DATA>", data_path);	if (!U7exists("<DATA>/exult.flx"))	{		add_system_path("<DATA>", EXULT_DATADIR);		if (!U7exists("<DATA>/exult.flx"))		{			add_system_path("<DATA>", "data");			if(!U7exists("<DATA>/exult.flx"))			{				char *sep = std::strrchr(runpath,'/');				if (!sep) sep = std::strrchr(runpath,'\\');				int plen = sep-runpath;				char *dpath = new char[plen+10];				std::strncpy(dpath, runpath, plen+1);				dpath[plen+1] = 0;				std::strcat(dpath,"data");				cerr << "dpath = " << dpath << endl;				add_system_path("<DATA>",dpath);				if(!U7exists("<DATA>/exult.flx"))				{					// We've tried them all...					cerr << "Could not find 'exult.flx' anywhere." << endl;						cerr << "Please make sure Exult is correctly installed," << endl;					cerr << "and the Exult data path is specified in the configuration file." << endl;					cerr << "(See the README file for more information)" << endl;					exit(-1);				}			}		}	}	std::string default_music = get_system_path("<DATA>/music");	config->value("config/disk/music_path",music_path,default_music.c_str());	add_system_path("<MUSIC>", music_path);	add_system_path("<STATIC>", "static");	add_system_path("<GAMEDAT>", "gamedat");	add_system_path("<PATCH>", "patch");//	add_system_path("<SAVEGAME>", "savegame");	add_system_path("<SAVEGAME>", ".");	std::cout << "Exult path settings:" << std::endl;	std::cout << "Data          : " << get_system_path("<DATA>") << std::endl;	std::cout << "Digital music : " << get_system_path("<MUSIC>") << std::endl;	std::cout << std::endl;	// Check CRCs of our .flx files	bool crc_ok = true;	uint32 crc = crc32_syspath("<DATA>/exult.flx");	if (crc != EXULT_FLX_CRC32) {		crc_ok = false;		cerr << "exult.flx has a wrong checksum!" << endl;	}	if (U7exists("<DATA>/exult_bg.flx")) {		if (crc32_syspath("<DATA>/exult_bg.flx") != EXULT_BG_FLX_CRC32) {			crc_ok = false;			cerr << "exult_bg.flx has a wrong checksum!" << endl;		}	}	if (U7exists("<DATA>/exult_si.flx")) {		if (crc32_syspath("<DATA>/exult_si.flx") != EXULT_SI_FLX_CRC32) {			crc_ok = false;			cerr << "exult_si.flx has a wrong checksum!" << endl;		}	}	bool config_ignore_crc;	config->value("config/disk/no_crc",config_ignore_crc);	ignore_crc |= config_ignore_crc;	if (!ignore_crc && !crc_ok) {		cerr << "This usually means the file(s) mentioned above are "			 << "from a different version" << endl			 << "of Exult than this one. Please re-install Exult" << endl			 << endl			 << "(Note: if you modified the .flx files yourself, "			 << "you can skip this check" << endl			 << "by passing the --nocrc parameter.)" << endl;				return 1;	}	// Convert from old format if needed	vector<string> vs=config->listkeys("config/disk/game",false);	if(vs.size()==0)	{		// Convert from the older format		string data_directory;		config->value("config/disk/u7path",data_directory,".");		config->set("config/disk/game/blackgate/path",data_directory,true);		const string	s("blackgate");		config->set("config/disk/game/blackgate/title",s,true);		vs.push_back(s);	}	get_game_paths("blackgate");	get_game_paths("serpentisle");	// Enable tracing of intrinsics?	config->value("config/debug/trace/intrinsics",intrinsic_trace);	// Enable tracing of UC-instructions?	string uctrace;	config->value("config/debug/trace/usecode", uctrace, "no");	to_uppercase(uctrace);	if (uctrace == "YES")		usecode_trace = 1;	else if (uctrace == "VERBOSE")		usecode_trace = 2;	else		usecode_trace = 0;	// Save game compression level	config->value("config/disk/save_compression_level", save_compression, 1);	if (save_compression < 0 || save_compression > 2) save_compression = 1;	config->set("config/disk/save_compression_level", save_compression, true);#if 0 && USECODE_DEBUGGER	// Enable usecode debugger	config->value("config/debug/debugger/enable",usecode_debugging);	initialise_usecode_debugger();#endif#if (defined(USECODE_DEBUGGER) && defined(XWIN))	signal(SIGUSR1, SIG_IGN);#endif	cheat.init();	Init();				// Create main window.	cheat.finish_init();	Mouse::mouse = new Mouse(gwin);	Mouse::mouse->set_shape(Mouse::hand);	int result = Play();		// start game#if defined(WIN32) && defined(USE_EXULTSTUDIO)	// Currently, leaving the game results in destruction of the window.	//  Maybe sometime in the future, there is an option like "return to	//  main menu and select another scenario". Becaule DnD isn't registered until	//  you really enter the game, we remove it here to prevent possible bugs	//  invilved with registering DnD a second time over an old variable.    RevokeDragDrop(hgwin);	delete windnd;#endif	return result;}