mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-02 23:35:28 +01:00
fix(editor): a photo origin aligned by hand isn't overridden by //$g, the 4K photos of the zoom take the tile under the camera alone
- //$g of the scenery file went before the origin of //$o, also where the user had aligned the photo by hand in the editor: the alignment was gone on the next opening. An origin typed in the editor is written into //$o with the word "aligned", and such an origin goes before //$g. The word is optional: a release before it passes it over and reads the origin as before, and an //$o without it is read as before. "Use it" (the origin of //$g) takes the word off. - The zoom turned the 4K photos on for the 3 x 3 tiles around the camera, as the setting for them does: up to about 0.75 GB of the memory of the graphics card, unasked. By the zoom alone the 4K photo is the tile under the camera (about 85 MB); the setting keeps the 3 x 3.
This commit is contained in:
@@ -762,12 +762,12 @@ bool editor_orthophoto::owns(gfx::geometry_handle const &Geometry)
|
||||
// the line of the scenery and its format: editor_records::orthophoto_line() and read_orthophoto()
|
||||
std::string editor_orthophoto::mark(config const &Config, bool const Enabled, bool const Origin)
|
||||
{
|
||||
return editor_records::orthophoto_line(Enabled, Origin, Config.north, Config.east);
|
||||
return editor_records::orthophoto_line(Enabled, Origin, Config.north, Config.east, Config.aligned);
|
||||
}
|
||||
|
||||
bool editor_orthophoto::read_mark(std::string const &Text, config &Config, bool &Enabled)
|
||||
{
|
||||
return editor_records::read_orthophoto(Text, Enabled, Config.north, Config.east);
|
||||
return editor_records::read_orthophoto(Text, Enabled, Config.north, Config.east, &Config.aligned);
|
||||
}
|
||||
|
||||
void editor_orthophoto::enabled(bool State)
|
||||
@@ -1044,11 +1044,11 @@ bool editor_orthophoto::outside_area(tile_key const &Key) const
|
||||
return false == m_area.empty() && 0 == m_area_tiles.count(Key);
|
||||
}
|
||||
|
||||
int editor_orthophoto::level_for(int Distance, bool Hires)
|
||||
int editor_orthophoto::level_for(int Distance, int HiresReach)
|
||||
{
|
||||
// coarser imagery further away keeps the memory use of large radii in check
|
||||
if (Distance <= 1)
|
||||
return Hires ? hires_pixels : standard_pixels;
|
||||
if (Distance <= HiresReach)
|
||||
return hires_pixels;
|
||||
if (Distance <= 3)
|
||||
return standard_pixels;
|
||||
if (Distance <= 6)
|
||||
@@ -1056,6 +1056,13 @@ int editor_orthophoto::level_for(int Distance, bool Hires)
|
||||
return standard_pixels / 4;
|
||||
}
|
||||
|
||||
int editor_orthophoto::hires_reach() const
|
||||
{
|
||||
if (m_config.hires)
|
||||
return 1;
|
||||
return m_zoom_hires ? 0 : -1;
|
||||
}
|
||||
|
||||
editor_orthophoto::tile_key editor_orthophoto::camera_tile(glm::dvec3 const &Camera) const
|
||||
{
|
||||
double const east = m_config.east - Camera.x;
|
||||
@@ -1692,7 +1699,7 @@ void editor_orthophoto::update(glm::dvec3 const &Camera)
|
||||
tile &t = m_tiles[key];
|
||||
if (!in_service_area(key.first, key.second))
|
||||
t.empty = true;
|
||||
int const level = first_level(t, level_for(std::max(std::abs(dx), std::abs(dy)), m_config.hires || m_zoom_hires));
|
||||
int const level = first_level(t, level_for(std::max(std::abs(dx), std::abs(dy)), hires_reach()));
|
||||
if (t.empty || (t.level == level && t.alpha == m_alpha) || (t.requested == level && t.requested_alpha == m_alpha) || now < t.retry_at)
|
||||
continue;
|
||||
schedule(key, t, level, m_alpha);
|
||||
@@ -2036,7 +2043,7 @@ bool editor_orthophoto::hurry_tile(tile_key const &Key, int const Distance)
|
||||
t.empty = true;
|
||||
if (t.empty)
|
||||
return false;
|
||||
auto const level{first_level(t, level_for(Distance, m_config.hires || m_zoom_hires))};
|
||||
auto const level{first_level(t, level_for(Distance, hires_reach()))};
|
||||
t.retry_at = 0.0;
|
||||
if (t.level == level && t.alpha == m_alpha)
|
||||
return false; // already shown as it should be
|
||||
|
||||
Reference in New Issue
Block a user