From c78954d80d27c2fac7fe24e3c4e7766408706c48 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Sat, 17 Feb 2024 13:16:11 -0800 Subject: Asset cache returns const Texture. --- game/src/plugins/texture_view.c | 14 +++++++------- game/src/plugins/viewer.c | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'game/src') diff --git a/game/src/plugins/texture_view.c b/game/src/plugins/texture_view.c index fda62db..b624f46 100644 --- a/game/src/plugins/texture_view.c +++ b/game/src/plugins/texture_view.c @@ -35,13 +35,13 @@ bool init(Game* game, State** pp_state) { RenderBackend* render_backend = gfx_get_render_backend(game->gfx); - Texture* texture = gfx_load_texture( - render_backend, &(LoadTextureCmd){ - .origin = TextureFromFile, - .type = LoadTexture, - .filtering = LinearFiltering, - .mipmaps = false, - .data.texture.filepath = mstring_make(texture_file)}); + const Texture* texture = gfx_load_texture( + game->gfx, &(LoadTextureCmd){ + .origin = AssetFromFile, + .type = LoadTexture, + .filtering = LinearFiltering, + .mipmaps = false, + .data.texture.filepath = mstring_make(texture_file)}); if (!texture) { goto cleanup; } diff --git a/game/src/plugins/viewer.c b/game/src/plugins/viewer.c index dd7f451..c58b0e0 100644 --- a/game/src/plugins/viewer.c +++ b/game/src/plugins/viewer.c @@ -30,7 +30,7 @@ struct State { }; /// Load the skyquad texture. -static Texture* load_environment_map(Gfx* gfx) { +static const Texture* load_environment_map(Gfx* gfx) { assert(gfx); return gfx_load_texture( gfx, &(LoadTextureCmd){ @@ -56,7 +56,7 @@ static SceneNode* load_skyquad(Gfx* gfx, SceneNode* root) { RenderBackend* render_backend = gfx_get_render_backend(gfx); - Texture* environment_map = load_environment_map(gfx); + const Texture* environment_map = load_environment_map(gfx); if (!environment_map) { return 0; } -- cgit v1.2.3