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

Method Draw_StretchPic

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

Source from the content-addressed store, hash-verified

127 =============
128 */
129 public void Draw_StretchPic (int x, int y, int w, int h, String pic) {
130
131 image_t image;
132
133 image = Draw_FindPic(pic);
134 if (image == null)
135 {
136 Com.Printf (Defines.PRINT_ALL, "Can't find pic: " + pic +'\n');
137 return;
138 }
139
140 if (scrap_dirty)
141 Scrap_Upload();
142
143 if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) != 0) ) && !image.has_alpha)
144 gl.glDisable(GL_ALPHA_TEST);
145
146 GL_Bind(image.texnum);
147 gl.glBegin (GL_QUADS);
148 gl.glTexCoord2f (image.sl, image.tl);
149 gl.glVertex2f (x, y);
150 gl.glTexCoord2f (image.sh, image.tl);
151 gl.glVertex2f (x+w, y);
152 gl.glTexCoord2f (image.sh, image.th);
153 gl.glVertex2f (x+w, y+h);
154 gl.glTexCoord2f (image.sl, image.th);
155 gl.glVertex2f (x, y+h);
156 gl.glEnd ();
157
158 if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) !=0 ) ) && !image.has_alpha)
159 gl.glEnable(GL_ALPHA_TEST);
160 }
161
162
163 /*

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