Beispiel #1
0
int write_polmap()
{
    cout << "Reading UO data.." << endl;
    open_uo_data_files();
    read_uo_data();
    write_polmap( "dngnmap0.pol", 5120, 6144 );
    write_polmap( "map0.pol", 0, 6144 );
	clear_tiledata();
    return 0;
}
Beispiel #2
0
static int write_polmap()
{
  INFO_PRINT << "Reading UO data..\n";
  Core::open_uo_data_files();
  Core::read_uo_data();
  write_polmap("dngnmap0.pol", 5120, 6144);
  write_polmap("map0.pol", 0, 6144);
  Core::clear_tiledata();
  return 0;
}
Beispiel #3
0
int xmain( int argc, char* argv[] )
{
    StoreCmdArgs( argc, argv );
    ConfigFile cf( "pol.cfg" );
    ConfigElem elem;

    cf.readraw( elem );

    config.uo_datafile_root = elem.remove_string( "UoDataFileRoot" );
    config.uo_datafile_root = normalized_dir_form( config.uo_datafile_root );

	unsigned short max_tile = elem.remove_ushort( "MaxTileID", 0x3FFF );

	if (max_tile != 0x3FFF && max_tile != 0x7FFF)
		config.max_tile_id = 0x3FFF;
	else
		config.max_tile_id = max_tile;

	if (argc <= 1)
		return Usage(1);

    if (argv[1][0] == '/' || argv[1][1] == ':')
    {
        config.uo_datafile_root = argv[1];
        --argc;
        ++argv;
    }

	if (stricmp( argv[1], "tiledump" ) == 0)
	{
		return tiledump( argc, argv );
	}
	else if (stricmp( argv[1], "vertile" ) == 0)
	{
		return vertile( argc, argv );
	}
    else if (stricmp( argv[1], "verlandtile" ) == 0)
    {
        return verlandtile( argc, argv );
    }
    else if (stricmp( argv[1], "landtilehist" ) == 0)
    {
        return landtilehist( argc, argv );
    }
	else if (stricmp( argv[1], "flagsearch" ) == 0)
	{
		return flagsearch( argc, argv );
	}
	else if (stricmp( argv[1], "landtileflagsearch" ) == 0)
	{
		return landtileflagsearch( argc, argv );
	}
    else if (stricmp( argv[1], "loschange" ) == 0)
    {
        return loschange( argc, argv );
    }
	else if (stricmp( argv[1], "rawdump" ) == 0)
	{
		return rawdump( argc, argv );
	}
    else if (stricmp( argv[1], "ctable" ) == 0)
    {
        return print_ctable();
    }
    else if (stricmp( argv[1], "sndlist" ) == 0)
    {
        return print_sndlist(argc, argv);
    }
    else if (stricmp( argv[1], "statics" ) == 0)
    {
        return print_statics();
    }
    else if (stricmp( argv[1], "verdata" ) == 0)
    {
        return print_verdata_info();
    }
    else if (stricmp( argv[1], "multis" ) == 0)
    {
        return print_multis();
    }
    else if (stricmp( argv[1], "water" ) == 0)
    {
        return print_water_data();
    }
    else if (stricmp( argv[1], "newstatics" ) == 0)
    {
        return write_pol_static_files( "main" );
    }
    else if (stricmp( argv[1], "staticsmax" ) == 0)
    {
        void staticsmax();
        open_uo_data_files();
        staticsmax();
        return 0;
    }
    else if (stricmp( argv[1], "watersearch" ) == 0)
    {
        return water_search(argc,argv);
    }
    else if (stricmp( argv[1], "zhist" ) == 0)
    {
        return z_histogram();
    }
    else if (stricmp( argv[1], "staticshist" ) == 0)
    {
        return statics_histogram();
    }
    else if (stricmp( argv[1], "writedungmap" ) == 0)
    {
        return write_polmap();
    }
    else if (stricmp( argv[1], "writekeys" ) == 0)
    {
        printf( "Keys written to current.key" );
        return 0;
    }
    else if (stricmp( argv[1], "mapdump" ) == 0)
    {
        return mapdump( argc, argv );
    }
    else if (stricmp( argv[1], "contour" ) == 0)
    {
        return contour( argc, argv );
    }
    else if (stricmp( argv[1], "findlandtile" ) == 0)
    {
        return findlandtile( argc-1, argv+1 );
    }
	else if (stricmp( argv[1], "findlandtileflags" ) == 0)
	{
		return findlandtileflags( argc-1, argv+1 );
	}
    else if (stricmp( argv[1], "findgraphic" ) == 0)
    {
        return findgraphic( argc-1, argv+1 );
    }
    else if (stricmp( argv[1], "defragstatics" ) == 0)
    {
        return defragstatics( argc-1, argv+1 );
    }
    
	return 0;
}