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

Function DrawPlacedRoomFace

Descent3/render.cpp:330–348  ·  view source on GitHub ↗

Draw a room rotated and placed in space

Source from the content-addressed store, hash-verified

328
329// Draw a room rotated and placed in space
330static void DrawPlacedRoomFace(room *rp, vector *rotpoint, matrix *rotmat, vector *placepoint, int facenum, int color) {
331 face *fp = &rp->faces[facenum];
332
333 g3Point p0, p1;
334 uint8_t c0, c1;
335 int v;
336 for (v = 0; v < fp->num_verts; v++) {
337 vector tv;
338
339 tv = (rp->verts[fp->face_verts[v]] - *rotpoint) * *rotmat + *placepoint;
340 c0 = g3_RotatePoint(&p0, &tv);
341
342 tv = (rp->verts[fp->face_verts[(v + 1) % fp->num_verts]] - *rotpoint) * *rotmat + *placepoint;
343 c1 = g3_RotatePoint(&p1, &tv);
344
345 if (!(c0 & c1)) // both not off screen?
346 g3_DrawLine(color, &p0, &p1);
347 }
348}
349#endif // ifdef EDITOR
350
351struct clip_wnd {

Callers 1

RenderMineFunction · 0.85

Calls 2

g3_RotatePointFunction · 0.85
g3_DrawLineFunction · 0.85

Tested by

no test coverage detected