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

Function rend_DrawLine

renderer/HardwareOpenGL.cpp:1817–1848  ·  view source on GitHub ↗

Draws a line

Source from the content-addressed store, hash-verified

1815
1816// Draws a line
1817void 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
1851void rend_SetFogColor(ddgr_color color) {

Callers 15

g3_DrawLineFunction · 0.70
g3_DrawBoxFunction · 0.70
DrawVertBoxFunction · 0.50
ui_DrawLineFunction · 0.50
ui_DrawBoxFunction · 0.50
ui_DrawLTBoxFunction · 0.50
DrawBorderMethod · 0.50
RenderMethod · 0.50
RenderMissileReticleFunction · 0.50
RenderZoomReticleFunction · 0.50
TerrainDrawCurrentVertFunction · 0.50
RenderSmallWindowFunction · 0.50

Calls 7

g3_RefreshTransformsFunction · 0.85
GR_COLOR_REDFunction · 0.85
GR_COLOR_GREENFunction · 0.85
GR_COLOR_BLUEFunction · 0.85
rend_SetAlphaTypeFunction · 0.70
rend_SetLightingFunction · 0.70
rend_SetTextureTypeFunction · 0.70

Tested by

no test coverage detected