Bitmap: Always upload data in GL_RGBA format

This commit is contained in:
Jonas Kulla 2014-07-21 01:38:22 +00:00
parent c1d627e0ae
commit ca9f83c6de
1 changed files with 5 additions and 5 deletions

View File

@ -814,7 +814,7 @@ void Bitmap::drawText(const IntRect &rect, const char *str, int align)
else else
txtSurf = TTF_RenderUTF8_Blended(font, str, c); txtSurf = TTF_RenderUTF8_Blended(font, str, c);
p->ensureFormat(txtSurf, SDL_PIXELFORMAT_ARGB8888); p->ensureFormat(txtSurf, SDL_PIXELFORMAT_ABGR8888);
int alignX = rect.x; int alignX = rect.x;
@ -898,14 +898,14 @@ void Bitmap::drawText(const IntRect &rect, const char *str, int align)
{ {
TEX::uploadSubImage(posRect.x, posRect.y, TEX::uploadSubImage(posRect.x, posRect.y,
posRect.w, posRect.h, posRect.w, posRect.h,
txtSurf->pixels, GL_BGRA); txtSurf->pixels, GL_RGBA);
} }
else else
{ {
GLMeta::subRectImageUpload(txtSurf->w, subSrcX, subSrcY, GLMeta::subRectImageUpload(txtSurf->w, subSrcX, subSrcY,
posRect.x, posRect.y, posRect.x, posRect.y,
posRect.w, posRect.h, posRect.w, posRect.h,
txtSurf, GL_BGRA); txtSurf, GL_RGBA);
GLMeta::subRectImageEnd(); GLMeta::subRectImageEnd();
} }
} }
@ -916,7 +916,7 @@ void Bitmap::drawText(const IntRect &rect, const char *str, int align)
TEXFBO &gpTF = shState->gpTexFBO(txtSurf->w, txtSurf->h); TEXFBO &gpTF = shState->gpTexFBO(txtSurf->w, txtSurf->h);
TEX::bind(gpTF.tex); TEX::bind(gpTF.tex);
TEX::uploadSubImage(0, 0, txtSurf->w, txtSurf->h, txtSurf->pixels, GL_BGRA); TEX::uploadSubImage(0, 0, txtSurf->w, txtSurf->h, txtSurf->pixels, GL_RGBA);
GLMeta::blitBegin(p->gl); GLMeta::blitBegin(p->gl);
GLMeta::blitSource(gpTF); GLMeta::blitSource(gpTF);
@ -949,7 +949,7 @@ void Bitmap::drawText(const IntRect &rect, const char *str, int align)
shader.setOpacity(txtAlpha); shader.setOpacity(txtAlpha);
shState->bindTex(); shState->bindTex();
TEX::uploadSubImage(0, 0, txtSurf->w, txtSurf->h, txtSurf->pixels, GL_BGRA); TEX::uploadSubImage(0, 0, txtSurf->w, txtSurf->h, txtSurf->pixels, GL_RGBA);
TEX::setSmooth(true); TEX::setSmooth(true);
Quad &quad = shState->gpQuad(); Quad &quad = shState->gpQuad();