Wrong pixel size for source buffer for old drivers
authorPatrice Mandin <patmandin@gmail.com>
Thu, 02 Dec 2004 13:45:29 +0000
changeset 100213aa96c76e86
parent 1001 70bfe658442c
child 1003 ece5ab8acd1c
Wrong pixel size for source buffer for old drivers
src/video/ataricommon/SDL_atarigl.c
     1.1 --- a/src/video/ataricommon/SDL_atarigl.c	Tue Nov 30 19:02:42 2004 +0000
     1.2 +++ b/src/video/ataricommon/SDL_atarigl.c	Thu Dec 02 13:45:29 2004 +0000
     1.3 @@ -545,8 +545,8 @@
     1.4  	switch (pixel_format->BitsPerPixel) {
     1.5  		case 15:
     1.6  			/* 15 bits unsupported */
     1.7 -			gl_pixelsize = 2;
     1.8  			if (tinygl_present) {
     1.9 +				gl_pixelsize = 3;
    1.10  				osmesa_format = VDI_RGB;
    1.11  				if (redmask == 31<<10) {
    1.12  					gl_copyshadow = CopyShadowRGBTo555;
    1.13 @@ -555,6 +555,7 @@
    1.14  					gl_convert = Convert565To555le;
    1.15  				}
    1.16  			} else {
    1.17 +				gl_pixelsize = 4;
    1.18  				osmesa_format = OSMESA_ARGB;
    1.19  				if (redmask == 31<<10) {
    1.20  					gl_copyshadow = CopyShadow8888To555;
    1.21 @@ -566,8 +567,8 @@
    1.22  			break;
    1.23  		case 16:
    1.24  			/* 16 bits unsupported */
    1.25 -			gl_pixelsize = 2;
    1.26  			if (tinygl_present) {
    1.27 +				gl_pixelsize = 3;
    1.28  				osmesa_format = VDI_RGB;
    1.29  				gl_copyshadow = CopyShadowRGBTo565;
    1.30  				if (redmask != 31<<11) {
    1.31 @@ -575,6 +576,7 @@
    1.32  					gl_convert = Convert565le;
    1.33  				}
    1.34  			} else {
    1.35 +				gl_pixelsize = 4;
    1.36  				osmesa_format = OSMESA_ARGB;
    1.37  				gl_copyshadow = CopyShadow8888To565;
    1.38  				if (redmask != 31<<11) {
    1.39 @@ -601,8 +603,8 @@
    1.40  			}
    1.41  			break;
    1.42  		case 32:
    1.43 -			gl_pixelsize = 4;
    1.44  			if (tinygl_present) {
    1.45 +				gl_pixelsize = 3;
    1.46  				osmesa_format = VDI_RGB;
    1.47  				gl_copyshadow = CopyShadowRGBToARGB;
    1.48  				if (redmask == 255) {
    1.49 @@ -613,6 +615,7 @@
    1.50  					gl_convert = CopyShadowRGBToRGBA;
    1.51  				}
    1.52  			} else {
    1.53 +				gl_pixelsize = 4;
    1.54  				gl_copyshadow = CopyShadowDirect;
    1.55  				if (redmask == 255<<16) {
    1.56  					osmesa_format = OSMESA_ARGB;
    1.57 @@ -698,7 +701,7 @@
    1.58  	Uint8 *srcline, *srccol;
    1.59  
    1.60  	srcline = (Uint8 *)gl_shadow;
    1.61 -	srcpitch = surface->w *3;
    1.62 +	srcpitch = surface->w * gl_pixelsize;
    1.63  	dstline = surface->pixels;
    1.64  	dstpitch = surface->pitch >>1;
    1.65  
    1.66 @@ -726,7 +729,7 @@
    1.67  	Uint8 *srcline, *srccol;
    1.68  
    1.69  	srcline = (Uint8 *)gl_shadow;
    1.70 -	srcpitch = surface->w *3;
    1.71 +	srcpitch = surface->w * gl_pixelsize;
    1.72  	dstline = surface->pixels;
    1.73  	dstpitch = surface->pitch >>1;
    1.74  
    1.75 @@ -755,7 +758,7 @@
    1.76  	Uint8 *srcline, *srccol;
    1.77  
    1.78  	srcline = (Uint8 *)gl_shadow;
    1.79 -	srcpitch = surface->w *3;
    1.80 +	srcpitch = surface->w * gl_pixelsize;
    1.81  	dstline = surface->pixels;
    1.82  	dstpitch = surface->pitch;
    1.83  
    1.84 @@ -782,7 +785,7 @@
    1.85  	Uint8 *srcline, *srccol;
    1.86  
    1.87  	srcline = (Uint8 *)gl_shadow;
    1.88 -	srcpitch = surface->w *3;
    1.89 +	srcpitch = surface->w * gl_pixelsize;
    1.90  	dstline = surface->pixels;
    1.91  	dstpitch = surface->pitch >>2;
    1.92  
    1.93 @@ -812,7 +815,7 @@
    1.94  	Uint8 *srcline, *srccol;
    1.95  
    1.96  	srcline = (Uint8 *)gl_shadow;
    1.97 -	srcpitch = surface->w *3;
    1.98 +	srcpitch = surface->w * gl_pixelsize;
    1.99  	dstline = surface->pixels;
   1.100  	dstpitch = surface->pitch >>2;
   1.101  
   1.102 @@ -842,7 +845,7 @@
   1.103  	Uint8 *srcline, *srccol;
   1.104  
   1.105  	srcline = (Uint8 *)gl_shadow;
   1.106 -	srcpitch = surface->w *3;
   1.107 +	srcpitch = surface->w * gl_pixelsize;
   1.108  	dstline = surface->pixels;
   1.109  	dstpitch = surface->pitch >>2;
   1.110  
   1.111 @@ -872,7 +875,7 @@
   1.112  	Uint8 *srcline, *srccol;
   1.113  
   1.114  	srcline = (Uint8 *)gl_shadow;
   1.115 -	srcpitch = surface->w *3;
   1.116 +	srcpitch = surface->w * gl_pixelsize;
   1.117  	dstline = surface->pixels;
   1.118  	dstpitch = surface->pitch >>2;
   1.119  
   1.120 @@ -902,7 +905,7 @@
   1.121  	Uint32 *srcline, *srccol;
   1.122  
   1.123  	srcline = (Uint32 *)gl_shadow;
   1.124 -	srcpitch = surface->w;
   1.125 +	srcpitch = (surface->w * gl_pixelsize) >>2;
   1.126  	dstline = surface->pixels;
   1.127  	dstpitch = surface->pitch >>1;
   1.128  
   1.129 @@ -932,7 +935,7 @@
   1.130  	Uint32 *srcline, *srccol;
   1.131  
   1.132  	srcline = (Uint32 *)gl_shadow;
   1.133 -	srcpitch = surface->w;
   1.134 +	srcpitch = (surface->w * gl_pixelsize) >> 2;
   1.135  	dstline = surface->pixels;
   1.136  	dstpitch = surface->pitch >>1;
   1.137