[refactor] Organize STRING

This commit is contained in:
2026-06-05 18:38:45 +08:00
Unverified
parent da03b301fb
commit 9ee88ef7b9
19 changed files with 124 additions and 51 deletions
+2 -1
View File
@@ -2,6 +2,7 @@
#include <fonts/pixel_font.h>
#include <graphics/draw.h>
#include <common.h>
#include <string_utils.h>
void pf_print_char(char c, SUINT32 basex, SUINT32 basey, EFI_GRAPHICS_OUTPUT_BLT_PIXEL color) {
for (SUINT32 y = 0; y < 16; y++) {
@@ -23,7 +24,7 @@ void pf_print_char(char c, SUINT32 basex, SUINT32 basey, EFI_GRAPHICS_OUTPUT_BLT
}
void pf_print(const char* text, SUINT32 basex, SUINT32 basey, EFI_GRAPHICS_OUTPUT_BLT_PIXEL color) {
for (SUINT32 i = 0; i < strlen(text); i++) {
for (SUINT32 i = 0; i < str_len(text); i++) {
char c = text[i];
pf_print_char(c, basex + i * 8, basey, color); // 只要 字数 * 8 + basex 不爆hr就没事
}