mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-21 09:44:59 +01:00
feat(editor): ~ shows or hides the orthophoto, Ctrl+~ downloads what the camera sees first; the speed of the camera in the View menu (#312)
* feat(editor): ~ shows or hides the orthophoto, Ctrl+~ downloads what the camera sees first; the speed of the camera in the View menu ~ (the key left of 1) turns the orthophoto on and off. Ctrl+~ finds what of the ground the camera sees (rays through a grid over the screen down to the level of the ground under the camera, or as far as 2.5 km where they don't come down to it) and puts those tiles at the front of the queue of the downloads, the ones which failed tried again at once; the status line tells how many. Tab is not used, the laying and the switches have it. View > Camera speed: the speed of the free camera of the editor (x0.05 to x10, 1 as it was), how many times faster Ctrl makes it (1 to 30, 30 as it was), and in the top view as fast as the view is zoomed, so the map crosses the screen at the same pace zoomed in or out. Kept in the settings of the editor; the camera of the cab and of the free fly outside the editor unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DDcMn1Q7wdYkbxDUWscNHZ * fix(editor): Ctrl+~ in the top view, over a scenery with no terrain under the camera and with the orthophoto off; "As it was" without the speed going with the zoom In the top view the box is the view itself, its corners on the ground. The ground under the camera is the terrain, else the scenery, else the rays go as far as the reach. The tile of the camera is taken anew by hurry(), it isn't followed while the layer is off. The top view is as fast zoomed in as out by default, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DDcMn1Q7wdYkbxDUWscNHZ * fix(editor): the corners of the top view on the ground put where the camera is (the view matrix is camera-relative) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DDcMn1Q7wdYkbxDUWscNHZ * i18n(editor): Polish for the orthophoto keys and the camera speed, on top of the master's own translations Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DDcMn1Q7wdYkbxDUWscNHZ * fix(editor): Ctrl+~ asks only for the tiles update() would ask for; the tooltip of "Track colours" back in its place After the reviews of #312: - hurry() skips the tiles outside the download area set and marks the ones outside the area the service covers as empty, as update() does, so Ctrl+~ no longer queues downloads update() drops at once (and the workers took anyway, into the disk cache, against the area set), nor requests the service can't answer. - A blank tile hurried takes the standard image first, as in update(); first_level() and outside_area() are shared by both loops, and the body of the loop of hurry() is hurry_tile(). - orthophoto_hurry() takes the level of the terrain only when it's below the camera, as the branch of the scenery already did: a camera under the terrain (a tunnel, under the heightmap) no longer flips the box of the view behind it. - The "Camera speed" menu goes after the tooltip of "Track colours", which it had taken. - #include <set> once in editorOrthophoto.hpp. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QRgQ1K1Qu7TCsa74zsNURd --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -102,6 +102,9 @@ class editor_orthophoto
|
||||
editor_orthophoto(editor_orthophoto const &) = delete;
|
||||
editor_orthophoto &operator=(editor_orthophoto const &) = delete;
|
||||
|
||||
// the tiles over a rectangle of the world (x, z; what the camera sees), within the reach around the camera, asked for before anything
|
||||
// else, the ones which failed tried again at once. returns: how many were put at the front of the queue
|
||||
std::size_t hurry(glm::dvec2 const &Min, glm::dvec2 const &Max, glm::dvec3 const &Camera);
|
||||
bool enabled() const { return m_enabled; }
|
||||
// disabling drops the queue and returns the gpu memory of the resident tiles
|
||||
void enabled(bool State);
|
||||
@@ -245,6 +248,12 @@ class editor_orthophoto
|
||||
};
|
||||
|
||||
static int level_for(int Distance, bool Hires);
|
||||
// the level a tile is asked for at first: a tile showing nothing yet takes the standard image before the 4K one
|
||||
static int first_level(tile const &Tile, int Level);
|
||||
// the tile is outside the download area set, which then has no imagery asked for it
|
||||
bool outside_area(tile_key const &Key) const;
|
||||
// a tile of the view hurried: put at the front of the queue unless it's shown as it should be. true: counted among the hurried
|
||||
bool hurry_tile(tile_key const &Key, int Distance);
|
||||
tile_key camera_tile(glm::dvec3 const &Camera) const;
|
||||
glm::dvec2 tile_corner(tile_key const &Key) const; // world (x,z) of the north-west corner
|
||||
void schedule(tile_key const &Key, tile &Tile, int Level, std::uint8_t Alpha);
|
||||
@@ -300,6 +309,7 @@ class editor_orthophoto
|
||||
bool m_prefetch_paused{false};
|
||||
source m_prefetch_source;
|
||||
std::uint32_t m_prefetch_generation{0};
|
||||
std::set<tile_key> m_urgent; // asked for by hurry(): workers take these first; guarded by m_mutex
|
||||
|
||||
std::atomic<bool> m_stop{false};
|
||||
std::atomic<std::uint32_t> m_generation{1};
|
||||
|
||||
Reference in New Issue
Block a user