18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 07:07:05 +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:
maj00r
2026-11-24 19:12:11 +01:00
parent 744a7c7dca
commit c508f5eef1
8 changed files with 81 additions and 20 deletions
+6 -2
View File
@@ -871,7 +871,7 @@ std::string camera_line(camera const &Camera)
// //$o -------------------------------------------------------------------------------------------------------------------------------
// format of the line: on <0/1> [origin <north> <east>]
std::string orthophoto_line(bool const Enabled, bool const Origin, double const North, double const East)
std::string orthophoto_line(bool const Enabled, bool const Origin, double const North, double const East, bool const Aligned)
{
// how the imagery is shown is the user's, kept with the editor (EditorSettings); the scenery keeps whether it's on and where the
// scenery lies
@@ -882,11 +882,13 @@ std::string orthophoto_line(bool const Enabled, bool const Origin, double const
{
std::snprintf(text, sizeof(text), " origin %.2f %.2f", North, East);
result += text;
if (Aligned)
result += " aligned";
}
return result;
}
bool read_orthophoto(std::string const &Line, bool &Enabled, double &North, double &East)
bool read_orthophoto(std::string const &Line, bool &Enabled, double &North, double &East, bool *Aligned)
{
std::istringstream words{Line};
std::string key;
@@ -898,6 +900,8 @@ bool read_orthophoto(std::string const &Line, bool &Enabled, double &North, doub
words >> Enabled;
else if (key == "origin")
words >> North >> East;
else if (key == "aligned" && Aligned != nullptr)
*Aligned = true;
else
continue;
if (words.fail())