mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-18 10:19:20 +02:00
Fix the base map orientation, drop the city overlay, keep td.scn out of the editor
The Geoportal images arrive with their first row at the north edge, which is the opposite of what the default texture coordinates assume - the vertical ones are now swapped, for the picker's base map and the orthophoto alike. With the real map carrying its own detail as the view zooms in, the drawn city markers had nothing to add and are gone, along with the coordinate table behind them. Only the country's extent remains, to open the picker on. -editor no longer inherits the scenery named in eu07.ini. That is whatever was last driven, which has nothing to do with editing; without an explicit -s the editor opens on empty ground.
This commit is contained in:
@@ -18,62 +18,26 @@ namespace editor
|
||||
namespace
|
||||
{
|
||||
|
||||
// geographic coordinates, degrees, as (latitude, longitude); projected to EPSG:2180 on first use so
|
||||
// the numbers stay readable and there is a single place where the frame is decided
|
||||
struct geo_point
|
||||
{
|
||||
double latitude;
|
||||
double longitude;
|
||||
};
|
||||
|
||||
// the country's corners, wide enough to hold all of it: the Odra in the west, the Bug in the east,
|
||||
// the Tatras in the south and the coast in the north
|
||||
constexpr geo_point kSouthWest{49.00, 14.10};
|
||||
constexpr geo_point kNorthEast{54.90, 24.20};
|
||||
|
||||
struct named_geo_point
|
||||
{
|
||||
char const *name;
|
||||
geo_point position;
|
||||
};
|
||||
|
||||
constexpr named_geo_point kPlaces[]{
|
||||
{"Warszawa", {52.23, 21.01}}, {"Krakow", {50.06, 19.94}}, {"Lodz", {51.77, 19.46}},
|
||||
{"Wroclaw", {51.11, 17.03}}, {"Poznan", {52.41, 16.93}}, {"Gdansk", {54.35, 18.65}},
|
||||
{"Szczecin", {53.43, 14.55}}, {"Bydgoszcz", {53.12, 18.01}}, {"Lublin", {51.25, 22.57}},
|
||||
{"Bialystok", {53.13, 23.16}}, {"Katowice", {50.26, 19.02}}, {"Rzeszow", {50.04, 22.00}},
|
||||
{"Olsztyn", {53.78, 20.49}}, {"Kielce", {50.87, 20.63}}, {"Zielona Gora", {51.94, 15.51}},
|
||||
{"Opole", {50.67, 17.93}}, {"Torun", {53.02, 18.61}}, {"Gorzow Wlkp.", {52.73, 15.24}},
|
||||
{"Koszalin", {54.19, 16.18}}, {"Czestochowa", {50.81, 19.12}}};
|
||||
// the country's corners in degrees, wide enough to hold all of it: the Odra in the west, the Bug in
|
||||
// the east, the Tatras in the south and the coast in the north
|
||||
double const kSouthLatitude = 49.00;
|
||||
double const kNorthLatitude = 54.90;
|
||||
double const kWestLongitude = 14.10;
|
||||
double const kEastLongitude = 24.20;
|
||||
|
||||
} // namespace
|
||||
|
||||
void poland_extent(glm::dvec2 &Min, glm::dvec2 &Max)
|
||||
{
|
||||
// the projection is not axis-aligned with the graticule, so the extreme corners come from
|
||||
// projecting all four of them and taking the outermost values
|
||||
auto const sw = puwg1992(kSouthWest.latitude, kSouthWest.longitude);
|
||||
auto const se = puwg1992(kSouthWest.latitude, kNorthEast.longitude);
|
||||
auto const nw = puwg1992(kNorthEast.latitude, kSouthWest.longitude);
|
||||
auto const ne = puwg1992(kNorthEast.latitude, kNorthEast.longitude);
|
||||
// the projection is not axis-aligned with the graticule, so the extremes come from projecting
|
||||
// all four corners and taking the outermost values
|
||||
auto const sw = puwg1992(kSouthLatitude, kWestLongitude);
|
||||
auto const se = puwg1992(kSouthLatitude, kEastLongitude);
|
||||
auto const nw = puwg1992(kNorthLatitude, kWestLongitude);
|
||||
auto const ne = puwg1992(kNorthLatitude, kEastLongitude);
|
||||
|
||||
Min = {std::min({sw.x, se.x, nw.x, ne.x}), std::min({sw.y, se.y, nw.y, ne.y})};
|
||||
Max = {std::max({sw.x, se.x, nw.x, ne.x}), std::max({sw.y, se.y, nw.y, ne.y})};
|
||||
}
|
||||
|
||||
std::vector<map_place> const &poland_places()
|
||||
{
|
||||
static std::vector<map_place> const places = []() {
|
||||
std::vector<map_place> result;
|
||||
result.reserve(std::size(kPlaces));
|
||||
for (auto const &place : kPlaces)
|
||||
{
|
||||
result.push_back({place.name, puwg1992(place.position.latitude, place.position.longitude)});
|
||||
}
|
||||
return result;
|
||||
}();
|
||||
|
||||
return places;
|
||||
}
|
||||
|
||||
} // namespace editor
|
||||
|
||||
Reference in New Issue
Block a user