Minor cleanup.

This commit is contained in:
Simon Forman 2023-02-28 07:45:38 -08:00
parent 5423e0b239
commit f87ddbfa9e
1 changed files with 9 additions and 8 deletions

View File

@ -24,17 +24,18 @@ void
draw_char(u8 ch, u64 dest_x, u64 dest_y) draw_char(u8 ch, u64 dest_x, u64 dest_y)
{ {
// Check the inputs. // Check the inputs.
if (ch < 0 || ch > font_numchars if (ch < 0 || dest_x < 0 || dest_y < 0
|| dest_x < 0 || dest_x >= (FRAME_WIDTH - font_width) || ch >= font_numchars
|| dest_y < 0 || dest_y >= (FRAME_HEIGHT - font_height)) || dest_x >= (FRAME_WIDTH - font_width)
|| dest_y >= (FRAME_HEIGHT - font_height))
// No error message or anything, just decline to draw. // No error message or anything, just decline to draw.
return; return;
carefree_alpha_blend_blit( carefree_alpha_blend_blit(
frame_buffer, frame_buffer, // destination
font_data[ch], font_data[ch], // source
FRAME_WIDTH, FRAME_WIDTH, // destination width (or "stride")
dest_x, dest_x, // top
dest_y, dest_y, // left
font_width, font_width,
font_height font_height
); );