/// <summary> /// Reads information from CLIMATE.PAK and POLITIC.PAK. /// </summary> /// <param name="dfLocation">DFLocation.</param> private void ReadClimatePoliticData(ref DFLocation dfLocation) { DFPosition pos = LongitudeLatitudeToMapPixel((int)dfLocation.MapTableData.Longitude, (int)dfLocation.MapTableData.Latitude); // Read politic data. This should always equal region index + 128. dfLocation.Politic = politicPak.GetValue(pos.X, pos.Y); // Read climate data int worldClimate = climatePak.GetValue(pos.X, pos.Y); dfLocation.Climate = MapsFile.GetWorldClimateSettings(worldClimate); }
/// <summary> /// Reads information from CLIMATE.PAK and POLITIC.PAK. /// </summary> /// <param name="dfLocation">DFLocation.</param> private void ReadClimatePoliticData(ref DFLocation dfLocation) { // Get world map coordinates. As usual Daggerfall's vertical origin // is at the bottom. We need to invert Y as our origin is at the top. // Coordinates also appear to be -1 of actual location on world map. // Adjusting to correct location by adding +1 to X and Y. int x = (int)dfLocation.MapTableData.Longitude / 128 + 1; int y = 499 - (int)dfLocation.MapTableData.Latitude / 128 + 1; // Read politic data. This should always equal region index + 128. dfLocation.Politic = PoliticPak.GetValue(x, y); // Read climate data int worldClimate = ClimatePak.GetValue(x, y); dfLocation.Climate = MapsFile.GetWorldClimateSettings(worldClimate); }