… | |
… | |
2366 | }; |
2366 | }; |
2367 | |
2367 | |
2368 | int x, y; |
2368 | int x, y; |
2369 | |
2369 | |
2370 | glEnable (GL_TEXTURE_2D); |
2370 | glEnable (GL_TEXTURE_2D); |
|
|
2371 | /* GL_REPLACE would be correct, as we don't need to modulate alpha, |
|
|
2372 | * but the nvidia driver (185.18.14) mishandles alpha textures |
|
|
2373 | * ansd takes the colour from god knows where instead of using |
|
|
2374 | * Cp. MODULATE results in the same colour, but slightly different |
|
|
2375 | * alpha, but atcually gives us the correct colour with nvidia. |
|
|
2376 | */ |
2371 | glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); |
2377 | glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); |
2372 | glEnable (GL_BLEND); |
2378 | glEnable (GL_BLEND); |
2373 | glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
2379 | glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
2374 | glBegin (GL_QUADS); |
2380 | glBegin (GL_QUADS); |
2375 | |
2381 | |
2376 | for (y = 0; y < h; y++) |
2382 | for (y = 0; y < h; y++) |
… | |
… | |
2383 | float *c = color [m & 15]; |
2389 | float *c = color [m & 15]; |
2384 | |
2390 | |
2385 | float tx1 = m & 0x40 ? 0.5 : 0.; |
2391 | float tx1 = m & 0x40 ? 0.5 : 0.; |
2386 | float tx2 = tx1 + 0.5; |
2392 | float tx2 = tx1 + 0.5; |
2387 | |
2393 | |
2388 | glColor4f (c[0], c[1], c[2], 0.75); |
2394 | glColor4f (c[0], c[1], c[2], 1); |
2389 | glTexCoord2f (tx1, 0.); glVertex2i (x , y ); |
2395 | glTexCoord2f (tx1, 0.); glVertex2i (x , y ); |
2390 | glTexCoord2f (tx1, 1.); glVertex2i (x , y + 1); |
2396 | glTexCoord2f (tx1, 1.); glVertex2i (x , y + 1); |
2391 | glTexCoord2f (tx2, 1.); glVertex2i (x + 1, y + 1); |
2397 | glTexCoord2f (tx2, 1.); glVertex2i (x + 1, y + 1); |
2392 | glTexCoord2f (tx2, 0.); glVertex2i (x + 1, y ); |
2398 | glTexCoord2f (tx2, 0.); glVertex2i (x + 1, y ); |
2393 | } |
2399 | } |