From 5fbd63116d427656c30bb92f1e2a8b6221912324 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Thu, 9 Nov 2023 12:11:29 -0500 Subject: [PATCH] [OpenGL] Provide a visible fatal error if shader can't be read --- lib/ivis_opengl/gfx_api_gl.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ivis_opengl/gfx_api_gl.cpp b/lib/ivis_opengl/gfx_api_gl.cpp index ab679a130ea..bc2b3ed51d2 100644 --- a/lib/ivis_opengl/gfx_api_gl.cpp +++ b/lib/ivis_opengl/gfx_api_gl.cpp @@ -1207,7 +1207,11 @@ std::string gl_pipeline_state_object::readShaderBuf(const std::string& name, std char *buffer; fp = PHYSFS_openRead(name.c_str()); - ASSERT_OR_RETURN(nullptr, fp != nullptr, "Could not open %s", name.c_str()); + if (fp == nullptr) + { + debug(LOG_FATAL, "Failed to read required shader file: %s\nPlease remove any mods and/or reinstall Warzone 2100.", name.c_str()); + return ""; + } debug(LOG_3D, "Reading...[directory: %s] %s", PHYSFS_getRealDir(name.c_str()), name.c_str()); filesize = PHYSFS_fileLength(fp); buffer = (char *)malloc(filesize + 1);