Fixed bug #764
Added better error checking from Mason Wheeler --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403908
This commit is contained in:
parent
ba8fff9ab2
commit
ac573d8522
1 changed files with 9 additions and 3 deletions
|
@ -2417,11 +2417,17 @@ SDL_RenderCopy(SDL_TextureID textureID, const SDL_Rect * srcrect,
|
|||
SDL_Rect real_srcrect;
|
||||
SDL_Rect real_dstrect;
|
||||
|
||||
if (!texture || texture->renderer != SDL_CurrentDisplay.current_renderer) {
|
||||
return -1;
|
||||
}
|
||||
renderer = SDL_CurrentDisplay.current_renderer;
|
||||
if (!renderer) {
|
||||
SDL_SetError("No current renderer available");
|
||||
return -1;
|
||||
}
|
||||
if (!texture) {
|
||||
SDL_SetError("Texture not found");
|
||||
return -1;
|
||||
}
|
||||
if (texture->renderer != renderer) {
|
||||
SDL_SetError("Texture was not created with this renderer");
|
||||
return -1;
|
||||
}
|
||||
if (!renderer->RenderCopy) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue