--- deliantra/Deliantra-Client/Client.xs 2010/10/14 00:02:39 1.306 +++ deliantra/Deliantra-Client/Client.xs 2012/01/07 15:24:41 1.313 @@ -582,14 +582,14 @@ deliantra_main () { char *argv[] = { 0 }; - call_argv ("::main", G_DISCARD | G_VOID, argv); + call_argv ("DC::Main::main", G_DISCARD | G_VOID, argv); } #ifdef __MACOSX__ /* to due surprising braindamage on the side of SDL design, we * do some mind-boggling hack here: SDL requires a custom main() * on OS X, so... we provide one and call the original main(), which, - * due to share dlibrary magic, calls -lSDLmain's main, not perl's main, + * due to shared library magic, calls -lSDLmain's main, not perl's main, * and which calls our main (== SDL_main) back. */ extern C_LINKAGE int @@ -823,8 +823,8 @@ # undef const_iv }; - for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) - newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); + for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ > const_iv; civ--) + newCONSTSUB (stash, (char *)civ[-1].name, newSViv (civ[-1].iv)); assert (SDLK_MODIFIER_MIN == SDLK_NUMLOCK); assert (SDLK_MODIFIER_MAX == SDLK_COMPOSE); @@ -952,12 +952,9 @@ if (RETVAL) { av_clear (texture_av); - - SDL_WM_SetCaption ("Deliantra MORPG Client " VERSION, "Deliantra"); #define GL_FUNC(ptr,name) gl.name = (ptr)SDL_GL_GetProcAddress ("gl" # name); #include "glfunc.h" #undef GL_FUNC - if (!gl.ActiveTexture ) gl.ActiveTexture = gl.ActiveTextureARB; if (!gl.MultiTexCoord2f) gl.MultiTexCoord2f = gl.MultiTexCoord2fARB; } @@ -966,6 +963,9 @@ RETVAL void +SDL_WM_SetCaption (const char *title, const char *icon) + +void SDL_GL_SwapBuffers () char * @@ -977,8 +977,15 @@ int SDL_GetModState () +int +SDL_WaitEvent () + C_ARGS: 0 + void -poll_events () +SDL_PumpEvents () + +void +peep_events () PPCODE: { SDL_Event ev; @@ -1142,6 +1149,10 @@ void IMG_Init (int flags = IMG_INIT_JPG | IMG_INIT_PNG) +# MIX_INIT_MP3 gives smpeg + libstdc++ + libgcc_s +void +Mix_Init (int flags = MIX_INIT_MOD | MIX_INIT_OGG) + void load_image_inline (SV *image_) ALIAS: @@ -2568,9 +2579,10 @@ int sh1 = sh + 2; int sh3 = sh * 3; int sw3 = sw * 3; - uint8_t *darkness1 = (uint8_t *)malloc (sw1 * sh1); SV *darkness3_sv = sv_2mortal (newSV (sw3 * sh3)); uint8_t *darkness3 = (uint8_t *)SvPVX (darkness3_sv); + uint8_t *darkness1 = (uint8_t *)malloc (sw1 * sh1); + memset (darkness1, 0, sw1*sh1); SvPOK_only (darkness3_sv); SvCUR_set (darkness3_sv, sw3 * sh3); @@ -3159,8 +3171,8 @@ # undef const_iv }; - for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) - newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); + for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ > const_iv; civ--) + newCONSTSUB (stash, (char *)civ[-1].name, newSViv (civ[-1].iv)); texture_av = newAV (); AvREAL_off (texture_av);