void Graphics::setTransparent(SDL_Surface *sprite)
{
- SDL_SetColorKey(sprite, SDL_TRUE, SDL_MapRGB(sprite->format, 0, 0, 0));
+ if (sprite)
+ SDL_SetColorKey(sprite, SDL_TRUE, SDL_MapRGB(sprite->format, 0, 0, 0));
}
bool Graphics::canShowMedalMessage() const
SDL_UpdateTexture(texture, NULL, screen->pixels, screen->w * 4);
SDL_RenderCopy(renderer, texture, NULL, NULL);
SDL_RenderPresent(renderer);
+ SDL_RenderClear(renderer);
if (takeRandomScreenShots)
{
#endif
if (!image)
- showErrorAndExit(ERR_FILE, filename);
+ return showErrorAndExit(ERR_FILE, filename), image;
newImage = SDL_ConvertSurface(image, screen->format, 0);
#endif
if (!image)
- showErrorAndExit(ERR_FILE, filename);
+ return showErrorAndExit(ERR_FILE, filename), image;
if ((hue != 0) || (sat != 0) || (value != 0))
{
{
tile[i] = loadImage(filename);
+ if (!tile[i])
+ abort();
+
if (autoAlpha)
{
if ((i < MAP_EXITSIGN) || (i >= MAP_WATERANIM))
{
if (!image)
{
- showErrorAndExit("graphics::blit() - NULL pointer", SDL_GetError());
+ return showErrorAndExit("graphics::blit() - NULL pointer", SDL_GetError());
}
if ((x < -image->w) || (x > 640 + image->w))