summaryrefslogtreecommitdiffstats
path: root/src/text.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/text.h')
-rw-r--r--src/text.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/text.h b/src/text.h
index 3c0b3a8..9aa3fdd 100644
--- a/src/text.h
+++ b/src/text.h
@@ -5,6 +5,7 @@
5#include <stdio.h> 5#include <stdio.h>
6 6
7#include "common.h" 7#include "common.h"
8#include "bitmap.h"
8 9
9typedef enum { 10typedef enum {
10 TXT_MODE_TILED_BG, 11 TXT_MODE_TILED_BG,
@@ -15,7 +16,7 @@ typedef struct Font {
15 // A pointer to an area of memory containing font data. 16 // A pointer to an area of memory containing font data.
16 // TODO: Should we unpack each char everytime or unpack everything into RAM? 17 // TODO: Should we unpack each char everytime or unpack everything into RAM?
17 // Maybe this should be optional? 18 // Maybe this should be optional?
18 u32 *data; 19 u16 *data;
19 // The char_map stores the index to the character position within the font 20 // The char_map stores the index to the character position within the font
20 // array depending on the ascii number we want to render. This allows 21 // array depending on the ascii number we want to render. This allows
21 // the usage reduced font sets, for example just uppercase letters and 22 // the usage reduced font sets, for example just uppercase letters and
@@ -93,7 +94,12 @@ txt_putc_m3(char c) {
93 for (size_t i = 0; i < text_engine.font.char_height; ++i) { 94 for (size_t i = 0; i < text_engine.font.char_height; ++i) {
94 for (size_t j = 0; j < text_engine.font.char_width; ++j) { 95 for (size_t j = 0; j < text_engine.font.char_width; ++j) {
95 if ((tile.row[i] >> 4 * j) & 0x1) { 96 if ((tile.row[i] >> 4 * j) & 0x1) {
96 FRAMEBUFFER[y + i][x + j] = text_engine.font.color; 97 put_pixel_m4(x + j, y + i, 1, backbuffer);
98 // TODO: Clean this up please.
99 // put_pixel_m3(x + j,
100 // y + i,
101 // text_engine.font.color,
102 // FRAMEBUFFER);
97 } 103 }
98 } 104 }
99 } 105 }