MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / DrawTerrainOutline

Function DrawTerrainOutline

Descent3/terrainrender.cpp:2233–2254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2231#endif
2232#if (!defined(RELEASE) || defined(NEWEDITOR))
2233__inline void DrawTerrainOutline(int tcell, int nverts, g3Point **pointlist)
2234{
2235 int i;
2236 g3Point tpnt[256];
2237 g3Point *tpnt_list[256];
2238 for (i = 0; i < nverts; i++) {
2239 tpnt[i] = *pointlist[i];
2240 tpnt_list[i] = &tpnt[i];
2241 }
2242#if (defined(EDITOR) || defined(NEWEDITOR))
2243 if (TerrainSelected[tcell]) {
2244 for (i = 0; i < nverts - 1; i++)
2245 g3_DrawLine(GR_RGB(255, 255, 255), tpnt_list[i], tpnt_list[i + 1]);
2246 g3_DrawLine(GR_RGB(255, 255, 255), tpnt_list[i], tpnt_list[0]);
2247 } else
2248#endif
2249 {
2250 for (i = 0; i < nverts - 1; i++)
2251 g3_DrawLine(GR_RGB(128, 128, 128), tpnt_list[i], tpnt_list[i + 1]);
2252 g3_DrawLine(GR_RGB(128, 128, 128), tpnt_list[i], tpnt_list[0]);
2253 }
2254}
2255#endif
2256int TerrainSortingFunction(const terrain_render_info *a, terrain_render_info *b) { return b->z - a->z; }
2257void SortTerrainList(int cellcount) {

Calls 2

g3_DrawLineFunction · 0.85
GR_RGBFunction · 0.50

Tested by

no test coverage detected