From c91612c77539e8435d27bcfecb5d7d9ca93cbbc7 Mon Sep 17 00:00:00 2001 From: "Joseph C. Sible" Date: Sat, 18 Apr 2026 22:39:31 -0400 Subject: [PATCH] Print the filename and error when failing to open a texture --- textures.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/textures.cpp b/textures.cpp index 446d66d2..30f59b72 100644 --- a/textures.cpp +++ b/textures.cpp @@ -258,7 +258,7 @@ bool texture_data::readtexture(string tn) { #elif CAP_PNG FILE *f = fopen(tn.c_str(), "rb"); - if(!f) { printf("failed to open file\n"); return false; } + if(!f) { perror("fopen"); printf("failed to open file %s\n", tn.c_str()); return false; } png_structp png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); if(!png) { printf("failed to create_read_struct\n"); return false; } if(setjmp(png_jmpbuf(png))) {