Fixed borked font bitmap allocation size
This commit is contained in:
1 parent
5be35aa3de
commit
dd406fe7b4
1 file changed
+3
-1
@@ -3847,8 +3847,10 @@ int main(void)
|
|||||||
struct File_Read_Result font_data = read_file__cruddy(font_file);
|
struct File_Read_Result font_data = read_file__cruddy(font_file);
|
||||||
// TODO(Zelaven): How much data do I have to make sure that I read at minimum?
|
// TODO(Zelaven): How much data do I have to make sure that I read at minimum?
|
||||||
assert(font_data.size > 16);
|
assert(font_data.size > 16);
|
||||||
g_font_bitmap = memory_arena_allocate(&font_arena, sizeof(char), _Alignof(char));
|
|
||||||
{
|
{
|
||||||
|
int font_bitmap_size = g_font_bitmap_width * g_font_bitmap_height;
|
||||||
|
g_font_bitmap = memory_arena_allocate(
|
||||||
|
&font_arena, font_bitmap_size, _Alignof(char));
|
||||||
int bake_font_return_value = stbtt_BakeFontBitmap(
|
int bake_font_return_value = stbtt_BakeFontBitmap(
|
||||||
font_data.data, 0,
|
font_data.data, 0,
|
||||||
20.0,
|
20.0,
|
||||||
|
|||||||
Reference in new issue
Block a user