… | |
… | |
184 | { |
184 | { |
185 | GSList *attrs = run->item->analysis.extra_attrs; |
185 | GSList *attrs = run->item->analysis.extra_attrs; |
186 | |
186 | |
187 | while (attrs) |
187 | while (attrs) |
188 | { |
188 | { |
189 | PangoAttribute *attr = attrs->data; |
189 | PangoAttribute *attr = (PangoAttribute *)attrs->data; |
190 | |
190 | |
191 | if (attr->klass->type == PANGO_ATTR_SHAPE) |
191 | if (attr->klass->type == PANGO_ATTR_SHAPE) |
192 | return 1; |
192 | return 1; |
193 | |
193 | |
194 | attrs = attrs->next; |
194 | attrs = attrs->next; |
… | |
… | |
212 | static void |
212 | static void |
213 | substitute_func (FcPattern *pattern, gpointer data) |
213 | substitute_func (FcPattern *pattern, gpointer data) |
214 | { |
214 | { |
215 | FcPatternAddBool (pattern, FC_HINTING, 1); |
215 | FcPatternAddBool (pattern, FC_HINTING, 1); |
216 | #ifdef FC_HINT_STYLE |
216 | #ifdef FC_HINT_STYLE |
217 | FcPatternAddBool (pattern, FC_HINT_STYLE, FC_HINT_FULL); |
217 | FcPatternAddInteger (pattern, FC_HINT_STYLE, FC_HINT_FULL); |
218 | #endif |
218 | #endif |
219 | FcPatternAddBool (pattern, FC_AUTOHINT, 0); |
219 | FcPatternAddBool (pattern, FC_AUTOHINT, 0); |
220 | } |
220 | } |
221 | |
221 | |
222 | static void |
222 | static void |
… | |
… | |
481 | ev.data2 = 0; |
481 | ev.data2 = 0; |
482 | |
482 | |
483 | SDL_PushEvent ((SDL_Event *)&ev); |
483 | SDL_PushEvent ((SDL_Event *)&ev); |
484 | } |
484 | } |
485 | |
485 | |
|
|
486 | // approximately divide by 255 |
486 | static unsigned int |
487 | static unsigned int |
487 | div255 (unsigned int n) |
488 | div255 (unsigned int n) |
488 | { |
489 | { |
489 | return (n + (n >> 8)) >> 8; |
490 | return (n + (n >> 8)) >> 8; |
490 | } |
491 | } |
… | |
… | |
889 | void SDL_QuitSubSystem (U32 flags) |
890 | void SDL_QuitSubSystem (U32 flags) |
890 | |
891 | |
891 | void SDL_Quit () |
892 | void SDL_Quit () |
892 | |
893 | |
893 | int SDL_GL_SetAttribute (int attr, int value) |
894 | int SDL_GL_SetAttribute (int attr, int value) |
|
|
895 | C_ARGS: (SDL_GLattr)attr, value |
894 | |
896 | |
895 | int SDL_GL_GetAttribute (int attr) |
897 | int SDL_GL_GetAttribute (int attr) |
896 | CODE: |
898 | CODE: |
897 | if (SDL_GL_GetAttribute (attr, &RETVAL)) |
899 | if (SDL_GL_GetAttribute ((SDL_GLattr)attr, &RETVAL)) |
898 | XSRETURN_UNDEF; |
900 | XSRETURN_UNDEF; |
899 | OUTPUT: |
901 | OUTPUT: |
900 | RETVAL |
902 | RETVAL |
901 | |
903 | |
902 | void |
904 | void |
… | |
… | |
975 | void |
977 | void |
976 | SDL_GL_SwapBuffers () |
978 | SDL_GL_SwapBuffers () |
977 | |
979 | |
978 | char * |
980 | char * |
979 | SDL_GetKeyName (int sym) |
981 | SDL_GetKeyName (int sym) |
|
|
982 | C_ARGS: (SDLKey)sym |
980 | |
983 | |
981 | int |
984 | int |
982 | SDL_GetAppState () |
985 | SDL_GetAppState () |
983 | |
986 | |
984 | int |
987 | int |
… | |
… | |
1081 | OUTPUT: |
1084 | OUTPUT: |
1082 | RETVAL |
1085 | RETVAL |
1083 | |
1086 | |
1084 | int |
1087 | int |
1085 | Mix_OpenAudio (int frequency = 44100, int format = MIX_DEFAULT_FORMAT, int channels = 2, int chunksize = 4096) |
1088 | Mix_OpenAudio (int frequency = 44100, int format = MIX_DEFAULT_FORMAT, int channels = 2, int chunksize = 4096) |
1086 | POSTCALL: |
1089 | POSTCALL: |
1087 | Mix_HookMusicFinished (music_finished); |
1090 | Mix_HookMusicFinished (music_finished); |
1088 | Mix_ChannelFinished (channel_finished); |
1091 | Mix_ChannelFinished (channel_finished); |
1089 | |
1092 | |
1090 | void |
1093 | void |
1091 | Mix_QuerySpec () |
1094 | Mix_QuerySpec () |
… | |
… | |
1212 | |
1215 | |
1213 | SDL_LockSurface (surface2); |
1216 | SDL_LockSurface (surface2); |
1214 | EXTEND (SP, 6); |
1217 | EXTEND (SP, 6); |
1215 | PUSHs (sv_2mortal (newSViv (surface2->w))); |
1218 | PUSHs (sv_2mortal (newSViv (surface2->w))); |
1216 | PUSHs (sv_2mortal (newSViv (surface2->h))); |
1219 | PUSHs (sv_2mortal (newSViv (surface2->h))); |
1217 | PUSHs (sv_2mortal (newSVpvn (surface2->pixels, surface2->h * surface2->pitch))); |
1220 | PUSHs (sv_2mortal (newSVpvn ((const char *)surface2->pixels, surface2->h * surface2->pitch))); |
1218 | PUSHs (sv_2mortal (newSViv (surface->flags & (SDL_SRCCOLORKEY | SDL_SRCALPHA) ? GL_RGBA : GL_RGB))); |
1221 | PUSHs (sv_2mortal (newSViv (surface->flags & (SDL_SRCCOLORKEY | SDL_SRCALPHA) ? GL_RGBA : GL_RGB))); |
1219 | PUSHs (sv_2mortal (newSViv (GL_RGBA))); |
1222 | PUSHs (sv_2mortal (newSViv (GL_RGBA))); |
1220 | PUSHs (sv_2mortal (newSViv (GL_UNSIGNED_BYTE))); |
1223 | PUSHs (sv_2mortal (newSViv (GL_UNSIGNED_BYTE))); |
1221 | SDL_UnlockSurface (surface2); |
1224 | SDL_UnlockSurface (surface2); |
1222 | |
1225 | |
… | |
… | |
1294 | MODULE = Deliantra::Client PACKAGE = DC::Font |
1297 | MODULE = Deliantra::Client PACKAGE = DC::Font |
1295 | |
1298 | |
1296 | PROTOTYPES: DISABLE |
1299 | PROTOTYPES: DISABLE |
1297 | |
1300 | |
1298 | DC::Font |
1301 | DC::Font |
1299 | new_from_file (SV *class, char *path, int id = 0) |
1302 | new_from_file (SV *klass, char *path, int id = 0) |
1300 | CODE: |
1303 | CODE: |
1301 | { |
1304 | { |
1302 | int count; |
1305 | int count; |
1303 | FcPattern *pattern = FcFreeTypeQuery ((const FcChar8 *)path, id, 0, &count); |
1306 | FcPattern *pattern = FcFreeTypeQuery ((const FcChar8 *)path, id, 0, &count); |
1304 | RETVAL = pango_fc_font_description_from_pattern (pattern, 0); |
1307 | RETVAL = pango_fc_font_description_from_pattern (pattern, 0); |
… | |
… | |
1333 | PROTOTYPE: |
1336 | PROTOTYPE: |
1334 | CODE: |
1337 | CODE: |
1335 | tc_restore (); |
1338 | tc_restore (); |
1336 | |
1339 | |
1337 | DC::Layout |
1340 | DC::Layout |
1338 | new (SV *class) |
1341 | new (SV *klass) |
1339 | CODE: |
1342 | CODE: |
1340 | New (0, RETVAL, 1, struct cf_layout); |
1343 | New (0, RETVAL, 1, struct cf_layout); |
1341 | |
1344 | |
1342 | RETVAL->pl = pango_layout_new (opengl_context); |
1345 | RETVAL->pl = pango_layout_new (opengl_context); |
1343 | RETVAL->r = 1.; |
1346 | RETVAL->r = 1.; |
… | |
… | |
1866 | MODULE = Deliantra::Client PACKAGE = DC::Map |
1869 | MODULE = Deliantra::Client PACKAGE = DC::Map |
1867 | |
1870 | |
1868 | PROTOTYPES: DISABLE |
1871 | PROTOTYPES: DISABLE |
1869 | |
1872 | |
1870 | DC::Map |
1873 | DC::Map |
1871 | new (SV *class) |
1874 | new (SV *klass) |
1872 | CODE: |
1875 | CODE: |
1873 | New (0, RETVAL, 1, struct map); |
1876 | New (0, RETVAL, 1, struct map); |
1874 | RETVAL->x = 0; |
1877 | RETVAL->x = 0; |
1875 | RETVAL->y = 0; |
1878 | RETVAL->y = 0; |
1876 | RETVAL->w = 0; |
1879 | RETVAL->w = 0; |
… | |
… | |
1915 | |
1918 | |
1916 | void |
1919 | void |
1917 | set_smooth (DC::Map self, int face, int smooth, int level) |
1920 | set_smooth (DC::Map self, int face, int smooth, int level) |
1918 | CODE: |
1921 | CODE: |
1919 | { |
1922 | { |
1920 | tileid texid; |
1923 | tileid texid; |
1921 | maptex *tex; |
1924 | maptex *tex; |
1922 | |
1925 | |
1923 | if (face < 0 || face >= self->faces) |
1926 | if (face < 0 || face >= self->faces) |
1924 | return; |
1927 | return; |
1925 | |
1928 | |
1926 | if (smooth < 0 || smooth >= self->faces) |
1929 | if (smooth < 0 || smooth >= self->faces) |
1927 | return; |
1930 | return; |
1928 | |
1931 | |
1929 | texid = self->face2tile [face]; |
1932 | texid = self->face2tile [face]; |
1930 | |
1933 | |
1931 | if (!texid) |
1934 | if (!texid) |
1932 | return; |
1935 | return; |
1933 | |
1936 | |
1934 | tex = self->tex + texid; |
1937 | tex = self->tex + texid; |
… | |
… | |
1967 | } |
1970 | } |
1968 | |
1971 | |
1969 | void |
1972 | void |
1970 | expire_textures (DC::Map self, int texid, int count) |
1973 | expire_textures (DC::Map self, int texid, int count) |
1971 | PPCODE: |
1974 | PPCODE: |
1972 | for (; texid < self->texs && count; ++texid, --count) |
1975 | for (; texid < self->texs && count; ++texid, --count) |
1973 | { |
1976 | { |
1974 | maptex *tex = self->tex + texid; |
1977 | maptex *tex = self->tex + texid; |
1975 | |
1978 | |
1976 | if (tex->name) |
1979 | if (tex->name) |
1977 | { |
1980 | { |
… | |
… | |
2179 | | (b << 16) |
2182 | | (b << 16) |
2180 | | (a << 24); |
2183 | | (a << 24); |
2181 | } |
2184 | } |
2182 | } |
2185 | } |
2183 | |
2186 | |
2184 | RETVAL = map_sv; |
2187 | RETVAL = map_sv; |
2185 | } |
2188 | } |
2186 | OUTPUT: |
2189 | OUTPUT: |
2187 | RETVAL |
2190 | RETVAL |
2188 | |
2191 | |
2189 | void |
2192 | void |
2190 | draw (DC::Map self, int mx, int my, int sw, int sh, int Tw, int Th, U32 player = 0xffffffff, int sdx = 0, int sdy = 0) |
2193 | draw (DC::Map self, int mx, int my, int sw, int sh, int Tw, int Th, U32 player = 0xffffffff, int sdx = 0, int sdy = 0) |
2191 | CODE: |
2194 | CODE: |
2192 | { |
2195 | { |
2193 | int x, y, z; |
2196 | int x, y, z; |
2194 | |
2197 | |
2195 | HV *smooth = (HV *)sv_2mortal ((SV *)newHV ()); |
2198 | HV *smooth = (HV *)sv_2mortal ((SV *)newHV ()); |
2196 | uint32_t smooth_level[256 / 32]; // one bit for every possible smooth level |
2199 | uint32_t smooth_level[256 / 32]; // one bit for every possible smooth level |
2197 | static uint8_t smooth_max[256][256]; // egad, fast and wasteful on memory (64k) |
2200 | static uint8_t smooth_max[256][256]; // egad, fast and wasteful on memory (64k) |
2198 | smooth_key skey; |
2201 | smooth_key skey; |
2199 | int pl_x, pl_y; |
2202 | int pl_x, pl_y; |
2200 | maptex pl_tex; |
2203 | maptex pl_tex; |
… | |
… | |
2718 | else |
2721 | else |
2719 | *data++ = 0; |
2722 | *data++ = 0; |
2720 | } |
2723 | } |
2721 | } |
2724 | } |
2722 | |
2725 | |
2723 | /* if size is w*h + 5 then no data has been found */ |
2726 | /* if size is w*h + 5 then no data has been found */ |
2724 | if (data - (uint8_t *)SvPVX (data_sv) != w * h + 5) |
2727 | if (data - (uint8_t *)SvPVX (data_sv) != w * h + 5) |
2725 | { |
2728 | { |
2726 | SvPOK_only (data_sv); |
2729 | SvPOK_only (data_sv); |
2727 | SvCUR_set (data_sv, data - (uint8_t *)SvPVX (data_sv)); |
2730 | SvCUR_set (data_sv, data - (uint8_t *)SvPVX (data_sv)); |
2728 | } |
2731 | } |
2729 | |
2732 | |
2730 | RETVAL = data_sv; |
2733 | RETVAL = data_sv; |
2731 | } |
2734 | } |
2732 | OUTPUT: |
2735 | OUTPUT: |
2733 | RETVAL |
2736 | RETVAL |
2734 | |
2737 | |
2735 | void |
2738 | void |
… | |
… | |
2742 | STRLEN len; |
2745 | STRLEN len; |
2743 | uint8_t *data, *end; |
2746 | uint8_t *data, *end; |
2744 | |
2747 | |
2745 | len = SvLEN (data_sv); |
2748 | len = SvLEN (data_sv); |
2746 | SvGROW (data_sv, len + 8); // reserve at least 7+ bytes more |
2749 | SvGROW (data_sv, len + 8); // reserve at least 7+ bytes more |
2747 | data = SvPVbyte_nolen (data_sv); |
2750 | data = (uint8_t *)SvPVbyte_nolen (data_sv); |
2748 | end = data + len + 8; |
2751 | end = data + len + 8; |
2749 | |
2752 | |
2750 | if (len < 5) |
2753 | if (len < 5) |
2751 | XSRETURN_EMPTY; |
2754 | XSRETURN_EMPTY; |
2752 | |
2755 | |
… | |
… | |
2813 | } |
2816 | } |
2814 | |
2817 | |
2815 | MODULE = Deliantra::Client PACKAGE = DC::RW |
2818 | MODULE = Deliantra::Client PACKAGE = DC::RW |
2816 | |
2819 | |
2817 | DC::RW |
2820 | DC::RW |
2818 | new (SV *class, SV *data_sv) |
2821 | new (SV *klass, SV *data_sv) |
2819 | CODE: |
2822 | CODE: |
2820 | { |
2823 | { |
2821 | STRLEN datalen; |
2824 | STRLEN datalen; |
2822 | char *data = SvPVbyte (data_sv, datalen); |
2825 | char *data = SvPVbyte (data_sv, datalen); |
2823 | |
2826 | |
… | |
… | |
2825 | } |
2828 | } |
2826 | OUTPUT: |
2829 | OUTPUT: |
2827 | RETVAL |
2830 | RETVAL |
2828 | |
2831 | |
2829 | DC::RW |
2832 | DC::RW |
2830 | new_from_file (SV *class, const char *path, const char *mode = "rb") |
2833 | new_from_file (SV *klass, const char *path, const char *mode = "rb") |
2831 | CODE: |
2834 | CODE: |
2832 | RETVAL = SDL_RWFromFile (path, mode); |
2835 | RETVAL = SDL_RWFromFile (path, mode); |
2833 | OUTPUT: |
2836 | OUTPUT: |
2834 | RETVAL |
2837 | RETVAL |
2835 | |
2838 | |
… | |
… | |
2944 | #else |
2947 | #else |
2945 | XPUSHs (sv_2mortal (newSVpv ("(sdl mixer too old)", 0))); |
2948 | XPUSHs (sv_2mortal (newSVpv ("(sdl mixer too old)", 0))); |
2946 | #endif |
2949 | #endif |
2947 | |
2950 | |
2948 | DC::MixChunk |
2951 | DC::MixChunk |
2949 | new (SV *class, DC::RW rwops) |
2952 | new (SV *klass, DC::RW rwops) |
2950 | CODE: |
2953 | CODE: |
2951 | RETVAL = Mix_LoadWAV_RW (rwops, 1); |
2954 | RETVAL = Mix_LoadWAV_RW (rwops, 1); |
2952 | OUTPUT: |
2955 | OUTPUT: |
2953 | RETVAL |
2956 | RETVAL |
2954 | |
2957 | |
… | |
… | |
3024 | RETVAL = Mix_PlayingMusic (); |
3027 | RETVAL = Mix_PlayingMusic (); |
3025 | OUTPUT: |
3028 | OUTPUT: |
3026 | RETVAL |
3029 | RETVAL |
3027 | |
3030 | |
3028 | DC::MixMusic |
3031 | DC::MixMusic |
3029 | new (SV *class, DC::RW rwops) |
3032 | new (SV *klass, DC::RW rwops) |
3030 | CODE: |
3033 | CODE: |
3031 | RETVAL = Mix_LoadMUS_RW (rwops); |
3034 | RETVAL = Mix_LoadMUS_RW (rwops); |
3032 | OUTPUT: |
3035 | OUTPUT: |
3033 | RETVAL |
3036 | RETVAL |
3034 | |
3037 | |
… | |
… | |
3187 | gl.BlendFuncSeparateEXT = 0; |
3190 | gl.BlendFuncSeparateEXT = 0; |
3188 | |
3191 | |
3189 | void |
3192 | void |
3190 | apple_nvidia_bug (int enable) |
3193 | apple_nvidia_bug (int enable) |
3191 | |
3194 | |
3192 | char * |
3195 | const char * |
3193 | gl_vendor () |
3196 | gl_vendor () |
3194 | CODE: |
3197 | CODE: |
3195 | RETVAL = (char *)glGetString (GL_VENDOR); |
3198 | RETVAL = (const char *)glGetString (GL_VENDOR); |
3196 | OUTPUT: |
3199 | OUTPUT: |
3197 | RETVAL |
3200 | RETVAL |
3198 | |
3201 | |
3199 | char * |
3202 | const char * |
3200 | gl_version () |
3203 | gl_version () |
3201 | CODE: |
3204 | CODE: |
3202 | RETVAL = (char *)glGetString (GL_VERSION); |
3205 | RETVAL = (const char *)glGetString (GL_VERSION); |
3203 | OUTPUT: |
3206 | OUTPUT: |
3204 | RETVAL |
3207 | RETVAL |
3205 | |
3208 | |
3206 | char * |
3209 | const char * |
3207 | gl_extensions () |
3210 | gl_extensions () |
3208 | CODE: |
3211 | CODE: |
3209 | RETVAL = (char *)glGetString (GL_EXTENSIONS); |
3212 | RETVAL = (const char *)glGetString (GL_EXTENSIONS); |
3210 | OUTPUT: |
3213 | OUTPUT: |
3211 | RETVAL |
3214 | RETVAL |
3212 | |
3215 | |
3213 | const char *glGetString (GLenum pname) |
3216 | const char *glGetString (GLenum pname) |
|
|
3217 | CODE: |
|
|
3218 | RETVAL = (const char *)glGetString (pname); |
|
|
3219 | OUTPUT: |
|
|
3220 | RETVAL |
3214 | |
3221 | |
3215 | GLint glGetInteger (GLenum pname) |
3222 | GLint glGetInteger (GLenum pname) |
3216 | CODE: |
3223 | CODE: |
3217 | glGetIntegerv (pname, &RETVAL); |
3224 | glGetIntegerv (pname, &RETVAL); |
3218 | OUTPUT: |
3225 | OUTPUT: |
… | |
… | |
3421 | |
3428 | |
3422 | void |
3429 | void |
3423 | find_widget (SV *self, NV x, NV y) |
3430 | find_widget (SV *self, NV x, NV y) |
3424 | PPCODE: |
3431 | PPCODE: |
3425 | { |
3432 | { |
3426 | if (within_widget (self, x, y)) |
3433 | if (within_widget (self, x, y)) |
3427 | XPUSHs (self); |
3434 | XPUSHs (self); |
3428 | } |
3435 | } |
3429 | |
3436 | |
3430 | BOOT: |
3437 | BOOT: |
3431 | { |
3438 | { |
… | |
… | |
3439 | |
3446 | |
3440 | void |
3447 | void |
3441 | draw (SV *self) |
3448 | draw (SV *self) |
3442 | CODE: |
3449 | CODE: |
3443 | { |
3450 | { |
3444 | HV *hv; |
3451 | HV *hv; |
3445 | SV **svp; |
3452 | SV **svp; |
3446 | NV x, y, w, h; |
3453 | NV x, y, w, h; |
3447 | SV *draw_x_sv = GvSV (draw_x_gv); |
3454 | SV *draw_x_sv = GvSV (draw_x_gv); |
3448 | SV *draw_y_sv = GvSV (draw_y_gv); |
3455 | SV *draw_y_sv = GvSV (draw_y_gv); |
3449 | SV *draw_w_sv = GvSV (draw_w_gv); |
3456 | SV *draw_w_sv = GvSV (draw_w_gv); |
3450 | SV *draw_h_sv = GvSV (draw_h_gv); |
3457 | SV *draw_h_sv = GvSV (draw_h_gv); |