ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/plugins/cfperl/cfperl.xs
(Generate patch)

Comparing deliantra/server/plugins/cfperl/cfperl.xs (file contents):
Revision 1.53 by root, Sun Jun 11 15:02:16 2006 UTC vs.
Revision 1.54 by root, Mon Jun 12 13:25:27 2006 UTC

1644player *next (player *pl) 1644player *next (player *pl)
1645 CODE: 1645 CODE:
1646 RETVAL = pl->next; 1646 RETVAL = pl->next;
1647 OUTPUT: RETVAL 1647 OUTPUT: RETVAL
1648 1648
1649bool
1650cell_visible (player *pl, int dx, int dy)
1651 CODE:
1652 RETVAL = FABS (dx) <= pl->socket.mapx / 2 && FABS (dy) <= pl->socket.mapy / 2
1653 && !pl->blocked_los [dx + pl->socket.mapx / 2][dy + pl->socket.mapy / 2];
1654 OUTPUT:
1655 RETVAL
1656
1649void 1657void
1650send (player *pl, SV *packet) 1658send (player *pl, SV *packet)
1651 CODE: 1659 CODE:
1652{ 1660{
1653 STRLEN len; 1661 STRLEN len;
1778object *cf_map_insert_object (mapstruct *where, object* op, int x, int y) 1786object *cf_map_insert_object (mapstruct *where, object* op, int x, int y)
1779 1787
1780object* cf_map_present_arch_by_name (mapstruct *map, const char* str, int nx, int ny) 1788object* cf_map_present_arch_by_name (mapstruct *map, const char* str, int nx, int ny)
1781 C_ARGS: str, map, nx, ny 1789 C_ARGS: str, map, nx, ny
1782 1790
1783#int cf_map_get_flags (mapstruct* map, mapstruct** nmap, I16 x, I16 y, I16 *nx, I16 *ny)
1784
1785void 1791void
1792cf_map_normalise (mapstruct *map, int x, int y)
1793 PPCODE:
1794{
1795 mapstruct *nmap = 0;
1796 I16 nx = 0, ny = 0;
1797 int flags = cf_map_get_flags (map, &nmap, x, y, &nx, &ny);
1798
1799 EXTEND (SP, 4);
1800 PUSHs (sv_2mortal (newSViv (flags)));
1801
1802 if (GIMME_V == G_ARRAY)
1803 {
1804 PUSHs (sv_2mortal (newSVcfapi (CFAPI_PMAP, nmap)));
1805 PUSHs (sv_2mortal (newSViv (nx)));
1806 PUSHs (sv_2mortal (newSViv (ny)));
1807 }
1808}
1809
1810void
1786at (mapstruct *obj, unsigned int x, unsigned int y) 1811at (mapstruct *map, unsigned int x, unsigned int y)
1787 PROTOTYPE: $$$ 1812 PROTOTYPE: $$$
1788 INIT:
1789 if (x >= MAP_WIDTH (obj) || y >= MAP_HEIGHT (obj)) XSRETURN_EMPTY;
1790 PPCODE: 1813 PPCODE:
1791{ 1814{
1792 object *o; 1815 object *o;
1793 1816 mapstruct *nmap = 0;
1817 I16 nx, ny;
1818
1819 cf_map_get_flags (map, &nmap, x, y, &nx, &ny);
1820
1821 if (nmap)
1794 for (o = GET_MAP_OB (obj, x, y); o; o = o->above) 1822 for (o = GET_MAP_OB (nmap, nx, ny); o; o = o->above)
1795 XPUSHs (sv_2mortal (newSVcfapi (CFAPI_POBJECT, o))); 1823 XPUSHs (sv_2mortal (newSVcfapi (CFAPI_POBJECT, o)));
1796} 1824}
1797 1825
1798SV * 1826SV *
1799bot_at (mapstruct *obj, unsigned int x, unsigned int y) 1827bot_at (mapstruct *obj, unsigned int x, unsigned int y)
1800 PROTOTYPE: $$$ 1828 PROTOTYPE: $$$

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines