Skip to content

Commit

Permalink
Apply Guichan's changes from 2c7c2d51801b53adc198446ba3e3b430b1bccd45…
Browse files Browse the repository at this point in the history
… (May 1st 2009)

convertToDisplayFormat has been changed so it now throws an exception if conversion fails.
  • Loading branch information
Jarod42 committed Sep 17, 2024
1 parent fa8d936 commit dab26d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion TODO
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
* Continue rebasing from 248c226d245db0d735653e057dd48d437d0e9eee
* Continue rebasing from 3437d59c7393d5fafe151582d285b3665399a7b7
* Add a focus listener interface.
* Make focus apply synchronously.
* Graphics and input objects for DirectX.
Expand Down
7 changes: 6 additions & 1 deletion src/sdl/sdlimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ namespace gcn
SDL_FreeSurface(mSurface);
mSurface = NULL;

if (tmp == NULL)
{
throw GCN_EXCEPTION("Unable to convert image to display format.");
}

if (hasPink)
{
SDL_SetColorKey(tmp, SDL_TRUE,
Expand All @@ -191,7 +196,7 @@ namespace gcn
SDL_SetTextureBlendMode(tmpTexture, SDL_BLENDMODE_BLEND);
SDL_DestroyTexture(mTexture);
mTexture = tmpTexture;
}
}
}

void SDLImage::free()
Expand Down

0 comments on commit dab26d8

Please sign in to comment.