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

Function g3_DrawSphere

renderer/HardwareDraw.cpp:236–243  ·  view source on GitHub ↗

draw a sortof sphere - i.e., the 2d radius is proportional to the 3d radius, but not to the distance from the eye

Source from the content-addressed store, hash-verified

234// draw a sortof sphere - i.e., the 2d radius is proportional to the 3d
235// radius, but not to the distance from the eye
236void g3_DrawSphere(ddgr_color color, g3Point *pnt, float rad) {
237 if (!(pnt->p3_codes & CC_BEHIND)) {
238 if (!(pnt->p3_flags & PF_PROJECTED))
239 g3_ProjectPoint(pnt);
240
241 rend_FillCircle(color, pnt->p3_sx, pnt->p3_sy, (rad * Matrix_scale.x * Window_w2 / pnt->p3_z));
242 }
243}
244
245// draws a bitmap with the specified 3d width & height
246// If offsets are not -1, then the blitter draws not from the upper left hand

Callers 4

DrawRoomObjectsFunction · 0.85
DrawAllPathsFunction · 0.85
EBNode_DrawRoomFunction · 0.85
RenderObjectFunction · 0.85

Calls 2

g3_ProjectPointFunction · 0.85
rend_FillCircleFunction · 0.70

Tested by

no test coverage detected