mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-24 20:54:59 -07:00
dwrite: do not try to create font face if font file creation fails
This commit is contained in:
@@ -337,7 +337,10 @@ fp_font_open(String8 path)
|
||||
{
|
||||
String16 path16 = str16_from_8(scratch.arena, t->path);
|
||||
error = IDWriteFactory_CreateFontFileReference(fp_dwrite_state->factory, (WCHAR *)path16.str, 0, &font.file);
|
||||
error = IDWriteFactory_CreateFontFace(fp_dwrite_state->factory, DWRITE_FONT_FACE_TYPE_TRUETYPE, 1, &font.file, 0, DWRITE_FONT_SIMULATIONS_NONE, &font.face);
|
||||
if(font.file != 0)
|
||||
{
|
||||
error = IDWriteFactory_CreateFontFace(fp_dwrite_state->factory, DWRITE_FONT_FACE_TYPE_TRUETYPE, 1, &font.file, 0, DWRITE_FONT_SIMULATIONS_NONE, &font.face);
|
||||
}
|
||||
|
||||
// rjf: failure trying just the normal path? -> generate new tasks that search in system folders
|
||||
if(t == first_task && font.file == 0)
|
||||
|
||||
@@ -11310,7 +11310,8 @@ rd_frame(void)
|
||||
{
|
||||
U64 candidate_frame_time_us = 1000000/(U64)candidate;
|
||||
S64 frame_time_us_diff = (S64)frame_time_history_avg_us - (S64)candidate_frame_time_us;
|
||||
if(abs_s64(frame_time_us_diff) < best_target_hz_frame_time_us_diff)
|
||||
if(abs_s64(frame_time_us_diff) < best_target_hz_frame_time_us_diff &&
|
||||
frame_time_history_avg_us < candidate_frame_time_us + 1000)
|
||||
{
|
||||
best_target_hz = candidate;
|
||||
best_target_hz_frame_time_us_diff = frame_time_us_diff;
|
||||
|
||||
Reference in New Issue
Block a user