src/video/ataricommon/SDL_atarigl.c
changeset 1005 2ab1cb02a44e
parent 1003 ece5ab8acd1c
child 1238 1901fea5edac
     1.1 --- a/src/video/ataricommon/SDL_atarigl.c	Sat Dec 04 10:31:16 2004 +0000
     1.2 +++ b/src/video/ataricommon/SDL_atarigl.c	Sat Dec 04 20:53:58 2004 +0000
     1.3 @@ -425,6 +425,7 @@
     1.4  	/* Init OpenGL context using OSMesa */
     1.5  	gl_convert = ConvertNull;
     1.6  	gl_copyshadow = CopyShadowNull;
     1.7 +	gl_upsidedown = SDL_FALSE;
     1.8  
     1.9  	pixel_format = current->format;
    1.10  	redmask = pixel_format->Rmask;
    1.11 @@ -539,6 +540,7 @@
    1.12  	/* Init OpenGL context using OSMesa */
    1.13  	gl_convert = ConvertNull;
    1.14  	gl_copyshadow = CopyShadowNull;
    1.15 +	gl_upsidedown = SDL_FALSE;
    1.16  
    1.17  	pixel_format = current->format;
    1.18  	redmask = pixel_format->Rmask;
    1.19 @@ -556,6 +558,7 @@
    1.20  				}
    1.21  			} else {
    1.22  				gl_pixelsize = 4;
    1.23 +				gl_upsidedown = SDL_TRUE;
    1.24  				osmesa_format = OSMESA_ARGB;
    1.25  				if (redmask == 31<<10) {
    1.26  					gl_copyshadow = CopyShadow8888To555;
    1.27 @@ -577,6 +580,7 @@
    1.28  				}
    1.29  			} else {
    1.30  				gl_pixelsize = 4;
    1.31 +				gl_upsidedown = SDL_TRUE;
    1.32  				osmesa_format = OSMESA_ARGB;
    1.33  				gl_copyshadow = CopyShadow8888To565;
    1.34  				if (redmask != 31<<11) {
    1.35 @@ -595,6 +599,7 @@
    1.36  				}
    1.37  			} else {
    1.38  				gl_copyshadow = CopyShadowDirect;
    1.39 +				gl_upsidedown = SDL_TRUE;
    1.40  				if (redmask == 255<<16) {
    1.41  					osmesa_format = OSMESA_RGB;
    1.42  				} else {
    1.43 @@ -616,6 +621,7 @@
    1.44  				}
    1.45  			} else {
    1.46  				gl_pixelsize = 4;
    1.47 +				gl_upsidedown = SDL_TRUE;
    1.48  				gl_copyshadow = CopyShadowDirect;
    1.49  				if (redmask == 255<<16) {
    1.50  					osmesa_format = OSMESA_ARGB;
    1.51 @@ -685,6 +691,10 @@
    1.52  	srcpitch = surface->w * gl_pixelsize;
    1.53  	dstline = surface->pixels;
    1.54  	dstpitch = surface->pitch;
    1.55 +	if (gl_upsidedown) {
    1.56 +		srcline += (surface->h-1)*srcpitch;
    1.57 +		srcpitch = -srcpitch;
    1.58 +	}
    1.59  
    1.60  	for (y=0; y<surface->h; y++) {
    1.61  		memcpy(dstline, srcline, srcpitch);
    1.62 @@ -704,6 +714,10 @@
    1.63  	srcpitch = surface->w * gl_pixelsize;
    1.64  	dstline = surface->pixels;
    1.65  	dstpitch = surface->pitch >>1;
    1.66 +	if (gl_upsidedown) {
    1.67 +		srcline += (surface->h-1)*srcpitch;
    1.68 +		srcpitch = -srcpitch;
    1.69 +	}
    1.70  
    1.71  	for (y=0; y<surface->h; y++) {
    1.72  		srccol = srcline;
    1.73 @@ -732,6 +746,10 @@
    1.74  	srcpitch = surface->w * gl_pixelsize;
    1.75  	dstline = surface->pixels;
    1.76  	dstpitch = surface->pitch >>1;
    1.77 +	if (gl_upsidedown) {
    1.78 +		srcline += (surface->h-1)*srcpitch;
    1.79 +		srcpitch = -srcpitch;
    1.80 +	}
    1.81  
    1.82  	for (y=0; y<surface->h; y++) {
    1.83  		srccol = srcline;
    1.84 @@ -761,6 +779,10 @@
    1.85  	srcpitch = surface->w * gl_pixelsize;
    1.86  	dstline = surface->pixels;
    1.87  	dstpitch = surface->pitch;
    1.88 +	if (gl_upsidedown) {
    1.89 +		srcline += (surface->h-1)*srcpitch;
    1.90 +		srcpitch = -srcpitch;
    1.91 +	}
    1.92  
    1.93  	for (y=0; y<surface->h; y++) {
    1.94  		srccol = srcline;
    1.95 @@ -788,6 +810,10 @@
    1.96  	srcpitch = surface->w * gl_pixelsize;
    1.97  	dstline = surface->pixels;
    1.98  	dstpitch = surface->pitch >>2;
    1.99 +	if (gl_upsidedown) {
   1.100 +		srcline += (surface->h-1)*srcpitch;
   1.101 +		srcpitch = -srcpitch;
   1.102 +	}
   1.103  
   1.104  	for (y=0; y<surface->h; y++) {
   1.105  		srccol = srcline;
   1.106 @@ -818,6 +844,10 @@
   1.107  	srcpitch = surface->w * gl_pixelsize;
   1.108  	dstline = surface->pixels;
   1.109  	dstpitch = surface->pitch >>2;
   1.110 +	if (gl_upsidedown) {
   1.111 +		srcline += (surface->h-1)*srcpitch;
   1.112 +		srcpitch = -srcpitch;
   1.113 +	}
   1.114  
   1.115  	for (y=0; y<surface->h; y++) {
   1.116  		srccol = srcline;
   1.117 @@ -848,6 +878,10 @@
   1.118  	srcpitch = surface->w * gl_pixelsize;
   1.119  	dstline = surface->pixels;
   1.120  	dstpitch = surface->pitch >>2;
   1.121 +	if (gl_upsidedown) {
   1.122 +		srcline += (surface->h-1)*srcpitch;
   1.123 +		srcpitch = -srcpitch;
   1.124 +	}
   1.125  
   1.126  	for (y=0; y<surface->h; y++) {
   1.127  		srccol = srcline;
   1.128 @@ -878,6 +912,10 @@
   1.129  	srcpitch = surface->w * gl_pixelsize;
   1.130  	dstline = surface->pixels;
   1.131  	dstpitch = surface->pitch >>2;
   1.132 +	if (gl_upsidedown) {
   1.133 +		srcline += (surface->h-1)*srcpitch;
   1.134 +		srcpitch = -srcpitch;
   1.135 +	}
   1.136  
   1.137  	for (y=0; y<surface->h; y++) {
   1.138  		srccol = srcline;
   1.139 @@ -908,6 +946,10 @@
   1.140  	srcpitch = (surface->w * gl_pixelsize) >>2;
   1.141  	dstline = surface->pixels;
   1.142  	dstpitch = surface->pitch >>1;
   1.143 +	if (gl_upsidedown) {
   1.144 +		srcline += (surface->h-1)*srcpitch;
   1.145 +		srcpitch = -srcpitch;
   1.146 +	}
   1.147  
   1.148  	for (y=0; y<surface->h; y++) {
   1.149  		srccol = srcline;
   1.150 @@ -938,6 +980,10 @@
   1.151  	srcpitch = (surface->w * gl_pixelsize) >> 2;
   1.152  	dstline = surface->pixels;
   1.153  	dstpitch = surface->pitch >>1;
   1.154 +	if (gl_upsidedown) {
   1.155 +		srcline += (surface->h-1)*srcpitch;
   1.156 +		srcpitch = -srcpitch;
   1.157 +	}
   1.158  
   1.159  	for (y=0; y<surface->h; y++) {
   1.160  		srccol = srcline;