- Timestamp:
- 02/06/12 03:31:18 (16 months ago)
- File:
-
- 1 edited
-
trunk/core/action_stack.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/action_stack.c
r1647 r1648 33 33 return 0; 34 34 } 35 35 36 36 return 1; 37 37 } … … 44 44 if (num_stacks == MAX_ACTION_STACKS) 45 45 return -1; 46 46 47 47 // Initialize new action stack 48 48 action_stack_t** tmp = (action_stack_t**)malloc(sizeof(action_stack_t*) * (num_stacks + 1)); … … 50 50 51 51 tmp[num_stacks] = (action_stack_t*)malloc(sizeof(action_stack_t)); 52 52 53 53 action_stack_t* stack = tmp[num_stacks]; 54 54 if(proc_func) { … … 61 61 stack->comp_id = task_comp_id; 62 62 stack->delay_target_ticks = 0; 63 stack->stack[0] = p; 63 stack->stack[0] = p; 64 64 65 65 action_stack_t** old = action_stacks; 66 66 action_stacks = tmp; 67 67 ++num_stacks; 68 68 69 69 if (old != NULL) 70 70 free(old); 71 72 // Increment task_comp_id, handle wraparound, 71 72 // Increment task_comp_id, handle wraparound, 73 73 // and do not take values already in use 74 74 do … … 86 86 if (num_stacks > 1) 87 87 tmp = (action_stack_t**)malloc(sizeof(action_stack_t*) * (num_stacks - 1)); 88 88 89 89 int src_index, dst_index; 90 90 for (src_index = 0, dst_index = 0; src_index < num_stacks; ++src_index) … … 100 100 } 101 101 } 102 102 103 103 action_stack_t** old = action_stacks; 104 104 --num_stacks; … … 112 112 if (active_stack == -1) 113 113 return; 114 114 115 115 --(action_stacks[active_stack]->stack_ptr); 116 116 } … … 145 145 // WARNING stack program flow is reversed 146 146 action_push_release(key); 147 #if defined(CAM_KEY_CLICK_DELAY) // camera need delay for click 148 action_push_delay(CAM_KEY_CLICK_DELAY); 149 #endif 147 #if defined(CAM_KEY_CLICK_DELAY) // camera need delay for click 148 action_push_delay(CAM_KEY_CLICK_DELAY); 149 #endif 150 150 action_push_press(key); 151 151 } … … 165 165 166 166 action_stack_t* task = action_stacks[active_stack]; 167 task->stack[++task->stack_ptr] = p; 167 task->stack[++task->stack_ptr] = p; 168 168 } 169 169 … … 244 244 if(action_process_delay(2) || (kbd_last_clicked = kbd_get_clicked_key())) 245 245 { 246 if (!kbd_last_clicked) 246 if (!kbd_last_clicked) 247 247 kbd_last_clicked=0xFFFF; 248 248 action_clear_delay(); … … 272 272 return 0; 273 273 } 274 274 275 275 return 1; 276 276 }
Note: See TracChangeset
for help on using the changeset viewer.