diff options
Diffstat (limited to 'apps/plugins/lib/playergfx.c')
-rw-r--r-- | apps/plugins/lib/playergfx.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/apps/plugins/lib/playergfx.c b/apps/plugins/lib/playergfx.c index c332c02711..d07043c572 100644 --- a/apps/plugins/lib/playergfx.c +++ b/apps/plugins/lib/playergfx.c | |||
@@ -28,7 +28,6 @@ | |||
28 | 28 | ||
29 | /*** globals ***/ | 29 | /*** globals ***/ |
30 | 30 | ||
31 | static const struct plugin_api *pgfx_rb = NULL; /* global api struct pointer */ | ||
32 | static int char_width; | 31 | static int char_width; |
33 | static int char_height; | 32 | static int char_height; |
34 | static int pixel_height; | 33 | static int pixel_height; |
@@ -40,14 +39,13 @@ static int drawmode = DRMODE_SOLID; | |||
40 | /*** Special functions ***/ | 39 | /*** Special functions ***/ |
41 | 40 | ||
42 | /* library init */ | 41 | /* library init */ |
43 | bool pgfx_init(const struct plugin_api* newrb, int cwidth, int cheight) | 42 | bool pgfx_init(int cwidth, int cheight) |
44 | { | 43 | { |
45 | int i; | 44 | int i; |
46 | 45 | ||
47 | if (((unsigned) cwidth * (unsigned) cheight) > 8 || (unsigned) cheight > 2) | 46 | if (((unsigned) cwidth * (unsigned) cheight) > 8 || (unsigned) cheight > 2) |
48 | return false; | 47 | return false; |
49 | 48 | ||
50 | pgfx_rb = newrb; | ||
51 | char_width = cwidth; | 49 | char_width = cwidth; |
52 | char_height = cheight; | 50 | char_height = cheight; |
53 | pixel_height = 7 * char_height; | 51 | pixel_height = 7 * char_height; |
@@ -55,7 +53,7 @@ bool pgfx_init(const struct plugin_api* newrb, int cwidth, int cheight) | |||
55 | 53 | ||
56 | for (i = 0; i < cwidth * cheight; i++) | 54 | for (i = 0; i < cwidth * cheight; i++) |
57 | { | 55 | { |
58 | if ((gfx_chars[i] = pgfx_rb->lcd_get_locked_pattern()) == 0) | 56 | if ((gfx_chars[i] = rb->lcd_get_locked_pattern()) == 0) |
59 | { | 57 | { |
60 | pgfx_release(); | 58 | pgfx_release(); |
61 | return false; | 59 | return false; |
@@ -72,7 +70,7 @@ void pgfx_release(void) | |||
72 | 70 | ||
73 | for (i = 0; i < 8; i++) | 71 | for (i = 0; i < 8; i++) |
74 | if (gfx_chars[i]) | 72 | if (gfx_chars[i]) |
75 | pgfx_rb->lcd_unlock_pattern(gfx_chars[i]); | 73 | rb->lcd_unlock_pattern(gfx_chars[i]); |
76 | } | 74 | } |
77 | 75 | ||
78 | /* place the display */ | 76 | /* place the display */ |
@@ -84,12 +82,12 @@ void pgfx_display(int cx, int cy) | |||
84 | 82 | ||
85 | for (i = 0; i < width; i++) | 83 | for (i = 0; i < width; i++) |
86 | for (j = 0; j < height; j++) | 84 | for (j = 0; j < height; j++) |
87 | pgfx_rb->lcd_putc(cx + i, cy + j, gfx_chars[char_height * i + j]); | 85 | rb->lcd_putc(cx + i, cy + j, gfx_chars[char_height * i + j]); |
88 | } | 86 | } |
89 | 87 | ||
90 | void pgfx_display_block(int cx, int cy, int x, int y) | 88 | void pgfx_display_block(int cx, int cy, int x, int y) |
91 | { | 89 | { |
92 | pgfx_rb->lcd_putc(cx, cy, gfx_chars[char_height * x + y]); | 90 | rb->lcd_putc(cx, cy, gfx_chars[char_height * x + y]); |
93 | } | 91 | } |
94 | 92 | ||
95 | 93 | ||
@@ -100,9 +98,9 @@ void pgfx_update(void) | |||
100 | int i; | 98 | int i; |
101 | 99 | ||
102 | for (i = 0; i < char_width * char_height; i++) | 100 | for (i = 0; i < char_width * char_height; i++) |
103 | pgfx_rb->lcd_define_pattern(gfx_chars[i], gfx_buffer + 7 * i); | 101 | rb->lcd_define_pattern(gfx_chars[i], gfx_buffer + 7 * i); |
104 | 102 | ||
105 | pgfx_rb->lcd_update(); | 103 | rb->lcd_update(); |
106 | } | 104 | } |
107 | 105 | ||
108 | /*** Parameter handling ***/ | 106 | /*** Parameter handling ***/ |
@@ -203,7 +201,7 @@ void pgfx_clear_display(void) | |||
203 | { | 201 | { |
204 | unsigned bits = (drawmode & DRMODE_INVERSEVID) ? 0x1F : 0; | 202 | unsigned bits = (drawmode & DRMODE_INVERSEVID) ? 0x1F : 0; |
205 | 203 | ||
206 | pgfx_rb->memset(gfx_buffer, bits, char_width * pixel_height); | 204 | rb->memset(gfx_buffer, bits, char_width * pixel_height); |
207 | } | 205 | } |
208 | 206 | ||
209 | /* Set a single pixel */ | 207 | /* Set a single pixel */ |