Skip to content

Commit

Permalink
Fix 'Could not locate uniform: u_Time' shader error when noise is dis…
Browse files Browse the repository at this point in the history
…abled
  • Loading branch information
drfiemost committed Dec 23, 2023
1 parent db548fb commit 4467e33
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Hurrican/src/DX8Graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,8 @@ bool DirectGraphicsClass::SetDeviceInfo() {
Shaders[PROGRAM_RENDER].NameClr = Shaders[PROGRAM_RENDER].GetAttribute("a_Color");
Shaders[PROGRAM_RENDER].NameTex = Shaders[PROGRAM_RENDER].GetAttribute("a_Texcoord0");
Shaders[PROGRAM_RENDER].NameMvp = Shaders[PROGRAM_RENDER].GetUniform("u_MVPMatrix");
NameTime = Shaders[PROGRAM_RENDER].GetUniform("u_Time");
if (CommandLineParams.ScreenNoise)
NameTime = Shaders[PROGRAM_RENDER].GetUniform("u_Time");
#endif /* USE_GL2 || USE_GL3 */

/* Matrices setup */
Expand Down Expand Up @@ -577,7 +578,7 @@ void DirectGraphicsClass::RendertoBuffer(GLenum PrimitiveType,
// Check if the program is already in use
if (ProgramCurrent != program_next) {
Shaders[program_next].Use();
if (program_next==PROGRAM_RENDER) {
if (CommandLineParams.ScreenNoise && (program_next==PROGRAM_RENDER)) {
glUniform1i(NameTime, 50*SDL_GetTicks()/1000);
}
ProgramCurrent = program_next;
Expand Down

0 comments on commit 4467e33

Please sign in to comment.