… | |
… | |
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 |
|
|
104 | |
|
|
105 | static char * |
|
|
106 | fast_sv_grow (SV *sv, STRLEN need) |
|
|
107 | { |
|
|
108 | STRLEN len = SvLEN (sv); |
|
|
109 | STRLEN want = SvCUR (sv) + need; |
|
|
110 | |
|
|
111 | if (expect_false (len < want)) |
|
|
112 | { |
|
|
113 | do |
|
|
114 | len *= 2; |
|
|
115 | while (len < want); |
|
|
116 | |
|
|
117 | sv_grow (sv, len); |
|
|
118 | } |
|
|
119 | |
|
|
120 | SvCUR_set (sv, want); |
|
|
121 | return SvEND (sv) - need; |
|
|
122 | } |
102 | |
123 | |
103 | static AV *texture_av; |
124 | static AV *texture_av; |
104 | |
125 | |
105 | static struct |
126 | static struct |
106 | { |
127 | { |
… | |
… | |
458 | ev.code = 1; |
479 | ev.code = 1; |
459 | ev.data1 = (void *)(long)channel; |
480 | ev.data1 = (void *)(long)channel; |
460 | ev.data2 = 0; |
481 | ev.data2 = 0; |
461 | |
482 | |
462 | SDL_PushEvent ((SDL_Event *)&ev); |
483 | SDL_PushEvent ((SDL_Event *)&ev); |
|
|
484 | } |
|
|
485 | |
|
|
486 | static unsigned int |
|
|
487 | div255 (unsigned int n) |
|
|
488 | { |
|
|
489 | return (n + (n >> 8)) >> 8; |
463 | } |
490 | } |
464 | |
491 | |
465 | static unsigned int |
492 | static unsigned int |
466 | minpot (unsigned int n) |
493 | minpot (unsigned int n) |
467 | { |
494 | { |
… | |
… | |
928 | |
955 | |
929 | SDL_WM_SetCaption ("Deliantra MORPG Client " VERSION, "Deliantra"); |
956 | SDL_WM_SetCaption ("Deliantra MORPG Client " VERSION, "Deliantra"); |
930 | #define GL_FUNC(ptr,name) gl.name = (ptr)SDL_GL_GetProcAddress ("gl" # name); |
957 | #define GL_FUNC(ptr,name) gl.name = (ptr)SDL_GL_GetProcAddress ("gl" # name); |
931 | #include "glfunc.h" |
958 | #include "glfunc.h" |
932 | #undef GL_FUNC |
959 | #undef GL_FUNC |
|
|
960 | |
|
|
961 | if (!gl.ActiveTexture ) gl.ActiveTexture = gl.ActiveTextureARB; |
|
|
962 | if (!gl.MultiTexCoord2f) gl.MultiTexCoord2f = gl.MultiTexCoord2fARB; |
933 | } |
963 | } |
934 | } |
964 | } |
935 | OUTPUT: |
965 | OUTPUT: |
936 | RETVAL |
966 | RETVAL |
937 | |
967 | |
… | |
… | |
1022 | |
1052 | |
1023 | XPUSHs (sv_2mortal (sv_bless (newRV_noinc ((SV *)hv), gv_stashpv ("DC::UI::Event", 1)))); |
1053 | XPUSHs (sv_2mortal (sv_bless (newRV_noinc ((SV *)hv), gv_stashpv ("DC::UI::Event", 1)))); |
1024 | } |
1054 | } |
1025 | } |
1055 | } |
1026 | |
1056 | |
|
|
1057 | char * |
|
|
1058 | SDL_AudioDriverName () |
|
|
1059 | CODE: |
|
|
1060 | { |
|
|
1061 | char buf [256]; |
|
|
1062 | if (!SDL_AudioDriverName (buf, sizeof (buf))) |
|
|
1063 | XSRETURN_UNDEF; |
|
|
1064 | |
|
|
1065 | RETVAL = buf; |
|
|
1066 | } |
|
|
1067 | OUTPUT: |
|
|
1068 | RETVAL |
|
|
1069 | |
1027 | int |
1070 | int |
1028 | Mix_OpenAudio (int frequency = 44100, int format = MIX_DEFAULT_FORMAT, int channels = 2, int chunksize = 4096) |
1071 | Mix_OpenAudio (int frequency = 44100, int format = MIX_DEFAULT_FORMAT, int channels = 2, int chunksize = 4096) |
1029 | POSTCALL: |
1072 | POSTCALL: |
1030 | Mix_HookMusicFinished (music_finished); |
1073 | Mix_HookMusicFinished (music_finished); |
1031 | Mix_ChannelFinished (channel_finished); |
1074 | Mix_ChannelFinished (channel_finished); |
… | |
… | |
1093 | add_font (char *file) |
1136 | add_font (char *file) |
1094 | CODE: |
1137 | CODE: |
1095 | RETVAL = FcConfigAppFontAddFile (0, (const FcChar8 *)file); |
1138 | RETVAL = FcConfigAppFontAddFile (0, (const FcChar8 *)file); |
1096 | OUTPUT: |
1139 | OUTPUT: |
1097 | RETVAL |
1140 | RETVAL |
|
|
1141 | |
|
|
1142 | void |
|
|
1143 | IMG_Init (int flags = IMG_INIT_JPG | IMG_INIT_PNG) |
1098 | |
1144 | |
1099 | void |
1145 | void |
1100 | load_image_inline (SV *image_) |
1146 | load_image_inline (SV *image_) |
1101 | ALIAS: |
1147 | ALIAS: |
1102 | load_image_file = 1 |
1148 | load_image_file = 1 |
… | |
… | |
1670 | void |
1716 | void |
1671 | 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) |
1717 | 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) |
1672 | PROTOTYPE: @ |
1718 | PROTOTYPE: @ |
1673 | CODE: |
1719 | CODE: |
1674 | { |
1720 | { |
|
|
1721 | glEnable (GL_BLEND); |
|
|
1722 | glBlendFunc (intensity ? GL_SRC_ALPHA : GL_ONE, GL_ONE_MINUS_SRC_ALPHA); |
1675 | glEnable (GL_TEXTURE_2D); |
1723 | glEnable (GL_TEXTURE_2D); |
1676 | glEnable (GL_BLEND); |
|
|
1677 | glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); |
|
|
1678 | glBindTexture (GL_TEXTURE_2D, name1); |
1724 | glBindTexture (GL_TEXTURE_2D, name1); |
1679 | |
1725 | |
1680 | glColor3f (intensity, intensity, intensity); |
1726 | glColor3f (intensity, intensity, intensity); |
1681 | glPushMatrix (); |
1727 | glPushMatrix (); |
1682 | glScalef (1./3, 1./3, 1.); |
1728 | glScalef (1./3, 1./3, 1.); |
… | |
… | |
1697 | glBindTexture (GL_TEXTURE_2D, name2); |
1743 | glBindTexture (GL_TEXTURE_2D, name2); |
1698 | glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); |
1744 | glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); |
1699 | |
1745 | |
1700 | /* rgb == rgb(glcolor) */ |
1746 | /* rgb == rgb(glcolor) */ |
1701 | glTexEnvi (GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_REPLACE); |
1747 | glTexEnvi (GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_REPLACE); |
1702 | glTexEnvi (GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_CONSTANT); |
1748 | glTexEnvi (GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_PRIMARY_COLOR); |
1703 | glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR); |
1749 | glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR); |
1704 | |
1750 | |
1705 | /* alpha = interpolate t0, t1 by env_alpha */ |
1751 | /* alpha = interpolate t0, t1 by env_alpha */ |
1706 | glTexEnvfv (GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, env_color); |
1752 | glTexEnvfv (GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, env_color); |
1707 | |
1753 | |
… | |
… | |
2094 | ? self->row + y |
2140 | ? self->row + y |
2095 | : 0; |
2141 | : 0; |
2096 | |
2142 | |
2097 | for (x = x0; x < x1; x++) |
2143 | for (x = x0; x < x1; x++) |
2098 | { |
2144 | { |
2099 | int r = 32, g = 32, b = 32, a = 192; |
2145 | unsigned int r = 32, g = 32, b = 32, a = 192; |
2100 | |
2146 | |
2101 | if (row && row->c0 <= x && x < row->c1) |
2147 | if (row && row->c0 <= x && x < row->c1) |
2102 | { |
2148 | { |
2103 | mapcell *cell = row->col + (x - row->c0); |
2149 | mapcell *cell = row->col + (x - row->c0); |
2104 | |
2150 | |
… | |
… | |
2106 | { |
2152 | { |
2107 | maptex tex = self->tex [cell->tile [z]]; |
2153 | maptex tex = self->tex [cell->tile [z]]; |
2108 | int a0 = 255 - tex.a; |
2154 | int a0 = 255 - tex.a; |
2109 | int a1 = tex.a; |
2155 | int a1 = tex.a; |
2110 | |
2156 | |
2111 | r = (r * a0 + tex.r * a1) / 255; |
2157 | r = div255 (r * a0 + tex.r * a1); |
2112 | g = (g * a0 + tex.g * a1) / 255; |
2158 | g = div255 (g * a0 + tex.g * a1); |
2113 | b = (b * a0 + tex.b * a1) / 255; |
2159 | b = div255 (b * a0 + tex.b * a1); |
2114 | a = (a * a0 + tex.a * a1) / 255; |
2160 | a = div255 (a * a0 + tex.a * a1); |
2115 | } |
2161 | } |
2116 | } |
2162 | } |
2117 | |
2163 | |
2118 | *map++ = (r ) |
2164 | *map++ = (r ) |
2119 | | (g << 8) |
2165 | | (g << 8) |
… | |
… | |
2126 | } |
2172 | } |
2127 | OUTPUT: |
2173 | OUTPUT: |
2128 | RETVAL |
2174 | RETVAL |
2129 | |
2175 | |
2130 | void |
2176 | void |
2131 | draw (DC::Map self, int mx, int my, int sw, int sh, int T, U32 player = 0xffffffff, int sdx = 0, int sdy = 0) |
2177 | 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) |
2132 | CODE: |
2178 | CODE: |
2133 | { |
2179 | { |
2134 | int x, y, z; |
2180 | int x, y, z; |
2135 | |
2181 | |
2136 | HV *smooth = (HV *)sv_2mortal ((SV *)newHV ()); |
2182 | HV *smooth = (HV *)sv_2mortal ((SV *)newHV ()); |
… | |
… | |
2220 | |
2266 | |
2221 | key.texname = tex.name; |
2267 | key.texname = tex.name; |
2222 | arr = rc_array (rc, &key); |
2268 | arr = rc_array (rc, &key); |
2223 | } |
2269 | } |
2224 | |
2270 | |
2225 | px = (x + 1) * T - tex.w; |
2271 | px = (x + 1) * Th - tex.w; |
2226 | py = (y + 1) * T - tex.h; |
2272 | py = (y + 1) * Tw - tex.h; |
2227 | |
2273 | |
2228 | if (expect_false (cell->player == player) && expect_false (z == 2)) |
2274 | if (expect_false (cell->player == player) && expect_false (z == 2)) |
2229 | { |
2275 | { |
2230 | pl_x = px; |
2276 | pl_x = px; |
2231 | pl_y = py; |
2277 | pl_y = py; |
… | |
… | |
2284 | if (cell->flags & 1) |
2330 | if (cell->flags & 1) |
2285 | { |
2331 | { |
2286 | rc_key_t key_ov = key; |
2332 | rc_key_t key_ov = key; |
2287 | maptex tex = self->tex [TEXID_SPEECH]; |
2333 | maptex tex = self->tex [TEXID_SPEECH]; |
2288 | rc_array_t *arr; |
2334 | rc_array_t *arr; |
2289 | int px = x * T + T * 2 / 32; |
2335 | int px = x * Tw + Tw * 2 / 32; |
2290 | int py = y * T - T * 6 / 32; |
2336 | int py = y * Th - Th * 6 / 32; |
2291 | |
2337 | |
2292 | key_ov.texname = tex.name; |
2338 | key_ov.texname = tex.name; |
2293 | arr = rc_array (rc_ov, &key_ov); |
2339 | arr = rc_array (rc_ov, &key_ov); |
2294 | |
2340 | |
2295 | rc_t2f_v3f (arr, 0 , 0 , px , py , 0); |
2341 | rc_t2f_v3f (arr, 0 , 0 , px , py , 0); |
2296 | rc_t2f_v3f (arr, 0 , tex.t, px , py + T, 0); |
2342 | rc_t2f_v3f (arr, 0 , tex.t, px , py + Th, 0); |
2297 | rc_t2f_v3f (arr, tex.s, tex.t, px + T, py + T, 0); |
2343 | rc_t2f_v3f (arr, tex.s, tex.t, px + Tw, py + Th, 0); |
2298 | rc_t2f_v3f (arr, tex.s, 0 , px + T, py , 0); |
2344 | rc_t2f_v3f (arr, tex.s, 0 , px + Tw, py , 0); |
2299 | } |
2345 | } |
2300 | } |
2346 | } |
2301 | } |
2347 | } |
2302 | } |
2348 | } |
2303 | |
2349 | |
… | |
… | |
2330 | if (!(bits & 0x1000) |
2376 | if (!(bits & 0x1000) |
2331 | && skey->level == level |
2377 | && skey->level == level |
2332 | && level > smooth_max [skey->x][skey->y]) |
2378 | && level > smooth_max [skey->x][skey->y]) |
2333 | { |
2379 | { |
2334 | maptex tex = self->tex [skey->tile]; |
2380 | maptex tex = self->tex [skey->tile]; |
2335 | int px = (((int)skey->x) - 1) * T; |
2381 | int px = (((int)skey->x) - 1) * Tw; |
2336 | int py = (((int)skey->y) - 1) * T; |
2382 | int py = (((int)skey->y) - 1) * Th; |
2337 | int border = bits & 15; |
2383 | int border = bits & 15; |
2338 | int corner = (bits >> 8) & ~(bits >> 4) & 15; |
2384 | int corner = (bits >> 8) & ~(bits >> 4) & 15; |
2339 | float dx = tex.s * .0625f; // 16 images/row |
2385 | float dx = tex.s * .0625f; // 16 images/row |
2340 | float dy = tex.t * .5f ; // 2 images/column |
2386 | float dy = tex.t * .5f ; // 2 images/column |
2341 | |
2387 | |
… | |
… | |
2354 | |
2400 | |
2355 | if (border) |
2401 | if (border) |
2356 | { |
2402 | { |
2357 | float ox = border * dx; |
2403 | float ox = border * dx; |
2358 | |
2404 | |
2359 | glTexCoord2f (ox , 0.f ); glVertex2i (px , py ); |
2405 | glTexCoord2f (ox , 0.f ); glVertex2i (px , py ); |
2360 | glTexCoord2f (ox , dy ); glVertex2i (px , py + T); |
2406 | glTexCoord2f (ox , dy ); glVertex2i (px , py + Th); |
2361 | glTexCoord2f (ox + dx, dy ); glVertex2i (px + T, py + T); |
2407 | glTexCoord2f (ox + dx, dy ); glVertex2i (px + Tw, py + Th); |
2362 | glTexCoord2f (ox + dx, 0.f ); glVertex2i (px + T, py ); |
2408 | glTexCoord2f (ox + dx, 0.f ); glVertex2i (px + Tw, py ); |
2363 | } |
2409 | } |
2364 | |
2410 | |
2365 | if (corner) |
2411 | if (corner) |
2366 | { |
2412 | { |
2367 | float ox = corner * dx; |
2413 | float ox = corner * dx; |
2368 | |
2414 | |
2369 | glTexCoord2f (ox , dy ); glVertex2i (px , py ); |
2415 | glTexCoord2f (ox , dy ); glVertex2i (px , py ); |
2370 | glTexCoord2f (ox , dy * 2.f); glVertex2i (px , py + T); |
2416 | glTexCoord2f (ox , dy * 2.f); glVertex2i (px , py + Th); |
2371 | glTexCoord2f (ox + dx, dy * 2.f); glVertex2i (px + T, py + T); |
2417 | glTexCoord2f (ox + dx, dy * 2.f); glVertex2i (px + Tw, py + Th); |
2372 | glTexCoord2f (ox + dx, dy ); glVertex2i (px + T, py ); |
2418 | glTexCoord2f (ox + dx, dy ); glVertex2i (px + Tw, py ); |
2373 | } |
2419 | } |
2374 | } |
2420 | } |
2375 | } |
2421 | } |
2376 | } |
2422 | } |
2377 | } |
2423 | } |
… | |
… | |
2418 | for (x = 0; x < sw; x++) |
2464 | for (x = 0; x < sw; x++) |
2419 | if (row->c0 <= x + mx && x + mx < row->c1) |
2465 | if (row->c0 <= x + mx && x + mx < row->c1) |
2420 | { |
2466 | { |
2421 | mapcell *cell = row->col + (x + mx - row->c0); |
2467 | mapcell *cell = row->col + (x + mx - row->c0); |
2422 | |
2468 | |
2423 | int px = x * T; |
2469 | int px = x * Tw; |
2424 | int py = y * T; |
2470 | int py = y * Th; |
2425 | |
2471 | |
2426 | if (expect_false (cell->player == player)) |
2472 | if (expect_false (cell->player == player)) |
2427 | { |
2473 | { |
2428 | px += sdx; |
2474 | px += sdx; |
2429 | py += sdy; |
2475 | py += sdy; |
2430 | } |
2476 | } |
2431 | |
2477 | |
2432 | if (cell->stat_hp) |
2478 | if (cell->stat_hp) |
2433 | { |
2479 | { |
2434 | int width = cell->stat_width * T; |
2480 | int width = cell->stat_width * Tw; |
2435 | int thick = (sh * T / 32 + 27) / 28 + 1 + cell->stat_width; |
2481 | int thick = (sh * Th / 32 + 27) / 28 + 1 + cell->stat_width; |
2436 | |
2482 | |
2437 | glColor3ub (0, 0, 0); |
2483 | glColor3ub (0, 0, 0); |
2438 | glRectf (px + 1, py - thick - 2, |
2484 | glRectf (px + 1, py - thick - 2, |
2439 | px + width - 1, py); |
2485 | px + width - 1, py); |
2440 | |
2486 | |
… | |
… | |
2520 | int x, y; |
2566 | int x, y; |
2521 | int sw1 = sw + 2; |
2567 | int sw1 = sw + 2; |
2522 | int sh1 = sh + 2; |
2568 | int sh1 = sh + 2; |
2523 | int sh3 = sh * 3; |
2569 | int sh3 = sh * 3; |
2524 | int sw3 = sw * 3; |
2570 | int sw3 = sw * 3; |
2525 | uint8_t *darkness1 = (uint8_t *)malloc (sw1 * sh1); |
|
|
2526 | SV *darkness3_sv = sv_2mortal (newSV (sw3 * sh3)); |
2571 | SV *darkness3_sv = sv_2mortal (newSV (sw3 * sh3)); |
2527 | uint8_t *darkness3 = (uint8_t *)SvPVX (darkness3_sv); |
2572 | uint8_t *darkness3 = (uint8_t *)SvPVX (darkness3_sv); |
|
|
2573 | uint8_t *darkness1 = (uint8_t *)malloc (sw1 * sh1); |
|
|
2574 | memset (darkness1, 0, sw1*sh1); |
2528 | |
2575 | |
2529 | SvPOK_only (darkness3_sv); |
2576 | SvPOK_only (darkness3_sv); |
2530 | SvCUR_set (darkness3_sv, sw3 * sh3); |
2577 | SvCUR_set (darkness3_sv, sw3 * sh3); |
2531 | |
2578 | |
2532 | mx += self->x - 1; |
2579 | mx += self->x - 1; |
… | |
… | |
2793 | if (RETVAL < 0) |
2840 | if (RETVAL < 0) |
2794 | { |
2841 | { |
2795 | RETVAL = Mix_GroupOldest (-1); |
2842 | RETVAL = Mix_GroupOldest (-1); |
2796 | |
2843 | |
2797 | if (RETVAL < 0) |
2844 | if (RETVAL < 0) |
|
|
2845 | { |
|
|
2846 | // happens sometimes, maybe it just stopped playing(?) |
|
|
2847 | RETVAL = Mix_GroupAvailable (-1); |
|
|
2848 | |
|
|
2849 | if (RETVAL < 0) |
2798 | XSRETURN_UNDEF; |
2850 | XSRETURN_UNDEF; |
2799 | |
2851 | } |
|
|
2852 | else |
2800 | Mix_HaltChannel (RETVAL); |
2853 | Mix_HaltChannel (RETVAL); |
2801 | } |
2854 | } |
2802 | |
2855 | |
2803 | Mix_UnregisterAllEffects (RETVAL); |
2856 | Mix_UnregisterAllEffects (RETVAL); |
2804 | Mix_Volume (RETVAL, 128); |
2857 | Mix_Volume (RETVAL, 128); |
2805 | } |
2858 | } |
… | |
… | |
2864 | Mix_SetReverseStereo (self, flip); |
2917 | Mix_SetReverseStereo (self, flip); |
2865 | |
2918 | |
2866 | MODULE = Deliantra::Client PACKAGE = DC::MixChunk |
2919 | MODULE = Deliantra::Client PACKAGE = DC::MixChunk |
2867 | |
2920 | |
2868 | PROTOTYPES: DISABLE |
2921 | PROTOTYPES: DISABLE |
|
|
2922 | |
|
|
2923 | void |
|
|
2924 | decoders () |
|
|
2925 | PPCODE: |
|
|
2926 | #if SDL_MIXER_MAJOR_VERSION > 1 || SDL_MIXER_MINOR_VERSION > 2 || SDL_MIXER_PATCHLEVEL >= 10 |
|
|
2927 | int i, num = Mix_GetNumChunkDecoders (); |
|
|
2928 | EXTEND (SP, num); |
|
|
2929 | for (i = 0; i < num; ++i) |
|
|
2930 | PUSHs (sv_2mortal (newSVpv (Mix_GetChunkDecoder (i), 0))); |
|
|
2931 | #else |
|
|
2932 | XPUSHs (sv_2mortal (newSVpv ("(sdl mixer too old)", 0))); |
|
|
2933 | #endif |
2869 | |
2934 | |
2870 | DC::MixChunk |
2935 | DC::MixChunk |
2871 | new (SV *class, DC::RW rwops) |
2936 | new (SV *class, DC::RW rwops) |
2872 | CODE: |
2937 | CODE: |
2873 | RETVAL = Mix_LoadWAV_RW (rwops, 1); |
2938 | RETVAL = Mix_LoadWAV_RW (rwops, 1); |
… | |
… | |
2906 | OUTPUT: |
2971 | OUTPUT: |
2907 | RETVAL |
2972 | RETVAL |
2908 | |
2973 | |
2909 | MODULE = Deliantra::Client PACKAGE = DC::MixMusic |
2974 | MODULE = Deliantra::Client PACKAGE = DC::MixMusic |
2910 | |
2975 | |
|
|
2976 | void |
|
|
2977 | decoders () |
|
|
2978 | PPCODE: |
|
|
2979 | #if SDL_MIXER_MAJOR_VERSION > 1 || SDL_MIXER_MINOR_VERSION > 2 || SDL_MIXER_PATCHLEVEL >= 10 |
|
|
2980 | int i, num = Mix_GetNumMusicDecoders (); |
|
|
2981 | EXTEND (SP, num); |
|
|
2982 | for (i = 0; i < num; ++i) |
|
|
2983 | PUSHs (sv_2mortal (newSVpv (Mix_GetMusicDecoder (i), 0))); |
|
|
2984 | #else |
|
|
2985 | XPUSHs (sv_2mortal (newSVpv ("(sdl mixer too old)", 0))); |
|
|
2986 | #endif |
|
|
2987 | |
2911 | int |
2988 | int |
2912 | volume (int volume = -1) |
2989 | volume (int volume = -1) |
2913 | PROTOTYPE: ;$ |
2990 | PROTOTYPE: ;$ |
2914 | CODE: |
2991 | CODE: |
2915 | if (items > 0) |
2992 | if (items > 0) |
… | |
… | |
2925 | |
3002 | |
2926 | void |
3003 | void |
2927 | halt () |
3004 | halt () |
2928 | CODE: |
3005 | CODE: |
2929 | Mix_HaltMusic (); |
3006 | Mix_HaltMusic (); |
|
|
3007 | |
|
|
3008 | int |
|
|
3009 | playing () |
|
|
3010 | CODE: |
|
|
3011 | RETVAL = Mix_PlayingMusic (); |
|
|
3012 | OUTPUT: |
|
|
3013 | RETVAL |
2930 | |
3014 | |
2931 | DC::MixMusic |
3015 | DC::MixMusic |
2932 | new (SV *class, DC::RW rwops) |
3016 | new (SV *class, DC::RW rwops) |
2933 | CODE: |
3017 | CODE: |
2934 | RETVAL = Mix_LoadMUS_RW (rwops); |
3018 | RETVAL = Mix_LoadMUS_RW (rwops); |
… | |
… | |
3129 | |
3213 | |
3130 | int glGetError () |
3214 | int glGetError () |
3131 | |
3215 | |
3132 | void glFinish () |
3216 | void glFinish () |
3133 | |
3217 | |
|
|
3218 | void glFlush () |
|
|
3219 | |
3134 | void glClear (int mask) |
3220 | void glClear (int mask) |
3135 | |
3221 | |
3136 | void glClearColor (float r, float g, float b, float a = 1.0) |
3222 | void glClearColor (float r, float g, float b, float a = 1.0) |
3137 | PROTOTYPE: @ |
3223 | PROTOTYPE: @ |
3138 | |
3224 | |