diff --git a/GUIManager.cpp b/GUIManager.cpp index 09e3102b..ea24bf49 100644 --- a/GUIManager.cpp +++ b/GUIManager.cpp @@ -130,7 +130,13 @@ namespace ed font = fonts->AddFontDefault(); else font = fonts->AddFontFromFileTTF(m_cachedFont.c_str(), m_cachedFontSize); - fonts->AddFontFromFileTTF(edFont.first.c_str(), edFont.second); + ImFont* edFontPtr = fonts->AddFontFromFileTTF(edFont.first.c_str(), edFont.second); + + if (font == nullptr || edFontPtr == nullptr) { + fonts->Clear(); + font = fonts->AddFontDefault(); + font = fonts->AddFontDefault(); + } ImGui::GetIO().FontDefault = font; fonts->Build(); diff --git a/SHADERed.vcxproj b/SHADERed.vcxproj index 5acd6623..5753cbbd 100644 --- a/SHADERed.vcxproj +++ b/SHADERed.vcxproj @@ -42,7 +42,7 @@ Application true - v141 + v142 Unicode @@ -110,6 +110,7 @@ _DEBUG;_CONSOLE;%(PreprocessorDefinitions) true pch.h + E:\SHADERed\libs;E:\MoonLight\inc;%(AdditionalIncludeDirectories) Console diff --git a/main.cpp b/main.cpp index 253e919a..10088168 100644 --- a/main.cpp +++ b/main.cpp @@ -57,6 +57,11 @@ int main() fullscreen = preload.get(); maximized = preload.get(); preload.close(); + + if (wndWidth > GetSystemMetrics(SM_CXVIRTUALSCREEN)) + wndWidth = GetSystemMetrics(SM_CXVIRTUALSCREEN); + if (wndHeight > GetSystemMetrics(SM_CYVIRTUALSCREEN)) + wndHeight = GetSystemMetrics(SM_CYVIRTUALSCREEN); } else DeleteFileA("workspace.dat"); // prevent from crashing diff --git a/settings.ini b/settings.ini index 1241c282..3a1734aa 100644 --- a/settings.ini +++ b/settings.ini @@ -9,7 +9,7 @@ reopenshaders=1 openshadersdblclk=1 template=HLSL customfont=0 -font=E:\SHADERed\Debug\inconsolata.ttf +font=inconsolata.ttf fontsize=16 [preview] gizmo=1 @@ -18,7 +18,7 @@ statusbar=1 fpslimit=0 [editor] smartpred=1 -font=E:\SHADERed\inconsolata.ttf +font=inconsolata.ttf fontsize=18 whitespace=0 highlightline=1