… | |
… | |
85 | |
85 | |
86 | #define MIN_FONT_HEIGHT 10 |
86 | #define MIN_FONT_HEIGHT 10 |
87 | |
87 | |
88 | /* mask out modifiers we are not interested in */ |
88 | /* mask out modifiers we are not interested in */ |
89 | #define MOD_MASK (KMOD_CTRL | KMOD_SHIFT | KMOD_ALT | KMOD_META) |
89 | #define MOD_MASK (KMOD_CTRL | KMOD_SHIFT | KMOD_ALT | KMOD_META) |
90 | |
|
|
91 | #if 1 |
|
|
92 | # define PARACHUTE SDL_INIT_NOPARACHUTE |
|
|
93 | #else |
|
|
94 | # define PARACHUTE 0 |
|
|
95 | #endif |
|
|
96 | |
90 | |
97 | static AV *texture_av; |
91 | static AV *texture_av; |
98 | |
92 | |
99 | static struct |
93 | static struct |
100 | { |
94 | { |
… | |
… | |
644 | const_iv (KMOD_NUM), |
638 | const_iv (KMOD_NUM), |
645 | const_iv (KMOD_CAPS), |
639 | const_iv (KMOD_CAPS), |
646 | const_iv (KMOD_MODE), |
640 | const_iv (KMOD_MODE), |
647 | |
641 | |
648 | const_iv (MIX_DEFAULT_FORMAT), |
642 | const_iv (MIX_DEFAULT_FORMAT), |
|
|
643 | |
|
|
644 | const_iv (SDL_INIT_TIMER), |
|
|
645 | const_iv (SDL_INIT_AUDIO), |
|
|
646 | const_iv (SDL_INIT_VIDEO), |
|
|
647 | const_iv (SDL_INIT_CDROM), |
|
|
648 | const_iv (SDL_INIT_JOYSTICK), |
|
|
649 | const_iv (SDL_INIT_EVERYTHING), |
|
|
650 | const_iv (SDL_INIT_NOPARACHUTE), |
|
|
651 | const_iv (SDL_INIT_EVENTTHREAD), |
649 | # undef const_iv |
652 | # undef const_iv |
650 | }; |
653 | }; |
651 | |
654 | |
652 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
655 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
653 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
656 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
… | |
… | |
689 | pango_context_set_language (opengl_context, pango_language_from_string ("en")); |
692 | pango_context_set_language (opengl_context, pango_language_from_string ("en")); |
690 | /*pango_context_set_base_dir (opengl_context, PANGO_DIRECTION_WEAK_LTR);*/ |
693 | /*pango_context_set_base_dir (opengl_context, PANGO_DIRECTION_WEAK_LTR);*/ |
691 | #endif |
694 | #endif |
692 | } |
695 | } |
693 | |
696 | |
694 | char * |
|
|
695 | SDL_GetError () |
697 | char *SDL_GetError () |
696 | |
698 | |
697 | int |
699 | int SDL_Init (U32 flags) |
698 | SDL_Init (U32 flags = SDL_INIT_VIDEO | SDL_INIT_AUDIO | PARACHUTE) |
|
|
699 | |
700 | |
700 | void |
701 | int SDL_InitSubSystem (U32 flags) |
|
|
702 | |
|
|
703 | void SDL_QuitSubSystem (U32 flags) |
|
|
704 | |
701 | SDL_Quit () |
705 | void SDL_Quit () |
702 | |
706 | |
703 | void |
707 | void |
704 | SDL_ListModes (int rgb, int alpha) |
708 | SDL_ListModes (int rgb, int alpha) |
705 | PPCODE: |
709 | PPCODE: |
706 | { |
710 | { |
… | |
… | |
728 | m = SDL_ListModes (0, SDL_FULLSCREEN | SDL_OPENGL); |
732 | m = SDL_ListModes (0, SDL_FULLSCREEN | SDL_OPENGL); |
729 | |
733 | |
730 | if (m && m != (SDL_Rect **)-1) |
734 | if (m && m != (SDL_Rect **)-1) |
731 | while (*m) |
735 | while (*m) |
732 | { |
736 | { |
733 | if ((*m)->w >= 800 && (*m)->h >= 480) |
|
|
734 | { |
|
|
735 | AV *av = newAV (); |
737 | AV *av = newAV (); |
736 | av_push (av, newSViv ((*m)->w)); |
738 | av_push (av, newSViv ((*m)->w)); |
737 | av_push (av, newSViv ((*m)->h)); |
739 | av_push (av, newSViv ((*m)->h)); |
738 | av_push (av, newSViv (rgb)); |
740 | av_push (av, newSViv (rgb)); |
739 | av_push (av, newSViv (alpha)); |
741 | av_push (av, newSViv (alpha)); |
740 | XPUSHs (sv_2mortal (newRV_noinc ((SV *)av))); |
742 | XPUSHs (sv_2mortal (newRV_noinc ((SV *)av))); |
741 | } |
|
|
742 | |
743 | |
743 | ++m; |
744 | ++m; |
744 | } |
745 | } |
745 | } |
746 | } |
746 | |
747 | |
… | |
… | |
1825 | uint32_t smooth_level[256 / 32]; // one bit for every possible smooth level |
1826 | uint32_t smooth_level[256 / 32]; // one bit for every possible smooth level |
1826 | static uint8_t smooth_max[256][256]; // egad, fast and wasteful on memory (64k) |
1827 | static uint8_t smooth_max[256][256]; // egad, fast and wasteful on memory (64k) |
1827 | smooth_key skey; |
1828 | smooth_key skey; |
1828 | int pl_x, pl_y; |
1829 | int pl_x, pl_y; |
1829 | maptex pl_tex; |
1830 | maptex pl_tex; |
1830 | |
|
|
1831 | pl_tex.name = 0; |
|
|
1832 | |
|
|
1833 | rc_t *rc = rc_alloc (); |
1831 | rc_t *rc = rc_alloc (); |
1834 | rc_key_t key; |
1832 | rc_key_t key; |
1835 | rc_array_t *arr; |
1833 | rc_array_t *arr; |
|
|
1834 | |
|
|
1835 | pl_tex.name = 0; |
1836 | |
1836 | |
1837 | // thats current max. sorry. |
1837 | // thats current max. sorry. |
1838 | if (sw > 255) sw = 255; |
1838 | if (sw > 255) sw = 255; |
1839 | if (sh > 255) sh = 255; |
1839 | if (sh > 255) sh = 255; |
1840 | |
1840 | |