… | |
… | |
580 | |
580 | |
581 | static void |
581 | static void |
582 | deliantra_main () |
582 | deliantra_main () |
583 | { |
583 | { |
584 | char *argv[] = { 0 }; |
584 | char *argv[] = { 0 }; |
585 | call_argv ("::main", G_DISCARD | G_VOID, argv); |
585 | call_argv ("DC::Main::main", G_DISCARD | G_VOID, argv); |
586 | } |
586 | } |
587 | |
587 | |
588 | #ifdef __MACOSX__ |
588 | #ifdef __MACOSX__ |
589 | /* to due surprising braindamage on the side of SDL design, we |
589 | /* to due surprising braindamage on the side of SDL design, we |
590 | * do some mind-boggling hack here: SDL requires a custom main() |
590 | * 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, |
591 | * on OS X, so... we provide one and call the original main(), which, |
592 | * 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, |
593 | * and which calls our main (== SDL_main) back. |
593 | * and which calls our main (== SDL_main) back. |
594 | */ |
594 | */ |
595 | extern C_LINKAGE int |
595 | extern C_LINKAGE int |
596 | main (int argc, char *argv[]) |
596 | main (int argc, char *argv[]) |
597 | { |
597 | { |
… | |
… | |
821 | |
821 | |
822 | const_iv (FOW_DARKNESS) |
822 | const_iv (FOW_DARKNESS) |
823 | # undef const_iv |
823 | # undef const_iv |
824 | }; |
824 | }; |
825 | |
825 | |
826 | 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--) |
827 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
827 | newCONSTSUB (stash, (char *)civ[-1].name, newSViv (civ[-1].iv)); |
828 | |
828 | |
829 | assert (SDLK_MODIFIER_MIN == SDLK_NUMLOCK); |
829 | assert (SDLK_MODIFIER_MIN == SDLK_NUMLOCK); |
830 | assert (SDLK_MODIFIER_MAX == SDLK_COMPOSE); |
830 | assert (SDLK_MODIFIER_MAX == SDLK_COMPOSE); |
831 | } |
831 | } |
832 | |
832 | |
… | |
… | |
950 | ); |
950 | ); |
951 | |
951 | |
952 | if (RETVAL) |
952 | if (RETVAL) |
953 | { |
953 | { |
954 | av_clear (texture_av); |
954 | av_clear (texture_av); |
955 | |
|
|
956 | SDL_WM_SetCaption ("Deliantra MORPG Client " VERSION, "Deliantra"); |
|
|
957 | #define GL_FUNC(ptr,name) gl.name = (ptr)SDL_GL_GetProcAddress ("gl" # name); |
955 | #define GL_FUNC(ptr,name) gl.name = (ptr)SDL_GL_GetProcAddress ("gl" # name); |
958 | #include "glfunc.h" |
956 | #include "glfunc.h" |
959 | #undef GL_FUNC |
957 | #undef GL_FUNC |
960 | |
|
|
961 | if (!gl.ActiveTexture ) gl.ActiveTexture = gl.ActiveTextureARB; |
958 | if (!gl.ActiveTexture ) gl.ActiveTexture = gl.ActiveTextureARB; |
962 | if (!gl.MultiTexCoord2f) gl.MultiTexCoord2f = gl.MultiTexCoord2fARB; |
959 | if (!gl.MultiTexCoord2f) gl.MultiTexCoord2f = gl.MultiTexCoord2fARB; |
963 | } |
960 | } |
964 | } |
961 | } |
965 | OUTPUT: |
962 | OUTPUT: |
966 | RETVAL |
963 | RETVAL |
967 | |
964 | |
968 | void |
965 | void |
|
|
966 | SDL_WM_SetCaption (const char *title, const char *icon) |
|
|
967 | |
|
|
968 | void |
969 | SDL_GL_SwapBuffers () |
969 | SDL_GL_SwapBuffers () |
970 | |
970 | |
971 | char * |
971 | char * |
972 | SDL_GetKeyName (int sym) |
972 | SDL_GetKeyName (int sym) |
973 | |
973 | |
… | |
… | |
975 | SDL_GetAppState () |
975 | SDL_GetAppState () |
976 | |
976 | |
977 | int |
977 | int |
978 | SDL_GetModState () |
978 | SDL_GetModState () |
979 | |
979 | |
|
|
980 | int |
|
|
981 | SDL_WaitEvent () |
|
|
982 | C_ARGS: 0 |
|
|
983 | |
980 | void |
984 | void |
|
|
985 | SDL_PumpEvents () |
|
|
986 | |
|
|
987 | void |
981 | poll_events () |
988 | peep_events () |
982 | PPCODE: |
989 | PPCODE: |
983 | { |
990 | { |
984 | SDL_Event ev; |
991 | SDL_Event ev; |
985 | |
992 | |
986 | SDL_PumpEvents (); |
993 | SDL_PumpEvents (); |
… | |
… | |
1139 | OUTPUT: |
1146 | OUTPUT: |
1140 | RETVAL |
1147 | RETVAL |
1141 | |
1148 | |
1142 | void |
1149 | void |
1143 | IMG_Init (int flags = IMG_INIT_JPG | IMG_INIT_PNG) |
1150 | IMG_Init (int flags = IMG_INIT_JPG | IMG_INIT_PNG) |
|
|
1151 | |
|
|
1152 | # MIX_INIT_MP3 gives smpeg + libstdc++ + libgcc_s |
|
|
1153 | void |
|
|
1154 | Mix_Init (int flags = MIX_INIT_MOD | MIX_INIT_OGG) |
1144 | |
1155 | |
1145 | void |
1156 | void |
1146 | load_image_inline (SV *image_) |
1157 | load_image_inline (SV *image_) |
1147 | ALIAS: |
1158 | ALIAS: |
1148 | load_image_file = 1 |
1159 | load_image_file = 1 |
… | |
… | |
2566 | int x, y; |
2577 | int x, y; |
2567 | int sw1 = sw + 2; |
2578 | int sw1 = sw + 2; |
2568 | int sh1 = sh + 2; |
2579 | int sh1 = sh + 2; |
2569 | int sh3 = sh * 3; |
2580 | int sh3 = sh * 3; |
2570 | int sw3 = sw * 3; |
2581 | int sw3 = sw * 3; |
2571 | uint8_t *darkness1 = (uint8_t *)malloc (sw1 * sh1); |
|
|
2572 | SV *darkness3_sv = sv_2mortal (newSV (sw3 * sh3)); |
2582 | SV *darkness3_sv = sv_2mortal (newSV (sw3 * sh3)); |
2573 | uint8_t *darkness3 = (uint8_t *)SvPVX (darkness3_sv); |
2583 | uint8_t *darkness3 = (uint8_t *)SvPVX (darkness3_sv); |
|
|
2584 | uint8_t *darkness1 = (uint8_t *)malloc (sw1 * sh1); |
|
|
2585 | memset (darkness1, 0, sw1*sh1); |
2574 | |
2586 | |
2575 | SvPOK_only (darkness3_sv); |
2587 | SvPOK_only (darkness3_sv); |
2576 | SvCUR_set (darkness3_sv, sw3 * sh3); |
2588 | SvCUR_set (darkness3_sv, sw3 * sh3); |
2577 | |
2589 | |
2578 | mx += self->x - 1; |
2590 | mx += self->x - 1; |
… | |
… | |
3157 | const_iv (GL_FUNC_SUBTRACT), |
3169 | const_iv (GL_FUNC_SUBTRACT), |
3158 | const_iv (GL_FUNC_REVERSE_SUBTRACT), |
3170 | const_iv (GL_FUNC_REVERSE_SUBTRACT), |
3159 | # undef const_iv |
3171 | # undef const_iv |
3160 | }; |
3172 | }; |
3161 | |
3173 | |
3162 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
3174 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ > const_iv; civ--) |
3163 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
3175 | newCONSTSUB (stash, (char *)civ[-1].name, newSViv (civ[-1].iv)); |
3164 | |
3176 | |
3165 | texture_av = newAV (); |
3177 | texture_av = newAV (); |
3166 | AvREAL_off (texture_av); |
3178 | AvREAL_off (texture_av); |
3167 | } |
3179 | } |
3168 | |
3180 | |