#pragma once #include "raylib.h" #include "Planet.hpp" #include // Equal Earth 2D map: per-cell screen positions + the projection/draw helpers. struct Map2D { std::vector pos; // screen position per cell (fast path) std::vector lon; // longitude per cell (radians, for seam detection) std::vector lat; // latitude per cell (radians) }; void buildMap2D(const Planet& p, Rectangle r, Map2D& m); double wrapPi(double l); // Project a (lon,lat) onto the map with the longitude pan applied. Vector2 projLonLat(double lon, double lat, double lonOffset, Rectangle r); Vector2 mapScreen(const Map2D& m, int idx, Rectangle r, double lonOffset); // lonOffset pans the map east/west (radians); y is unchanged by the pan. void drawMap2D(const Planet& p, const std::vector& vc, const Map2D& m, Rectangle r, double lonOffset); // Translucent Live World cloud/rain layer over the 2D map (white -> dark storm where it rains; // alpha = cloud cover). Same triangle iteration as drawMap2D but blended on top. void drawWeather2D(const Planet& p, const std::vector& cloud, const std::vector& rain, const Map2D& m, Rectangle r, double lonOffset);