Renders a room in just outline form
| 3387 | } |
| 3388 | // Renders a room in just outline form |
| 3389 | void RenderRoomOutline(room *rp) { |
| 3390 | int fn; |
| 3391 | ddgr_color back_line_color, face_line_color; |
| 3392 | back_line_color = GR_RGB(100, 100, 100); |
| 3393 | face_line_color = GR_RGB(255, 255, 255); |
| 3394 | for (fn = 0; fn < rp->num_faces; fn++) { |
| 3395 | face *fp = &rp->faces[fn]; |
| 3396 | g3Point p0, p1; |
| 3397 | uint8_t c0, c1; |
| 3398 | int v; |
| 3399 | ddgr_color color; |
| 3400 | for (v = 0; v < fp->num_verts; v++) { |
| 3401 | c0 = g3_RotatePoint(&p0, &rp->verts[fp->face_verts[v]]); |
| 3402 | c1 = g3_RotatePoint(&p1, &rp->verts[fp->face_verts[(v + 1) % fp->num_verts]]); |
| 3403 | if ((!(fp->flags & FF_VISIBLE)) || ((fp->flags & FF_NOT_FACING))) { |
| 3404 | // wouldn't normally be rendered |
| 3405 | color = back_line_color; |
| 3406 | } else { |
| 3407 | color = face_line_color; |
| 3408 | } |
| 3409 | if (!(c0 & c1)) { // both not off screen? |
| 3410 | // Draw current edge in green |
| 3411 | g3_DrawLine(color, &p0, &p1); |
| 3412 | } |
| 3413 | } |
| 3414 | } |
| 3415 | } |
| 3416 | // Draws the mine, starting at a the specified room |
| 3417 | // The rendering surface must be set up, and g3_StartFrame() must have been called |
| 3418 | // Parameters: viewer_roomnum - what room the viewer is in |
no test coverage detected