+TexturePtr
+TextureManager::create_dummy_texture()
+{
+ const std::string dummy_texture_fname = "images/engine/missing.png";
+
+ // on error, try loading placeholder file
+ try
+ {
+ TexturePtr tex = create_image_texture_raw(dummy_texture_fname);
+ return tex;
+ }
+ catch (const std::exception& err)
+ {
+ // on error (when loading placeholder), try using empty surface,
+ // when that fails to, just give up
+ SDLSurfacePtr image(SDL_CreateRGBSurface(0, 1024, 1024, 8, 0, 0, 0, 0));
+ if (!image)
+ {
+ throw err;
+ }
+ else
+ {
+ log_warning << "Couldn't load texture '" << dummy_texture_fname << "' (now using empty one): " << err.what() << std::endl;
+ return VideoSystem::new_texture(image.get());
+ }
+ }