Draws a line
| 1815 | |
| 1816 | // Draws a line |
| 1817 | void rend_DrawLine(int x1, int y1, int x2, int y2) { |
| 1818 | int8_t atype; |
| 1819 | light_state ltype; |
| 1820 | texture_type ttype; |
| 1821 | int color = gpu_state.cur_color; |
| 1822 | |
| 1823 | g3_RefreshTransforms(true); |
| 1824 | |
| 1825 | int r = GR_COLOR_RED(color); |
| 1826 | int g = GR_COLOR_GREEN(color); |
| 1827 | int b = GR_COLOR_BLUE(color); |
| 1828 | |
| 1829 | atype = gpu_state.cur_alpha_type; |
| 1830 | ltype = gpu_state.cur_light_state; |
| 1831 | ttype = gpu_state.cur_texture_type; |
| 1832 | |
| 1833 | rend_SetAlphaType(AT_ALWAYS); |
| 1834 | rend_SetLighting(LS_NONE); |
| 1835 | rend_SetTextureType(TT_FLAT); |
| 1836 | |
| 1837 | // TODO: Generalize |
| 1838 | dglBegin(GL_LINES); |
| 1839 | dglColor4ub(r, g, b, 255); |
| 1840 | dglVertex2i(x1 + gpu_state.clip_x1, y1 + gpu_state.clip_y1); |
| 1841 | dglColor4ub(r, g, b, 255); |
| 1842 | dglVertex2i(x2 + gpu_state.clip_x1, y2 + gpu_state.clip_y1); |
| 1843 | dglEnd(); |
| 1844 | |
| 1845 | rend_SetAlphaType(atype); |
| 1846 | rend_SetLighting(ltype); |
| 1847 | rend_SetTextureType(ttype); |
| 1848 | } |
| 1849 | |
| 1850 | // Sets the color of fog |
| 1851 | void rend_SetFogColor(ddgr_color color) { |
no test coverage detected