diff --git a/src/cache.cpp b/src/cache.cpp index d9f29dd32bd..33a54936bf1 100644 --- a/src/cache.cpp +++ b/src/cache.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include "async_handler.h" #include "cache.h" @@ -274,13 +275,15 @@ namespace { return LoadDummyBitmap(s.directory, f); } +#ifndef NDEBUG // Test if the file was requested asynchronously before. // If not the file can't be expected to exist -> bug. + // This test is expensive and turned off in release builds. FileRequestAsync* request = AsyncHandler::RequestFile(s.directory, f); if (!request->IsReady()) { - Output::Debug("BUG: File Not Requested: %s/%s", s.directory, f.c_str()); - return BitmapRef(); + Output::Error("BUG: File Not Requested: %s/%s", s.directory, f.c_str()); } +#endif BitmapRef ret = LoadBitmap(s.directory, f, transparent, Bitmap::Flag_ReadOnly | ( T == Material::Chipset? Bitmap::Flag_Chipset: