… | |
… | |
930 | |
930 | |
931 | SDL_WM_SetCaption ("Deliantra MORPG Client " VERSION, "Deliantra"); |
931 | SDL_WM_SetCaption ("Deliantra MORPG Client " VERSION, "Deliantra"); |
932 | #define GL_FUNC(ptr,name) gl.name = (ptr)SDL_GL_GetProcAddress ("gl" # name); |
932 | #define GL_FUNC(ptr,name) gl.name = (ptr)SDL_GL_GetProcAddress ("gl" # name); |
933 | #include "glfunc.h" |
933 | #include "glfunc.h" |
934 | #undef GL_FUNC |
934 | #undef GL_FUNC |
|
|
935 | |
|
|
936 | if (!gl.ActiveTexture ) gl.ActiveTexture = gl.ActiveTextureARB; |
|
|
937 | if (!gl.MultiTexCoord2f) gl.MultiTexCoord2f = gl.MultiTexCoord2fARB; |
935 | } |
938 | } |
936 | } |
939 | } |
937 | OUTPUT: |
940 | OUTPUT: |
938 | RETVAL |
941 | RETVAL |
939 | |
942 | |
… | |
… | |
1672 | void |
1675 | void |
1673 | draw_fow_texture (float intensity, int hidden_tex, int name1, uint8_t *data1, float s, float t, int w, int h, float blend = 0.f, int dx = 0, int dy = 0, int name2 = 0, uint8_t *data2 = data1) |
1676 | draw_fow_texture (float intensity, int hidden_tex, int name1, uint8_t *data1, float s, float t, int w, int h, float blend = 0.f, int dx = 0, int dy = 0, int name2 = 0, uint8_t *data2 = data1) |
1674 | PROTOTYPE: @ |
1677 | PROTOTYPE: @ |
1675 | CODE: |
1678 | CODE: |
1676 | { |
1679 | { |
|
|
1680 | glEnable (GL_BLEND); |
|
|
1681 | glBlendFunc (intensity ? GL_SRC_ALPHA : GL_ONE, GL_ONE_MINUS_SRC_ALPHA); |
1677 | glEnable (GL_TEXTURE_2D); |
1682 | glEnable (GL_TEXTURE_2D); |
1678 | glEnable (GL_BLEND); |
|
|
1679 | glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); |
|
|
1680 | glBindTexture (GL_TEXTURE_2D, name1); |
1683 | glBindTexture (GL_TEXTURE_2D, name1); |
1681 | |
1684 | |
1682 | glColor3f (intensity, intensity, intensity); |
1685 | glColor3f (intensity, intensity, intensity); |
1683 | glPushMatrix (); |
1686 | glPushMatrix (); |
1684 | glScalef (1./3, 1./3, 1.); |
1687 | glScalef (1./3, 1./3, 1.); |
… | |
… | |
1699 | glBindTexture (GL_TEXTURE_2D, name2); |
1702 | glBindTexture (GL_TEXTURE_2D, name2); |
1700 | glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); |
1703 | glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); |
1701 | |
1704 | |
1702 | /* rgb == rgb(glcolor) */ |
1705 | /* rgb == rgb(glcolor) */ |
1703 | glTexEnvi (GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_REPLACE); |
1706 | glTexEnvi (GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_REPLACE); |
1704 | glTexEnvi (GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_CONSTANT); |
1707 | glTexEnvi (GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_PRIMARY_COLOR); |
1705 | glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR); |
1708 | glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR); |
1706 | |
1709 | |
1707 | /* alpha = interpolate t0, t1 by env_alpha */ |
1710 | /* alpha = interpolate t0, t1 by env_alpha */ |
1708 | glTexEnvfv (GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, env_color); |
1711 | glTexEnvfv (GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, env_color); |
1709 | |
1712 | |