mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-20 18:34:53 +02:00
- In the top view of the tracks work area, the renderer's reach is the half diagonal of the screen. It used to be three extents, which cut wide windows short. - Cells far from the camera no longer draw only their tracks: the terrain shapes are drawn too. Models keep their own ranges. - In that view, the heightmap streamer loads chunks as far as the corners, up to 50 km. The detail comes from the size of a pixel, not from the distance. - The walk over the chunks around the camera is skipped while it would ask for nothing, so a wide reach costs little. - A setting, kept in the editor settings, leaves out the ballast of the railway in the top view, so the ground under the tracks shows. It is in the View menu and next to the extent slider. - Self-test: ortho <extent> [noballast|ballast], orthophoto off.
85 lines
2.9 KiB
C++
85 lines
2.9 KiB
C++
#pragma once
|
|
|
|
#include <map>
|
|
#include <string>
|
|
#include <utility>
|
|
|
|
class editorSettings
|
|
{
|
|
public:
|
|
// camera movement key scheme in the editor
|
|
enum class movement_scheme
|
|
{
|
|
wsad, // new default: W/S/A/D + E/Q
|
|
legacy // old scheme: arrows + Page Up/Down
|
|
};
|
|
|
|
editorSettings() = default;
|
|
|
|
bool load();
|
|
bool save();
|
|
|
|
movement_scheme movement() const { return m_movement; }
|
|
void movement(movement_scheme scheme) { m_movement = scheme; }
|
|
|
|
// geoportal orthophoto layer (editor_orthophoto); the origin is kept per scenery
|
|
struct orthophoto_settings
|
|
{
|
|
int radius{2};
|
|
float height{0.0f};
|
|
float opacity{0.6f};
|
|
int year{0};
|
|
bool hires{false};
|
|
bool drape{true};
|
|
float lift{0.05f};
|
|
bool in_scene{false};
|
|
};
|
|
orthophoto_settings &orthophoto() { return m_orthophoto; }
|
|
// PUWG 1992 northing/easting of the scenery's (0,0,0) point; false when none was stored
|
|
bool orthophoto_origin(std::string const &Scenery, double &North, double &East) const;
|
|
void orthophoto_origin(std::string const &Scenery, double North, double East);
|
|
|
|
double platform_edge() const { return m_platform_edge; }
|
|
void platform_edge(double Distance) { m_platform_edge = Distance; }
|
|
double signal_offset() const { return m_signal_offset; }
|
|
void signal_offset(double Distance) { m_signal_offset = Distance; }
|
|
|
|
// node bank: cards with the previews of the models or a list, and the size of the cards in pixels
|
|
bool nodebank_previews() const { return m_nodebank_previews; }
|
|
void nodebank_previews(bool Previews) { m_nodebank_previews = Previews; }
|
|
int nodebank_card() const { return m_nodebank_card; }
|
|
void nodebank_card(int Size) { m_nodebank_card = Size; }
|
|
|
|
// colours of the editor: 0 green, as the rest of the simulator; 1 amber
|
|
int palette() const { return m_palette; }
|
|
void palette(int Palette) { m_palette = Palette; }
|
|
|
|
bool first_steps() const { return m_first_steps; }
|
|
void first_steps(bool Show) { m_first_steps = Show; }
|
|
// a scenery begun with no terrain is offered the terrain model as the first track is laid
|
|
bool terrain_offer() const { return m_terrain_offer; }
|
|
void terrain_offer(bool Offer) { m_terrain_offer = Offer; }
|
|
bool track_tools_more() const { return m_track_tools_more; }
|
|
void track_tools_more(bool Show) { m_track_tools_more = Show; }
|
|
// the ballast of the railway drawn in the top view
|
|
bool top_ballast() const { return m_top_ballast; }
|
|
void top_ballast(bool Show) { m_top_ballast = Show; }
|
|
|
|
private:
|
|
movement_scheme m_movement{movement_scheme::wsad};
|
|
orthophoto_settings m_orthophoto;
|
|
std::map<std::string, std::pair<double, double>> m_orthophoto_origins;
|
|
double m_platform_edge{1.725};
|
|
double m_signal_offset{2.25};
|
|
bool m_nodebank_previews{true};
|
|
int m_nodebank_card{96};
|
|
int m_palette{0};
|
|
bool m_first_steps{true};
|
|
bool m_terrain_offer{true};
|
|
bool m_track_tools_more{false};
|
|
bool m_top_ballast{true};
|
|
};
|
|
|
|
// global editor settings instance
|
|
extern editorSettings EditorSettings;
|