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

Method Draw_Pic

client/src/main/java/jake2/client/render/fast/Draw.java:168–199  ·  view source on GitHub ↗
(int x, int y, String pic)

Source from the content-addressed store, hash-verified

166 =============
167 */
168 public void Draw_Pic(int x, int y, String pic)
169 {
170 image_t image;
171
172 image = Draw_FindPic(pic);
173 if (image == null)
174 {
175 Com.Printf(Defines.PRINT_ALL, "Can't find pic: " +pic + '\n');
176 return;
177 }
178 if (scrap_dirty)
179 Scrap_Upload();
180
181 if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) != 0 ) ) && !image.has_alpha)
182 gl.glDisable (GL_ALPHA_TEST);
183
184 GL_Bind(image.texnum);
185
186 gl.glBegin (GL_QUADS);
187 gl.glTexCoord2f (image.sl, image.tl);
188 gl.glVertex2f (x, y);
189 gl.glTexCoord2f (image.sh, image.tl);
190 gl.glVertex2f (x+image.width, y);
191 gl.glTexCoord2f (image.sh, image.th);
192 gl.glVertex2f (x+image.width, y+image.height);
193 gl.glTexCoord2f (image.sl, image.th);
194 gl.glVertex2f (x, y+image.height);
195 gl.glEnd ();
196
197 if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) != 0 ) ) && !image.has_alpha)
198 gl.glEnable (GL_ALPHA_TEST);
199 }
200
201 /*
202 =============

Callers

nothing calls this directly

Calls 10

Draw_FindPicMethod · 0.95
PrintfMethod · 0.95
Scrap_UploadMethod · 0.80
glDisableMethod · 0.65
glBeginMethod · 0.65
glTexCoord2fMethod · 0.65
glVertex2fMethod · 0.65
glEndMethod · 0.65
glEnableMethod · 0.65
GL_BindMethod · 0.45

Tested by

no test coverage detected