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

Function CodeTerrainPoint

Descent3/terrainrender.cpp:877–888  ·  view source on GitHub ↗

codes a point for visibility in the window passed to RenderTerrain()

Source from the content-addressed store, hash-verified

875}
876// codes a point for visibility in the window passed to RenderTerrain()
877uint8_t CodeTerrainPoint(g3Point *p) {
878 uint8_t cc = 0;
879 if (p->p3_sx > Clip_scale_right)
880 cc |= CC_OFF_RIGHT;
881 if (p->p3_sx < Clip_scale_left)
882 cc |= CC_OFF_LEFT;
883 if (p->p3_sy > Clip_scale_bot)
884 cc |= CC_OFF_BOT;
885 if (p->p3_sy < Clip_scale_top)
886 cc |= CC_OFF_TOP;
887 return cc;
888}
889// Returns true if light can hit this segment/heighth bit
890int IsTerrainDynamicChecked(int seg, int bit) {
891 if (seg < 0 || seg >= (TERRAIN_WIDTH * TERRAIN_DEPTH))

Callers 2

ObjectOutOfPortalFunction · 0.85
SearchQuadTreeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected