… | |
… | |
2522 | THIS->send_packet (buf, len); |
2522 | THIS->send_packet (buf, len); |
2523 | } |
2523 | } |
2524 | |
2524 | |
2525 | MODULE = cf PACKAGE = cf::face PREFIX = face_ |
2525 | MODULE = cf PACKAGE = cf::face PREFIX = face_ |
2526 | |
2526 | |
2527 | INCLUDE: $PERL $srcdir/genacc faceset ../include/face.h | |
2527 | #INCLUDE: $PERL $srcdir/genacc faceset ../include/face.h | |
2528 | |
2528 | |
2529 | faceidx face_find (utf8_string name, faceidx defidx = 0) |
2529 | faceidx face_find (utf8_string name, faceidx defidx = 0) |
2530 | |
2530 | |
2531 | faceidx alloc (utf8_string name) |
2531 | faceidx alloc (utf8_string name) |
2532 | CODE: |
2532 | CODE: |
… | |
… | |
2597 | { |
2597 | { |
2598 | ns->faces_sent.reset (); |
2598 | ns->faces_sent.reset (); |
2599 | ns->force_newmap = true; |
2599 | ns->force_newmap = true; |
2600 | } |
2600 | } |
2601 | |
2601 | |
|
|
2602 | MODULE = cf PACKAGE = cf::anim PREFIX = anim_ |
|
|
2603 | |
|
|
2604 | #INCLUDE: $PERL $srcdir/genacc faceset ../include/anim.h | |
|
|
2605 | |
|
|
2606 | animidx anim_find (utf8_string name) |
|
|
2607 | CODE: |
|
|
2608 | RETVAL = animation::find (name).number; |
|
|
2609 | OUTPUT: RETVAL |
|
|
2610 | |
|
|
2611 | animidx set (utf8_string name, SV *frames, int facings = 1) |
|
|
2612 | CODE: |
|
|
2613 | { |
|
|
2614 | if (!SvROK (frames) && SvTYPE (SvRV (frames)) != SVt_PVAV) |
|
|
2615 | croak ("frames must be an arrayref"); |
|
|
2616 | |
|
|
2617 | AV *av = (AV *)SvRV (frames); |
|
|
2618 | |
|
|
2619 | animation *anim = &animation::find (name); |
|
|
2620 | if (anim->number) |
|
|
2621 | { |
|
|
2622 | anim->resize (av_len (av) + 1); |
|
|
2623 | anim->facings = facings; |
|
|
2624 | } |
|
|
2625 | else |
|
|
2626 | anim = &animation::create (name, av_len (av) + 1, facings); |
|
|
2627 | |
|
|
2628 | for (int i = 0; i < anim->num_animations; ++i) |
|
|
2629 | anim->faces [i] = face_find (SvPVutf8_nolen (*av_fetch (av, i, 1))); |
|
|
2630 | } |
|
|
2631 | OUTPUT: RETVAL |
|
|
2632 | |
|
|
2633 | void invalidate_all () |
|
|
2634 | CODE: |
|
|
2635 | for_all_clients (ns) |
|
|
2636 | ns->anims_sent.reset (); |
|
|
2637 | |