File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -1590,14 +1590,14 @@ surf_convert(pgSurfaceObject *self, PyObject *args)
15901590static SDL_Surface *
15911591pg_DisplayFormat (SDL_Surface * surface )
15921592{
1593- if (! pg_GetDefaultConvertFormat ()) {
1594- SDL_SetError ( "No convert format has been set, try display.set_mode()"
1595- // " or Window.get_surface()"
1596- // (uncomment when Window API is published)
1597- );
1593+ SDL_PixelFormat * default_format = pg_GetDefaultConvertFormat ();
1594+ if (! default_format ) {
1595+ SDL_SetError (
1596+ "No convert format has been set, try display.set_mode()"
1597+ " or Window.get_surface()." );
15981598 return NULL ;
15991599 }
1600- return PG_ConvertSurface (surface , pg_GetDefaultConvertFormat () );
1600+ return PG_ConvertSurface (surface , default_format );
16011601}
16021602
16031603static SDL_Surface *
@@ -1611,10 +1611,9 @@ pg_DisplayFormatAlpha(SDL_Surface *surface)
16111611 Uint32 bmask = 0x000000ff ;
16121612
16131613 if (!pg_GetDefaultConvertFormat ()) {
1614- SDL_SetError ("No convert format has been set, try display.set_mode()"
1615- // " or Window.get_surface()"
1616- // (uncomment when Window API is published)
1617- );
1614+ SDL_SetError (
1615+ "No convert format has been set, try display.set_mode()"
1616+ " or Window.get_surface()." );
16181617 return NULL ;
16191618 }
16201619 dformat = pg_GetDefaultConvertFormat ();
You can’t perform that action at this time.
0 commit comments