#pragma once #include "raylib.h" #include "Planet.hpp" #include #include // World overlays drawn over the globe (3D) and/or the Equal Earth map (2D): // plate borders, per-plate drift arrows + labels, Phase-3 rivers, lat/lon // graticule, projected line segments, and the selected-cell subgrid patch. // ---- Plate borders (dual contour through boundary triangles) ---------------- // Segments separating two real plates go to `real` (drawn yellow); any segment // touching a baby (young spreading-ridge) plate goes to `ridge` (drawn red). void buildBorders(const Planet& p, float radius, std::vector& real, std::vector& ridge); // ---- Nation borders (civ Step 3) ------------------------------------------- // Same dual-contour, but separating cells of different `cellNation()` (a realm's outline: // inter-realm borders + its coast + wilderness frontier). One segment list. void buildNationBorders(const Planet& p, float radius, std::vector& segs); // Like buildNationBorders but on the per-cell culture split (civ Step 4): cultural-region outlines. void buildCultureBorders(const Planet& p, float radius, std::vector& segs); // Frontier segments between two cells whose realms are in an active war (civ Step 5): the war front. void buildWarFrontier(const Planet& p, float radius, std::vector& segs); // Great-circle arcs between allied (-> ally) and rival (-> rival) realm capitals (civ Step 6). void buildDiploLinks(const Planet& p, float radius, std::vector& ally, std::vector& rival); // ---- Per-plate drift arrows ------------------------------------------------- struct PlateLabel { int id; Vector3 pos; }; void buildDriftArrows(const Planet& p, float radius, std::vector& out, std::vector& labels); // ---- Phase-3 rivers: drainage-network segments (cell -> its downstream cell) - // Split into normal and "big" rivers by discharge so they can be drawn at two // line widths. Needs Planet::computeHydrology() to have been called. void buildRivers(const Planet& p, float radius, std::vector& rivers, std::vector& bigRivers); // ---- Coastline (land/ocean boundary, dual contour through triangles) -------- // Like buildBorders but on the elevation-vs-seaLevel split. For each emitted segment // (pairs in `segs`) records a representative adjacent OCEAN cell in `oceanCell` (one // entry per segment, i.e. per 2 points) so the viewer can colour it by that cell's tide. void buildCoastline(const Planet& p, float radius, std::vector& segs, std::vector& oceanCell); // ---- Ocean currents (subsampled arrows, warm/cold) -------------------------- // Short arrows along Planet::current() over a subsample of ocean cells. `cols` has one // colour per segment (warm = poleward/red, cold = equatorward/blue). Needs computeClimate // (which computes the current field) to have run. void buildCurrents(const Planet& p, float radius, std::vector& segs, std::vector& cols); // ---- Lat/lon graticule ------------------------------------------------------ // Polylines of (lon,lat) radians (Vector2.x=lon, .y=lat). std::vector> buildGraticule(); void drawGraticule3D(const std::vector>& g, float radius); void drawGraticule2D(const std::vector>& g, Rectangle r, double lonOffset); // Degree numbers along the 2D map edges (latitudes at the left, longitudes at the // bottom). lonOffset is the map's east/west pan. Draw inside the map scissor. void drawGraticuleLabels2D(Rectangle r, double lonOffset); // Project 3D sphere line segments (pairs of points) onto the 2D map. void drawSegments2D(const std::vector& segs, Color col, float width, Rectangle r, double lonOffset); // As drawSegments2D but with a per-segment colour (cols has one entry per segment, // i.e. per 2 points). Used for the tide-shaded coastline. void drawColoredSegments2D(const std::vector& segs, const std::vector& cols, float width, Rectangle r, double lonOffset); // ---- Subgrid overlay (high-res patch over a selected cell) ------------------ void drawSubgrids(const std::vector>& sgs, float visBase, float elevExagg, double seaLevel, float eps);