summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2025-07-17 16:43:29 -0700
committer3gg <3gg@shellblade.net>2025-07-17 16:43:29 -0700
commit10cd24c9e5da615064c782effafc7477bf074054 (patch)
tree4fb371e9be9d66f27915a92f11afa2b8c9a1291e
parent18e0598ad1e664f7dfd0bb077a50ee45101a9ce8 (diff)
Use C23
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/backend.c24
2 files changed, 13 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e4a677d..42d2502 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0)
2 2
3project(isogfx) 3project(isogfx)
4 4
5set(CMAKE_C_STANDARD 17) 5set(CMAKE_C_STANDARD 23)
6set(CMAKE_C_STANDARD_REQUIRED On) 6set(CMAKE_C_STANDARD_REQUIRED On)
7set(CMAKE_C_EXTENSIONS Off) 7set(CMAKE_C_EXTENSIONS Off)
8 8
diff --git a/src/backend.c b/src/backend.c
index 567146f..94f1728 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -36,10 +36,10 @@ IsoBackend* iso_backend_init(const IsoGfx* iso) {
36 36
37 IsoBackend* backend = calloc(1, sizeof(IsoBackend)); 37 IsoBackend* backend = calloc(1, sizeof(IsoBackend));
38 if (!backend) { 38 if (!backend) {
39 return 0; 39 return nullptr;
40 } 40 }
41 41
42 if (!(backend->gfx = gfx_init())) { 42 if (!((backend->gfx = gfx_init()))) {
43 goto cleanup; 43 goto cleanup;
44 } 44 }
45 GfxCore* gfxcore = gfx_get_core(backend->gfx); 45 GfxCore* gfxcore = gfx_get_core(backend->gfx);
@@ -47,14 +47,14 @@ IsoBackend* iso_backend_init(const IsoGfx* iso) {
47 int screen_width, screen_height; 47 int screen_width, screen_height;
48 isogfx_get_screen_size(iso, &screen_width, &screen_height); 48 isogfx_get_screen_size(iso, &screen_width, &screen_height);
49 49
50 if (!(backend->screen_texture = gfx_make_texture( 50 if (!((backend->screen_texture = gfx_make_texture(
51 gfxcore, &(TextureDesc){.width = screen_width, 51 gfxcore, &(TextureDesc){.width = screen_width,
52 .height = screen_height, 52 .height = screen_height,
53 .dimension = Texture2D, 53 .dimension = Texture2D,
54 .format = TextureSRGBA8, 54 .format = TextureSRGBA8,
55 .filtering = NearestFiltering, 55 .filtering = NearestFiltering,
56 .wrap = ClampToEdge, 56 .wrap = ClampToEdge,
57 .mipmaps = false}))) { 57 .mipmaps = false})))) {
58 goto cleanup; 58 goto cleanup;
59 } 59 }
60 60
@@ -75,7 +75,7 @@ IsoBackend* iso_backend_init(const IsoGfx* iso) {
75 .name = sstring_make("Texture")}; 75 .name = sstring_make("Texture")};
76 Material* material = gfx_make_material(&material_desc); 76 Material* material = gfx_make_material(&material_desc);
77 if (!material) { 77 if (!material) {
78 return false; 78 return nullptr;
79 } 79 }
80 80
81 const MeshDesc mesh_desc = 81 const MeshDesc mesh_desc =
@@ -92,7 +92,7 @@ cleanup:
92 gfx_destroy(&backend->gfx); 92 gfx_destroy(&backend->gfx);
93 } 93 }
94 free(backend); 94 free(backend);
95 return 0; 95 return nullptr;
96} 96}
97 97
98void iso_backend_shutdown(IsoBackend** ppApp) { 98void iso_backend_shutdown(IsoBackend** ppApp) {