diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2012-12-07 01:50:52 -0500 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2012-12-18 19:16:26 -0500 |
commit | 371c86bf3f4d1708fc40db2aa7fa572eb429d0b4 (patch) | |
tree | be339c62eac616ac6938c2929349b72377c10ee2 /apps/plugins/oscilloscope.c | |
parent | f668c3624184fedc14d34f87ad7b5f1e43bc87a1 (diff) |
Adapt OSD in plugin lib to be greylib compatible.
Requires addition of viewports and alternate framebuffers to greylib
which are essentially similar to the core implementation except that
the framebuffer can be any size and relationship to a viewport. Drawing
is always fully clipped to the intersecting area.
Adapt oscilloscope.c to the API change. FFT will use the new features
(later update).
Get rid of silly and wrong lcd_bmp_part use in OSD. Remove it from
plugin API (must be made incompatible now).
Change-Id: Iafa5e2174148fb8ad11db6b9d4add0dcabc5c563
Diffstat (limited to 'apps/plugins/oscilloscope.c')
-rw-r--r-- | apps/plugins/oscilloscope.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/plugins/oscilloscope.c b/apps/plugins/oscilloscope.c index 4fbf96939d..c418f127fc 100644 --- a/apps/plugins/oscilloscope.c +++ b/apps/plugins/oscilloscope.c @@ -727,7 +727,14 @@ static void osc_osd_init(void) /* Grab the plugin buffer for the OSD back buffer */ size_t bufsize; void *buf = rb->plugin_get_buffer(&bufsize); - osd_init(buf, bufsize, osd_lcd_draw_cb); + + int width, height; + rb->lcd_setfont(FONT_UI); + rb->lcd_getstringsize("M", NULL, &height); + width = LCD_WIDTH; + height += 2 + 2*OSC_OSD_MARGIN_SIZE; + osd_init(OSD_INIT_MAJOR_HEIGHT | OSD_INIT_MINOR_MAX, buf, bufsize, + osd_lcd_draw_cb, &width, &height, NULL); } /* Format a message by ID and show the OSD */ @@ -1826,7 +1833,7 @@ static long oscilloscope_draw(void) static void osc_cleanup(void) { - osd_init(NULL, 0, NULL); + osd_destroy(); #ifdef OSCILLOSCOPE_GRAPHMODE anim_waveform_exit(); |