diff options
Diffstat (limited to 'src/shader_sys.c')
| -rw-r--r-- | src/shader_sys.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/shader_sys.c b/src/shader_sys.c index 2686f5f..d19e64b 100644 --- a/src/shader_sys.c +++ b/src/shader_sys.c @@ -111,18 +111,15 @@ i32 load_new_shader(const char* path) } } //TODO: Handle slots a bit better. - if(current_idx == BLANK_DEFAULT) - TRACELOG(LOG_WARNING, "Warning: No more empty shader slots.\n"); + assert(current_idx != BLANK_DEFAULT); return current_idx; } void set_active_shader(i32 idx) { - if(idx < 0 || idx >= MAX_SHADER_SIZE) - TRACELOG(LOG_WARNING,"Bounds check: Attempted to set shader at non-existent index %i.\n", idx); - else - BeginShaderMode(shader_slots[idx]); + assert(idx >= 0 && idx < MAX_SHADER_SIZE); + BeginShaderMode(shader_slots[idx]); } void update_shaders(void) @@ -148,10 +145,7 @@ void reset_active_shader(void) void unload_shader(i32 idx) { - if(idx < 0 || idx >= MAX_SHADER_SIZE){ - TRACELOG(LOG_WARNING,"Bounds check: Attempted to unload shader at non-existent index %i.\n", idx); - return; - } + assert(idx >= 0 && idx < MAX_SHADER_SIZE); UnloadShader(shader_slots[idx]); shader_slots[idx] = (Shader){0}; |
