Fix engine_texture_from_file not using the correct length

This commit is contained in:
Fierelier 2023-05-15 10:40:41 +02:00
parent 8ead04c256
commit 298d4f1bab

View File

@ -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);
}