Changeset 1647
- Timestamp:
- 02/06/12 03:29:30 (16 months ago)
- File:
-
- 1 edited
-
trunk/core/action_stack.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/action_stack.c
r1602 r1647 52 52 53 53 action_stack_t* stack = tmp[num_stacks]; 54 stack->action_process = proc_func; 54 if(proc_func) { 55 stack->action_process = proc_func; 56 } else { 57 stack->action_process = action_stack_standard; 58 } 59 55 60 stack->stack_ptr = 0; 56 61 stack->comp_id = task_comp_id; … … 184 189 { 185 190 /* setup timer */ 186 long action = action_get_prev(p); 187 /* delay of -1 signals indefinite (actually 1 day) delay*/ 188 action_stacks[active_stack]->delay_target_ticks = t+((action == -1)?86400000:action); 191 long delay = action_get_prev(p); 192 /* delay of -1 signals indefinite (actually 1 day) delay*/ 193 if(delay == -1) { 194 delay = 86400000; 195 } 196 action_stacks[active_stack]->delay_target_ticks = t+delay; 189 197 return 0; 190 198 } … … 204 212 // Can only be called from an action stack 205 213 int action_stack_standard(long p) 206 { 207 long t; 208 214 { 209 215 switch (p) 210 216 { … … 275 281 if (stack->stack_ptr > -1) 276 282 { 277 long stack_arg = action_get_prev(1); 278 if (stack->action_process) 279 stack->action_process(stack_arg); 280 else 281 action_stack_standard(stack_arg); 283 stack->action_process(action_get_prev(1)); 282 284 } 283 285 else … … 289 291 void action_stack_process_all() 290 292 { 291 int i; 292 for (i = num_stacks - 1; i >= 0; --i) 293 { 294 active_stack = i; 295 action_stack_process(i); 296 } 297 293 for (active_stack = num_stacks - 1; active_stack >= 0; --active_stack) 294 { 295 action_stack_process(active_stack); 296 } 297 298 298 active_stack = -1; 299 299 }
Note: See TracChangeset
for help on using the changeset viewer.