… | |
… | |
3562 | or cf::cleanup "$path: version mismatch, cannot proceed."; |
3562 | or cf::cleanup "$path: version mismatch, cannot proceed."; |
3563 | |
3563 | |
3564 | cf::cede_to_tick; |
3564 | cf::cede_to_tick; |
3565 | |
3565 | |
3566 | { |
3566 | { |
3567 | my $faces = $facedata->{faceinfo}; |
3567 | my $faces = delete $facedata->{faceinfo}; |
3568 | |
3568 | |
3569 | for my $face (sort keys %$faces) { |
3569 | for my $face (sort keys %$faces) { |
3570 | my $info = $faces->{$face}; |
3570 | my $info = $faces->{$face}; |
3571 | my $idx = (cf::face::find $face) || cf::face::alloc $face; |
3571 | my $idx = (cf::face::find $face) || cf::face::alloc $face; |
3572 | |
3572 | |
… | |
… | |
3574 | cf::face::set_magicmap $idx, $info->{magicmap}; |
3574 | cf::face::set_magicmap $idx, $info->{magicmap}; |
3575 | cf::face::set_data $idx, 0, $info->{data32}, $info->{hash32}; |
3575 | cf::face::set_data $idx, 0, $info->{data32}, $info->{hash32}; |
3576 | cf::face::set_data $idx, 1, $info->{data64}, $info->{hash64}; |
3576 | cf::face::set_data $idx, 1, $info->{data64}, $info->{hash64}; |
3577 | cf::face::set_data $idx, 2, $info->{glyph} , $info->{glyph} ; |
3577 | cf::face::set_data $idx, 2, $info->{glyph} , $info->{glyph} ; |
3578 | $FACEHASH{$info->{hash64}} = $idx;#d# |
3578 | $FACEHASH{$info->{hash64}} = $idx;#d# |
3579 | |
3579 | |
3580 | cf::cede_to_tick; |
3580 | cf::cede_to_tick; |
3581 | } |
3581 | } |
3582 | |
3582 | |
3583 | while (my ($face, $info) = each %$faces) { |
3583 | while (my ($face, $info) = each %$faces) { |
3584 | next unless $info->{smooth}; |
3584 | next unless $info->{smooth}; |
… | |
… | |
3596 | cf::cede_to_tick; |
3596 | cf::cede_to_tick; |
3597 | } |
3597 | } |
3598 | } |
3598 | } |
3599 | |
3599 | |
3600 | { |
3600 | { |
3601 | my $anims = $facedata->{animinfo}; |
3601 | my $anims = delete $facedata->{animinfo}; |
3602 | |
3602 | |
3603 | while (my ($anim, $info) = each %$anims) { |
3603 | while (my ($anim, $info) = each %$anims) { |
3604 | cf::anim::set $anim, $info->{frames}, $info->{facings}; |
3604 | cf::anim::set $anim, $info->{frames}, $info->{facings}; |
3605 | cf::cede_to_tick; |
3605 | cf::cede_to_tick; |
3606 | } |
3606 | } |
3607 | |
3607 | |
3608 | cf::anim::invalidate_all; # d'oh |
3608 | cf::anim::invalidate_all; # d'oh |
3609 | } |
3609 | } |
3610 | |
3610 | |
3611 | { |
3611 | { |
3612 | my $res = $facedata->{resource}; |
3612 | my $res = delete $facedata->{resource}; |
3613 | |
3613 | |
3614 | while (my ($name, $info) = each %$res) { |
3614 | while (my ($name, $info) = each %$res) { |
3615 | if (defined (my $type = $info->{type})) { |
3615 | if (defined (my $type = $info->{type})) { |
3616 | # TODO: different hash - must free and use new index, or cache ixface data queue |
3616 | # TODO: different hash - must free and use new index, or cache ixface data queue |
3617 | my $idx = (cf::face::find $name) || cf::face::alloc $name; |
3617 | my $idx = (cf::face::find $name) || cf::face::alloc $name; |