brute forced text support, fixed an off-by one, lots to fix
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "buffer.cpp"
|
||||
|
||||
|
||||
|
||||
UwU::Buffer font() {
|
||||
const uint32_t fontInt[9] = {
|
||||
0xcc003f00,
|
||||
0xcc004300,
|
||||
0xcf33c300,
|
||||
0xcf33c300,
|
||||
0xcf33df00,
|
||||
0xcf33cf00,
|
||||
0xcf33cf00,
|
||||
0xcf33cf00,
|
||||
0x7ffeffe0
|
||||
};
|
||||
|
||||
UwU::Buffer font = UwU::Buffer(32, 9);
|
||||
uint32_t t;
|
||||
uint32_t b;
|
||||
for (uint16_t y = 0; y < 9; y++) {
|
||||
t = fontInt[y];
|
||||
for (uint16_t x = 0; x < 32; x++) {
|
||||
b = t & 0x80000000;
|
||||
if (b == 0x80000000) {
|
||||
font.pixels[(y * 128) + (x * 4) + 0] = 0xff;
|
||||
font.pixels[(y * 128) + (x * 4) + 1] = 0xff;
|
||||
font.pixels[(y * 128) + (x * 4) + 2] = 0xff;
|
||||
font.pixels[(y * 128) + (x * 4) + 3] = 0xff;
|
||||
} else {
|
||||
font.pixels[(y * 128) + (x * 4) + 0] = 0x00;
|
||||
font.pixels[(y * 128) + (x * 4) + 1] = 0x00;
|
||||
font.pixels[(y * 128) + (x * 4) + 2] = 0x00;
|
||||
font.pixels[(y * 128) + (x * 4) + 3] = 0x00;
|
||||
}
|
||||
t = t << 1;
|
||||
}
|
||||
}
|
||||
return font;
|
||||
}
|
||||
Reference in New Issue
Block a user