… | |
… | |
577 | |
577 | |
578 | return mod; |
578 | return mod; |
579 | } |
579 | } |
580 | |
580 | |
581 | static void |
581 | static void |
582 | deliantra_main () |
582 | deliantra_main (SV *real_main) |
583 | { |
583 | { |
584 | char *argv[] = { 0 }; |
584 | dSP; |
585 | call_argv ("DC::Main::main", G_DISCARD | G_VOID, argv); |
585 | |
|
|
586 | PUSHMARK (SP); |
|
|
587 | call_sv (real_main, G_DISCARD | G_VOID); |
586 | } |
588 | } |
587 | |
589 | |
588 | #ifdef __MACOSX__ |
590 | #ifdef __MACOSX__ |
|
|
591 | static SV *real_main; |
|
|
592 | |
589 | /* to due surprising braindamage on the side of SDL design, we |
593 | /* to due surprising braindamage on the side of SDL design, we |
590 | * do some mind-boggling hack here: SDL requires a custom main() |
594 | * 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, |
595 | * 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, |
596 | * due to shared library magic, calls -lSDLmain's main, not perl's main, |
593 | * and which calls our main (== SDL_main) back. |
597 | * and which calls our main (== SDL_main) back. |
594 | */ |
598 | */ |
595 | extern C_LINKAGE int |
599 | extern C_LINKAGE int |
596 | main (int argc, char *argv[]) |
600 | main (int argc, char *argv[]) |
597 | { |
601 | { |
598 | deliantra_main (); |
602 | deliantra_main (real_main); |
599 | } |
603 | } |
600 | |
604 | |
601 | #undef main |
605 | #undef main |
602 | |
606 | |
603 | extern C_LINKAGE int main (int argc, char *argv[]); |
607 | extern C_LINKAGE int main (int argc, char *argv[]); |
604 | |
608 | |
605 | static void |
609 | static void |
606 | SDL_braino (void) |
610 | SDL_main_hack (SV *real_main_) |
607 | { |
611 | { |
|
|
612 | real_main = real_main_; |
|
|
613 | |
608 | char *argv[] = { "deliantra client", 0 }; |
614 | char *argv[] = { "deliantra client", 0 }; |
609 | (main) (1, argv); |
615 | (main) (1, argv); |
610 | } |
616 | } |
611 | #else |
617 | #else |
612 | static void |
618 | static void |
613 | SDL_braino (void) |
619 | SDL_main_hack (SV *real_main) |
614 | { |
620 | { |
615 | deliantra_main (); |
621 | deliantra_main (real_main); |
616 | } |
622 | } |
617 | #endif |
623 | #endif |
618 | |
624 | |
619 | MODULE = Deliantra::Client PACKAGE = DC |
625 | MODULE = Deliantra::Client PACKAGE = DC |
620 | |
626 | |
… | |
… | |
871 | #endif |
877 | #endif |
872 | } |
878 | } |
873 | |
879 | |
874 | char *SDL_GetError () |
880 | char *SDL_GetError () |
875 | |
881 | |
876 | void SDL_braino () |
882 | void SDL_main_hack (SV *real_main) |
|
|
883 | PROTOTYPE: & |
877 | |
884 | |
878 | int SDL_Init (U32 flags) |
885 | int SDL_Init (U32 flags) |
879 | |
886 | |
880 | int SDL_InitSubSystem (U32 flags) |
887 | int SDL_InitSubSystem (U32 flags) |
881 | |
888 | |
… | |
… | |
950 | ); |
957 | ); |
951 | |
958 | |
952 | if (RETVAL) |
959 | if (RETVAL) |
953 | { |
960 | { |
954 | av_clear (texture_av); |
961 | 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); |
962 | #define GL_FUNC(ptr,name) gl.name = (ptr)SDL_GL_GetProcAddress ("gl" # name); |
958 | #include "glfunc.h" |
963 | #include "glfunc.h" |
959 | #undef GL_FUNC |
964 | #undef GL_FUNC |
960 | |
|
|
961 | if (!gl.ActiveTexture ) gl.ActiveTexture = gl.ActiveTextureARB; |
965 | if (!gl.ActiveTexture ) gl.ActiveTexture = gl.ActiveTextureARB; |
962 | if (!gl.MultiTexCoord2f) gl.MultiTexCoord2f = gl.MultiTexCoord2fARB; |
966 | if (!gl.MultiTexCoord2f) gl.MultiTexCoord2f = gl.MultiTexCoord2fARB; |
963 | } |
967 | } |
964 | } |
968 | } |
965 | OUTPUT: |
969 | OUTPUT: |
966 | RETVAL |
970 | RETVAL |
967 | |
971 | |
968 | void |
972 | void |
|
|
973 | SDL_WM_SetCaption (const char *title, const char *icon) |
|
|
974 | |
|
|
975 | void |
969 | SDL_GL_SwapBuffers () |
976 | SDL_GL_SwapBuffers () |
970 | |
977 | |
971 | char * |
978 | char * |
972 | SDL_GetKeyName (int sym) |
979 | SDL_GetKeyName (int sym) |
973 | |
980 | |
… | |
… | |
975 | SDL_GetAppState () |
982 | SDL_GetAppState () |
976 | |
983 | |
977 | int |
984 | int |
978 | SDL_GetModState () |
985 | SDL_GetModState () |
979 | |
986 | |
|
|
987 | int |
|
|
988 | SDL_WaitEvent () |
|
|
989 | C_ARGS: 0 |
|
|
990 | |
980 | void |
991 | void |
|
|
992 | SDL_PumpEvents () |
|
|
993 | |
|
|
994 | void |
981 | poll_events () |
995 | peep_events () |
982 | PPCODE: |
996 | PPCODE: |
983 | { |
997 | { |
984 | SDL_Event ev; |
998 | SDL_Event ev; |
985 | |
999 | |
986 | SDL_PumpEvents (); |
1000 | SDL_PumpEvents (); |
… | |
… | |
1140 | RETVAL |
1154 | RETVAL |
1141 | |
1155 | |
1142 | void |
1156 | void |
1143 | IMG_Init (int flags = IMG_INIT_JPG | IMG_INIT_PNG) |
1157 | IMG_Init (int flags = IMG_INIT_JPG | IMG_INIT_PNG) |
1144 | |
1158 | |
|
|
1159 | # MIX_INIT_MP3 gives smpeg + libstdc++ + libgcc_s |
1145 | void |
1160 | void |
1146 | Mix_Init (int flags = MIX_INIT_MOD | MIX_INIT_MP3 | MIX_INIT_OGG) |
1161 | Mix_Init (int flags = MIX_INIT_MOD | MIX_INIT_OGG) |
1147 | |
1162 | |
1148 | void |
1163 | void |
1149 | load_image_inline (SV *image_) |
1164 | load_image_inline (SV *image_) |
1150 | ALIAS: |
1165 | ALIAS: |
1151 | load_image_file = 1 |
1166 | load_image_file = 1 |