… | |
… | |
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 | call_argv ("::main", G_DISCARD | G_VOID, 0); |
|
|
536 | dSP; |
|
|
537 | } |
|
|
538 | |
|
|
539 | #ifdef __MACOSX__ |
|
|
540 | /* to due surprising braindamage on the side of SDL design, we |
|
|
541 | * do some mind-boggling hack here: SDL requires a custom main() |
|
|
542 | * on OS X, so... we provide one and call the original main(), which, |
|
|
543 | * due to share dlibrary magic, calls -lSDLmain's main, not perl's main, |
|
|
544 | * and which calls our main (== SDL_main) back. |
|
|
545 | */ |
|
|
546 | extern C_LINKAGE int |
|
|
547 | main (int argc, char *argv[]) |
|
|
548 | { |
|
|
549 | deliantra_main (); |
|
|
550 | } |
|
|
551 | |
|
|
552 | #undef main |
|
|
553 | |
|
|
554 | extern C_LINKAGE int main (int argc, char *argv[]); |
|
|
555 | |
|
|
556 | static void |
|
|
557 | SDL_braino (void) |
|
|
558 | { |
|
|
559 | char *argv[] = { "deliantra client", 0 }; |
|
|
560 | (main) (1, argv); |
|
|
561 | } |
|
|
562 | #else |
|
|
563 | static void |
|
|
564 | SDL_braino (void) |
|
|
565 | { |
|
|
566 | deliantra_main (); |
|
|
567 | } |
|
|
568 | #endif |
526 | |
569 | |
527 | MODULE = Deliantra::Client PACKAGE = DC |
570 | MODULE = Deliantra::Client PACKAGE = DC |
528 | |
571 | |
529 | PROTOTYPES: ENABLE |
572 | PROTOTYPES: ENABLE |
530 | |
573 | |
… | |
… | |
701 | |
744 | |
702 | NV floor (NV x) |
745 | NV floor (NV x) |
703 | |
746 | |
704 | NV ceil (NV x) |
747 | NV ceil (NV x) |
705 | |
748 | |
706 | NV ceilabs (NV x) |
|
|
707 | CODE: |
|
|
708 | RETVAL = x < 0. ? - ceil (-x) : ceil (x); |
|
|
709 | OUTPUT: |
|
|
710 | RETVAL |
|
|
711 | |
|
|
712 | IV minpot (UV n) |
749 | IV minpot (UV n) |
713 | |
750 | |
714 | IV popcount (UV n) |
751 | IV popcount (UV n) |
715 | |
752 | |
716 | void |
753 | void |
… | |
… | |
726 | /*pango_context_set_base_dir (opengl_context, PANGO_DIRECTION_WEAK_LTR);*/ |
763 | /*pango_context_set_base_dir (opengl_context, PANGO_DIRECTION_WEAK_LTR);*/ |
727 | #endif |
764 | #endif |
728 | } |
765 | } |
729 | |
766 | |
730 | char *SDL_GetError () |
767 | char *SDL_GetError () |
|
|
768 | |
|
|
769 | void SDL_braino () |
731 | |
770 | |
732 | int SDL_Init (U32 flags) |
771 | int SDL_Init (U32 flags) |
733 | |
772 | |
734 | int SDL_InitSubSystem (U32 flags) |
773 | int SDL_InitSubSystem (U32 flags) |
735 | |
774 | |