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

Comparing deliantra/server/server/cfperl.xs (file contents):
Revision 1.237 by root, Mon Jul 23 23:46:03 2007 UTC vs.
Revision 1.244 by root, Sat Aug 25 22:19:26 2007 UTC

1043 CALL_END; 1043 CALL_END;
1044 1044
1045 return can; 1045 return can;
1046} 1046}
1047 1047
1048player *
1049player::find (const char *name)
1050{
1051 CALL_BEGIN (1);
1052 CALL_ARG (name);
1053 CALL_CALL ("cf::player::find", G_SCALAR);
1054
1055 player *retval;
1056
1057 if (count)
1058 sv_to (POPs, retval);
1059 else
1060 retval = 0;
1061
1062 CALL_END;
1063
1064 return retval;
1065}
1066
1048maptile * 1067maptile *
1049maptile::find_sync (const char *path, maptile *origin) 1068maptile::find_sync (const char *path, maptile *origin)
1050{ 1069{
1051 CALL_BEGIN (2); 1070 CALL_BEGIN (2);
1052 CALL_ARG (path); 1071 CALL_ARG (path);
1064 1083
1065 return retval; 1084 return retval;
1066} 1085}
1067 1086
1068maptile * 1087maptile *
1069maptile::find_async (const char *path, maptile *origin) 1088maptile::find_async (const char *path, maptile *origin, bool load)
1070{ 1089{
1071 CALL_BEGIN (2); 1090 CALL_BEGIN (3);
1072 CALL_ARG (path); 1091 CALL_ARG (path);
1073 CALL_ARG (origin); 1092 CALL_ARG (origin);
1093 CALL_ARG (load);
1074 CALL_CALL ("cf::map::find_async", G_SCALAR); 1094 CALL_CALL ("cf::map::find_async", G_SCALAR);
1075 1095
1076 maptile *retval; 1096 maptile *retval;
1077 1097
1078 if (count) 1098 if (count)
1384 1404
1385 const_iv (NDI_BLACK) const_iv (NDI_WHITE) const_iv (NDI_NAVY) const_iv (NDI_RED) 1405 const_iv (NDI_BLACK) const_iv (NDI_WHITE) const_iv (NDI_NAVY) const_iv (NDI_RED)
1386 const_iv (NDI_ORANGE) const_iv (NDI_BLUE) const_iv (NDI_DK_ORANGE) const_iv (NDI_GREEN) 1406 const_iv (NDI_ORANGE) const_iv (NDI_BLUE) const_iv (NDI_DK_ORANGE) const_iv (NDI_GREEN)
1387 const_iv (NDI_LT_GREEN) const_iv (NDI_GREY) const_iv (NDI_BROWN) const_iv (NDI_GOLD) 1407 const_iv (NDI_LT_GREEN) const_iv (NDI_GREY) const_iv (NDI_BROWN) const_iv (NDI_GOLD)
1388 const_iv (NDI_TAN) const_iv (NDI_MAX_COLOR) const_iv (NDI_COLOR_MASK) const_iv (NDI_UNIQUE) 1408 const_iv (NDI_TAN) const_iv (NDI_MAX_COLOR) const_iv (NDI_COLOR_MASK) const_iv (NDI_UNIQUE)
1409 const_iv (NDI_ALL) const_iv (NDI_DEF) const_iv (NDI_REPLY) const_iv (NDI_CLIENT_MASK)
1389 const_iv (NDI_ALL) 1410 const_iv (NDI_NOCREATE)
1390 1411
1391 const_iv (UPD_LOCATION) const_iv (UPD_FLAGS) const_iv (UPD_WEIGHT) const_iv (UPD_FACE) 1412 const_iv (UPD_LOCATION) const_iv (UPD_FLAGS) const_iv (UPD_WEIGHT) const_iv (UPD_FACE)
1392 const_iv (UPD_NAME) const_iv (UPD_ANIM) const_iv (UPD_ANIMSPEED) const_iv (UPD_NROF) 1413 const_iv (UPD_NAME) const_iv (UPD_ANIM) const_iv (UPD_ANIMSPEED) const_iv (UPD_NROF)
1393 1414
1394 const_iv (UPD_SP_MANA) const_iv (UPD_SP_GRACE) const_iv (UPD_SP_DAMAGE) 1415 const_iv (UPD_SP_MANA) const_iv (UPD_SP_GRACE) const_iv (UPD_SP_DAMAGE)
1521 const_iv (SYMMETRY_Y) const_iv (SYMMETRY_XY) 1542 const_iv (SYMMETRY_Y) const_iv (SYMMETRY_XY)
1522 1543
1523 const_iv (GT_ENVIRONMENT) const_iv (GT_INVISIBLE) const_iv (GT_STARTEQUIP) 1544 const_iv (GT_ENVIRONMENT) const_iv (GT_INVISIBLE) const_iv (GT_STARTEQUIP)
1524 const_iv (GT_APPLY) const_iv (GT_ONLY_GOOD) const_iv (GT_UPDATE_INV) 1545 const_iv (GT_APPLY) const_iv (GT_ONLY_GOOD) const_iv (GT_UPDATE_INV)
1525 const_iv (GT_MINIMAL) 1546 const_iv (GT_MINIMAL)
1547
1548 const_iv (FT_FACE) const_iv (FT_MUSIC) const_iv (FT_SOUND)
1549 const_iv (FT_RSRC) const_iv (FT_NUM)
1526 }; 1550 };
1527 1551
1528 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) 1552 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; )
1529 newCONSTSUB (stash_cf, (char *)civ->name, newSViv (civ->iv)); 1553 newCONSTSUB (stash_cf, (char *)civ->name, newSViv (civ->iv));
1530 1554
1673octet_string path_combine (octet_string base, octet_string path) 1697octet_string path_combine (octet_string base, octet_string path)
1674 PROTOTYPE: $$ 1698 PROTOTYPE: $$
1675 1699
1676octet_string path_combine_and_normalize (octet_string base, octet_string path) 1700octet_string path_combine_and_normalize (octet_string base, octet_string path)
1677 PROTOTYPE: $$ 1701 PROTOTYPE: $$
1678
1679const_octet_string
1680get_maps_directory (octet_string path)
1681 PROTOTYPE: $
1682 ALIAS: maps_directory = 0
1683 CODE:
1684 RETVAL = create_pathname (path);
1685 OUTPUT: RETVAL
1686 1702
1687void 1703void
1688sub_generation_inc () 1704sub_generation_inc ()
1689 CODE: 1705 CODE:
1690 PL_sub_generation++; 1706 PL_sub_generation++;
1812#object *mortals (U32 index) 1828#object *mortals (U32 index)
1813# CODE: 1829# CODE:
1814# RETVAL = index < attachable::mortals.size () ? attachable::mortals [index] : 0; 1830# RETVAL = index < attachable::mortals.size () ? attachable::mortals [index] : 0;
1815# OUTPUT: RETVAL 1831# OUTPUT: RETVAL
1816 1832
1817INCLUDE: $PERL $srcdir/genacc attachable ../include/cfperl.h | 1833INCLUDE: $PERL $srcdir/genacc attachable ../include/util.h ../include/cfperl.h |
1818 1834
1819MODULE = cf PACKAGE = cf::global 1835MODULE = cf PACKAGE = cf::global
1820 1836
1821int invoke (SV *klass, int event, ...) 1837int invoke (SV *klass, int event, ...)
1822 CODE: 1838 CODE:
2148 pl->orig_stats = pl->ob->stats; 2164 pl->orig_stats = pl->ob->stats;
2149 2165
2150void clear_los (player *pl) 2166void clear_los (player *pl)
2151 2167
2152void cf_player_move (player *pl, int dir) 2168void cf_player_move (player *pl, int dir)
2153
2154void play_sound_player_only (player *pl, int soundnum, int x = 0, int y = 0);
2155 2169
2156bool 2170bool
2157cell_visible (player *pl, int dx, int dy) 2171cell_visible (player *pl, int dx, int dy)
2158 CODE: 2172 CODE:
2159 RETVAL = FABS (dx) <= pl->ns->mapx / 2 && FABS (dy) <= pl->ns->mapy / 2 2173 RETVAL = FABS (dx) <= pl->ns->mapx / 2 && FABS (dy) <= pl->ns->mapy / 2
2338 } 2352 }
2339 } 2353 }
2340 2354
2341 op->destroy (); 2355 op->destroy ();
2342} 2356}
2343
2344void play_sound_map (maptile *map, int x, int y, int sound_num)
2345 2357
2346int out_of_map (maptile *map, int x, int y) 2358int out_of_map (maptile *map, int x, int y)
2347 2359
2348void 2360void
2349trigger (maptile *map, long connection, bool state = true) 2361trigger (maptile *map, long connection, bool state = true)
2622 2634
2623 THIS->send_packet (buf, len); 2635 THIS->send_packet (buf, len);
2624} 2636}
2625 2637
2626faceidx 2638faceidx
2627client::find_face (utf8_string name, faceidx defidx = 0) 2639client::need_face (utf8_string name, int pri = 0)
2628 CODE: 2640 CODE:
2629 RETVAL = face_find (name, defidx); 2641 RETVAL = face_find (name, 0);
2642 if (RETVAL)
2643 {
2630 THIS->send_face (RETVAL); 2644 THIS->send_face (RETVAL, pri);
2631 THIS->flush_fx (); 2645 THIS->flush_fx ();
2646 }
2632 OUTPUT: 2647 OUTPUT:
2633 RETVAL 2648 RETVAL
2649
2650int
2651client::fx_want (int idx, int value = -1)
2652 CODE:
2653 if (0 < idx && idx < FT_NUM)
2654 {
2655 RETVAL = THIS->fx_want [idx];
2656 if (items > 2)
2657 THIS->fx_want [idx] = value;
2658 }
2659 else
2660 RETVAL = 0;
2661 OUTPUT:
2662 RETVAL
2663
2664MODULE = cf PACKAGE = cf::sound PREFIX = sound_
2665
2666faceidx sound_find (utf8_string name)
2667
2668void sound_set (utf8_string str, faceidx face)
2669
2670# dire hack
2671void old_sound_index (int idx, faceidx face)
2672 CODE:
2673 extern faceidx old_sound_index [SOUND_CAST_SPELL_0];
2674 old_sound_index [idx] = face;
2634 2675
2635MODULE = cf PACKAGE = cf::face PREFIX = face_ 2676MODULE = cf PACKAGE = cf::face PREFIX = face_
2636 2677
2637#INCLUDE: $PERL $srcdir/genacc faceset ../include/face.h | 2678#INCLUDE: $PERL $srcdir/genacc faceset ../include/face.h |
2638 2679

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines