From b18af8441117908f8e920e56bffa540b291716c5 Mon Sep 17 00:00:00 2001 From: iProgramInCpp Date: Fri, 19 Apr 2024 16:05:51 +0300 Subject: [PATCH] * Win32: Don't close app if texture missing. --- platforms/windows/AppPlatform_win32.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/platforms/windows/AppPlatform_win32.cpp b/platforms/windows/AppPlatform_win32.cpp index 8e23990..2c66582 100644 --- a/platforms/windows/AppPlatform_win32.cpp +++ b/platforms/windows/AppPlatform_win32.cpp @@ -169,12 +169,13 @@ Texture AppPlatform_win32::loadTexture(const std::string& str, bool bIsRequired) if (!bIsRequired) return Texture(0, 0, nullptr, 1, 0); - const std::string msg = "Error loading " + realPath + ". Did you unzip the Minecraft assets?"; - MessageBoxA(GetHWND(), msg.c_str(), getWindowTitle(), MB_OK); + const std::string msg = "Error loading " + realPath + ". Did you unzip the Minecraft assets?\n\nNote, you will be warned for every missing texture."; + MessageBoxA(GetHWND(), msg.c_str(), getWindowTitle(), MB_OK | MB_ICONERROR); if (f) fclose(f); - ::exit(1); + + return Texture(0, 0, nullptr, 0, 0); } int width = 0, height = 0, channels = 0;