aboutsummaryrefslogtreecommitdiff
path: root/src/texture_sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/texture_sys.c')
-rw-r--r--src/texture_sys.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/texture_sys.c b/src/texture_sys.c
index 3254d75..cb7f631 100644
--- a/src/texture_sys.c
+++ b/src/texture_sys.c
@@ -31,18 +31,14 @@ i32 load_new_tex(const char* path)
}
}
//TODO: Handle slots a bit better.
- if(current_idx == BLANK_DEFAULT)
- TRACELOG(LOG_WARNING, "Warning: No more empty texture slots.\n");
+ assert(current_idx != BLANK_DEFAULT);
return current_idx;
}
void draw_texture(i32 idx, i32 x, i32 y)
{
- if(idx < 0 || idx >= MAX_TEX_SIZE){
- TRACELOG(LOG_WARNING,"Bounds check: Attempted to draw texture from non-existent index %i.\n", idx);
- return;
- }
+ assert(idx >= 0 && idx < MAX_TEX_SIZE);
DrawTexture(texture_slots[idx], x, y, WHITE);
}
@@ -64,10 +60,7 @@ void update_textures(void)
void unload_tex(i32 idx)
{
- if(idx < 0 || idx >= MAX_TEX_SIZE){
- TRACELOG(LOG_WARNING,"Bounds check: Attempted to unload texture from non-existent index %i.\n", idx);
- return;
- }
+ assert(idx >= 0 && idx < MAX_TEX_SIZE);
UnloadTexture(texture_slots[idx]);
texture_slots[idx] = (Texture2D){0};
texture_modtimes[idx] = BLANK_DEFAULT;