MCPcopy Create free account
hub / github.com/CruiserOne/Astrolog / WireStar

Function WireStar

xdevice.cpp:2014–2042  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2012// Add a fixed star to the current wireframe file.
2013
2014void WireStar(int x, int y, int z, ES *pes)
2015{
2016 char *pch = pes->sz;
2017 int n;
2018
2019 // Determine star color.
2020 if (gs.fColor) {
2021 if (pes->ki != kDefault)
2022 n = pes->ki;
2023 else {
2024 n = 255 - (int)((pes->mag - rStarLite) / rStarSpan * 224.0);
2025 n = Min(n, 255); n = Max(n, 32);
2026 n = -(int)Rgb(n, n, n);
2027 }
2028 DrawColor(n);
2029 }
2030
2031 // Draw star point.
2032 if (!FOdd(gs.nAllStar))
2033 WireSpot(x, y, z);
2034 else
2035 WireOctahedron(x, y, z, 3 * gi.nScaleT);
2036
2037 // Draw star's name label.
2038 if (!gs.fLabel || gs.nAllStar < 2)
2039 return;
2040 gi.zDefault = z + 8*gi.nScaleT;
2041 DrawSz(pes->pchBest, x, y, dtCent);
2042}
2043
2044
2045// Given longitude and latitude values on a globe, return the 3D pixel

Callers 3

WireDrawGlobeFunction · 0.85
WireChartOrbitFunction · 0.85
WireChartSphereFunction · 0.85

Calls 4

DrawColorFunction · 0.85
WireSpotFunction · 0.85
WireOctahedronFunction · 0.85
DrawSzFunction · 0.85

Tested by

no test coverage detected