From f319f0bb59f5e05bd06dcd160699f2b0f2f14e8a Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Sat, 4 Feb 2023 11:16:37 -0800 Subject: Rename cstring -> cstr. --- gfx/src/error.c | 2 +- gfx/src/render/shader.c | 6 +++--- gfx/src/util/texture.c | 18 +++++++++--------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/gfx/src/error.c b/gfx/src/error.c index 3f11747..4370097 100644 --- a/gfx/src/error.c +++ b/gfx/src/error.c @@ -2,4 +2,4 @@ xlstring gfx_error; -const char* gfx_get_error(void) { return xlstring_cstring(&gfx_error); } +const char* gfx_get_error(void) { return xlstring_cstr(&gfx_error); } diff --git a/gfx/src/render/shader.c b/gfx/src/render/shader.c index c8e02fd..d4778a2 100644 --- a/gfx/src/render/shader.c +++ b/gfx/src/render/shader.c @@ -26,9 +26,9 @@ static lstring make_defines_string(const ShaderDesc* desc) { for (size_t i = 0; i < desc->num_defines; ++i) { const ShaderCompilerDefine* define = &desc->defines[i]; lstring_append_cstr(&defines, "#define "); - lstring_append_cstr(&defines, sstring_cstring(&define->name)); + lstring_append_cstr(&defines, sstring_cstr(&define->name)); lstring_append_cstr(&defines, " "); - lstring_append_cstr(&defines, sstring_cstring(&define->value)); + lstring_append_cstr(&defines, sstring_cstr(&define->value)); lstring_append_cstr(&defines, "\n"); } return defines; @@ -50,7 +50,7 @@ static GLuint create_shader(const ShaderDesc* desc) { lstring defines = make_defines_string(desc); - const char* source_bits[] = {header, lstring_cstring(&defines), desc->code}; + const char* source_bits[] = {header, lstring_cstr(&defines), desc->code}; const GLint source_lengths[] = { strlen(header), lstring_length(defines), strlen(desc->code)}; diff --git a/gfx/src/util/texture.c b/gfx/src/util/texture.c index dae5bd2..99241f4 100644 --- a/gfx/src/util/texture.c +++ b/gfx/src/util/texture.c @@ -6,21 +6,21 @@ #define STB_IMAGE_IMPLEMENTATION #include -Texture* gfx_load_texture(RenderBackend* render_backend, - const LoadTextureCmd* cmd) { +Texture* gfx_load_texture( + RenderBackend* render_backend, const LoadTextureCmd* cmd) { assert(render_backend); assert(cmd); assert(cmd->origin == TextureFromFile || cmd->origin == TextureFromMemory); assert(cmd->type == LoadTexture || cmd->type == LoadCubemap); - int width, height, components, old_components; + int width, height, components, old_components; unsigned char* pixels[6] = {0}; switch (cmd->origin) { case TextureFromFile: switch (cmd->type) { case LoadTexture: { - const char* filepath = mstring_cstring(&cmd->data.texture.filepath); + const char* filepath = mstring_cstr(&cmd->data.texture.filepath); pixels[0] = stbi_load(filepath, &width, &height, &components, 0); if (!pixels[0]) { gfx_set_error("Failed to load texture file: %s", filepath); @@ -30,7 +30,7 @@ Texture* gfx_load_texture(RenderBackend* render_backend, case LoadCubemap: for (int i = 0; i < 6; ++i) { const char* filepath = - mstring_cstring(&cmd->data.cubemap.filepaths.filepath_pos_x + i); + mstring_cstr(&cmd->data.cubemap.filepaths.filepath_pos_x + i); stbi_uc* image_pixels = stbi_load(filepath, &width, &height, &components, 0); if (!image_pixels) { @@ -43,7 +43,7 @@ Texture* gfx_load_texture(RenderBackend* render_backend, "components"); break; } - pixels[i] = image_pixels; + pixels[i] = image_pixels; old_components = components; } break; @@ -68,8 +68,8 @@ Texture* gfx_load_texture(RenderBackend* render_backend, } TextureDesc desc = (TextureDesc){0}; - desc.width = width; - desc.height = height; + desc.width = width; + desc.height = height; switch (cmd->type) { case LoadTexture: @@ -113,7 +113,7 @@ Texture* gfx_load_texture(RenderBackend* render_backend, } desc.filtering = cmd->filtering; - desc.mipmaps = cmd->mipmaps; + desc.mipmaps = cmd->mipmaps; switch (cmd->type) { case LoadTexture: -- cgit v1.2.3