add mySDL_GetError
This commit is contained in:
@@ -1269,3 +1269,15 @@ SDL_Surface *mySDL_MakeDummySurface( int height, int width )
|
|||||||
|
|
||||||
return ret_image;
|
return ret_image;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* SDL sometimes fails to set an error, in which case we get the null string. We
|
||||||
|
* sometimes use that as a sentinel return value. This function returns "(none)"
|
||||||
|
* if no error is set. */
|
||||||
|
CString mySDL_GetError()
|
||||||
|
{
|
||||||
|
CString error = SDL_GetError();
|
||||||
|
if( error == "" )
|
||||||
|
return "(none)"; /* SDL sometimes fails to set an error */
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -88,5 +88,7 @@ SDL_RWops *OpenRWops( const CString &sPath, bool Write=false );
|
|||||||
SDL_RWops *OpenRWops( CString &sBuf );
|
SDL_RWops *OpenRWops( CString &sBuf );
|
||||||
SDL_Surface *mySDL_MakeDummySurface( int height, int width );
|
SDL_Surface *mySDL_MakeDummySurface( int height, int width );
|
||||||
|
|
||||||
|
CString mySDL_GetError();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user