Exemple #1
0
static int flagsearch(int argc, char** argv)
{
  Core::USTRUCT_TILE tile;

  Core::open_uo_data_files();
  Core::read_uo_data();

  if (argc < 3)
    return 1;

  unsigned int flags = strtoul(argv[2], NULL, 0);
  unsigned int notflags = 0;
  if (argc >= 4)
    notflags = strtoul(argv[3], NULL, 0);

  int i;
  for (i = 0; i <= 0xFFFF; i++)
  {
    unsigned short objtype = (unsigned short) i;
    read_objinfo(objtype, tile);
    if (((tile.flags & flags) == flags)
        && ((~tile.flags & notflags) == notflags))
    {
      display_tileinfo(objtype, tile);
    }
  }
  Core::clear_tiledata();
  return 0;
}
Exemple #2
0
static int loschange(int /*argc*/, char** /*argv*/)
{
  Core::USTRUCT_TILE tile;

  Core::open_uo_data_files();
  Core::read_uo_data();

  for (int i = 0; i <= 0xFFFF; i++)
  {
    unsigned short objtype = (unsigned short) i;
    read_objinfo(objtype, tile);

    bool old_lostest = (tile.flags & Core::USTRUCT_TILE::FLAG_WALKBLOCK)
                       != 0;

    bool new_lostest = (tile.flags
                        & (Core::USTRUCT_TILE::FLAG_WALKBLOCK
                           | Core::USTRUCT_TILE::FLAG_NO_SHOOT)) != 0;

    if (old_lostest != new_lostest)
    {
      display_tileinfo(objtype, tile);
      INFO_PRINT.Format(" Old LOS: %s\n New LOS: %s\n")
          << (old_lostest ? "true" : "false")
          << (new_lostest ? "true" : "false");

    }

  }
  Core::clear_tiledata();
  return 0;
}
Exemple #3
0
static int tiledump(int argc, char** argv)
{
  Core::USTRUCT_TILE tile;
  u32 version;
  if (argc != 3)
    return 1;

  FILE* fp = fopen(argv[2], "rb");
  fseek(fp, TILES_START, SEEK_SET);
  int recnum = 0;
  unsigned short objtype = 0;
  for (;;)
  {
    if (recnum == 0)
    {
      if (fread(&version, sizeof version, 1, fp) != 1)
        break;
      INFO_PRINT.Format("Block Version: {:08X}\n")
          << static_cast<unsigned long>(version);
    }
    if (fread(&tile, sizeof tile, 1, fp) != 1)
      break;
    display_tileinfo(objtype, tile);

    ++objtype;
    ++recnum;
    if (recnum == 32)
      recnum = 0;

  }
  fclose(fp);
  return 0;
}
Exemple #4
0
int loschange( int argc, char **argv )
{
	USTRUCT_TILE tile;
    
    open_uo_data_files();
    read_uo_data();
    
	for( int i = 0; i <= 0xFFFF; i++ )
	{
		unsigned short objtype = (unsigned short) i;
		read_objinfo( objtype, tile );
        
        bool old_lostest = (tile.flags & USTRUCT_TILE::FLAG_WALKBLOCK) != 0;

        bool new_lostest = (tile.flags & (USTRUCT_TILE::FLAG_WALKBLOCK|USTRUCT_TILE::FLAG_NO_SHOOT)) != 0;


        if (old_lostest != new_lostest)
        {
            display_tileinfo( objtype, tile );
            printf( " Old LOS: %s\n", old_lostest?"true":"false" );
            printf( " New LOS: %s\n", new_lostest?"true":"false" );

        }
         
	}
	clear_tiledata();
	return 0;
}
Exemple #5
0
int tiledump( int argc, char **argv )
{
	USTRUCT_TILE tile;
	u32 version;
	if (argc != 3) 
		return Usage( 1 );

	FILE *fp = fopen( argv[2], "rb" );
	fseek( fp, TILES_START, SEEK_SET );
	int recnum = 0;
	unsigned short objtype = 0;
	for(;;)
	{
		if (recnum == 0)
		{
			if (fread( &version, sizeof version, 1, fp ) != 1)
				break;
			printf( "Block Version: %08lX\n", version );
		}
		if (fread(  &tile, sizeof tile, 1, fp ) != 1)
			break;
		display_tileinfo( objtype, tile );

 		
		++objtype;
		++recnum;
		if (recnum == 32)
			recnum = 0;

	}
    return 0;
}
Exemple #6
0
static int vertile()
{
  Core::USTRUCT_TILE tile;

  Core::open_uo_data_files();
  Core::read_uo_data();

  int i;
  for (i = 0; i <= 0xFFFF; i++)
  {
    unsigned short objtype = (unsigned short) i;
    read_objinfo(objtype, tile);
    display_tileinfo(objtype, tile);
  }
  Core::clear_tiledata();
  return 0;
}
Exemple #7
0
int vertile( int argc, char **argv )
{
	USTRUCT_TILE tile;
    
    open_uo_data_files();
    read_uo_data();

	int i;
	for( i = 0; i <= 0xFFFF; i++ )
	{
		unsigned short objtype = (unsigned short) i;
		read_objinfo( objtype, tile );
        display_tileinfo( objtype, tile );
	}
	clear_tiledata();
	return 0;
}