Removed unecessary if

main
noah metz 2024-10-17 09:26:16 -06:00
parent c59c643cd0
commit 717a072b3d
2 changed files with 4 additions and 10 deletions

@ -247,7 +247,7 @@ VkResult render_thread(GLFWwindow* window, RenderContext* render_context) {
FontDescriptor test_font; FontDescriptor test_font;
uint32_t* charmap; uint32_t* charmap;
result = load_font(render_context->device, render_context->allocator, ui_context.font_layout, ui_context.font_pool, render_context->transfer_pool, render_context->transfer_queue, library, "test.ttf", 16, VK_FALSE, &charmap, &test_font); result = load_font(render_context->device, render_context->allocator, ui_context.font_layout, ui_context.font_pool, render_context->transfer_pool, render_context->transfer_queue, library, "test.ttf", 16, VK_TRUE, &charmap, &test_font);
if(result != VK_SUCCESS) { if(result != VK_SUCCESS) {
return result; return result;
} }

@ -525,15 +525,9 @@ VkResult load_font(VkDevice device, VmaAllocator allocator, VkDescriptorSetLayou
FT_Load_Glyph(face, glyph_index, load_flags); FT_Load_Glyph(face, glyph_index, load_flags);
for(uint32_t y = 0; y < face->glyph->bitmap.rows; y++) { for(uint32_t y = 0; y < face->glyph->bitmap.rows; y++) {
for(uint32_t x = 0; x < face->glyph->bitmap.width; x++) { for(uint32_t x = 0; x < face->glyph->bitmap.width; x++) {
if(antialias == VK_TRUE) {
uint32_t level = face->glyph->bitmap.buffer[y*face->glyph->bitmap.width+x]; uint32_t level = face->glyph->bitmap.buffer[y*face->glyph->bitmap.width+x];
level = ((level * 0xFFFFFF) / 256) << 8; level = ((level * 0xFFFFFF) / 256) << 8;
images[max_width*max_height*i + max_width*y + x] = 0x000000FF + level; images[max_width*max_height*i + max_width*y + x] = 0x000000FF + level;
} else {
if(face->glyph->bitmap.buffer[y*face->glyph->bitmap.width+x] != 0) {
images[max_width*max_height*i + max_width*y + x] = 0xFFFFFFFF;
}
}
} }
} }
} }