src/video/riscos/SDL_wimpvideo.c
branchSDL-1.2
changeset 12913 d07b4feae69c
parent 12786 4e73be7b4787
     1.1 --- a/src/video/riscos/SDL_wimpvideo.c	Tue Jun 11 06:28:12 2019 -0700
     1.2 +++ b/src/video/riscos/SDL_wimpvideo.c	Tue Jun 18 23:55:01 2019 +0100
     1.3 @@ -72,7 +72,7 @@
     1.4  		fmt = WIMP_FindSupportedSpriteFormat(bpp);
     1.5  		if (fmt == NULL)
     1.6  		{
     1.7 -			SDL_SetError("Pixel depth not supported");
     1.8 +			SDL_SetError("Pixel depth %d not supported", bpp);
     1.9  			return NULL;
    1.10  		}
    1.11  	}
    1.12 @@ -88,7 +88,6 @@
    1.13  
    1.14  	/* Allocate the new pixel format for the screen */
    1.15  	if ( ! SDL_ReallocFormat(current, fmt->sdl_bpp, fmt->rmask, fmt->gmask, fmt->bmask, 0) ) {
    1.16 -		SDL_SetError("Couldn't allocate new pixel format for requested mode");
    1.17  		return(NULL);
    1.18  	}
    1.19  
    1.20 @@ -100,7 +99,6 @@
    1.21  	buffer = WIMP_CreateBuffer(width, height, &fmt->ro);
    1.22  	if (buffer == NULL)
    1.23  	{
    1.24 -		SDL_SetError("Couldn't create sprite for video memory");
    1.25  		return (NULL);
    1.26  	}
    1.27  
    1.28 @@ -133,7 +131,6 @@
    1.29  
    1.30  	if (WIMP_SetupWindow(this, current) == 0)
    1.31  	{
    1.32 -		SDL_SetError("Unable to create window to display surface");
    1.33  		return NULL;
    1.34  	}
    1.35  
    1.36 @@ -213,6 +210,7 @@
    1.37  unsigned int WIMP_SetupWindow(_THIS, SDL_Surface *surface)
    1.38  {
    1.39  	_kernel_swi_regs regs;
    1.40 +	_kernel_oserror *error;
    1.41  	int window_data[23];
    1.42      int	*window_block = window_data+1;
    1.43  	int x = ((this->hidden->screen_width << this->hidden->xeig) - (surface->w << 1)) / 2;
    1.44 @@ -255,7 +253,8 @@
    1.45     regs.r[1] = (unsigned int)(window_block);
    1.46     
    1.47     /* Create the window */
    1.48 -   if (_kernel_swi(Wimp_CreateWindow, &regs, &regs) == NULL)
    1.49 +   error = _kernel_swi(Wimp_CreateWindow, &regs, &regs);
    1.50 +   if (error == NULL)
    1.51     {
    1.52  	   this->hidden->window_handle = window_data[0] = regs.r[0];
    1.53  
    1.54 @@ -268,8 +267,10 @@
    1.55         {
    1.56  		  WIMP_DeleteWindow(this);
    1.57  	   }
    1.58 +   } else {
    1.59 +       SDL_SetError("Unable to create window: %s (%i)", error->errmess, error->errnum);
    1.60     }
    1.61 -   
    1.62 +
    1.63     return this->hidden->window_handle;
    1.64  }
    1.65