… | |
… | |
647 | const_iv (SDL_INIT_CDROM), |
647 | const_iv (SDL_INIT_CDROM), |
648 | const_iv (SDL_INIT_JOYSTICK), |
648 | const_iv (SDL_INIT_JOYSTICK), |
649 | const_iv (SDL_INIT_EVERYTHING), |
649 | const_iv (SDL_INIT_EVERYTHING), |
650 | const_iv (SDL_INIT_NOPARACHUTE), |
650 | const_iv (SDL_INIT_NOPARACHUTE), |
651 | const_iv (SDL_INIT_EVENTTHREAD), |
651 | const_iv (SDL_INIT_EVENTTHREAD), |
|
|
652 | |
|
|
653 | const_iv (SDL_GL_RED_SIZE), |
|
|
654 | const_iv (SDL_GL_GREEN_SIZE), |
|
|
655 | const_iv (SDL_GL_BLUE_SIZE), |
|
|
656 | const_iv (SDL_GL_ALPHA_SIZE), |
|
|
657 | const_iv (SDL_GL_DOUBLEBUFFER), |
|
|
658 | const_iv (SDL_GL_BUFFER_SIZE), |
|
|
659 | const_iv (SDL_GL_DEPTH_SIZE), |
|
|
660 | const_iv (SDL_GL_STENCIL_SIZE), |
|
|
661 | const_iv (SDL_GL_ACCUM_RED_SIZE), |
|
|
662 | const_iv (SDL_GL_ACCUM_GREEN_SIZE), |
|
|
663 | const_iv (SDL_GL_ACCUM_BLUE_SIZE), |
|
|
664 | const_iv (SDL_GL_ACCUM_ALPHA_SIZE), |
|
|
665 | const_iv (SDL_GL_STEREO), |
|
|
666 | const_iv (SDL_GL_MULTISAMPLEBUFFERS), |
|
|
667 | const_iv (SDL_GL_MULTISAMPLESAMPLES), |
|
|
668 | const_iv (SDL_GL_ACCELERATED_VISUAL), |
|
|
669 | const_iv (SDL_GL_SWAP_CONTROL) |
652 | # undef const_iv |
670 | # undef const_iv |
653 | }; |
671 | }; |
654 | |
672 | |
655 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
673 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
656 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
674 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
… | |
… | |
702 | |
720 | |
703 | void SDL_QuitSubSystem (U32 flags) |
721 | void SDL_QuitSubSystem (U32 flags) |
704 | |
722 | |
705 | void SDL_Quit () |
723 | void SDL_Quit () |
706 | |
724 | |
|
|
725 | int SDL_GL_SetAttribute (int attr, int value) |
|
|
726 | |
|
|
727 | int SDL_GL_GetAttribute (int attr) |
|
|
728 | CODE: |
|
|
729 | if (SDL_GL_GetAttribute (attr, &RETVAL)) |
|
|
730 | XSRETURN_UNDEF; |
|
|
731 | OUTPUT: |
|
|
732 | RETVAL |
|
|
733 | |
707 | void |
734 | void |
708 | SDL_ListModes (int rgb, int alpha) |
735 | SDL_ListModes (int rgb, int alpha) |
709 | PPCODE: |
736 | PPCODE: |
710 | { |
737 | { |
711 | SDL_Rect **m; |
738 | SDL_Rect **m; |
… | |
… | |
722 | SDL_GL_SetAttribute (SDL_GL_ACCUM_GREEN_SIZE, 0); |
749 | SDL_GL_SetAttribute (SDL_GL_ACCUM_GREEN_SIZE, 0); |
723 | SDL_GL_SetAttribute (SDL_GL_ACCUM_BLUE_SIZE , 0); |
750 | SDL_GL_SetAttribute (SDL_GL_ACCUM_BLUE_SIZE , 0); |
724 | SDL_GL_SetAttribute (SDL_GL_ACCUM_ALPHA_SIZE, 0); |
751 | SDL_GL_SetAttribute (SDL_GL_ACCUM_ALPHA_SIZE, 0); |
725 | |
752 | |
726 | SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1); |
753 | SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1); |
727 | #if SDL_VERSION_ATLEAST(1,2,10) |
|
|
728 | SDL_GL_SetAttribute (SDL_GL_ACCELERATED_VISUAL, 1); |
|
|
729 | SDL_GL_SetAttribute (SDL_GL_SWAP_CONTROL, 1); |
754 | SDL_GL_SetAttribute (SDL_GL_SWAP_CONTROL, 1); |
730 | #endif |
|
|
731 | |
755 | |
732 | m = SDL_ListModes (0, SDL_FULLSCREEN | SDL_OPENGL); |
756 | m = SDL_ListModes (0, SDL_FULLSCREEN | SDL_OPENGL); |
733 | |
757 | |
734 | if (m && m != (SDL_Rect **)-1) |
758 | if (m && m != (SDL_Rect **)-1) |
735 | while (*m) |
759 | while (*m) |
736 | { |
760 | { |
|
|
761 | if ((*m)->w >= 400 && (*m)->h >= 300) |
|
|
762 | { |
737 | AV *av = newAV (); |
763 | AV *av = newAV (); |
738 | av_push (av, newSViv ((*m)->w)); |
764 | av_push (av, newSViv ((*m)->w)); |
739 | av_push (av, newSViv ((*m)->h)); |
765 | av_push (av, newSViv ((*m)->h)); |
740 | av_push (av, newSViv (rgb)); |
766 | av_push (av, newSViv (rgb)); |
741 | av_push (av, newSViv (alpha)); |
767 | av_push (av, newSViv (alpha)); |
742 | XPUSHs (sv_2mortal (newRV_noinc ((SV *)av))); |
768 | XPUSHs (sv_2mortal (newRV_noinc ((SV *)av))); |
|
|
769 | } |
743 | |
770 | |
744 | ++m; |
771 | ++m; |
745 | } |
772 | } |
746 | } |
773 | } |
747 | |
774 | |
… | |
… | |
1753 | } |
1780 | } |
1754 | } |
1781 | } |
1755 | } |
1782 | } |
1756 | } |
1783 | } |
1757 | else |
1784 | else |
|
|
1785 | { |
1758 | cell->darkness = 0; |
1786 | cell->darkness = 0; |
|
|
1787 | cell->stat_hp = 0; |
|
|
1788 | cell->flags = 0; |
|
|
1789 | cell->player = 0; |
|
|
1790 | } |
1759 | } |
1791 | } |
1760 | } |
1792 | } |
1761 | OUTPUT: |
1793 | OUTPUT: |
1762 | RETVAL |
1794 | RETVAL |
1763 | |
1795 | |
… | |
… | |
1815 | } |
1847 | } |
1816 | OUTPUT: |
1848 | OUTPUT: |
1817 | RETVAL |
1849 | RETVAL |
1818 | |
1850 | |
1819 | void |
1851 | void |
1820 | draw (DC::Map self, int mx, int my, int sw, int sh, int T, U32 player = 0xffffffff, int pdx = 0, int pdy = 0) |
1852 | draw (DC::Map self, int mx, int my, int sw, int sh, int T, U32 player = 0xffffffff, int sdx = 0, int sdy = 0) |
1821 | CODE: |
1853 | CODE: |
1822 | { |
1854 | { |
1823 | int x, y, z; |
1855 | int x, y, z; |
1824 | |
1856 | |
1825 | HV *smooth = (HV *)sv_2mortal ((SV *)newHV ()); |
1857 | HV *smooth = (HV *)sv_2mortal ((SV *)newHV ()); |
… | |
… | |
2072 | } |
2104 | } |
2073 | |
2105 | |
2074 | if (pl_tex.name) |
2106 | if (pl_tex.name) |
2075 | { |
2107 | { |
2076 | maptex tex = pl_tex; |
2108 | maptex tex = pl_tex; |
2077 | int px = pl_x + pdx; |
2109 | int px = pl_x + sdx; |
2078 | int py = pl_y + pdy; |
2110 | int py = pl_y + sdy; |
2079 | |
2111 | |
2080 | key.texname = tex.name; |
2112 | key.texname = tex.name; |
2081 | arr = rc_array (rc, &key); |
2113 | arr = rc_array (rc, &key); |
2082 | |
2114 | |
2083 | rc_t2f_v3f (arr, 0 , 0 , px , py , 0); |
2115 | rc_t2f_v3f (arr, 0 , 0 , px , py , 0); |