From ae70ae002eb3b28b84ed9027a6e1d20985f6a087 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 19 Jan 2017 00:45:39 +0300 Subject: Add physfs reporting errors on error loading images. --- src/resources/atlas/atlasmanager.cpp | 4 ++++ src/resources/loaders/imageloader.cpp | 1 + src/resources/loaders/musicloader.cpp | 1 + src/resources/loaders/soundloader.cpp | 1 + 4 files changed, 7 insertions(+) (limited to 'src') diff --git a/src/resources/atlas/atlasmanager.cpp b/src/resources/atlas/atlasmanager.cpp index 4e9028027..90b72b4d6 100644 --- a/src/resources/atlas/atlasmanager.cpp +++ b/src/resources/atlas/atlasmanager.cpp @@ -166,6 +166,10 @@ void AtlasManager::loadImages(const StringVect &files, images.push_back(image); } } + else + { + reportAlways("Physfs error: %s", PhysFs::getLastError()); + } delete d; } BLOCK_END("AtlasManager::loadImages") diff --git a/src/resources/loaders/imageloader.cpp b/src/resources/loaders/imageloader.cpp index 87abf97bb..21e7479f4 100644 --- a/src/resources/loaders/imageloader.cpp +++ b/src/resources/loaders/imageloader.cpp @@ -67,6 +67,7 @@ namespace { delete d; reportAlways("Image loading error: %s", path1.c_str()); + reportAlways("Physfs error: %s", PhysFs::getLastError()); BLOCK_END("DyedImageLoader::load") return nullptr; } diff --git a/src/resources/loaders/musicloader.cpp b/src/resources/loaders/musicloader.cpp index 1a5ae19b2..4610911bb 100644 --- a/src/resources/loaders/musicloader.cpp +++ b/src/resources/loaders/musicloader.cpp @@ -48,6 +48,7 @@ namespace SDL_RWops *const rw = MPHYSFSRWOPS_openRead(rl->path.c_str()); if (!rw) { + reportAlways("Physfs error: %s", PhysFs::getLastError()); reportAlways("Error loading resource: %s", rl->path.c_str()); return nullptr; diff --git a/src/resources/loaders/soundloader.cpp b/src/resources/loaders/soundloader.cpp index 172170b94..0934c1852 100644 --- a/src/resources/loaders/soundloader.cpp +++ b/src/resources/loaders/soundloader.cpp @@ -48,6 +48,7 @@ namespace SDL_RWops *const rw = MPHYSFSRWOPS_openRead(rl->path.c_str()); if (!rw) { + reportAlways("Physfs error: %s", PhysFs::getLastError()); reportAlways("Error loading resource: %s", rl->path.c_str()); return nullptr; -- cgit v1.2.3-60-g2f50