… | |
… | |
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 | if ((cell)->player) \ |
|
|
375 | (cell)->tile [2] = 0; \ |
|
|
376 | (cell)->darkness = 0; \ |
|
|
377 | (cell)->stat_hp = 0; \ |
|
|
378 | (cell)->flags = 0; \ |
|
|
379 | (cell)->player = 0; \ |
|
|
380 | } while (0) |
|
|
381 | |
372 | static void |
382 | static void |
373 | map_blank (DC__Map self, int x0, int y0, int w, int h) |
383 | map_blank (DC__Map self, int x0, int y0, int w, int h) |
374 | { |
384 | { |
375 | int x, y; |
385 | int x, y; |
376 | maprow *row; |
386 | maprow *row; |
… | |
… | |
390 | if (x >= row->c1) |
400 | if (x >= row->c1) |
391 | break; |
401 | break; |
392 | |
402 | |
393 | cell = row->col + x - row->c0; |
403 | cell = row->col + x - row->c0; |
394 | |
404 | |
395 | cell->darkness = 0; |
405 | CELL_CLEAR (cell); |
396 | cell->stat_hp = 0; |
|
|
397 | cell->flags = 0; |
|
|
398 | cell->player = 0; |
|
|
399 | } |
406 | } |
400 | } |
407 | } |
401 | } |
408 | } |
402 | |
409 | |
403 | typedef struct { |
410 | typedef struct { |
… | |
… | |
1780 | } |
1787 | } |
1781 | } |
1788 | } |
1782 | } |
1789 | } |
1783 | } |
1790 | } |
1784 | else |
1791 | else |
1785 | cell->darkness = 0; |
1792 | CELL_CLEAR (cell); |
1786 | } |
1793 | } |
1787 | } |
1794 | } |
1788 | OUTPUT: |
1795 | OUTPUT: |
1789 | RETVAL |
1796 | RETVAL |
1790 | |
1797 | |
… | |
… | |
1842 | } |
1849 | } |
1843 | OUTPUT: |
1850 | OUTPUT: |
1844 | RETVAL |
1851 | RETVAL |
1845 | |
1852 | |
1846 | void |
1853 | void |
1847 | draw (DC::Map self, int mx, int my, int sw, int sh, int T, U32 player = 0xffffffff, int pdx = 0, int pdy = 0) |
1854 | draw (DC::Map self, int mx, int my, int sw, int sh, int T, U32 player = 0xffffffff, int sdx = 0, int sdy = 0) |
1848 | CODE: |
1855 | CODE: |
1849 | { |
1856 | { |
1850 | int x, y, z; |
1857 | int x, y, z; |
1851 | |
1858 | |
1852 | HV *smooth = (HV *)sv_2mortal ((SV *)newHV ()); |
1859 | HV *smooth = (HV *)sv_2mortal ((SV *)newHV ()); |
… | |
… | |
2099 | } |
2106 | } |
2100 | |
2107 | |
2101 | if (pl_tex.name) |
2108 | if (pl_tex.name) |
2102 | { |
2109 | { |
2103 | maptex tex = pl_tex; |
2110 | maptex tex = pl_tex; |
2104 | int px = pl_x + pdx; |
2111 | int px = pl_x + sdx; |
2105 | int py = pl_y + pdy; |
2112 | int py = pl_y + sdy; |
2106 | |
2113 | |
2107 | key.texname = tex.name; |
2114 | key.texname = tex.name; |
2108 | arr = rc_array (rc, &key); |
2115 | arr = rc_array (rc, &key); |
2109 | |
2116 | |
2110 | rc_t2f_v3f (arr, 0 , 0 , px , py , 0); |
2117 | rc_t2f_v3f (arr, 0 , 0 , px , py , 0); |