… | |
… | |
48 | #endif |
48 | #endif |
49 | |
49 | |
50 | #define PANGO_ENABLE_BACKEND |
50 | #define PANGO_ENABLE_BACKEND |
51 | #define G_DISABLE_CAST_CHECKS |
51 | #define G_DISABLE_CAST_CHECKS |
52 | |
52 | |
53 | #include <glib/gmacros.h> |
53 | #include <glib.h> |
54 | |
54 | |
55 | #include <pango/pango.h> |
55 | #include <pango/pango.h> |
56 | |
56 | |
57 | #ifndef PANGO_VERSION_CHECK |
57 | #ifndef PANGO_VERSION_CHECK |
58 | # define PANGO_VERSION_CHECK(a,b,c) 0 |
58 | # define PANGO_VERSION_CHECK(a,b,c) 0 |
… | |
… | |
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 | } |
… | |
… | |
577 | |
578 | |
578 | return mod; |
579 | return mod; |
579 | } |
580 | } |
580 | |
581 | |
581 | static void |
582 | static void |
582 | deliantra_main () |
583 | deliantra_main (SV *real_main) |
583 | { |
584 | { |
584 | char *argv[] = { 0 }; |
585 | dSP; |
585 | call_argv ("DC::Main::main", G_DISCARD | G_VOID, argv); |
586 | |
|
|
587 | PUSHMARK (SP); |
|
|
588 | call_sv (real_main, G_DISCARD | G_VOID); |
586 | } |
589 | } |
587 | |
590 | |
588 | #ifdef __MACOSX__ |
591 | #ifdef __MACOSX__ |
|
|
592 | static SV *real_main; |
|
|
593 | |
589 | /* to due surprising braindamage on the side of SDL design, we |
594 | /* to due surprising braindamage on the side of SDL design, we |
590 | * do some mind-boggling hack here: SDL requires a custom main() |
595 | * do some mind-boggling hack here: SDL requires a custom main() |
591 | * on OS X, so... we provide one and call the original main(), which, |
596 | * on OS X, so... we provide one and call the original main(), which, |
592 | * due to shared library magic, calls -lSDLmain's main, not perl's main, |
597 | * due to shared library magic, calls -lSDLmain's main, not perl's main, |
593 | * and which calls our main (== SDL_main) back. |
598 | * and which calls our main (== SDL_main) back. |
594 | */ |
599 | */ |
595 | extern C_LINKAGE int |
600 | extern C_LINKAGE int |
596 | main (int argc, char *argv[]) |
601 | main (int argc, char *argv[]) |
597 | { |
602 | { |
598 | deliantra_main (); |
603 | deliantra_main (real_main); |
599 | } |
604 | } |
600 | |
605 | |
601 | #undef main |
606 | #undef main |
602 | |
607 | |
603 | extern C_LINKAGE int main (int argc, char *argv[]); |
608 | extern C_LINKAGE int main (int argc, char *argv[]); |
604 | |
609 | |
605 | static void |
610 | static void |
606 | SDL_braino (void) |
611 | SDL_main_hack (SV *real_main_) |
607 | { |
612 | { |
|
|
613 | real_main = real_main_; |
|
|
614 | |
608 | char *argv[] = { "deliantra client", 0 }; |
615 | char *argv[] = { "deliantra client", 0 }; |
609 | (main) (1, argv); |
616 | (main) (1, argv); |
610 | } |
617 | } |
611 | #else |
618 | #else |
612 | static void |
619 | static void |
613 | SDL_braino (void) |
620 | SDL_main_hack (SV *real_main) |
614 | { |
621 | { |
615 | deliantra_main (); |
622 | deliantra_main (real_main); |
616 | } |
623 | } |
617 | #endif |
624 | #endif |
618 | |
625 | |
619 | MODULE = Deliantra::Client PACKAGE = DC |
626 | MODULE = Deliantra::Client PACKAGE = DC |
620 | |
627 | |
… | |
… | |
871 | #endif |
878 | #endif |
872 | } |
879 | } |
873 | |
880 | |
874 | char *SDL_GetError () |
881 | char *SDL_GetError () |
875 | |
882 | |
876 | void SDL_braino () |
883 | void SDL_main_hack (SV *real_main) |
|
|
884 | PROTOTYPE: & |
877 | |
885 | |
878 | int SDL_Init (U32 flags) |
886 | int SDL_Init (U32 flags) |
879 | |
887 | |
880 | int SDL_InitSubSystem (U32 flags) |
888 | int SDL_InitSubSystem (U32 flags) |
881 | |
889 | |
882 | void SDL_QuitSubSystem (U32 flags) |
890 | void SDL_QuitSubSystem (U32 flags) |
883 | |
891 | |
884 | void SDL_Quit () |
892 | void SDL_Quit () |
885 | |
893 | |
886 | int SDL_GL_SetAttribute (int attr, int value) |
894 | int SDL_GL_SetAttribute (int attr, int value) |
|
|
895 | C_ARGS: (SDL_GLattr)attr, value |
887 | |
896 | |
888 | int SDL_GL_GetAttribute (int attr) |
897 | int SDL_GL_GetAttribute (int attr) |
889 | CODE: |
898 | CODE: |
890 | if (SDL_GL_GetAttribute (attr, &RETVAL)) |
899 | if (SDL_GL_GetAttribute ((SDL_GLattr)attr, &RETVAL)) |
891 | XSRETURN_UNDEF; |
900 | XSRETURN_UNDEF; |
892 | OUTPUT: |
901 | OUTPUT: |
893 | RETVAL |
902 | RETVAL |
894 | |
903 | |
895 | void |
904 | void |
… | |
… | |
968 | void |
977 | void |
969 | SDL_GL_SwapBuffers () |
978 | SDL_GL_SwapBuffers () |
970 | |
979 | |
971 | char * |
980 | char * |
972 | SDL_GetKeyName (int sym) |
981 | SDL_GetKeyName (int sym) |
|
|
982 | C_ARGS: (SDLKey)sym |
973 | |
983 | |
974 | int |
984 | int |
975 | SDL_GetAppState () |
985 | SDL_GetAppState () |
976 | |
986 | |
977 | int |
987 | int |
… | |
… | |
1074 | OUTPUT: |
1084 | OUTPUT: |
1075 | RETVAL |
1085 | RETVAL |
1076 | |
1086 | |
1077 | int |
1087 | int |
1078 | 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) |
1079 | POSTCALL: |
1089 | POSTCALL: |
1080 | Mix_HookMusicFinished (music_finished); |
1090 | Mix_HookMusicFinished (music_finished); |
1081 | Mix_ChannelFinished (channel_finished); |
1091 | Mix_ChannelFinished (channel_finished); |
1082 | |
1092 | |
1083 | void |
1093 | void |
1084 | Mix_QuerySpec () |
1094 | Mix_QuerySpec () |
… | |
… | |
1205 | |
1215 | |
1206 | SDL_LockSurface (surface2); |
1216 | SDL_LockSurface (surface2); |
1207 | EXTEND (SP, 6); |
1217 | EXTEND (SP, 6); |
1208 | PUSHs (sv_2mortal (newSViv (surface2->w))); |
1218 | PUSHs (sv_2mortal (newSViv (surface2->w))); |
1209 | PUSHs (sv_2mortal (newSViv (surface2->h))); |
1219 | PUSHs (sv_2mortal (newSViv (surface2->h))); |
1210 | PUSHs (sv_2mortal (newSVpvn (surface2->pixels, surface2->h * surface2->pitch))); |
1220 | PUSHs (sv_2mortal (newSVpvn ((const char *)surface2->pixels, surface2->h * surface2->pitch))); |
1211 | 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))); |
1212 | PUSHs (sv_2mortal (newSViv (GL_RGBA))); |
1222 | PUSHs (sv_2mortal (newSViv (GL_RGBA))); |
1213 | PUSHs (sv_2mortal (newSViv (GL_UNSIGNED_BYTE))); |
1223 | PUSHs (sv_2mortal (newSViv (GL_UNSIGNED_BYTE))); |
1214 | SDL_UnlockSurface (surface2); |
1224 | SDL_UnlockSurface (surface2); |
1215 | |
1225 | |
… | |
… | |
1287 | MODULE = Deliantra::Client PACKAGE = DC::Font |
1297 | MODULE = Deliantra::Client PACKAGE = DC::Font |
1288 | |
1298 | |
1289 | PROTOTYPES: DISABLE |
1299 | PROTOTYPES: DISABLE |
1290 | |
1300 | |
1291 | DC::Font |
1301 | DC::Font |
1292 | new_from_file (SV *class, char *path, int id = 0) |
1302 | new_from_file (SV *klass, char *path, int id = 0) |
1293 | CODE: |
1303 | CODE: |
1294 | { |
1304 | { |
1295 | int count; |
1305 | int count; |
1296 | FcPattern *pattern = FcFreeTypeQuery ((const FcChar8 *)path, id, 0, &count); |
1306 | FcPattern *pattern = FcFreeTypeQuery ((const FcChar8 *)path, id, 0, &count); |
1297 | RETVAL = pango_fc_font_description_from_pattern (pattern, 0); |
1307 | RETVAL = pango_fc_font_description_from_pattern (pattern, 0); |
… | |
… | |
1326 | PROTOTYPE: |
1336 | PROTOTYPE: |
1327 | CODE: |
1337 | CODE: |
1328 | tc_restore (); |
1338 | tc_restore (); |
1329 | |
1339 | |
1330 | DC::Layout |
1340 | DC::Layout |
1331 | new (SV *class) |
1341 | new (SV *klass) |
1332 | CODE: |
1342 | CODE: |
1333 | New (0, RETVAL, 1, struct cf_layout); |
1343 | New (0, RETVAL, 1, struct cf_layout); |
1334 | |
1344 | |
1335 | RETVAL->pl = pango_layout_new (opengl_context); |
1345 | RETVAL->pl = pango_layout_new (opengl_context); |
1336 | RETVAL->r = 1.; |
1346 | RETVAL->r = 1.; |
… | |
… | |
1485 | |
1495 | |
1486 | void |
1496 | void |
1487 | set_height (DC::Layout self, int base_height) |
1497 | set_height (DC::Layout self, int base_height) |
1488 | CODE: |
1498 | CODE: |
1489 | if (self->base_height != base_height) |
1499 | if (self->base_height != base_height) |
1490 | { |
1500 | { |
1491 | self->base_height = base_height; |
1501 | self->base_height = base_height; |
1492 | layout_update_font (self); |
1502 | layout_update_font (self); |
1493 | } |
1503 | } |
1494 | |
1504 | |
1495 | void |
1505 | void |
… | |
… | |
1859 | MODULE = Deliantra::Client PACKAGE = DC::Map |
1869 | MODULE = Deliantra::Client PACKAGE = DC::Map |
1860 | |
1870 | |
1861 | PROTOTYPES: DISABLE |
1871 | PROTOTYPES: DISABLE |
1862 | |
1872 | |
1863 | DC::Map |
1873 | DC::Map |
1864 | new (SV *class) |
1874 | new (SV *klass) |
1865 | CODE: |
1875 | CODE: |
1866 | New (0, RETVAL, 1, struct map); |
1876 | New (0, RETVAL, 1, struct map); |
1867 | RETVAL->x = 0; |
1877 | RETVAL->x = 0; |
1868 | RETVAL->y = 0; |
1878 | RETVAL->y = 0; |
1869 | RETVAL->w = 0; |
1879 | RETVAL->w = 0; |
… | |
… | |
1908 | |
1918 | |
1909 | void |
1919 | void |
1910 | set_smooth (DC::Map self, int face, int smooth, int level) |
1920 | set_smooth (DC::Map self, int face, int smooth, int level) |
1911 | CODE: |
1921 | CODE: |
1912 | { |
1922 | { |
1913 | tileid texid; |
1923 | tileid texid; |
1914 | maptex *tex; |
1924 | maptex *tex; |
1915 | |
1925 | |
1916 | if (face < 0 || face >= self->faces) |
1926 | if (face < 0 || face >= self->faces) |
1917 | return; |
1927 | return; |
1918 | |
1928 | |
1919 | if (smooth < 0 || smooth >= self->faces) |
1929 | if (smooth < 0 || smooth >= self->faces) |
1920 | return; |
1930 | return; |
1921 | |
1931 | |
1922 | texid = self->face2tile [face]; |
1932 | texid = self->face2tile [face]; |
1923 | |
1933 | |
1924 | if (!texid) |
1934 | if (!texid) |
1925 | return; |
1935 | return; |
1926 | |
1936 | |
1927 | tex = self->tex + texid; |
1937 | tex = self->tex + texid; |
… | |
… | |
1960 | } |
1970 | } |
1961 | |
1971 | |
1962 | void |
1972 | void |
1963 | expire_textures (DC::Map self, int texid, int count) |
1973 | expire_textures (DC::Map self, int texid, int count) |
1964 | PPCODE: |
1974 | PPCODE: |
1965 | for (; texid < self->texs && count; ++texid, --count) |
1975 | for (; texid < self->texs && count; ++texid, --count) |
1966 | { |
1976 | { |
1967 | maptex *tex = self->tex + texid; |
1977 | maptex *tex = self->tex + texid; |
1968 | |
1978 | |
1969 | if (tex->name) |
1979 | if (tex->name) |
1970 | { |
1980 | { |
… | |
… | |
2025 | self->y += MAP_EXTEND_Y; |
2035 | self->y += MAP_EXTEND_Y; |
2026 | } |
2036 | } |
2027 | } |
2037 | } |
2028 | |
2038 | |
2029 | SV * |
2039 | SV * |
2030 | map1a_update (DC::Map self, SV *data_, int extmap) |
2040 | map1a_update (DC::Map self, SV *data_) |
2031 | CODE: |
2041 | CODE: |
2032 | { |
2042 | { |
2033 | uint8_t *data = (uint8_t *)SvPVbyte_nolen (data_); |
2043 | uint8_t *data = (uint8_t *)SvPVbyte_nolen (data_); |
2034 | uint8_t *data_end = (uint8_t *)SvEND (data_); |
2044 | uint8_t *data_end = (uint8_t *)SvEND (data_); |
2035 | mapcell *cell; |
2045 | mapcell *cell; |
… | |
… | |
2056 | |
2066 | |
2057 | //TODO: don't trust server data to be in-range(!) |
2067 | //TODO: don't trust server data to be in-range(!) |
2058 | |
2068 | |
2059 | if (flags & 8) |
2069 | if (flags & 8) |
2060 | { |
2070 | { |
|
|
2071 | uint8_t ext, cmd; |
|
|
2072 | |
2061 | if (extmap) |
2073 | do |
2062 | { |
2074 | { |
2063 | uint8_t ext, cmd; |
2075 | ext = *data++; |
|
|
2076 | cmd = ext & 0x7f; |
2064 | |
2077 | |
2065 | do |
2078 | if (cmd < 4) |
|
|
2079 | cell->darkness = 255 - ext * 64 + 1; /* make sure this doesn't collide with FOW_DARKNESS */ |
|
|
2080 | else if (cmd == 5) // health |
2066 | { |
2081 | { |
2067 | ext = *data++; |
|
|
2068 | cmd = ext & 0x7f; |
|
|
2069 | |
|
|
2070 | if (cmd < 4) |
|
|
2071 | cell->darkness = 255 - ext * 64 + 1; /* make sure this doesn't collide with FOW_DARKNESS */ |
|
|
2072 | else if (cmd == 5) // health |
|
|
2073 | { |
|
|
2074 | cell->stat_width = 1; |
2082 | cell->stat_width = 1; |
2075 | cell->stat_hp = *data++; |
2083 | cell->stat_hp = *data++; |
2076 | } |
|
|
2077 | else if (cmd == 6) // monster width |
|
|
2078 | cell->stat_width = *data++ + 1; |
|
|
2079 | else if (cmd == 0x47) |
|
|
2080 | { |
|
|
2081 | if (*data == 1) cell->player = data [1]; |
|
|
2082 | else if (*data == 2) cell->player = data [2] + (data [1] << 8); |
|
|
2083 | else if (*data == 3) cell->player = data [3] + (data [2] << 8) + (data [1] << 16); |
|
|
2084 | else if (*data == 4) cell->player = data [4] + (data [3] << 8) + (data [2] << 16) + (data [1] << 24); |
|
|
2085 | |
|
|
2086 | data += *data + 1; |
|
|
2087 | } |
|
|
2088 | else if (cmd == 8) // cell flags |
|
|
2089 | cell->flags = *data++; |
|
|
2090 | else if (ext & 0x40) // unknown, multibyte => skip |
|
|
2091 | data += *data + 1; |
|
|
2092 | else |
|
|
2093 | data++; |
|
|
2094 | } |
2084 | } |
2095 | while (ext & 0x80); |
2085 | else if (cmd == 6) // monster width |
|
|
2086 | cell->stat_width = *data++ + 1; |
|
|
2087 | else if (cmd == 0x47) |
|
|
2088 | { |
|
|
2089 | if (*data == 1) cell->player = data [1]; |
|
|
2090 | else if (*data == 2) cell->player = data [2] + (data [1] << 8); |
|
|
2091 | else if (*data == 3) cell->player = data [3] + (data [2] << 8) + (data [1] << 16); |
|
|
2092 | else if (*data == 4) cell->player = data [4] + (data [3] << 8) + (data [2] << 16) + (data [1] << 24); |
|
|
2093 | |
|
|
2094 | data += *data + 1; |
|
|
2095 | } |
|
|
2096 | else if (cmd == 8) // cell flags |
|
|
2097 | cell->flags = *data++; |
|
|
2098 | else if (ext & 0x40) // unknown, multibyte => skip |
|
|
2099 | data += *data + 1; |
|
|
2100 | else |
|
|
2101 | data++; |
2096 | } |
2102 | } |
2097 | else |
2103 | while (ext & 0x80); |
2098 | cell->darkness = *data++ + 1; |
|
|
2099 | } |
2104 | } |
2100 | |
2105 | |
2101 | for (z = 0; z <= 2; ++z) |
2106 | for (z = 0; z <= 2; ++z) |
2102 | if (flags & (4 >> z)) |
2107 | if (flags & (4 >> z)) |
2103 | { |
2108 | { |
… | |
… | |
2177 | | (b << 16) |
2182 | | (b << 16) |
2178 | | (a << 24); |
2183 | | (a << 24); |
2179 | } |
2184 | } |
2180 | } |
2185 | } |
2181 | |
2186 | |
2182 | RETVAL = map_sv; |
2187 | RETVAL = map_sv; |
2183 | } |
2188 | } |
2184 | OUTPUT: |
2189 | OUTPUT: |
2185 | RETVAL |
2190 | RETVAL |
2186 | |
2191 | |
2187 | void |
2192 | void |
2188 | 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) |
2189 | CODE: |
2194 | CODE: |
2190 | { |
2195 | { |
2191 | int x, y, z; |
2196 | int x, y, z; |
2192 | |
2197 | |
2193 | HV *smooth = (HV *)sv_2mortal ((SV *)newHV ()); |
2198 | HV *smooth = (HV *)sv_2mortal ((SV *)newHV ()); |
2194 | 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 |
2195 | 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) |
2196 | smooth_key skey; |
2201 | smooth_key skey; |
2197 | int pl_x, pl_y; |
2202 | int pl_x, pl_y; |
2198 | maptex pl_tex; |
2203 | maptex pl_tex; |
… | |
… | |
2716 | else |
2721 | else |
2717 | *data++ = 0; |
2722 | *data++ = 0; |
2718 | } |
2723 | } |
2719 | } |
2724 | } |
2720 | |
2725 | |
2721 | /* 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 */ |
2722 | if (data - (uint8_t *)SvPVX (data_sv) != w * h + 5) |
2727 | if (data - (uint8_t *)SvPVX (data_sv) != w * h + 5) |
2723 | { |
2728 | { |
2724 | SvPOK_only (data_sv); |
2729 | SvPOK_only (data_sv); |
2725 | SvCUR_set (data_sv, data - (uint8_t *)SvPVX (data_sv)); |
2730 | SvCUR_set (data_sv, data - (uint8_t *)SvPVX (data_sv)); |
2726 | } |
2731 | } |
2727 | |
2732 | |
2728 | RETVAL = data_sv; |
2733 | RETVAL = data_sv; |
2729 | } |
2734 | } |
2730 | OUTPUT: |
2735 | OUTPUT: |
2731 | RETVAL |
2736 | RETVAL |
2732 | |
2737 | |
2733 | void |
2738 | void |
… | |
… | |
2740 | STRLEN len; |
2745 | STRLEN len; |
2741 | uint8_t *data, *end; |
2746 | uint8_t *data, *end; |
2742 | |
2747 | |
2743 | len = SvLEN (data_sv); |
2748 | len = SvLEN (data_sv); |
2744 | SvGROW (data_sv, len + 8); // reserve at least 7+ bytes more |
2749 | SvGROW (data_sv, len + 8); // reserve at least 7+ bytes more |
2745 | data = SvPVbyte_nolen (data_sv); |
2750 | data = (uint8_t *)SvPVbyte_nolen (data_sv); |
2746 | end = data + len + 8; |
2751 | end = data + len + 8; |
2747 | |
2752 | |
2748 | if (len < 5) |
2753 | if (len < 5) |
2749 | XSRETURN_EMPTY; |
2754 | XSRETURN_EMPTY; |
2750 | |
2755 | |
… | |
… | |
2811 | } |
2816 | } |
2812 | |
2817 | |
2813 | MODULE = Deliantra::Client PACKAGE = DC::RW |
2818 | MODULE = Deliantra::Client PACKAGE = DC::RW |
2814 | |
2819 | |
2815 | DC::RW |
2820 | DC::RW |
2816 | new (SV *class, SV *data_sv) |
2821 | new (SV *klass, SV *data_sv) |
2817 | CODE: |
2822 | CODE: |
2818 | { |
2823 | { |
2819 | STRLEN datalen; |
2824 | STRLEN datalen; |
2820 | char *data = SvPVbyte (data_sv, datalen); |
2825 | char *data = SvPVbyte (data_sv, datalen); |
2821 | |
2826 | |
… | |
… | |
2823 | } |
2828 | } |
2824 | OUTPUT: |
2829 | OUTPUT: |
2825 | RETVAL |
2830 | RETVAL |
2826 | |
2831 | |
2827 | DC::RW |
2832 | DC::RW |
2828 | 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") |
2829 | CODE: |
2834 | CODE: |
2830 | RETVAL = SDL_RWFromFile (path, mode); |
2835 | RETVAL = SDL_RWFromFile (path, mode); |
2831 | OUTPUT: |
2836 | OUTPUT: |
2832 | RETVAL |
2837 | RETVAL |
2833 | |
2838 | |
… | |
… | |
2942 | #else |
2947 | #else |
2943 | XPUSHs (sv_2mortal (newSVpv ("(sdl mixer too old)", 0))); |
2948 | XPUSHs (sv_2mortal (newSVpv ("(sdl mixer too old)", 0))); |
2944 | #endif |
2949 | #endif |
2945 | |
2950 | |
2946 | DC::MixChunk |
2951 | DC::MixChunk |
2947 | new (SV *class, DC::RW rwops) |
2952 | new (SV *klass, DC::RW rwops) |
2948 | CODE: |
2953 | CODE: |
2949 | RETVAL = Mix_LoadWAV_RW (rwops, 1); |
2954 | RETVAL = Mix_LoadWAV_RW (rwops, 1); |
2950 | OUTPUT: |
2955 | OUTPUT: |
2951 | RETVAL |
2956 | RETVAL |
2952 | |
2957 | |
… | |
… | |
3022 | RETVAL = Mix_PlayingMusic (); |
3027 | RETVAL = Mix_PlayingMusic (); |
3023 | OUTPUT: |
3028 | OUTPUT: |
3024 | RETVAL |
3029 | RETVAL |
3025 | |
3030 | |
3026 | DC::MixMusic |
3031 | DC::MixMusic |
3027 | new (SV *class, DC::RW rwops) |
3032 | new (SV *klass, DC::RW rwops) |
3028 | CODE: |
3033 | CODE: |
3029 | RETVAL = Mix_LoadMUS_RW (rwops); |
3034 | RETVAL = Mix_LoadMUS_RW (rwops); |
3030 | OUTPUT: |
3035 | OUTPUT: |
3031 | RETVAL |
3036 | RETVAL |
3032 | |
3037 | |
… | |
… | |
3185 | gl.BlendFuncSeparateEXT = 0; |
3190 | gl.BlendFuncSeparateEXT = 0; |
3186 | |
3191 | |
3187 | void |
3192 | void |
3188 | apple_nvidia_bug (int enable) |
3193 | apple_nvidia_bug (int enable) |
3189 | |
3194 | |
3190 | char * |
3195 | const char * |
3191 | gl_vendor () |
3196 | gl_vendor () |
3192 | CODE: |
3197 | CODE: |
3193 | RETVAL = (char *)glGetString (GL_VENDOR); |
3198 | RETVAL = (const char *)glGetString (GL_VENDOR); |
3194 | OUTPUT: |
3199 | OUTPUT: |
3195 | RETVAL |
3200 | RETVAL |
3196 | |
3201 | |
3197 | char * |
3202 | const char * |
3198 | gl_version () |
3203 | gl_version () |
3199 | CODE: |
3204 | CODE: |
3200 | RETVAL = (char *)glGetString (GL_VERSION); |
3205 | RETVAL = (const char *)glGetString (GL_VERSION); |
3201 | OUTPUT: |
3206 | OUTPUT: |
3202 | RETVAL |
3207 | RETVAL |
3203 | |
3208 | |
3204 | char * |
3209 | const char * |
3205 | gl_extensions () |
3210 | gl_extensions () |
3206 | CODE: |
3211 | CODE: |
3207 | RETVAL = (char *)glGetString (GL_EXTENSIONS); |
3212 | RETVAL = (const char *)glGetString (GL_EXTENSIONS); |
3208 | OUTPUT: |
3213 | OUTPUT: |
3209 | RETVAL |
3214 | RETVAL |
3210 | |
3215 | |
3211 | const char *glGetString (GLenum pname) |
3216 | const char *glGetString (GLenum pname) |
|
|
3217 | CODE: |
|
|
3218 | RETVAL = (const char *)glGetString (pname); |
|
|
3219 | OUTPUT: |
|
|
3220 | RETVAL |
3212 | |
3221 | |
3213 | GLint glGetInteger (GLenum pname) |
3222 | GLint glGetInteger (GLenum pname) |
3214 | CODE: |
3223 | CODE: |
3215 | glGetIntegerv (pname, &RETVAL); |
3224 | glGetIntegerv (pname, &RETVAL); |
3216 | OUTPUT: |
3225 | OUTPUT: |
… | |
… | |
3419 | |
3428 | |
3420 | void |
3429 | void |
3421 | find_widget (SV *self, NV x, NV y) |
3430 | find_widget (SV *self, NV x, NV y) |
3422 | PPCODE: |
3431 | PPCODE: |
3423 | { |
3432 | { |
3424 | if (within_widget (self, x, y)) |
3433 | if (within_widget (self, x, y)) |
3425 | XPUSHs (self); |
3434 | XPUSHs (self); |
3426 | } |
3435 | } |
3427 | |
3436 | |
3428 | BOOT: |
3437 | BOOT: |
3429 | { |
3438 | { |
… | |
… | |
3437 | |
3446 | |
3438 | void |
3447 | void |
3439 | draw (SV *self) |
3448 | draw (SV *self) |
3440 | CODE: |
3449 | CODE: |
3441 | { |
3450 | { |
3442 | HV *hv; |
3451 | HV *hv; |
3443 | SV **svp; |
3452 | SV **svp; |
3444 | NV x, y, w, h; |
3453 | NV x, y, w, h; |
3445 | SV *draw_x_sv = GvSV (draw_x_gv); |
3454 | SV *draw_x_sv = GvSV (draw_x_gv); |
3446 | SV *draw_y_sv = GvSV (draw_y_gv); |
3455 | SV *draw_y_sv = GvSV (draw_y_gv); |
3447 | SV *draw_w_sv = GvSV (draw_w_gv); |
3456 | SV *draw_w_sv = GvSV (draw_w_gv); |
3448 | SV *draw_h_sv = GvSV (draw_h_gv); |
3457 | SV *draw_h_sv = GvSV (draw_h_gv); |