| 109 | } |
| 110 | |
| 111 | void afxEffectVector::effects_init(afxChoreographer* chor, afxEffectList& effects, bool will_stop, F32 time_factor, |
| 112 | S32 group_index, const afxGroupTimingData* group_timing) |
| 113 | { |
| 114 | afxConstraintMgr* cons_mgr = chor->getConstraintMgr(); |
| 115 | |
| 116 | for (S32 i = 0; i < effects.size(); i++) |
| 117 | { |
| 118 | if (dynamic_cast<afxEffectGroupData*>(effects[i])) |
| 119 | { |
| 120 | afxEffectGroupData* eg = (afxEffectGroupData*)effects[i]; |
| 121 | if (eg->getSubstitutionCount() > 0) |
| 122 | { |
| 123 | // clone the datablock and perform substitutions |
| 124 | afxEffectGroupData* orig_db = eg; |
| 125 | eg = new afxEffectGroupData(*orig_db, true); |
| 126 | orig_db->performSubstitutions(eg, chor, group_index); |
| 127 | } |
| 128 | |
| 129 | if (eg->group_enabled) |
| 130 | { |
| 131 | if (eg->assign_idx) |
| 132 | { |
| 133 | for (S32 j = 0; j < eg->group_count; j++) |
| 134 | effects_init(chor, eg->fx_list, will_stop, time_factor, j+eg->idx_offset, &eg->timing); |
| 135 | } |
| 136 | else |
| 137 | { |
| 138 | for (S32 j = 0; j < eg->group_count; j++) |
| 139 | effects_init(chor, eg->fx_list, will_stop, time_factor, group_index, &eg->timing); |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | if (eg->isTempClone()) |
| 144 | delete eg; |
| 145 | } |
| 146 | else if (dynamic_cast<afxEffectWrapperData*>(effects[i])) |
| 147 | { |
| 148 | afxEffectWrapperData* ewd = (afxEffectWrapperData*)effects[i]; |
| 149 | |
| 150 | if (ewd->getSubstitutionCount() > 0) |
| 151 | { |
| 152 | // clone the ewd and perform substitutions |
| 153 | afxEffectWrapperData* orig_db = ewd; |
| 154 | ewd = new afxEffectWrapperData(*orig_db, true); |
| 155 | orig_db->performSubstitutions(ewd, chor, group_index); |
| 156 | } |
| 157 | |
| 158 | if (ewd->effect_enabled) |
| 159 | { |
| 160 | static afxEffectTimingData inherited_timing; |
| 161 | bool use_inherited_timing = false; |
| 162 | if (ewd->inherit_timing != 0) |
| 163 | { |
| 164 | if (group_timing) |
| 165 | { |
| 166 | inherited_timing = ewd->ewd_timing; |
| 167 | if ((ewd->inherit_timing & afxEffectDefs::TIMING_DELAY) != 0) |
| 168 | inherited_timing.delay = group_timing->delay; |
nothing calls this directly
no test coverage detected