aboutsummaryrefslogtreecommitdiff
path: root/src/texture_sys.c
diff options
context:
space:
mode:
authorUneven Prankster <unevenprankster@protonmail.com>2023-07-25 09:06:34 -0300
committerUneven Prankster <unevenprankster@protonmail.com>2023-07-25 09:06:34 -0300
commitb6923926a1faa02e2e9341c6e53193fd878718e2 (patch)
tree51ebf89babee2b8074e904be7c2eedd4db6c8ae0 /src/texture_sys.c
parent14226c542d7d3d32fb52370deea20e3609cd2b4c (diff)
Defined some base types. Based or cringe?
Diffstat (limited to 'src/texture_sys.c')
-rw-r--r--src/texture_sys.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/texture_sys.c b/src/texture_sys.c
index 170e124..3481a69 100644
--- a/src/texture_sys.c
+++ b/src/texture_sys.c
@@ -5,22 +5,22 @@
#define MAX_TEX_SIZE 16
static Texture2D texture_slots[MAX_TEX_SIZE] = {0};
-static long texture_modtimes[MAX_TEX_SIZE] = {0};
+static i32 texture_modtimes[MAX_TEX_SIZE] = {0};
static const char* texture_paths[MAX_TEX_SIZE] = {0};
void init_tex_sys(void)
{
- for(int i = 0; i < MAX_TEX_SIZE; ++i){
+ for(i32 i = 0; i < MAX_TEX_SIZE; ++i){
texture_slots[i] = (Texture2D){0};
texture_modtimes[i] = BLANK_DEFAULT;
texture_paths[i] = NULL;
}
}
-int load_new_tex(const char* path)
+i32 load_new_tex(const char* path)
{
- int current_idx = BLANK_DEFAULT;
- for(int i = 0; i < MAX_TEX_SIZE; ++i){
+ i32 current_idx = BLANK_DEFAULT;
+ for(i32 i = 0; i < MAX_TEX_SIZE; ++i){
if(texture_slots[i].id <= 0){
current_idx = i;
texture_slots[current_idx] = LoadTexture(path);
@@ -36,7 +36,7 @@ int load_new_tex(const char* path)
return current_idx;
}
-void draw_texture(int idx, int x, int y)
+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);
@@ -47,9 +47,9 @@ void draw_texture(int idx, int x, int y)
void update_textures(void)
{
- for(int i = 0; i < MAX_TEX_SIZE; ++i){
+ for(i32 i = 0; i < MAX_TEX_SIZE; ++i){
if(texture_slots[i].id > 0){
- long current_mod = GetFileModTime(texture_paths[i]);
+ i32 current_mod = GetFileModTime(texture_paths[i]);
if(current_mod != texture_modtimes[i]){
texture_modtimes[i] = current_mod;
@@ -61,7 +61,7 @@ void update_textures(void)
}
}
-void unload_tex(int idx)
+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);
@@ -75,7 +75,7 @@ void unload_tex(int idx)
void unload_active_textures(void)
{
- for(int i = 0; i < MAX_TEX_SIZE; ++i){
+ for(i32 i = 0; i < MAX_TEX_SIZE; ++i){
if(texture_slots[i].id > 0)
unload_tex(i);
}