… | |
… | |
367 | self->oy = 0; |
367 | self->oy = 0; |
368 | self->row = 0; |
368 | self->row = 0; |
369 | self->rows = 0; |
369 | self->rows = 0; |
370 | } |
370 | } |
371 | |
371 | |
|
|
372 | #define CELL_CLEAR(cell) \ |
|
|
373 | do { \ |
|
|
374 | (cell)->darkness = 0; \ |
|
|
375 | (cell)->stat_hp = 0; \ |
|
|
376 | (cell)->flags = 0; \ |
|
|
377 | (cell)->player = 0; \ |
|
|
378 | } while (0) |
|
|
379 | |
372 | static void |
380 | static void |
373 | map_blank (DC__Map self, int x0, int y0, int w, int h) |
381 | map_blank (DC__Map self, int x0, int y0, int w, int h) |
374 | { |
382 | { |
375 | int x, y; |
383 | int x, y; |
376 | maprow *row; |
384 | maprow *row; |
… | |
… | |
390 | if (x >= row->c1) |
398 | if (x >= row->c1) |
391 | break; |
399 | break; |
392 | |
400 | |
393 | cell = row->col + x - row->c0; |
401 | cell = row->col + x - row->c0; |
394 | |
402 | |
395 | cell->darkness = 0; |
403 | CELL_CLEAR (cell); |
396 | cell->stat_hp = 0; |
|
|
397 | cell->flags = 0; |
|
|
398 | cell->player = 0; |
|
|
399 | } |
404 | } |
400 | } |
405 | } |
401 | } |
406 | } |
402 | |
407 | |
403 | typedef struct { |
408 | typedef struct { |
… | |
… | |
756 | m = SDL_ListModes (0, SDL_FULLSCREEN | SDL_OPENGL); |
761 | m = SDL_ListModes (0, SDL_FULLSCREEN | SDL_OPENGL); |
757 | |
762 | |
758 | if (m && m != (SDL_Rect **)-1) |
763 | if (m && m != (SDL_Rect **)-1) |
759 | while (*m) |
764 | while (*m) |
760 | { |
765 | { |
|
|
766 | if ((*m)->w >= 400 && (*m)->h >= 300) |
|
|
767 | { |
761 | AV *av = newAV (); |
768 | AV *av = newAV (); |
762 | av_push (av, newSViv ((*m)->w)); |
769 | av_push (av, newSViv ((*m)->w)); |
763 | av_push (av, newSViv ((*m)->h)); |
770 | av_push (av, newSViv ((*m)->h)); |
764 | av_push (av, newSViv (rgb)); |
771 | av_push (av, newSViv (rgb)); |
765 | av_push (av, newSViv (alpha)); |
772 | av_push (av, newSViv (alpha)); |
766 | XPUSHs (sv_2mortal (newRV_noinc ((SV *)av))); |
773 | XPUSHs (sv_2mortal (newRV_noinc ((SV *)av))); |
|
|
774 | } |
767 | |
775 | |
768 | ++m; |
776 | ++m; |
769 | } |
777 | } |
770 | } |
778 | } |
771 | |
779 | |
… | |
… | |
1777 | } |
1785 | } |
1778 | } |
1786 | } |
1779 | } |
1787 | } |
1780 | } |
1788 | } |
1781 | else |
1789 | else |
1782 | cell->darkness = 0; |
1790 | CELL_CLEAR (cell); |
1783 | } |
1791 | } |
1784 | } |
1792 | } |
1785 | OUTPUT: |
1793 | OUTPUT: |
1786 | RETVAL |
1794 | RETVAL |
1787 | |
1795 | |
… | |
… | |
1839 | } |
1847 | } |
1840 | OUTPUT: |
1848 | OUTPUT: |
1841 | RETVAL |
1849 | RETVAL |
1842 | |
1850 | |
1843 | void |
1851 | void |
1844 | 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) |
1845 | CODE: |
1853 | CODE: |
1846 | { |
1854 | { |
1847 | int x, y, z; |
1855 | int x, y, z; |
1848 | |
1856 | |
1849 | HV *smooth = (HV *)sv_2mortal ((SV *)newHV ()); |
1857 | HV *smooth = (HV *)sv_2mortal ((SV *)newHV ()); |
… | |
… | |
2096 | } |
2104 | } |
2097 | |
2105 | |
2098 | if (pl_tex.name) |
2106 | if (pl_tex.name) |
2099 | { |
2107 | { |
2100 | maptex tex = pl_tex; |
2108 | maptex tex = pl_tex; |
2101 | int px = pl_x + pdx; |
2109 | int px = pl_x + sdx; |
2102 | int py = pl_y + pdy; |
2110 | int py = pl_y + sdy; |
2103 | |
2111 | |
2104 | key.texname = tex.name; |
2112 | key.texname = tex.name; |
2105 | arr = rc_array (rc, &key); |
2113 | arr = rc_array (rc, &key); |
2106 | |
2114 | |
2107 | rc_t2f_v3f (arr, 0 , 0 , px , py , 0); |
2115 | rc_t2f_v3f (arr, 0 , 0 , px , py , 0); |