| 682 | } |
| 683 | |
| 684 | bool JPAResource::calc(JPAEmitterWorkData *data, JPABaseEmitter *emitter) |
| 685 | { |
| 686 | data->mEmitter = emitter; |
| 687 | data->mResource = this; |
| 688 | data->mCreateNumber = 0; |
| 689 | |
| 690 | if (!emitter->processTillStartFrame()) { |
| 691 | return false; |
| 692 | } |
| 693 | |
| 694 | if (emitter->processTermination()) { |
| 695 | return true; |
| 696 | } |
| 697 | |
| 698 | if (emitter->checkStatus(JPAEMIT_StopCalc)) { |
| 699 | if (emitter->mEmitterCallback) { |
| 700 | emitter->mEmitterCallback->execute(emitter); |
| 701 | if (emitter->checkStatus(JPAEMIT_ForceDelete)) { |
| 702 | return true; |
| 703 | } |
| 704 | emitter->mEmitterCallback->executeAfter(emitter); |
| 705 | if (emitter->checkStatus(JPAEMIT_ForceDelete)) { |
| 706 | return true; |
| 707 | } |
| 708 | } |
| 709 | |
| 710 | } else { |
| 711 | calcKey(data); |
| 712 | |
| 713 | for (int i = fldNum - 1; i >= 0; i--) { |
| 714 | ppFld[i]->initOpParam(); |
| 715 | } |
| 716 | |
| 717 | if (emitter->mEmitterCallback) { |
| 718 | emitter->mEmitterCallback->execute(emitter); |
| 719 | if (emitter->checkStatus(JPAEMIT_ForceDelete)) { |
| 720 | return true; |
| 721 | } |
| 722 | } |
| 723 | |
| 724 | calcWorkData_c(data); |
| 725 | |
| 726 | for (int i = mCalcEmitterFuncListNum - 1; i >= 0; i--) { |
| 727 | (*mCalcEmitterFuncList[i])(data); |
| 728 | } |
| 729 | |
| 730 | for (int i = fldNum - 1; i >= 0; i--) { |
| 731 | ppFld[i]->prepare(data); |
| 732 | } |
| 733 | |
| 734 | if (!emitter->checkStatus(JPAEMIT_EnableDeleteEmitter)) { |
| 735 | pDyn->create(data); |
| 736 | } |
| 737 | |
| 738 | if (emitter->mEmitterCallback) { |
| 739 | emitter->mEmitterCallback->executeAfter(emitter); |
| 740 | if (emitter->checkStatus(JPAEMIT_ForceDelete)) { |
| 741 | return true; |
no test coverage detected