diff src/animate.c @ 47:f3818d996f4f

change interface of creating a animation action
author Thinker K.F. Li <thinker@branda.to>
date Sat, 09 Aug 2008 16:41:33 +0800
parents 46b77c92d118
children bdf711cbf0fb
line wrap: on
line diff
--- a/src/animate.c	Sat Aug 09 16:33:33 2008 +0800
+++ b/src/animate.c	Sat Aug 09 16:41:33 2008 +0800
@@ -120,7 +120,7 @@
     return word;
 }
 
-void mb_word_add_action(mb_word_t *word, mb_action_t *act) {
+static void mb_word_add_action(mb_word_t *word, mb_action_t *act) {
     STAILQ_INS_TAIL(word->actions, mb_action_t, next, act);
 }
 
@@ -323,7 +323,8 @@
     free(act);
 }
 
-mb_action_t *mb_shift_new(co_aix x, co_aix y, coord_t *coord) {
+mb_action_t *mb_shift_new(co_aix x, co_aix y, coord_t *coord,
+			  mb_word_t *word) {
     mb_shift_t *shift;
 
     shift = (mb_shift_t *)malloc(sizeof(mb_shift_t));
@@ -339,5 +340,7 @@
     shift->action.stop = mb_shift_stop;
     shift->action.free = mb_shift_free;
 
+    mb_word_add_action(word, (mb_action_t *)shift);
+
     return (mb_action_t *)shift;
 }