MCPcopy Create free account
hub / github.com/demoth/jake2 / Draw_Fill

Method Draw_Fill

client/src/main/java/jake2/client/render/fast/Draw.java:246–271  ·  view source on GitHub ↗
(int x, int y, int w, int h, int colorIndex)

Source from the content-addressed store, hash-verified

244 =============
245 */
246 public void Draw_Fill(int x, int y, int w, int h, int colorIndex) {
247
248 if ( colorIndex > 255)
249 Com.Error(Defines.ERR_FATAL, "Draw_Fill: bad color");
250
251 gl.glDisable(GL_TEXTURE_2D);
252
253 int color = d_8to24table[colorIndex];
254
255 gl.glColor3ub(
256 (byte)((color >> 0) & 0xff), // r
257 (byte)((color >> 8) & 0xff), // g
258 (byte)((color >> 16) & 0xff) // b
259 );
260
261 gl.glBegin (GL_QUADS);
262
263 gl.glVertex2f(x,y);
264 gl.glVertex2f(x+w, y);
265 gl.glVertex2f(x+w, y+h);
266 gl.glVertex2f(x, y+h);
267
268 gl.glEnd();
269 gl.glColor3f(1,1,1);
270 gl.glEnable(GL_TEXTURE_2D);
271 }
272
273 //=============================================================================
274

Callers

nothing calls this directly

Calls 8

ErrorMethod · 0.95
glDisableMethod · 0.65
glColor3ubMethod · 0.65
glBeginMethod · 0.65
glVertex2fMethod · 0.65
glEndMethod · 0.65
glColor3fMethod · 0.65
glEnableMethod · 0.65

Tested by

no test coverage detected