Skip to content

Commit

Permalink
[OpenGL] Provide a visible fatal error if shader can't be read
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Nov 9, 2023
1 parent 13061cc commit 5fbd631
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/ivis_opengl/gfx_api_gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5fbd631

Please sign in to comment.