From 298d4f1bab15c6e9956e83a542d44781d92afcf0 Mon Sep 17 00:00:00 2001 From: Fierelier Date: Mon, 15 May 2023 10:40:41 +0200 Subject: [PATCH] Fix engine_texture_from_file not using the correct length --- modules/engine/frontend/generic/textures.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/engine/frontend/generic/textures.c b/modules/engine/frontend/generic/textures.c index e290831..52bee94 100644 --- a/modules/engine/frontend/generic/textures.c +++ b/modules/engine/frontend/generic/textures.c @@ -73,6 +73,6 @@ void engine_texture_render_2d(struct ENGINE_TEXTURE * texture,int sx,int sy) { void engine_texture_from_file(struct ENGINE_TEXTURE * texture,char * fpath) { FILE * f = fopen(fpath,"r"); - fgets(((struct ENGINE_GENERIC_TEXTURE *)(texture->fe_texture))->pixels,texture->width * texture->height,f); + fgets(((struct ENGINE_GENERIC_TEXTURE *)(texture->fe_texture))->pixels,texture->width * texture->height * 4,f); fclose(f); }