ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/Client.xs
(Generate patch)

Comparing deliantra/Deliantra-Client/Client.xs (file contents):
Revision 1.264 by root, Fri Jul 18 22:32:54 2008 UTC vs.
Revision 1.268 by root, Sun Jul 20 02:57:43 2008 UTC

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
372static void 382static void
373map_blank (DC__Map self, int x0, int y0, int w, int h) 383map_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
403typedef struct { 410typedef struct {
756 m = SDL_ListModes (0, SDL_FULLSCREEN | SDL_OPENGL); 763 m = SDL_ListModes (0, SDL_FULLSCREEN | SDL_OPENGL);
757 764
758 if (m && m != (SDL_Rect **)-1) 765 if (m && m != (SDL_Rect **)-1)
759 while (*m) 766 while (*m)
760 { 767 {
768 if ((*m)->w >= 400 && (*m)->h >= 300)
769 {
761 AV *av = newAV (); 770 AV *av = newAV ();
762 av_push (av, newSViv ((*m)->w)); 771 av_push (av, newSViv ((*m)->w));
763 av_push (av, newSViv ((*m)->h)); 772 av_push (av, newSViv ((*m)->h));
764 av_push (av, newSViv (rgb)); 773 av_push (av, newSViv (rgb));
765 av_push (av, newSViv (alpha)); 774 av_push (av, newSViv (alpha));
766 XPUSHs (sv_2mortal (newRV_noinc ((SV *)av))); 775 XPUSHs (sv_2mortal (newRV_noinc ((SV *)av)));
776 }
767 777
768 ++m; 778 ++m;
769 } 779 }
770} 780}
771 781
1777 } 1787 }
1778 } 1788 }
1779 } 1789 }
1780 } 1790 }
1781 else 1791 else
1782 cell->darkness = 0; 1792 CELL_CLEAR (cell);
1783 } 1793 }
1784} 1794}
1785 OUTPUT: 1795 OUTPUT:
1786 RETVAL 1796 RETVAL
1787 1797
1839} 1849}
1840 OUTPUT: 1850 OUTPUT:
1841 RETVAL 1851 RETVAL
1842 1852
1843void 1853void
1844draw (DC::Map self, int mx, int my, int sw, int sh, int T, U32 player = 0xffffffff, int pdx = 0, int pdy = 0) 1854draw (DC::Map self, int mx, int my, int sw, int sh, int T, U32 player = 0xffffffff, int sdx = 0, int sdy = 0)
1845 CODE: 1855 CODE:
1846{ 1856{
1847 int x, y, z; 1857 int x, y, z;
1848 1858
1849 HV *smooth = (HV *)sv_2mortal ((SV *)newHV ()); 1859 HV *smooth = (HV *)sv_2mortal ((SV *)newHV ());
2096 } 2106 }
2097 2107
2098 if (pl_tex.name) 2108 if (pl_tex.name)
2099 { 2109 {
2100 maptex tex = pl_tex; 2110 maptex tex = pl_tex;
2101 int px = pl_x + pdx; 2111 int px = pl_x + sdx;
2102 int py = pl_y + pdy; 2112 int py = pl_y + sdy;
2103 2113
2104 key.texname = tex.name; 2114 key.texname = tex.name;
2105 arr = rc_array (rc, &key); 2115 arr = rc_array (rc, &key);
2106 2116
2107 rc_t2f_v3f (arr, 0 , 0 , px , py , 0); 2117 rc_t2f_v3f (arr, 0 , 0 , px , py , 0);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines