ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/Client.xs
(Generate patch)

Comparing deliantra/Deliantra-Client/Client.xs (file contents):
Revision 1.298 by root, Tue Dec 22 00:46:05 2009 UTC vs.
Revision 1.310 by root, Tue Dec 27 07:23:33 2011 UTC

99 99
100#define KMOD_LRAM 0x10000 // our extension 100#define KMOD_LRAM 0x10000 // our extension
101 101
102#define TEXID_SPEECH 1 102#define TEXID_SPEECH 1
103#define TEXID_NOFACE 2 103#define TEXID_NOFACE 2
104
105static char *
106fast_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}
104 123
105static AV *texture_av; 124static AV *texture_av;
106 125
107static struct 126static struct
108{ 127{
463 482
464 SDL_PushEvent ((SDL_Event *)&ev); 483 SDL_PushEvent ((SDL_Event *)&ev);
465} 484}
466 485
467static unsigned int 486static unsigned int
487div255 (unsigned int n)
488{
489 return (n + (n >> 8)) >> 8;
490}
491
492static unsigned int
468minpot (unsigned int n) 493minpot (unsigned int n)
469{ 494{
470 if (!n) 495 if (!n)
471 return 0; 496 return 0;
472 497
555 580
556static void 581static void
557deliantra_main () 582deliantra_main ()
558{ 583{
559 char *argv[] = { 0 }; 584 char *argv[] = { 0 };
560 call_argv ("::main", G_DISCARD | G_VOID, argv); 585 call_argv ("DC::Main::main", G_DISCARD | G_VOID, argv);
561} 586}
562 587
563#ifdef __MACOSX__ 588#ifdef __MACOSX__
564 /* to due surprising braindamage on the side of SDL design, we 589 /* to due surprising braindamage on the side of SDL design, we
565 * do some mind-boggling hack here: SDL requires a custom main() 590 * do some mind-boggling hack here: SDL requires a custom main()
566 * on OS X, so... we provide one and call the original main(), which, 591 * on OS X, so... we provide one and call the original main(), which,
567 * due to share dlibrary magic, calls -lSDLmain's main, not perl's main, 592 * due to shared library magic, calls -lSDLmain's main, not perl's main,
568 * and which calls our main (== SDL_main) back. 593 * and which calls our main (== SDL_main) back.
569 */ 594 */
570 extern C_LINKAGE int 595 extern C_LINKAGE int
571 main (int argc, char *argv[]) 596 main (int argc, char *argv[])
572 { 597 {
796 821
797 const_iv (FOW_DARKNESS) 822 const_iv (FOW_DARKNESS)
798# undef const_iv 823# undef const_iv
799 }; 824 };
800 825
801 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) 826 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ > const_iv; civ--)
802 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); 827 newCONSTSUB (stash, (char *)civ[-1].name, newSViv (civ[-1].iv));
803 828
804 assert (SDLK_MODIFIER_MIN == SDLK_NUMLOCK); 829 assert (SDLK_MODIFIER_MIN == SDLK_NUMLOCK);
805 assert (SDLK_MODIFIER_MAX == SDLK_COMPOSE); 830 assert (SDLK_MODIFIER_MAX == SDLK_COMPOSE);
806} 831}
807 832
930 955
931 SDL_WM_SetCaption ("Deliantra MORPG Client " VERSION, "Deliantra"); 956 SDL_WM_SetCaption ("Deliantra MORPG Client " VERSION, "Deliantra");
932#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);
933#include "glfunc.h" 958#include "glfunc.h"
934#undef GL_FUNC 959#undef GL_FUNC
960
961 if (!gl.ActiveTexture ) gl.ActiveTexture = gl.ActiveTextureARB;
962 if (!gl.MultiTexCoord2f) gl.MultiTexCoord2f = gl.MultiTexCoord2fARB;
935 } 963 }
936} 964}
937 OUTPUT: 965 OUTPUT:
938 RETVAL 966 RETVAL
939 967
1024 1052
1025 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))));
1026 } 1054 }
1027} 1055}
1028 1056
1057char *
1058SDL_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
1029int 1070int
1030Mix_OpenAudio (int frequency = 44100, int format = MIX_DEFAULT_FORMAT, int channels = 2, int chunksize = 4096) 1071Mix_OpenAudio (int frequency = 44100, int format = MIX_DEFAULT_FORMAT, int channels = 2, int chunksize = 4096)
1031 POSTCALL: 1072 POSTCALL:
1032 Mix_HookMusicFinished (music_finished); 1073 Mix_HookMusicFinished (music_finished);
1033 Mix_ChannelFinished (channel_finished); 1074 Mix_ChannelFinished (channel_finished);
1095add_font (char *file) 1136add_font (char *file)
1096 CODE: 1137 CODE:
1097 RETVAL = FcConfigAppFontAddFile (0, (const FcChar8 *)file); 1138 RETVAL = FcConfigAppFontAddFile (0, (const FcChar8 *)file);
1098 OUTPUT: 1139 OUTPUT:
1099 RETVAL 1140 RETVAL
1141
1142void
1143IMG_Init (int flags = IMG_INIT_JPG | IMG_INIT_PNG)
1144
1145void
1146Mix_Init (int flags = MIX_INIT_MOD | MIX_INIT_MP3 | MIX_INIT_OGG)
1100 1147
1101void 1148void
1102load_image_inline (SV *image_) 1149load_image_inline (SV *image_)
1103 ALIAS: 1150 ALIAS:
1104 load_image_file = 1 1151 load_image_file = 1
1672void 1719void
1673draw_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) 1720draw_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: @ 1721 PROTOTYPE: @
1675 CODE: 1722 CODE:
1676{ 1723{
1724 glEnable (GL_BLEND);
1725 glBlendFunc (intensity ? GL_SRC_ALPHA : GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
1677 glEnable (GL_TEXTURE_2D); 1726 glEnable (GL_TEXTURE_2D);
1678 glEnable (GL_BLEND);
1679 glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
1680 glBindTexture (GL_TEXTURE_2D, name1); 1727 glBindTexture (GL_TEXTURE_2D, name1);
1681 1728
1682 glColor3f (intensity, intensity, intensity); 1729 glColor3f (intensity, intensity, intensity);
1683 glPushMatrix (); 1730 glPushMatrix ();
1684 glScalef (1./3, 1./3, 1.); 1731 glScalef (1./3, 1./3, 1.);
1699 glBindTexture (GL_TEXTURE_2D, name2); 1746 glBindTexture (GL_TEXTURE_2D, name2);
1700 glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); 1747 glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
1701 1748
1702 /* rgb == rgb(glcolor) */ 1749 /* rgb == rgb(glcolor) */
1703 glTexEnvi (GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_REPLACE); 1750 glTexEnvi (GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_REPLACE);
1704 glTexEnvi (GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_CONSTANT); 1751 glTexEnvi (GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_PRIMARY_COLOR);
1705 glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR); 1752 glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR);
1706 1753
1707 /* alpha = interpolate t0, t1 by env_alpha */ 1754 /* alpha = interpolate t0, t1 by env_alpha */
1708 glTexEnvfv (GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, env_color); 1755 glTexEnvfv (GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, env_color);
1709 1756
2096 ? self->row + y 2143 ? self->row + y
2097 : 0; 2144 : 0;
2098 2145
2099 for (x = x0; x < x1; x++) 2146 for (x = x0; x < x1; x++)
2100 { 2147 {
2101 int r = 32, g = 32, b = 32, a = 192; 2148 unsigned int r = 32, g = 32, b = 32, a = 192;
2102 2149
2103 if (row && row->c0 <= x && x < row->c1) 2150 if (row && row->c0 <= x && x < row->c1)
2104 { 2151 {
2105 mapcell *cell = row->col + (x - row->c0); 2152 mapcell *cell = row->col + (x - row->c0);
2106 2153
2108 { 2155 {
2109 maptex tex = self->tex [cell->tile [z]]; 2156 maptex tex = self->tex [cell->tile [z]];
2110 int a0 = 255 - tex.a; 2157 int a0 = 255 - tex.a;
2111 int a1 = tex.a; 2158 int a1 = tex.a;
2112 2159
2113 r = (r * a0 + tex.r * a1) / 255; 2160 r = div255 (r * a0 + tex.r * a1);
2114 g = (g * a0 + tex.g * a1) / 255; 2161 g = div255 (g * a0 + tex.g * a1);
2115 b = (b * a0 + tex.b * a1) / 255; 2162 b = div255 (b * a0 + tex.b * a1);
2116 a = (a * a0 + tex.a * a1) / 255; 2163 a = div255 (a * a0 + tex.a * a1);
2117 } 2164 }
2118 } 2165 }
2119 2166
2120 *map++ = (r ) 2167 *map++ = (r )
2121 | (g << 8) 2168 | (g << 8)
2128} 2175}
2129 OUTPUT: 2176 OUTPUT:
2130 RETVAL 2177 RETVAL
2131 2178
2132void 2179void
2133draw (DC::Map self, int mx, int my, int sw, int sh, int T, U32 player = 0xffffffff, int sdx = 0, int sdy = 0) 2180draw (DC::Map self, int mx, int my, int sw, int sh, int Tw, int Th, U32 player = 0xffffffff, int sdx = 0, int sdy = 0)
2134 CODE: 2181 CODE:
2135{ 2182{
2136 int x, y, z; 2183 int x, y, z;
2137 2184
2138 HV *smooth = (HV *)sv_2mortal ((SV *)newHV ()); 2185 HV *smooth = (HV *)sv_2mortal ((SV *)newHV ());
2222 2269
2223 key.texname = tex.name; 2270 key.texname = tex.name;
2224 arr = rc_array (rc, &key); 2271 arr = rc_array (rc, &key);
2225 } 2272 }
2226 2273
2227 px = (x + 1) * T - tex.w; 2274 px = (x + 1) * Th - tex.w;
2228 py = (y + 1) * T - tex.h; 2275 py = (y + 1) * Tw - tex.h;
2229 2276
2230 if (expect_false (cell->player == player) && expect_false (z == 2)) 2277 if (expect_false (cell->player == player) && expect_false (z == 2))
2231 { 2278 {
2232 pl_x = px; 2279 pl_x = px;
2233 pl_y = py; 2280 pl_y = py;
2286 if (cell->flags & 1) 2333 if (cell->flags & 1)
2287 { 2334 {
2288 rc_key_t key_ov = key; 2335 rc_key_t key_ov = key;
2289 maptex tex = self->tex [TEXID_SPEECH]; 2336 maptex tex = self->tex [TEXID_SPEECH];
2290 rc_array_t *arr; 2337 rc_array_t *arr;
2291 int px = x * T + T * 2 / 32; 2338 int px = x * Tw + Tw * 2 / 32;
2292 int py = y * T - T * 6 / 32; 2339 int py = y * Th - Th * 6 / 32;
2293 2340
2294 key_ov.texname = tex.name; 2341 key_ov.texname = tex.name;
2295 arr = rc_array (rc_ov, &key_ov); 2342 arr = rc_array (rc_ov, &key_ov);
2296 2343
2297 rc_t2f_v3f (arr, 0 , 0 , px , py , 0); 2344 rc_t2f_v3f (arr, 0 , 0 , px , py , 0);
2298 rc_t2f_v3f (arr, 0 , tex.t, px , py + T, 0); 2345 rc_t2f_v3f (arr, 0 , tex.t, px , py + Th, 0);
2299 rc_t2f_v3f (arr, tex.s, tex.t, px + T, py + T, 0); 2346 rc_t2f_v3f (arr, tex.s, tex.t, px + Tw, py + Th, 0);
2300 rc_t2f_v3f (arr, tex.s, 0 , px + T, py , 0); 2347 rc_t2f_v3f (arr, tex.s, 0 , px + Tw, py , 0);
2301 } 2348 }
2302 } 2349 }
2303 } 2350 }
2304 } 2351 }
2305 2352
2332 if (!(bits & 0x1000) 2379 if (!(bits & 0x1000)
2333 && skey->level == level 2380 && skey->level == level
2334 && level > smooth_max [skey->x][skey->y]) 2381 && level > smooth_max [skey->x][skey->y])
2335 { 2382 {
2336 maptex tex = self->tex [skey->tile]; 2383 maptex tex = self->tex [skey->tile];
2337 int px = (((int)skey->x) - 1) * T; 2384 int px = (((int)skey->x) - 1) * Tw;
2338 int py = (((int)skey->y) - 1) * T; 2385 int py = (((int)skey->y) - 1) * Th;
2339 int border = bits & 15; 2386 int border = bits & 15;
2340 int corner = (bits >> 8) & ~(bits >> 4) & 15; 2387 int corner = (bits >> 8) & ~(bits >> 4) & 15;
2341 float dx = tex.s * .0625f; // 16 images/row 2388 float dx = tex.s * .0625f; // 16 images/row
2342 float dy = tex.t * .5f ; // 2 images/column 2389 float dy = tex.t * .5f ; // 2 images/column
2343 2390
2356 2403
2357 if (border) 2404 if (border)
2358 { 2405 {
2359 float ox = border * dx; 2406 float ox = border * dx;
2360 2407
2361 glTexCoord2f (ox , 0.f ); glVertex2i (px , py ); 2408 glTexCoord2f (ox , 0.f ); glVertex2i (px , py );
2362 glTexCoord2f (ox , dy ); glVertex2i (px , py + T); 2409 glTexCoord2f (ox , dy ); glVertex2i (px , py + Th);
2363 glTexCoord2f (ox + dx, dy ); glVertex2i (px + T, py + T); 2410 glTexCoord2f (ox + dx, dy ); glVertex2i (px + Tw, py + Th);
2364 glTexCoord2f (ox + dx, 0.f ); glVertex2i (px + T, py ); 2411 glTexCoord2f (ox + dx, 0.f ); glVertex2i (px + Tw, py );
2365 } 2412 }
2366 2413
2367 if (corner) 2414 if (corner)
2368 { 2415 {
2369 float ox = corner * dx; 2416 float ox = corner * dx;
2370 2417
2371 glTexCoord2f (ox , dy ); glVertex2i (px , py ); 2418 glTexCoord2f (ox , dy ); glVertex2i (px , py );
2372 glTexCoord2f (ox , dy * 2.f); glVertex2i (px , py + T); 2419 glTexCoord2f (ox , dy * 2.f); glVertex2i (px , py + Th);
2373 glTexCoord2f (ox + dx, dy * 2.f); glVertex2i (px + T, py + T); 2420 glTexCoord2f (ox + dx, dy * 2.f); glVertex2i (px + Tw, py + Th);
2374 glTexCoord2f (ox + dx, dy ); glVertex2i (px + T, py ); 2421 glTexCoord2f (ox + dx, dy ); glVertex2i (px + Tw, py );
2375 } 2422 }
2376 } 2423 }
2377 } 2424 }
2378 } 2425 }
2379 } 2426 }
2420 for (x = 0; x < sw; x++) 2467 for (x = 0; x < sw; x++)
2421 if (row->c0 <= x + mx && x + mx < row->c1) 2468 if (row->c0 <= x + mx && x + mx < row->c1)
2422 { 2469 {
2423 mapcell *cell = row->col + (x + mx - row->c0); 2470 mapcell *cell = row->col + (x + mx - row->c0);
2424 2471
2425 int px = x * T; 2472 int px = x * Tw;
2426 int py = y * T; 2473 int py = y * Th;
2427 2474
2428 if (expect_false (cell->player == player)) 2475 if (expect_false (cell->player == player))
2429 { 2476 {
2430 px += sdx; 2477 px += sdx;
2431 py += sdy; 2478 py += sdy;
2432 } 2479 }
2433 2480
2434 if (cell->stat_hp) 2481 if (cell->stat_hp)
2435 { 2482 {
2436 int width = cell->stat_width * T; 2483 int width = cell->stat_width * Tw;
2437 int thick = (sh * T / 32 + 27) / 28 + 1 + cell->stat_width; 2484 int thick = (sh * Th / 32 + 27) / 28 + 1 + cell->stat_width;
2438 2485
2439 glColor3ub (0, 0, 0); 2486 glColor3ub (0, 0, 0);
2440 glRectf (px + 1, py - thick - 2, 2487 glRectf (px + 1, py - thick - 2,
2441 px + width - 1, py); 2488 px + width - 1, py);
2442 2489
2522 int x, y; 2569 int x, y;
2523 int sw1 = sw + 2; 2570 int sw1 = sw + 2;
2524 int sh1 = sh + 2; 2571 int sh1 = sh + 2;
2525 int sh3 = sh * 3; 2572 int sh3 = sh * 3;
2526 int sw3 = sw * 3; 2573 int sw3 = sw * 3;
2527 uint8_t *darkness1 = (uint8_t *)malloc (sw1 * sh1);
2528 SV *darkness3_sv = sv_2mortal (newSV (sw3 * sh3)); 2574 SV *darkness3_sv = sv_2mortal (newSV (sw3 * sh3));
2529 uint8_t *darkness3 = (uint8_t *)SvPVX (darkness3_sv); 2575 uint8_t *darkness3 = (uint8_t *)SvPVX (darkness3_sv);
2576 uint8_t *darkness1 = (uint8_t *)malloc (sw1 * sh1);
2577 memset (darkness1, 0, sw1*sh1);
2530 2578
2531 SvPOK_only (darkness3_sv); 2579 SvPOK_only (darkness3_sv);
2532 SvCUR_set (darkness3_sv, sw3 * sh3); 2580 SvCUR_set (darkness3_sv, sw3 * sh3);
2533 2581
2534 mx += self->x - 1; 2582 mx += self->x - 1;
2795 if (RETVAL < 0) 2843 if (RETVAL < 0)
2796 { 2844 {
2797 RETVAL = Mix_GroupOldest (-1); 2845 RETVAL = Mix_GroupOldest (-1);
2798 2846
2799 if (RETVAL < 0) 2847 if (RETVAL < 0)
2848 {
2849 // happens sometimes, maybe it just stopped playing(?)
2850 RETVAL = Mix_GroupAvailable (-1);
2851
2852 if (RETVAL < 0)
2800 XSRETURN_UNDEF; 2853 XSRETURN_UNDEF;
2801 2854 }
2855 else
2802 Mix_HaltChannel (RETVAL); 2856 Mix_HaltChannel (RETVAL);
2803 } 2857 }
2804 2858
2805 Mix_UnregisterAllEffects (RETVAL); 2859 Mix_UnregisterAllEffects (RETVAL);
2806 Mix_Volume (RETVAL, 128); 2860 Mix_Volume (RETVAL, 128);
2807} 2861}
2866 Mix_SetReverseStereo (self, flip); 2920 Mix_SetReverseStereo (self, flip);
2867 2921
2868MODULE = Deliantra::Client PACKAGE = DC::MixChunk 2922MODULE = Deliantra::Client PACKAGE = DC::MixChunk
2869 2923
2870PROTOTYPES: DISABLE 2924PROTOTYPES: DISABLE
2925
2926void
2927decoders ()
2928 PPCODE:
2929#if SDL_MIXER_MAJOR_VERSION > 1 || SDL_MIXER_MINOR_VERSION > 2 || SDL_MIXER_PATCHLEVEL >= 10
2930 int i, num = Mix_GetNumChunkDecoders ();
2931 EXTEND (SP, num);
2932 for (i = 0; i < num; ++i)
2933 PUSHs (sv_2mortal (newSVpv (Mix_GetChunkDecoder (i), 0)));
2934#else
2935 XPUSHs (sv_2mortal (newSVpv ("(sdl mixer too old)", 0)));
2936#endif
2871 2937
2872DC::MixChunk 2938DC::MixChunk
2873new (SV *class, DC::RW rwops) 2939new (SV *class, DC::RW rwops)
2874 CODE: 2940 CODE:
2875 RETVAL = Mix_LoadWAV_RW (rwops, 1); 2941 RETVAL = Mix_LoadWAV_RW (rwops, 1);
2908 OUTPUT: 2974 OUTPUT:
2909 RETVAL 2975 RETVAL
2910 2976
2911MODULE = Deliantra::Client PACKAGE = DC::MixMusic 2977MODULE = Deliantra::Client PACKAGE = DC::MixMusic
2912 2978
2979void
2980decoders ()
2981 PPCODE:
2982#if SDL_MIXER_MAJOR_VERSION > 1 || SDL_MIXER_MINOR_VERSION > 2 || SDL_MIXER_PATCHLEVEL >= 10
2983 int i, num = Mix_GetNumMusicDecoders ();
2984 EXTEND (SP, num);
2985 for (i = 0; i < num; ++i)
2986 PUSHs (sv_2mortal (newSVpv (Mix_GetMusicDecoder (i), 0)));
2987#else
2988 XPUSHs (sv_2mortal (newSVpv ("(sdl mixer too old)", 0)));
2989#endif
2990
2913int 2991int
2914volume (int volume = -1) 2992volume (int volume = -1)
2915 PROTOTYPE: ;$ 2993 PROTOTYPE: ;$
2916 CODE: 2994 CODE:
2917 if (items > 0) 2995 if (items > 0)
2927 3005
2928void 3006void
2929halt () 3007halt ()
2930 CODE: 3008 CODE:
2931 Mix_HaltMusic (); 3009 Mix_HaltMusic ();
3010
3011int
3012playing ()
3013 CODE:
3014 RETVAL = Mix_PlayingMusic ();
3015 OUTPUT:
3016 RETVAL
2932 3017
2933DC::MixMusic 3018DC::MixMusic
2934new (SV *class, DC::RW rwops) 3019new (SV *class, DC::RW rwops)
2935 CODE: 3020 CODE:
2936 RETVAL = Mix_LoadMUS_RW (rwops); 3021 RETVAL = Mix_LoadMUS_RW (rwops);
3076 const_iv (GL_FUNC_SUBTRACT), 3161 const_iv (GL_FUNC_SUBTRACT),
3077 const_iv (GL_FUNC_REVERSE_SUBTRACT), 3162 const_iv (GL_FUNC_REVERSE_SUBTRACT),
3078# undef const_iv 3163# undef const_iv
3079 }; 3164 };
3080 3165
3081 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) 3166 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ > const_iv; civ--)
3082 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); 3167 newCONSTSUB (stash, (char *)civ[-1].name, newSViv (civ[-1].iv));
3083 3168
3084 texture_av = newAV (); 3169 texture_av = newAV ();
3085 AvREAL_off (texture_av); 3170 AvREAL_off (texture_av);
3086} 3171}
3087 3172
3130 RETVAL 3215 RETVAL
3131 3216
3132int glGetError () 3217int glGetError ()
3133 3218
3134void glFinish () 3219void glFinish ()
3220
3221void glFlush ()
3135 3222
3136void glClear (int mask) 3223void glClear (int mask)
3137 3224
3138void glClearColor (float r, float g, float b, float a = 1.0) 3225void glClearColor (float r, float g, float b, float a = 1.0)
3139 PROTOTYPE: @ 3226 PROTOTYPE: @

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines