… | |
… | |
38 | #include <SDL_thread.h> |
38 | #include <SDL_thread.h> |
39 | #include <SDL_endian.h> |
39 | #include <SDL_endian.h> |
40 | #include <SDL_image.h> |
40 | #include <SDL_image.h> |
41 | #include <SDL_mixer.h> |
41 | #include <SDL_mixer.h> |
42 | #include <SDL_opengl.h> |
42 | #include <SDL_opengl.h> |
|
|
43 | |
|
|
44 | /* work around os x broken headers */ |
|
|
45 | #ifdef __MACOSX__ |
|
|
46 | typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); |
|
|
47 | #endif |
43 | |
48 | |
44 | #define PANGO_ENABLE_BACKEND |
49 | #define PANGO_ENABLE_BACKEND |
45 | #define G_DISABLE_CAST_CHECKS |
50 | #define G_DISABLE_CAST_CHECKS |
46 | |
51 | |
47 | #include <glib/gmacros.h> |
52 | #include <glib/gmacros.h> |
… | |
… | |
521 | if (!svp || !SvTRUE (*svp)) |
526 | if (!svp || !SvTRUE (*svp)) |
522 | return 0; |
527 | return 0; |
523 | |
528 | |
524 | return 1; |
529 | return 1; |
525 | } |
530 | } |
|
|
531 | |
|
|
532 | static void |
|
|
533 | deliantra_main () |
|
|
534 | { |
|
|
535 | char *argv[] = { 0 }; |
|
|
536 | call_argv ("::main", G_DISCARD | G_VOID, argv); |
|
|
537 | dSP; |
|
|
538 | } |
|
|
539 | |
|
|
540 | #ifdef __MACOSX__ |
|
|
541 | /* to due surprising braindamage on the side of SDL design, we |
|
|
542 | * do some mind-boggling hack here: SDL requires a custom main() |
|
|
543 | * on OS X, so... we provide one and call the original main(), which, |
|
|
544 | * due to share dlibrary magic, calls -lSDLmain's main, not perl's main, |
|
|
545 | * and which calls our main (== SDL_main) back. |
|
|
546 | */ |
|
|
547 | extern C_LINKAGE int |
|
|
548 | main (int argc, char *argv[]) |
|
|
549 | { |
|
|
550 | deliantra_main (); |
|
|
551 | } |
|
|
552 | |
|
|
553 | #undef main |
|
|
554 | |
|
|
555 | extern C_LINKAGE int main (int argc, char *argv[]); |
|
|
556 | |
|
|
557 | static void |
|
|
558 | SDL_braino (void) |
|
|
559 | { |
|
|
560 | char *argv[] = { "deliantra client", 0 }; |
|
|
561 | (main) (1, argv); |
|
|
562 | } |
|
|
563 | #else |
|
|
564 | static void |
|
|
565 | SDL_braino (void) |
|
|
566 | { |
|
|
567 | deliantra_main (); |
|
|
568 | } |
|
|
569 | #endif |
526 | |
570 | |
527 | MODULE = Deliantra::Client PACKAGE = DC |
571 | MODULE = Deliantra::Client PACKAGE = DC |
528 | |
572 | |
529 | PROTOTYPES: ENABLE |
573 | PROTOTYPES: ENABLE |
530 | |
574 | |
… | |
… | |
720 | /*pango_context_set_base_dir (opengl_context, PANGO_DIRECTION_WEAK_LTR);*/ |
764 | /*pango_context_set_base_dir (opengl_context, PANGO_DIRECTION_WEAK_LTR);*/ |
721 | #endif |
765 | #endif |
722 | } |
766 | } |
723 | |
767 | |
724 | char *SDL_GetError () |
768 | char *SDL_GetError () |
|
|
769 | |
|
|
770 | void SDL_braino () |
725 | |
771 | |
726 | int SDL_Init (U32 flags) |
772 | int SDL_Init (U32 flags) |
727 | |
773 | |
728 | int SDL_InitSubSystem (U32 flags) |
774 | int SDL_InitSubSystem (U32 flags) |
729 | |
775 | |