Endian fix for drawing alpha in images.

This commit is contained in:
2006-06-14 16:02:11 +00:00
parent acd56a193b
commit 6388715b43
2 changed files with 4 additions and 2 deletions

View File

@@ -1302,7 +1302,8 @@ static void sima_draw_alpha_pixels(float x1, float y1, int rectx, int recty, uns
{
/* swap bytes, so alpha is most significant one, then just draw it as luminance int */
glPixelStorei(GL_UNPACK_SWAP_BYTES, 1);
if(G.order==B_ENDIAN)
glPixelStorei(GL_UNPACK_SWAP_BYTES, 1);
glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_LUMINANCE, GL_UNSIGNED_INT, recti);
glPixelStorei(GL_UNPACK_SWAP_BYTES, 0);
}

View File

@@ -351,7 +351,8 @@ static void renderwin_draw(RenderWin *rw, int just_clear)
if(rw->flags & RW_FLAGS_ALPHA) {
if(rres.rect32) {
/* swap bytes, so alpha is most significant one, then just draw it as luminance int */
glPixelStorei(GL_UNPACK_SWAP_BYTES, 1);
if(G.order==B_ENDIAN)
glPixelStorei(GL_UNPACK_SWAP_BYTES, 1);
glaDrawPixelsSafe(fullrect[0][0], fullrect[0][1], rres.rectx, rres.recty, rres.rectx, GL_LUMINANCE, GL_UNSIGNED_INT, rres.rect32);
glPixelStorei(GL_UNPACK_SWAP_BYTES, 0);
}