diff options
Diffstat (limited to 'apps/plugins/demystify.c')
-rw-r--r-- | apps/plugins/demystify.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/apps/plugins/demystify.c b/apps/plugins/demystify.c index 81ac53cc6c..a389018c4e 100644 --- a/apps/plugins/demystify.c +++ b/apps/plugins/demystify.c | |||
@@ -78,7 +78,7 @@ struct line_color | |||
78 | * Compute a new random step to make the point bounce the borders of the screen | 78 | * Compute a new random step to make the point bounce the borders of the screen |
79 | */ | 79 | */ |
80 | 80 | ||
81 | int get_new_step(int step) | 81 | static int get_new_step(int step) |
82 | { | 82 | { |
83 | if(step>0) | 83 | if(step>0) |
84 | return -(MIN_STEP_RANGE + rb->rand() % (MAX_STEP_RANGE-MIN_STEP_RANGE)); | 84 | return -(MIN_STEP_RANGE + rb->rand() % (MAX_STEP_RANGE-MIN_STEP_RANGE)); |
@@ -108,7 +108,7 @@ struct polygon | |||
108 | /* | 108 | /* |
109 | * Generates a random polygon (which fits the screen size though) | 109 | * Generates a random polygon (which fits the screen size though) |
110 | */ | 110 | */ |
111 | void polygon_init(struct polygon * polygon, struct screen * display) | 111 | static void polygon_init(struct polygon * polygon, struct screen * display) |
112 | { | 112 | { |
113 | int i; | 113 | int i; |
114 | for(i=0;i<NB_POINTS;++i) | 114 | for(i=0;i<NB_POINTS;++i) |
@@ -122,7 +122,7 @@ void polygon_init(struct polygon * polygon, struct screen * display) | |||
122 | * Draw the given polygon onto the screen | 122 | * Draw the given polygon onto the screen |
123 | */ | 123 | */ |
124 | 124 | ||
125 | void polygon_draw(struct polygon * polygon, struct screen * display) | 125 | static void polygon_draw(struct polygon * polygon, struct screen * display) |
126 | { | 126 | { |
127 | int i; | 127 | int i; |
128 | for(i=0;i<NB_POINTS-1;++i) | 128 | for(i=0;i<NB_POINTS-1;++i) |
@@ -144,7 +144,7 @@ struct polygon_move | |||
144 | struct point move_steps[NB_POINTS]; | 144 | struct point move_steps[NB_POINTS]; |
145 | }; | 145 | }; |
146 | 146 | ||
147 | void polygon_move_init(struct polygon_move * polygon_move) | 147 | static void polygon_move_init(struct polygon_move * polygon_move) |
148 | { | 148 | { |
149 | int i; | 149 | int i; |
150 | for(i=0;i<NB_POINTS;++i) | 150 | for(i=0;i<NB_POINTS;++i) |
@@ -159,7 +159,8 @@ void polygon_move_init(struct polygon_move * polygon_move) | |||
159 | * Update the given polygon's position according to the given informations in | 159 | * Update the given polygon's position according to the given informations in |
160 | * polygon_move (polygon_move may be updated) | 160 | * polygon_move (polygon_move may be updated) |
161 | */ | 161 | */ |
162 | void polygon_update(struct polygon *polygon, struct screen * display, struct polygon_move *polygon_move) | 162 | static void polygon_update(struct polygon *polygon, struct screen * display, |
163 | struct polygon_move *polygon_move) | ||
163 | { | 164 | { |
164 | int i, x, y, step; | 165 | int i, x, y, step; |
165 | for(i=0;i<NB_POINTS;++i) | 166 | for(i=0;i<NB_POINTS;++i) |
@@ -208,14 +209,14 @@ struct polygon_fifo | |||
208 | struct polygon tab[MAX_POLYGONS]; | 209 | struct polygon tab[MAX_POLYGONS]; |
209 | }; | 210 | }; |
210 | 211 | ||
211 | void fifo_init(struct polygon_fifo * fifo) | 212 | static void fifo_init(struct polygon_fifo * fifo) |
212 | { | 213 | { |
213 | fifo->fifo_tail=0; | 214 | fifo->fifo_tail=0; |
214 | fifo->fifo_head=0; | 215 | fifo->fifo_head=0; |
215 | fifo->nb_items=0; | 216 | fifo->nb_items=0; |
216 | } | 217 | } |
217 | 218 | ||
218 | void fifo_push(struct polygon_fifo * fifo, struct polygon * polygon) | 219 | static void fifo_push(struct polygon_fifo * fifo, struct polygon * polygon) |
219 | { | 220 | { |
220 | if(fifo->nb_items>=MAX_POLYGONS) | 221 | if(fifo->nb_items>=MAX_POLYGONS) |
221 | return; | 222 | return; |
@@ -231,7 +232,7 @@ void fifo_push(struct polygon_fifo * fifo, struct polygon * polygon) | |||
231 | fifo->fifo_head=0; | 232 | fifo->fifo_head=0; |
232 | } | 233 | } |
233 | 234 | ||
234 | struct polygon * fifo_pop(struct polygon_fifo * fifo) | 235 | static struct polygon * fifo_pop(struct polygon_fifo * fifo) |
235 | { | 236 | { |
236 | int index; | 237 | int index; |
237 | if(fifo->nb_items==0) | 238 | if(fifo->nb_items==0) |
@@ -248,7 +249,7 @@ struct polygon * fifo_pop(struct polygon_fifo * fifo) | |||
248 | * Drawing stuffs | 249 | * Drawing stuffs |
249 | */ | 250 | */ |
250 | 251 | ||
251 | void polygons_draw(struct polygon_fifo * polygons, struct screen * display) | 252 | static void polygons_draw(struct polygon_fifo * polygons, struct screen * display) |
252 | { | 253 | { |
253 | int i, j; | 254 | int i, j; |
254 | for(i=0, j=polygons->fifo_tail;i<polygons->nb_items;++i, ++j) | 255 | for(i=0, j=polygons->fifo_tail;i<polygons->nb_items;++i, ++j) |
@@ -259,7 +260,7 @@ void polygons_draw(struct polygon_fifo * polygons, struct screen * display) | |||
259 | } | 260 | } |
260 | } | 261 | } |
261 | 262 | ||
262 | void cleanup(void) | 263 | static void cleanup(void) |
263 | { | 264 | { |
264 | backlight_use_settings(); | 265 | backlight_use_settings(); |
265 | #ifdef HAVE_REMOTE_LCD | 266 | #ifdef HAVE_REMOTE_LCD |
@@ -268,14 +269,14 @@ void cleanup(void) | |||
268 | } | 269 | } |
269 | 270 | ||
270 | #ifdef HAVE_LCD_COLOR | 271 | #ifdef HAVE_LCD_COLOR |
271 | void color_randomize(struct line_color * color) | 272 | static void color_randomize(struct line_color * color) |
272 | { | 273 | { |
273 | color->r = rb->rand()%255; | 274 | color->r = rb->rand()%255; |
274 | color->g = rb->rand()%255; | 275 | color->g = rb->rand()%255; |
275 | color->b = rb->rand()%255; | 276 | color->b = rb->rand()%255; |
276 | } | 277 | } |
277 | 278 | ||
278 | void color_init(struct line_color * color) | 279 | static void color_init(struct line_color * color) |
279 | { | 280 | { |
280 | color_randomize(color); | 281 | color_randomize(color); |
281 | color->current_r=color->r; | 282 | color->current_r=color->r; |
@@ -283,7 +284,7 @@ void color_init(struct line_color * color) | |||
283 | color->current_b=color->b; | 284 | color->current_b=color->b; |
284 | } | 285 | } |
285 | 286 | ||
286 | void color_change(struct line_color * color) | 287 | static void color_change(struct line_color * color) |
287 | { | 288 | { |
288 | if(color->current_r<color->r) | 289 | if(color->current_r<color->r) |
289 | ++color->current_r; | 290 | ++color->current_r; |
@@ -307,7 +308,7 @@ void color_change(struct line_color * color) | |||
307 | #define COLOR_RGBPACK(color) \ | 308 | #define COLOR_RGBPACK(color) \ |
308 | LCD_RGBPACK((color)->current_r, (color)->current_g, (color)->current_b) | 309 | LCD_RGBPACK((color)->current_r, (color)->current_g, (color)->current_b) |
309 | 310 | ||
310 | void color_apply(struct line_color * color, struct screen * display) | 311 | static void color_apply(struct line_color * color, struct screen * display) |
311 | { | 312 | { |
312 | if (display->is_color){ | 313 | if (display->is_color){ |
313 | unsigned foreground= | 314 | unsigned foreground= |
@@ -321,7 +322,7 @@ void color_apply(struct line_color * color, struct screen * display) | |||
321 | * Main function | 322 | * Main function |
322 | */ | 323 | */ |
323 | 324 | ||
324 | int plugin_main(void) | 325 | static int plugin_main(void) |
325 | { | 326 | { |
326 | int action; | 327 | int action; |
327 | int sleep_time=DEFAULT_WAIT_TIME; | 328 | int sleep_time=DEFAULT_WAIT_TIME; |