41 qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
42 qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
59 float frow, fcol, size;
63 if ( (num&127) == 32 )
79 qglTexCoord2f (fcol, frow);
81 qglTexCoord2f (fcol + size, frow);
83 qglTexCoord2f (fcol + size, frow + size);
84 qglVertex2f (
x+8,
y+8);
85 qglTexCoord2f (fcol, frow + size);
100 if (
name[0] !=
'/' &&
name[0] !=
'\\')
150 qglDisable (GL_ALPHA_TEST);
154 qglTexCoord2f (gl->
sl, gl->
tl);
156 qglTexCoord2f (gl->
sh, gl->
tl);
157 qglVertex2f (
x+
w,
y);
158 qglTexCoord2f (gl->
sh, gl->
th);
159 qglVertex2f (
x+
w,
y+h);
160 qglTexCoord2f (gl->
sl, gl->
th);
161 qglVertex2f (
x,
y+h);
165 qglEnable (GL_ALPHA_TEST);
188 qglDisable (GL_ALPHA_TEST);
192 qglTexCoord2f (gl->
sl, gl->
tl);
194 qglTexCoord2f (gl->
sh, gl->
tl);
196 qglTexCoord2f (gl->
sh, gl->
th);
198 qglTexCoord2f (gl->
sl, gl->
th);
203 qglEnable (GL_ALPHA_TEST);
226 qglDisable (GL_ALPHA_TEST);
230 qglTexCoord2f (
x/64.0,
y/64.0);
232 qglTexCoord2f ( (
x+
w)/64.0,
y/64.0);
233 qglVertex2f (
x+
w,
y);
234 qglTexCoord2f ( (
x+
w)/64.0, (
y+h)/64.0);
235 qglVertex2f (
x+
w,
y+h);
236 qglTexCoord2f (
x/64.0, (
y+h)/64.0 );
237 qglVertex2f (
x,
y+h);
241 qglEnable (GL_ALPHA_TEST);
260 if ( (
unsigned)c > 255)
263 qglDisable (GL_TEXTURE_2D);
266 qglColor3f (color.v[0]/255.0,
273 qglVertex2f (
x+
w,
y);
274 qglVertex2f (
x+
w,
y+h);
275 qglVertex2f (
x,
y+h);
279 qglEnable (GL_TEXTURE_2D);
292 qglEnable (GL_BLEND);
293 qglDisable (GL_TEXTURE_2D);
294 qglColor4f (0, 0, 0, 0.8);
303 qglColor4f (1,1,1,1);
304 qglEnable (GL_TEXTURE_2D);
305 qglDisable (GL_BLEND);
321 unsigned image32[256*256];
322 unsigned char image8[256*256];
342 t = rows*hscale / 256 - 1.0/512.0;
344 if ( !qglColorTableEXT )
348 for (
i=0 ;
i<trows ;
i++)
350 row = (
int)(
i*hscale);
353 source = data + cols*row;
354 dest = &image32[
i*256];
355 fracstep = cols*0x10000/256;
356 frac = fracstep >> 1;
357 for (
j=0 ;
j<256 ;
j++)
364 qglTexImage2D (GL_TEXTURE_2D, 0,
gl_tex_solid_format, 256, 256, 0, GL_RGBA, GL_UNSIGNED_BYTE, image32);
370 for (
i=0 ;
i<trows ;
i++)
372 row = (
int)(
i*hscale);
375 source = data + cols*row;
376 dest = &image8[
i*256];
377 fracstep = cols*0x10000/256;
378 frac = fracstep >> 1;
379 for (
j=0 ;
j<256 ;
j++)
381 dest[
j] = source[frac>>16];
386 qglTexImage2D( GL_TEXTURE_2D,
395 qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
396 qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
399 qglDisable (GL_ALPHA_TEST);
402 qglTexCoord2f (1.0/512.0, 1.0/512.0);
404 qglTexCoord2f (511.0/512.0, 1.0/512.0);
405 qglVertex2f (
x+
w,
y);
406 qglTexCoord2f (511.0/512.0,
t);
407 qglVertex2f (
x+
w,
y+h);
408 qglTexCoord2f (1.0/512.0,
t);
409 qglVertex2f (
x,
y+h);
413 qglEnable (GL_ALPHA_TEST);