Mercurial > MadButterfly
annotate src/mbaf/animated_menu.c @ 935:960e2395973d
Fix the bug of crash by abort() when running testsvg.js.
The cached coords their pcache areas should be recomputed are also add
ro zeroing list. They have no dirty areas. But, their pcache area
must be added to parent cached coord.
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Fri, 12 Nov 2010 16:03:19 +0800 |
parents | 152bc503dc99 |
children | dffecd62817c |
rev | line source |
---|---|
822
586e50f82c1f
Unify coding style tag for emacs and vim.
Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com>
parents:
757
diff
changeset
|
1 // -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 4; -*- |
586e50f82c1f
Unify coding style tag for emacs and vim.
Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com>
parents:
757
diff
changeset
|
2 // vim: sw=4:ts=8:sts=4 |
318 | 3 #include <stdio.h> |
4 #include <mb.h> | |
5 #include <string.h> | |
325 | 6 //#include "menu.h" |
456
26c302b47de1
Change name of header files.
Thinker K.F. Li <thinker@branda.to>
parents:
455
diff
changeset
|
7 #include "mb_af.h" |
26c302b47de1
Change name of header files.
Thinker K.F. Li <thinker@branda.to>
parents:
455
diff
changeset
|
8 #include "mb_ani_menu.h" |
344 | 9 static void mb_animated_menu_update(mb_animated_menu_t *m); |
318 | 10 static void set_text(coord_t *g, char *text) |
11 { | |
12 geo_t *geo; | |
13 shape_t *shape; | |
14 | |
15 FOR_COORD_MEMBERS(g, geo) { | |
16 shape = geo_get_shape(geo); | |
922
152bc503dc99
Conditional compile for sh_text in mbaf
Thinker K.F. Li <thinker@codemud.net>
parents:
822
diff
changeset
|
17 #ifdef SH_TEXT |
318 | 18 if(shape->obj.obj_type == MBO_TEXT) { |
19 sh_text_set_text(shape, text); | |
20 } | |
922
152bc503dc99
Conditional compile for sh_text in mbaf
Thinker K.F. Li <thinker@codemud.net>
parents:
822
diff
changeset
|
21 #endif |
318 | 22 } |
23 } | |
24 | |
25 static void mb_animated_menu_fillMenuContent(mb_animated_menu_t *m) | |
26 { | |
27 int i; | |
28 coord_t *textgroup; | |
29 coord_t *group; | |
30 coord_t *lightbar; | |
31 | |
32 // fill new item | |
33 for(i=0;i<8;i++) { | |
34 group = (coord_t *) m->objects[m->items[i]]; | |
35 if (i < m->max) | |
36 set_text(group, m->titles[m->top+i]); | |
37 else | |
38 set_text(group, ""); | |
454
9b8dda201ccb
Make naming convention consistent with MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents:
368
diff
changeset
|
39 rdman_coord_changed(MBAF_RDMAN(m->app),group); |
318 | 40 } |
41 | |
42 | |
43 textgroup = (coord_t *) m->objects[m->items[i]]; | |
44 coord_hide(textgroup); | |
454
9b8dda201ccb
Make naming convention consistent with MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents:
368
diff
changeset
|
45 rdman_coord_changed(MBAF_RDMAN(m->app),textgroup); |
318 | 46 |
47 lightbar = (coord_t *) m->lightbar; | |
48 group = (coord_t *) m->objects[m->cur]; | |
49 coord_y(lightbar) = coord_y(group); | |
454
9b8dda201ccb
Make naming convention consistent with MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents:
368
diff
changeset
|
50 rdman_coord_changed(MBAF_RDMAN(m->app),lightbar); |
9b8dda201ccb
Make naming convention consistent with MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents:
368
diff
changeset
|
51 rdman_redraw_changed(MBAF_RDMAN(m->app)); |
318 | 52 } |
53 | |
54 static void mb_animated_menu_complete(event_t *ev,void *arg) | |
55 { | |
56 mb_animated_menu_t *m = (mb_animated_menu_t *) arg; | |
57 | |
58 m->ready++; | |
59 } | |
60 | |
61 static void mb_animated_menu_fillMenuContentUp(mb_animated_menu_t *m) | |
62 { | |
63 int i; | |
64 coord_t *textgroup; | |
65 coord_t *group; | |
66 coord_t *lightbar; | |
67 int tmp; | |
68 mb_timeval_t start, playing, now; | |
69 mb_progm_t *progm; | |
70 mb_word_t *word; | |
71 | |
72 | |
73 // fill new item | |
74 group = (coord_t *) m->objects[m->items[8]]; | |
75 set_text(group, m->titles[m->top]); | |
76 | |
454
9b8dda201ccb
Make naming convention consistent with MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents:
368
diff
changeset
|
77 m->progm = progm = mb_progm_new(2, MBAF_RDMAN(m->app)); |
318 | 78 MB_TIMEVAL_SET(&start, 0, 0); |
79 MB_TIMEVAL_SET(&playing, 0, m->speed); | |
80 word = mb_progm_next_word(progm, &start, &playing); | |
81 get_now(&now); | |
82 | |
83 for(i=0;i<7;i++) { | |
84 //shift to the next item | |
85 textgroup = (coord_t *) m->objects[m->items[i]]; | |
86 mb_shift_new(0,m->menus_y[i+1]-coord_y(textgroup), textgroup,word); | |
87 } | |
88 // fade out the item[7] | |
89 textgroup = (coord_t *) m->objects[m->items[7]]; | |
90 mb_shift_new(0,100, textgroup,word); | |
91 | |
92 // fade in the item[8] | |
93 textgroup = (coord_t *) m->objects[m->items[8]]; | |
94 group = (coord_t *) m->objects[m->items[0]]; | |
95 coord_y(textgroup) = m->menus_y[0]-100; | |
96 coord_show(textgroup); | |
97 mb_shift_new(0,100, textgroup,word); | |
98 | |
99 lightbar = (coord_t *) m->lightbar; | |
100 mb_shift_new(0,m->menus_y[m->cur]-coord_y(lightbar),lightbar,word); | |
822
586e50f82c1f
Unify coding style tag for emacs and vim.
Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com>
parents:
757
diff
changeset
|
101 |
318 | 102 MB_TIMEVAL_SET(&start, 0, m->speed); |
103 MB_TIMEVAL_SET(&playing, 0, 0); | |
104 word = mb_progm_next_word(progm, &start, &playing); | |
105 textgroup = (coord_t *) m->objects[m->items[7]]; | |
106 mb_visibility_new(VIS_HIDDEN, textgroup,word); | |
107 | |
108 mb_progm_free_completed(progm); | |
109 m->ready--; | |
110 subject_add_observer(mb_progm_get_complete(progm), mb_animated_menu_complete,m); | |
454
9b8dda201ccb
Make naming convention consistent with MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents:
368
diff
changeset
|
111 mb_progm_start(progm, X_MB_tman(MBAF_RDMAN(m->app)->rt), &now); |
9b8dda201ccb
Make naming convention consistent with MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents:
368
diff
changeset
|
112 rdman_redraw_changed(MBAF_RDMAN(m->app)); |
318 | 113 tmp = m->items[8]; |
114 for(i=8;i>0;i--) { | |
115 m->items[i] = m->items[i-1]; | |
116 } | |
117 m->items[0] = tmp; | |
118 } | |
119 | |
120 | |
121 static void mb_animated_menu_fillMenuContentDown(mb_animated_menu_t *m) | |
122 { | |
123 int i; | |
124 int tmp; | |
125 mb_timeval_t start, playing, now; | |
126 mb_progm_t *progm; | |
127 mb_word_t *word; | |
128 | |
129 | |
130 // fill new item | |
131 set_text((coord_t *)m->objects[m->items[8]], m->titles[m->top+7]); | |
132 | |
454
9b8dda201ccb
Make naming convention consistent with MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents:
368
diff
changeset
|
133 m->progm = progm = mb_progm_new(2, MBAF_RDMAN(m->app)); |
318 | 134 MB_TIMEVAL_SET(&start, 0, 0); |
135 MB_TIMEVAL_SET(&playing, 0, m->speed); | |
136 word = mb_progm_next_word(progm, &start, &playing); | |
137 get_now(&now); | |
138 | |
139 for(i=1;i<8;i++) { | |
140 //shift to the next item | |
141 mb_shift_new(0,m->menus_y[i-1]-coord_y((coord_t *)m->objects[m->items[i]]), (coord_t *) m->objects[m->items[i]],word); | |
142 } | |
143 // fade out the item[0] | |
144 mb_shift_new(0,-100, (coord_t *)m->objects[m->items[0]],word); | |
145 | |
146 // fade in the item[8] | |
147 coord_y((coord_t *)m->objects[m->items[8]]) = m->menus_y[7]+100; | |
148 coord_show(((coord_t *)(m->objects[m->items[8]]))); | |
149 mb_shift_new(0,-100, (coord_t *)m->objects[m->items[8]],word); | |
150 | |
151 mb_shift_new(0,m->menus_y[m->cur]-coord_y((coord_t *)m->lightbar),((coord_t *)(m->lightbar)),word); | |
152 | |
153 MB_TIMEVAL_SET(&start, 0, m->speed); | |
154 MB_TIMEVAL_SET(&playing, 0, 0); | |
155 word = mb_progm_next_word(progm, &start, &playing); | |
156 mb_visibility_new(VIS_VISIBLE, (coord_t *) m->objects[m->items[0]],word); | |
157 | |
158 mb_progm_free_completed(progm); | |
159 m->ready--; | |
160 subject_add_observer(mb_progm_get_complete(progm), mb_animated_menu_complete,m); | |
454
9b8dda201ccb
Make naming convention consistent with MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents:
368
diff
changeset
|
161 mb_progm_start(progm, X_MB_tman(MBAF_RDMAN(m->app)->rt), &now); |
9b8dda201ccb
Make naming convention consistent with MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents:
368
diff
changeset
|
162 rdman_redraw_changed(MBAF_RDMAN(m->app)); |
318 | 163 tmp = m->items[0]; |
164 for(i=0;i<8;i++) { | |
165 m->items[i] = m->items[i+1]; | |
166 } | |
167 m->items[8] = tmp; | |
168 } | |
169 | |
170 void mb_animated_menu_moveLightBar(mb_animated_menu_t *m) | |
171 { | |
172 mb_timeval_t start, playing, now; | |
173 mb_progm_t *progm; | |
174 mb_word_t *word; | |
175 coord_t *lightbar; | |
176 | |
454
9b8dda201ccb
Make naming convention consistent with MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents:
368
diff
changeset
|
177 m->progm = progm = mb_progm_new(1, MBAF_RDMAN(m->app)); |
318 | 178 MB_TIMEVAL_SET(&start, 0, 0); |
179 MB_TIMEVAL_SET(&playing, 0, m->speed); | |
180 word = mb_progm_next_word(progm, &start, &playing); | |
181 get_now(&now); | |
182 | |
183 lightbar = (coord_t *) m->lightbar; | |
184 mb_shift_new(0,m->menus_y[m->cur]-coord_y(lightbar),lightbar,word); | |
185 mb_progm_free_completed(progm); | |
186 m->ready--; | |
187 subject_add_observer(mb_progm_get_complete(progm), mb_animated_menu_complete,m); | |
454
9b8dda201ccb
Make naming convention consistent with MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents:
368
diff
changeset
|
188 mb_progm_start(progm, X_MB_tman(MBAF_RDMAN(m->app)->rt), &now); |
9b8dda201ccb
Make naming convention consistent with MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents:
368
diff
changeset
|
189 rdman_redraw_changed(MBAF_RDMAN(m->app)); |
318 | 190 } |
191 | |
192 static void mb_animated_menu_up(mb_animated_menu_t *m) | |
193 { | |
194 if (m->cur > 5) { | |
195 m->cur--; | |
196 mb_animated_menu_moveLightBar(m); | |
344 | 197 mb_animated_menu_update(m); |
318 | 198 } else { |
199 if (m->top > 0) { | |
200 m->top--; | |
201 mb_animated_menu_fillMenuContentUp(m); | |
344 | 202 mb_animated_menu_update(m); |
318 | 203 } else { |
822
586e50f82c1f
Unify coding style tag for emacs and vim.
Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com>
parents:
757
diff
changeset
|
204 if (m->cur == 0) |
318 | 205 return; |
206 m->cur--; | |
207 mb_animated_menu_moveLightBar(m); | |
344 | 208 mb_animated_menu_update(m); |
318 | 209 } |
210 } | |
211 } | |
212 static void mb_animated_menu_down(mb_animated_menu_t *m) | |
213 { | |
214 | |
215 if (m->cur < 5) { | |
216 if (m->top+m->cur <= m->max) { | |
217 m->cur++; | |
218 mb_animated_menu_moveLightBar(m); | |
344 | 219 mb_animated_menu_update(m); |
318 | 220 } |
221 } else { | |
222 if ((m->top+8) < m->max-1) { | |
223 m->top++; | |
224 mb_animated_menu_fillMenuContentDown(m); | |
344 | 225 mb_animated_menu_update(m); |
318 | 226 } else { |
227 if (m->cur+m->top < m->max-1) { | |
228 m->cur++; | |
229 mb_animated_menu_moveLightBar(m); | |
344 | 230 mb_animated_menu_update(m); |
318 | 231 } else |
232 return; | |
233 } | |
234 } | |
235 } | |
236 | |
344 | 237 void mb_animated_menu_set_update_callback(mb_animated_menu_t *m, void (*f)(mb_animated_menu_t *m, int sel)) |
238 { | |
239 m->update_callback = f; | |
240 } | |
318 | 241 void mb_animated_menu_set_callback(mb_animated_menu_t *m, void (*f)(mb_animated_menu_t *m, int sel)) |
242 { | |
243 m->callback = f; | |
244 } | |
344 | 245 static void mb_animated_menu_update(mb_animated_menu_t *m) |
246 { | |
247 if (m->update_callback) | |
248 m->update_callback(m,m->top+m->cur); | |
249 | |
250 } | |
318 | 251 static void mb_animated_menu_select(mb_animated_menu_t *m) |
252 { | |
253 if (m->callback) | |
254 m->callback(m,m->top+m->cur); | |
255 } | |
256 | |
332
f90c60967a9c
Add mb_progm_finish to terminate the current animation and put all objects in the final position.
wycc
parents:
329
diff
changeset
|
257 // Send the pending key in the animation progm complete callback |
f90c60967a9c
Add mb_progm_finish to terminate the current animation and put all objects in the final position.
wycc
parents:
329
diff
changeset
|
258 static void mb_animated_menu_keyHandler(event_t *ev, void *arg); |
f90c60967a9c
Add mb_progm_finish to terminate the current animation and put all objects in the final position.
wycc
parents:
329
diff
changeset
|
259 static void mb_animated_menu_send_pending_key(event_t *ev,void *arg) |
f90c60967a9c
Add mb_progm_finish to terminate the current animation and put all objects in the final position.
wycc
parents:
329
diff
changeset
|
260 { |
f90c60967a9c
Add mb_progm_finish to terminate the current animation and put all objects in the final position.
wycc
parents:
329
diff
changeset
|
261 mb_animated_menu_t *m = (mb_animated_menu_t *) arg; |
455
58b6337fb3b2
Fix bugs of pending keys of animated menu.
Thinker K.F. Li <thinker@branda.to>
parents:
454
diff
changeset
|
262 X_kb_event_t *xkey; |
822
586e50f82c1f
Unify coding style tag for emacs and vim.
Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com>
parents:
757
diff
changeset
|
263 |
455
58b6337fb3b2
Fix bugs of pending keys of animated menu.
Thinker K.F. Li <thinker@branda.to>
parents:
454
diff
changeset
|
264 xkey = &m->pending_keys[m->pending_pos]; |
58b6337fb3b2
Fix bugs of pending keys of animated menu.
Thinker K.F. Li <thinker@branda.to>
parents:
454
diff
changeset
|
265 m->pending_pos = (m->pending_pos + 1) & 0xf; |
58b6337fb3b2
Fix bugs of pending keys of animated menu.
Thinker K.F. Li <thinker@branda.to>
parents:
454
diff
changeset
|
266 mb_animated_menu_keyHandler((event_t *) xkey, m); |
332
f90c60967a9c
Add mb_progm_finish to terminate the current animation and put all objects in the final position.
wycc
parents:
329
diff
changeset
|
267 } |
318 | 268 static void mb_animated_menu_keyHandler(event_t *ev, void *arg) |
269 { | |
270 mb_animated_menu_t *m = (mb_animated_menu_t *) arg; | |
271 X_kb_event_t *xkey = (X_kb_event_t *)ev; | |
272 if(xkey->event.type != EVT_KB_PRESS) { | |
273 return; | |
274 } | |
332
f90c60967a9c
Add mb_progm_finish to terminate the current animation and put all objects in the final position.
wycc
parents:
329
diff
changeset
|
275 if (m->ready<=0) { |
455
58b6337fb3b2
Fix bugs of pending keys of animated menu.
Thinker K.F. Li <thinker@branda.to>
parents:
454
diff
changeset
|
276 m->pending_keys[m->pending_last++] = *xkey; |
58b6337fb3b2
Fix bugs of pending keys of animated menu.
Thinker K.F. Li <thinker@branda.to>
parents:
454
diff
changeset
|
277 m->pending_last &= 0xf; |
58b6337fb3b2
Fix bugs of pending keys of animated menu.
Thinker K.F. Li <thinker@branda.to>
parents:
454
diff
changeset
|
278 if(m->pending_last == m->pending_pos) |
58b6337fb3b2
Fix bugs of pending keys of animated menu.
Thinker K.F. Li <thinker@branda.to>
parents:
454
diff
changeset
|
279 m->pending_last = (m->pending_last - 1) & 0xf; |
58b6337fb3b2
Fix bugs of pending keys of animated menu.
Thinker K.F. Li <thinker@branda.to>
parents:
454
diff
changeset
|
280 else |
58b6337fb3b2
Fix bugs of pending keys of animated menu.
Thinker K.F. Li <thinker@branda.to>
parents:
454
diff
changeset
|
281 subject_add_observer(mb_progm_get_complete(m->progm), |
58b6337fb3b2
Fix bugs of pending keys of animated menu.
Thinker K.F. Li <thinker@branda.to>
parents:
454
diff
changeset
|
282 mb_animated_menu_send_pending_key, |
58b6337fb3b2
Fix bugs of pending keys of animated menu.
Thinker K.F. Li <thinker@branda.to>
parents:
454
diff
changeset
|
283 m); |
332
f90c60967a9c
Add mb_progm_finish to terminate the current animation and put all objects in the final position.
wycc
parents:
329
diff
changeset
|
284 return; |
f90c60967a9c
Add mb_progm_finish to terminate the current animation and put all objects in the final position.
wycc
parents:
329
diff
changeset
|
285 } |
318 | 286 switch(xkey->sym) { |
287 case 0xff51: /* left */ | |
288 break; | |
289 | |
290 case 0xff52: /* up */ | |
291 mb_animated_menu_up(m); | |
292 break; | |
293 | |
294 case 0xff53: /* right */ | |
295 break; | |
296 | |
297 case 0xff54: /* down */ | |
298 mb_animated_menu_down(m); | |
299 break; | |
300 | |
301 case 0xff0d: /* enter */ | |
302 mb_animated_menu_select(m); | |
303 break; | |
304 default: | |
305 return; | |
306 } | |
307 } | |
308 | |
822
586e50f82c1f
Unify coding style tag for emacs and vim.
Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com>
parents:
757
diff
changeset
|
309 /** \brief Create an instace of animated menu. |
318 | 310 * |
822
586e50f82c1f
Unify coding style tag for emacs and vim.
Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com>
parents:
757
diff
changeset
|
311 * The objectnames is used to extract symbols from the SVG file. |
318 | 312 * ${objectnames}0 - ${objectnames}8 is the text object. |
313 * ${objectnames}_lightbar is the lightbar. | |
314 * | |
315 */ | |
454
9b8dda201ccb
Make naming convention consistent with MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents:
368
diff
changeset
|
316 mb_animated_menu_t *mb_animated_menu_new(mbaf_t *app,mb_sprite_t *sp,char *objnames,char *menus[]) |
318 | 317 { |
318 mb_animated_menu_t *m; | |
757
f43224bf3524
Remove unused variables and refactor to X_MB_init_with_win
Thinker K.F. Li <thinker@codemud.net>
parents:
456
diff
changeset
|
319 int i; |
318 | 320 char name[255]; |
321 mb_obj_t *l; | |
322 int ii; | |
323 | |
324 if (menus == NULL) | |
325 i=0; | |
326 else | |
327 for(i=0;menus[i];i++); | |
328 ii=9; | |
822
586e50f82c1f
Unify coding style tag for emacs and vim.
Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com>
parents:
757
diff
changeset
|
329 |
318 | 330 m = (mb_animated_menu_t *) malloc(sizeof(mb_animated_menu_t)); |
331 m->items = (int *) malloc(sizeof(int)*ii*2+sizeof(mb_obj_t *)*ii); | |
332 m->app = app; | |
333 m->sprite = sp; | |
334 m->top = 0; | |
335 m->cur = 0; | |
336 m->ready = 1; | |
337 m->max = i; | |
338 m->menus_y = (int *) (m->items+ii); | |
339 m->objects = (mb_obj_t **) (m->menus_y+ii); | |
340 m->callback = NULL; | |
344 | 341 m->update_callback = NULL; |
318 | 342 m->speed = 300000; |
343 for(i=0;i<9;i++) { | |
344 m->items[i] = i; | |
345 snprintf(name,sizeof(name),"%s%d", objnames, i+1); | |
346 l = MB_SPRITE_GET_OBJ(sp,name); | |
347 if (l == NULL) { | |
348 fprintf(stderr,"Can not find symbol %s\n",name); | |
349 } | |
350 m->objects[i] = (mb_obj_t *) l; | |
351 m->menus_y[i] = coord_y((coord_t*)l); | |
352 } | |
353 m->titles = menus; | |
354 snprintf(name,sizeof(name), "%s_lightbar", objnames); | |
355 m->lightbar = (mb_obj_t *) MB_SPRITE_GET_OBJ(sp,name); | |
356 if (m->lightbar==NULL) | |
357 fprintf(stderr,"Can not find object %s\n",name); | |
455
58b6337fb3b2
Fix bugs of pending keys of animated menu.
Thinker K.F. Li <thinker@branda.to>
parents:
454
diff
changeset
|
358 m->pending_pos = m->pending_last = 0; |
318 | 359 mb_animated_menu_fillMenuContent(m); |
454
9b8dda201ccb
Make naming convention consistent with MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents:
368
diff
changeset
|
360 subject_add_observer(MBAF_KB_SUBJECT(app), mb_animated_menu_keyHandler,m); |
318 | 361 return m; |
362 } | |
363 | |
364 void mb_animated_menu_set_titles(mb_animated_menu_t *m, char *menus[]) | |
365 { | |
366 int i; | |
367 for(i=0;menus[i];i++); | |
368 | |
369 m->max = i; | |
370 m->top = 0; | |
371 m->cur = 0; | |
372 m->titles = menus; | |
373 mb_animated_menu_fillMenuContent(m); | |
329
740844ee48c4
Update position of light-bar after update menu item
Thinker K.F. Li <thinker@branda.to>
parents:
328
diff
changeset
|
374 mb_animated_menu_moveLightBar(m); |
318 | 375 } |
376 | |
377 | |
378 void mb_animated_menu_set_speed(mb_animated_menu_t *m,int speed) | |
379 { | |
380 m->speed = speed*1000; | |
381 } | |
382 | |
383 int mb_animated_menu_get_speed(mb_animated_menu_t *m) | |
384 { | |
385 return m->speed/1000; | |
386 } |