mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 09:49:19 +02:00
Put Geoportal imagery behind the plan and clear the scenery on a new map
The location picker now shows the real topographic map instead of a hand-drawn outline, fetched as one WMS image for whatever box is on screen; the schematic border is gone and only the city list remains, to jump the view somewhere recognisable. Under the plan itself a georeferenced map gets the orthophoto, tiled through the layout library's own EPSG:2180 grid and cache. What a native build was missing is here: the download (WinHTTP, on worker threads), the decode and the texture. Finished transfers are handed back on the thread that drains them, so both the library's cache and the graphics API stay on one thread. The imagery service turns down browser user agents and fails the odd request even for a plain one, so requests go out as curl and are retried a few times. Starting a new map now drops the loaded scenery and comes back on empty ground, instead of leaving the previous scenery's contents under a plan that has nothing to do with them. The reload is deferred to the top of the frame: taking the editor off the mode stack while it is drawing its own panels would pull the ground out from under them.
This commit is contained in:
@@ -609,6 +609,19 @@ void editor_mode::redo_last()
|
||||
|
||||
bool editor_mode::update()
|
||||
{
|
||||
if (Global.editor_reset_scenery)
|
||||
{
|
||||
// starting a new map: drop whatever scenery is loaded and come back on empty ground. done
|
||||
// here rather than where it was asked for, because taking the editor off the mode stack in
|
||||
// the middle of drawing its own panels would pull the ground out from under them
|
||||
Global.editor_reset_scenery = false;
|
||||
Global.editor_startup = true; // the editor is the base mode from here on, whatever started it
|
||||
Global.SceneryFile = "pusta.scn";
|
||||
Application.pop_mode();
|
||||
Application.push_mode(eu07_application::mode::scenarioloader);
|
||||
return true;
|
||||
}
|
||||
|
||||
Timer::UpdateTimers(true);
|
||||
|
||||
simulation::State.update_clocks();
|
||||
|
||||
Reference in New Issue
Block a user