diff options
author | Jens Arnold <amiconn@rockbox.org> | 2005-06-30 21:07:00 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2005-06-30 21:07:00 +0000 |
commit | 93867305d514b90bec2d5d7541297aef6a157efa (patch) | |
tree | e3e5ecfb84c337a227093122f7ddcf085d6c9f32 /apps/plugins/snow.c | |
parent | 05c3cc297814543d68065389b08ef2123020b0b9 (diff) | |
download | rockbox-93867305d514b90bec2d5d7541297aef6a157efa.tar.gz rockbox-93867305d514b90bec2d5d7541297aef6a157efa.zip |
Player graphics library extended and converted to new api. Please note that the player gfx bitmap format chas changed.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6956 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/snow.c')
-rw-r--r-- | apps/plugins/snow.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/apps/plugins/snow.c b/apps/plugins/snow.c index b3d3b14c46..75c561427a 100644 --- a/apps/plugins/snow.c +++ b/apps/plugins/snow.c | |||
@@ -23,10 +23,12 @@ | |||
23 | #define NUM_PARTICLES (LCD_WIDTH * LCD_HEIGHT / 72) | 23 | #define NUM_PARTICLES (LCD_WIDTH * LCD_HEIGHT / 72) |
24 | #define SNOW_HEIGHT LCD_HEIGHT | 24 | #define SNOW_HEIGHT LCD_HEIGHT |
25 | #define SNOW_WIDTH LCD_WIDTH | 25 | #define SNOW_WIDTH LCD_WIDTH |
26 | #define MYLCD(fn) rb->lcd_ ## fn | ||
26 | #else | 27 | #else |
27 | #define NUM_PARTICLES 10 | 28 | #define NUM_PARTICLES 10 |
28 | #define SNOW_HEIGHT 14 | 29 | #define SNOW_HEIGHT 14 |
29 | #define SNOW_WIDTH 20 | 30 | #define SNOW_WIDTH 20 |
31 | #define MYLCD(fn) pgfx_ ## fn | ||
30 | #endif | 32 | #endif |
31 | 33 | ||
32 | /* variable button definitions */ | 34 | /* variable button definitions */ |
@@ -81,14 +83,14 @@ static void snow_move(void) | |||
81 | 83 | ||
82 | for (i=0; i<NUM_PARTICLES; i++) { | 84 | for (i=0; i<NUM_PARTICLES; i++) { |
83 | if (particle_exists(i)) { | 85 | if (particle_exists(i)) { |
86 | MYLCD(set_drawmode)(DRMODE_SOLID|DRMODE_INVERSEVID); | ||
84 | #ifdef HAVE_LCD_BITMAP | 87 | #ifdef HAVE_LCD_BITMAP |
85 | rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); | ||
86 | rb->lcd_fillrect(particles[i][0],particles[i][1], | 88 | rb->lcd_fillrect(particles[i][0],particles[i][1], |
87 | FLAKE_WIDTH,FLAKE_WIDTH); | 89 | FLAKE_WIDTH,FLAKE_WIDTH); |
88 | rb->lcd_set_drawmode(DRMODE_SOLID); | ||
89 | #else | 90 | #else |
90 | pgfx_clearpixel(particles[i][0],particles[i][1]); | 91 | pgfx_drawpixel(particles[i][0],particles[i][1]); |
91 | #endif | 92 | #endif |
93 | MYLCD(set_drawmode)(DRMODE_SOLID); | ||
92 | #ifdef HAVE_REMOTE_LCD | 94 | #ifdef HAVE_REMOTE_LCD |
93 | if (particles[i][0] <= LCD_REMOTE_WIDTH | 95 | if (particles[i][0] <= LCD_REMOTE_WIDTH |
94 | && particles[i][1] <= LCD_REMOTE_HEIGHT) { | 96 | && particles[i][1] <= LCD_REMOTE_HEIGHT) { |
@@ -141,14 +143,12 @@ static void snow_init(void) | |||
141 | particles[i][0]=-1; | 143 | particles[i][0]=-1; |
142 | particles[i][1]=-1; | 144 | particles[i][1]=-1; |
143 | } | 145 | } |
144 | #ifdef HAVE_LCD_BITMAP | 146 | #ifdef HAVE_LCD_CHARCELLS |
145 | rb->lcd_clear_display(); | ||
146 | #else | ||
147 | pgfx_display(0, 0); /* display three times */ | 147 | pgfx_display(0, 0); /* display three times */ |
148 | pgfx_display(4, 0); | 148 | pgfx_display(4, 0); |
149 | pgfx_display(8, 0); | 149 | pgfx_display(8, 0); |
150 | pgfx_clear_display(); | ||
151 | #endif | 150 | #endif |
151 | MYLCD(clear_display)(); | ||
152 | #ifdef HAVE_REMOTE_LCD | 152 | #ifdef HAVE_REMOTE_LCD |
153 | rb->lcd_remote_clear_display(); | 153 | rb->lcd_remote_clear_display(); |
154 | #endif | 154 | #endif |
@@ -171,11 +171,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
171 | snow_init(); | 171 | snow_init(); |
172 | while (1) { | 172 | while (1) { |
173 | snow_move(); | 173 | snow_move(); |
174 | #ifdef HAVE_LCD_BITMAP | 174 | MYLCD(update)(); |
175 | rb->lcd_update(); | ||
176 | #else | ||
177 | pgfx_update(); | ||
178 | #endif | ||
179 | #ifdef HAVE_REMOTE_LCD | 175 | #ifdef HAVE_REMOTE_LCD |
180 | rb->lcd_remote_update(); | 176 | rb->lcd_remote_update(); |
181 | #endif | 177 | #endif |