Draw a wireframe box aligned with the screen. Used for the editor. Parameters: color - the color to draw the lines pnt - the center point rad - specifies the width/2 & height/2 of the box
| 414 | // pnt - the center point |
| 415 | // rad - specifies the width/2 & height/2 of the box |
| 416 | void g3_DrawBox(ddgr_color color, g3Point *pnt, float rad) { |
| 417 | if (!(pnt->p3_codes & CC_BEHIND)) { |
| 418 | if (!(pnt->p3_flags & PF_PROJECTED)) |
| 419 | g3_ProjectPoint(pnt); |
| 420 | |
| 421 | float w, h; |
| 422 | |
| 423 | w = rad * Matrix_scale.x * Window_w2 / pnt->p3_z; |
| 424 | h = rad * Matrix_scale.y * Window_h2 / pnt->p3_z; |
| 425 | |
| 426 | rend_DrawLine(round(pnt->p3_sx - w), round(pnt->p3_sy - h), round(pnt->p3_sx + w), round(pnt->p3_sy - h)); |
| 427 | rend_DrawLine(round(pnt->p3_sx + w), round(pnt->p3_sy - h), round(pnt->p3_sx + w), round(pnt->p3_sy + h)); |
| 428 | rend_DrawLine(round(pnt->p3_sx + w), round(pnt->p3_sy + h), round(pnt->p3_sx - w), round(pnt->p3_sy + h)); |
| 429 | rend_DrawLine(round(pnt->p3_sx - w), round(pnt->p3_sy + h), round(pnt->p3_sx - w), round(pnt->p3_sy - h)); |
| 430 | } |
| 431 | } |
| 432 | |
| 433 | // Sets the triangulation test to on or off |
| 434 | void g3_SetTriangulationTest(int state) { Triangulate_test = state; } |
no test coverage detected