(drivers_display) Cleanups

This commit is contained in:
twinaphex 2015-01-19 06:44:46 +01:00
parent 3ee307e743
commit 7a794b2ef1
3 changed files with 20 additions and 19 deletions

View File

@ -49,13 +49,14 @@ static void glui_blit_line(float x, float y, const char *message, bool green)
gl_set_viewport(gl, gl->win_width, gl->win_height, false, false);
params.x = x / gl->win_width;
params.y = 1.0f - y / gl->win_height;
params.scale = 1.0;
params.color = green ? FONT_COLOR_RGBA(100, 255, 100, 255)
: FONT_COLOR_RGBA(255, 255, 255, 255);
params.x = x / gl->win_width;
params.y = 1.0f - y / gl->win_height;
params.scale = 1.0;
params.color = FONT_COLOR_RGBA(255, 255, 255, 255);
params.full_screen = true;
if (green)
params.color = FONT_COLOR_RGBA(100, 255, 100, 255);
if (driver.video_data && driver.video_poke
&& driver.video_poke->set_osd_msg)
@ -245,7 +246,7 @@ static void glui_render_messagebox(const char *message)
return;
}
x = gl->win_width / 2 - strlen(list->elems[0].data) * glui->glyph_width / 2;
x = gl->win_width / 2 - strlen(list->elems[0].data) * glui->glyph_width / 2;
y = gl->win_height / 2 - list->size * glui->line_height / 2;
for (i = 0; i < list->size; i++)

View File

@ -51,13 +51,13 @@ static void ios_free(void *data)
static int menu_ios_iterate(unsigned action)
{
ios_handle_t *ih = NULL;
ios_handle_t *ios = NULL;
if (!driver.menu)
return 0;
ih = (ios_handle_t*)driver.menu->userdata;
if (ih->switch_to_ios)
ih->switch_to_ios();
ios = (ios_handle_t*)driver.menu->userdata;
if (ios->switch_to_ios)
ios->switch_to_ios();
return 0;
}

View File

@ -146,20 +146,20 @@ static void blit_line(int x, int y, const char *message, bool green)
for (i = 0; i < FONT_WIDTH; i++)
{
uint8_t rem = 1 << ((i + j * FONT_WIDTH) & 7);
int offset = (i + j * FONT_WIDTH) >> 3;
bool col = (driver.menu->font[FONT_OFFSET
int offset = (i + j * FONT_WIDTH) >> 3;
bool col = (driver.menu->font[FONT_OFFSET
((unsigned char)*message) + offset] & rem);
if (col)
{
rgui->frame_buf[(y + j) *
(rgui->frame_buf_pitch >> 1) + (x + i)] = green ?
if (!col)
continue;
rgui->frame_buf[(y + j) *
(rgui->frame_buf_pitch >> 1) + (x + i)] = green ?
#if defined(GEKKO)|| defined(PSP)
(3 << 0) | (10 << 4) | (3 << 8) | (7 << 12) : 0x7FFF;
#else
(15 << 0) | (7 << 4) | (15 << 8) | (7 << 12) : 0xFFFF;
(15 << 0) | (7 << 4) | (15 << 8) | (7 << 12) : 0xFFFF;
#endif
}
}
}