… | |
… | |
41 | #include <SDL_opengl.h> |
41 | #include <SDL_opengl.h> |
42 | |
42 | |
43 | /* work around os x broken headers */ |
43 | /* work around os x broken headers */ |
44 | #ifdef __MACOSX__ |
44 | #ifdef __MACOSX__ |
45 | typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); |
45 | typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); |
|
|
46 | typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); |
|
|
47 | typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); |
46 | #endif |
48 | #endif |
47 | |
49 | |
48 | #define PANGO_ENABLE_BACKEND |
50 | #define PANGO_ENABLE_BACKEND |
49 | #define G_DISABLE_CAST_CHECKS |
51 | #define G_DISABLE_CAST_CHECKS |
50 | |
52 | |
… | |
… | |
97 | |
99 | |
98 | #define KMOD_LRAM 0x10000 // our extension |
100 | #define KMOD_LRAM 0x10000 // our extension |
99 | |
101 | |
100 | #define TEXID_SPEECH 1 |
102 | #define TEXID_SPEECH 1 |
101 | #define TEXID_NOFACE 2 |
103 | #define TEXID_NOFACE 2 |
102 | #define TEXID_HIDDEN 3 |
|
|
103 | |
104 | |
104 | static AV *texture_av; |
105 | static AV *texture_av; |
105 | |
106 | |
106 | static struct |
107 | static struct |
107 | { |
108 | { |
… | |
… | |
929 | |
930 | |
930 | SDL_WM_SetCaption ("Deliantra MORPG Client " VERSION, "Deliantra"); |
931 | SDL_WM_SetCaption ("Deliantra MORPG Client " VERSION, "Deliantra"); |
931 | #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); |
932 | #include "glfunc.h" |
933 | #include "glfunc.h" |
933 | #undef GL_FUNC |
934 | #undef GL_FUNC |
|
|
935 | |
|
|
936 | if (!gl.ActiveTexture ) gl.ActiveTexture = gl.ActiveTextureARB; |
|
|
937 | if (!gl.MultiTexCoord2f) gl.MultiTexCoord2f = gl.MultiTexCoord2fARB; |
934 | } |
938 | } |
935 | } |
939 | } |
936 | OUTPUT: |
940 | OUTPUT: |
937 | RETVAL |
941 | RETVAL |
938 | |
942 | |
… | |
… | |
1671 | void |
1675 | void |
1672 | 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) |
1673 | PROTOTYPE: @ |
1677 | PROTOTYPE: @ |
1674 | CODE: |
1678 | CODE: |
1675 | { |
1679 | { |
1676 | glEnable (GL_TEXTURE_2D); |
|
|
1677 | glEnable (GL_BLEND); |
1680 | glEnable (GL_BLEND); |
1678 | glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); |
1681 | glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); |
|
|
1682 | glEnable (GL_TEXTURE_2D); |
1679 | glBindTexture (GL_TEXTURE_2D, name1); |
1683 | glBindTexture (GL_TEXTURE_2D, name1); |
1680 | |
1684 | |
1681 | glColor3f (intensity, intensity, intensity); |
1685 | glColor3f (intensity, intensity, intensity); |
1682 | glPushMatrix (); |
1686 | glPushMatrix (); |
1683 | glScalef (1./3, 1./3, 1.); |
1687 | glScalef (1./3, 1./3, 1.); |
… | |
… | |
2141 | int pl_x, pl_y; |
2145 | int pl_x, pl_y; |
2142 | maptex pl_tex; |
2146 | maptex pl_tex; |
2143 | rc_t *rc = rc_alloc (); |
2147 | rc_t *rc = rc_alloc (); |
2144 | rc_t *rc_ov = rc_alloc (); |
2148 | rc_t *rc_ov = rc_alloc (); |
2145 | rc_key_t key; |
2149 | rc_key_t key; |
2146 | rc_array_t *arr, *arr_hidden; |
2150 | rc_array_t *arr; |
2147 | |
2151 | |
2148 | pl_tex.name = 0; |
2152 | pl_tex.name = 0; |
2149 | |
2153 | |
2150 | // that's current max. sorry. |
2154 | // that's current max. sorry. |
2151 | if (sw > 255) sw = 255; |
2155 | if (sw > 255) sw = 255; |
… | |
… | |
2188 | } |
2192 | } |
2189 | |
2193 | |
2190 | glEnable (GL_BLEND); |
2194 | glEnable (GL_BLEND); |
2191 | glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
2195 | glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
2192 | glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); |
2196 | glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); |
2193 | |
|
|
2194 | key.texname = self->tex [TEXID_HIDDEN].name; |
|
|
2195 | arr_hidden = rc_array (rc_ov, &key); |
|
|
2196 | |
2197 | |
2197 | for (z = 0; z <= 2; z++) |
2198 | for (z = 0; z <= 2; z++) |
2198 | { |
2199 | { |
2199 | memset (smooth_level, 0, sizeof (smooth_level)); |
2200 | memset (smooth_level, 0, sizeof (smooth_level)); |
2200 | key.texname = -1; |
2201 | key.texname = -1; |