diff options
Diffstat (limited to 'src/shader_sys.c')
| -rw-r--r-- | src/shader_sys.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/shader_sys.c b/src/shader_sys.c index 180bdef..0fcc6ce 100644 --- a/src/shader_sys.c +++ b/src/shader_sys.c @@ -21,28 +21,28 @@ static char* shader_block_preprocess(const char* shader_source, ShaderStep shade char* parsed_total = NULL; - int start_idx = TextFindIndex(shader_source, start_markers[shader_step]); + i32 start_idx = TextFindIndex(shader_source, start_markers[shader_step]); if (start_idx == BLANK_DEFAULT){ TRACELOG(LOG_ERROR, "%s could not be found.", start_markers[shader_step]); goto parse_err; } start_idx += TextLength(start_markers[shader_step]); - int end_idx = TextFindIndex(shader_source, end_markers[shader_step]); + i32 end_idx = TextFindIndex(shader_source, end_markers[shader_step]); if (end_idx == BLANK_DEFAULT){ TRACELOG(LOG_ERROR, "%s could not be found. Don't forget to end blocks!", end_markers[shader_step]); goto parse_err; } - int block_sz = end_idx - start_idx; + i32 block_sz = end_idx - start_idx; const char* block = TextSubtext(shader_source, start_idx, block_sz); - int total_block_size = block_sz + TextLength(version_statement); + i32 total_block_size = block_sz + TextLength(version_statement); parsed_total = (char*)RL_MALLOC(total_block_size + NULL_TERM_SZ); - int cursor = 0; + i32 cursor = 0; TextAppend(parsed_total, version_statement, &cursor); TextAppend(parsed_total, block, &cursor); @@ -81,22 +81,22 @@ vertex_err: } static Shader shader_slots[MAX_SHADER_SIZE] = {0}; -static long shader_modtimes[MAX_SHADER_SIZE] = {0}; +static i32 shader_modtimes[MAX_SHADER_SIZE] = {0}; static const char* shader_paths[MAX_SHADER_SIZE] = {0}; void init_shader_sys(void) { - for(int i = 0; i < MAX_SHADER_SIZE; ++i){ + for(i32 i = 0; i < MAX_SHADER_SIZE; ++i){ shader_slots[i] = (Shader){0}; shader_modtimes[i] = BLANK_DEFAULT; shader_paths[i] = NULL; } } -int load_new_shader(const char* path) +i32 load_new_shader(const char* path) { - int current_idx = BLANK_DEFAULT; - for(int i = 0; i < MAX_SHADER_SIZE; ++i){ + i32 current_idx = BLANK_DEFAULT; + for(i32 i = 0; i < MAX_SHADER_SIZE; ++i){ if(shader_slots[i].id <= 0){ current_idx = i; shader_slots[current_idx] = load_joined_shader(path); @@ -112,7 +112,7 @@ int load_new_shader(const char* path) return current_idx; } -void set_active_shader(int 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); @@ -122,9 +122,9 @@ void set_active_shader(int idx) void update_shaders(void) { - for(int i = 0; i < MAX_SHADER_SIZE; ++i){ + for(i32 i = 0; i < MAX_SHADER_SIZE; ++i){ if(shader_slots[i].id > 0){ - long current_mod = GetFileModTime(shader_paths[i]); + i32 current_mod = GetFileModTime(shader_paths[i]); if(current_mod != shader_modtimes[i]){ shader_modtimes[i] = current_mod; @@ -141,7 +141,7 @@ void reset_active_shader(void) EndShaderMode(); } -void unload_shader(int idx) +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); @@ -156,7 +156,7 @@ void unload_shader(int idx) void unload_active_shaders(void) { - for(int i = 0; i < MAX_SHADER_SIZE; ++i){ + for(i32 i = 0; i < MAX_SHADER_SIZE; ++i){ if(shader_slots[i].id > 0) unload_shader(i); } |
