… | |
… | |
2016 | rc_key_t key; |
2016 | rc_key_t key; |
2017 | rc_array_t *arr, *arr_hidden; |
2017 | rc_array_t *arr, *arr_hidden; |
2018 | |
2018 | |
2019 | pl_tex.name = 0; |
2019 | pl_tex.name = 0; |
2020 | |
2020 | |
2021 | // thats current max. sorry. |
2021 | // that's current max. sorry. |
2022 | if (sw > 255) sw = 255; |
2022 | if (sw > 255) sw = 255; |
2023 | if (sh > 255) sh = 255; |
2023 | if (sh > 255) sh = 255; |
2024 | |
2024 | |
2025 | // clear key, in case of extra padding |
2025 | // clear key, in case of extra padding |
2026 | memset (&skey, 0, sizeof (skey)); |
2026 | memset (&skey, 0, sizeof (skey)); |
… | |
… | |
2174 | if (cell->flags & 1) |
2174 | if (cell->flags & 1) |
2175 | { |
2175 | { |
2176 | rc_key_t key_ov = key; |
2176 | rc_key_t key_ov = key; |
2177 | maptex tex = self->tex [TEXID_SPEECH]; |
2177 | maptex tex = self->tex [TEXID_SPEECH]; |
2178 | rc_array_t *arr; |
2178 | rc_array_t *arr; |
|
|
2179 | int px = x * T + T * 2 / 32; |
|
|
2180 | int py = y * T - T * 6 / 32; |
2179 | |
2181 | |
2180 | key_ov.texname = tex.name; |
2182 | key_ov.texname = tex.name; |
2181 | arr = rc_array (rc_ov, &key_ov); |
2183 | arr = rc_array (rc_ov, &key_ov); |
2182 | |
|
|
2183 | int px = x * T + T * 2 / 32; |
|
|
2184 | int py = y * T - T * 6 / 32; |
|
|
2185 | |
2184 | |
2186 | rc_t2f_v3f (arr, 0 , 0 , px , py , 0); |
2185 | rc_t2f_v3f (arr, 0 , 0 , px , py , 0); |
2187 | rc_t2f_v3f (arr, 0 , tex.t, px , py + T, 0); |
2186 | rc_t2f_v3f (arr, 0 , tex.t, px , py + T, 0); |
2188 | rc_t2f_v3f (arr, tex.s, tex.t, px + T, py + T, 0); |
2187 | rc_t2f_v3f (arr, tex.s, tex.t, px + T, py + T, 0); |
2189 | rc_t2f_v3f (arr, tex.s, 0 , px + T, py , 0); |
2188 | rc_t2f_v3f (arr, tex.s, 0 , px + T, py , 0); |
… | |
… | |
2367 | }; |
2366 | }; |
2368 | |
2367 | |
2369 | int x, y; |
2368 | int x, y; |
2370 | |
2369 | |
2371 | 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 | */ |
2372 | glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); |
2377 | glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); |
2373 | glEnable (GL_BLEND); |
2378 | glEnable (GL_BLEND); |
2374 | glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
2379 | glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
2375 | glBegin (GL_QUADS); |
2380 | glBegin (GL_QUADS); |
2376 | |
2381 | |
2377 | for (y = 0; y < h; y++) |
2382 | for (y = 0; y < h; y++) |
… | |
… | |
2384 | float *c = color [m & 15]; |
2389 | float *c = color [m & 15]; |
2385 | |
2390 | |
2386 | float tx1 = m & 0x40 ? 0.5 : 0.; |
2391 | float tx1 = m & 0x40 ? 0.5 : 0.; |
2387 | float tx2 = tx1 + 0.5; |
2392 | float tx2 = tx1 + 0.5; |
2388 | |
2393 | |
2389 | glColor4f (c[0], c[1], c[2], 0.75); |
2394 | glColor4f (c[0], c[1], c[2], 1); |
2390 | glTexCoord2f (tx1, 0.); glVertex2i (x , y ); |
2395 | glTexCoord2f (tx1, 0.); glVertex2i (x , y ); |
2391 | glTexCoord2f (tx1, 1.); glVertex2i (x , y + 1); |
2396 | glTexCoord2f (tx1, 1.); glVertex2i (x , y + 1); |
2392 | glTexCoord2f (tx2, 1.); glVertex2i (x + 1, y + 1); |
2397 | glTexCoord2f (tx2, 1.); glVertex2i (x + 1, y + 1); |
2393 | glTexCoord2f (tx2, 0.); glVertex2i (x + 1, y ); |
2398 | glTexCoord2f (tx2, 0.); glVertex2i (x + 1, y ); |
2394 | } |
2399 | } |