From f87ddbfa9e76b41d95872c320050197d860e9b81 Mon Sep 17 00:00:00 2001 From: Simon Forman Date: Tue, 28 Feb 2023 07:45:38 -0800 Subject: [PATCH] Minor cleanup. --- implementations/uvm-ncc/xerblin.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/implementations/uvm-ncc/xerblin.c b/implementations/uvm-ncc/xerblin.c index ae49893..5d4cd94 100644 --- a/implementations/uvm-ncc/xerblin.c +++ b/implementations/uvm-ncc/xerblin.c @@ -24,17 +24,18 @@ void draw_char(u8 ch, u64 dest_x, u64 dest_y) { // Check the inputs. - if (ch < 0 || ch > font_numchars - || dest_x < 0 || dest_x >= (FRAME_WIDTH - font_width) - || dest_y < 0 || dest_y >= (FRAME_HEIGHT - font_height)) + if (ch < 0 || dest_x < 0 || dest_y < 0 + || ch >= font_numchars + || dest_x >= (FRAME_WIDTH - font_width) + || dest_y >= (FRAME_HEIGHT - font_height)) // No error message or anything, just decline to draw. return; carefree_alpha_blend_blit( - frame_buffer, - font_data[ch], - FRAME_WIDTH, - dest_x, - dest_y, + frame_buffer, // destination + font_data[ch], // source + FRAME_WIDTH, // destination width (or "stride") + dest_x, // top + dest_y, // left font_width, font_height );