oops... fix first-time config initialization disaster!

This commit is contained in:
Ryan Fleury
2024-01-12 15:44:11 -08:00
parent ca8727c4af
commit 5410fac38e
3 changed files with 13 additions and 5 deletions
+1 -1
View File
@@ -7212,7 +7212,7 @@ df_core_begin_frame(Arena *arena, DF_CmdList *cmds, F32 dt)
{
for(DF_CfgSrc src = (DF_CfgSrc)0; src < DF_CfgSrc_COUNT; src = (DF_CfgSrc)(src+1))
{
cfg_load[src] = (load_cfg[src] && cfg_timestamps[src] != 0 && ((cfg_save[src] == 0 && df_state->cfg_cached_timestamp[src] != cfg_timestamps[src]) || cfg_files[src]->timestamp == 0));
cfg_load[src] = (load_cfg[src] && ((cfg_save[src] == 0 && df_state->cfg_cached_timestamp[src] != cfg_timestamps[src]) || cfg_files[src]->timestamp == 0));
cfg_load_any = cfg_load_any || cfg_load[src];
}
}
+1 -1
View File
@@ -11530,7 +11530,7 @@ df_gfx_begin_frame(Arena *arena, DF_CmdList *cmds)
}
//- rjf: if config opened 0 windows, we need to do some sensible default
if(df_gfx_state->first_window == 0)
if(windows->first == &df_g_nil_cfg_node)
{
OS_Handle preferred_monitor = os_primary_monitor();
Vec2F32 monitor_dim = os_dim_from_monitor(preferred_monitor);
+11 -3
View File
@@ -161,6 +161,11 @@ r_init(CmdLine *cmdln)
feature_levels, ArrayCount(feature_levels),
D3D11_SDK_VERSION,
&r_d3d11_state->base_device, 0, &r_d3d11_state->base_device_ctx);
if(!SUCCEEDED(error))
{
os_graphical_message(1, str8_lit("Fatal Error"), str8_lit("D3D11 device creation failure. The process is terminating."));
os_exit_process(1);
}
//- rjf: enable break-on-error
#if !defined(NDEBUG)
@@ -168,9 +173,12 @@ r_init(CmdLine *cmdln)
{
ID3D11InfoQueue *info = 0;
error = r_d3d11_state->base_device->QueryInterface(__uuidof(ID3D11InfoQueue), (void **)(&info));
error = info->SetBreakOnSeverity(D3D11_MESSAGE_SEVERITY_CORRUPTION, TRUE);
error = info->SetBreakOnSeverity(D3D11_MESSAGE_SEVERITY_ERROR, TRUE);
info->Release();
if(SUCCEEDED(error))
{
error = info->SetBreakOnSeverity(D3D11_MESSAGE_SEVERITY_CORRUPTION, TRUE);
error = info->SetBreakOnSeverity(D3D11_MESSAGE_SEVERITY_ERROR, TRUE);
info->Release();
}
}
#endif