#include "screen.h"
#include "SDL_opengl.h"
+#include <fcntl.h> // for access(2)
+#include <unistd.h> // for access(2)
using namespace IPDF;
using namespace std;
*/
void Screen::RenderBMP(const char * filename) const
{
+ if (access(filename, R_OK) == -1)
+ {
+ Error("No such file \"%s\" - Nothing to render - You might have done this deliberately?", filename);
+ return;
+ }
SDL_Surface * bmp = SDL_LoadBMP(filename);
if (bmp == NULL)
Fatal("Failed to load BMP from %s - %s", filename, SDL_GetError());