diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 8f221f1ff3..1aabd24959 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,7 @@ December 27, 2007 (Changes by Graf Zahl) +- Fixed: DFrameBuffer::CopyPixelData copied data as RGBA instead of BGRA. +- Temporarily changed FPNGTexture and FDDSTexture to always create True Color + native textures to preserve the original colors. - Darkened the console background a little after finding out that on very bright title pics it became quite hard to read the console's contents. - Fixed: PROP_Translation needed to be changed for the new value format. diff --git a/src/textures/ddstexture.cpp b/src/textures/ddstexture.cpp index ab44160e6b..562b945d3c 100644 --- a/src/textures/ddstexture.cpp +++ b/src/textures/ddstexture.cpp @@ -316,6 +316,7 @@ void FDDSTexture::Unload () FTextureFormat FDDSTexture::GetFormat() { +#if 0 switch (Format) { case ID_DXT1: return TEX_DXT1; @@ -325,6 +326,10 @@ FTextureFormat FDDSTexture::GetFormat() case ID_DXT5: return TEX_DXT5; default: return TEX_RGB; } +#else + // For now, create a true color texture to preserve all colors. + return TEX_RGB; +#endif } const BYTE *FDDSTexture::GetColumn (unsigned int column, const Span **spans_out) diff --git a/src/textures/pngtexture.cpp b/src/textures/pngtexture.cpp index 1e77fda721..6816e2f2a3 100644 --- a/src/textures/pngtexture.cpp +++ b/src/textures/pngtexture.cpp @@ -270,12 +270,17 @@ void FPNGTexture::Unload () FTextureFormat FPNGTexture::GetFormat() { +#if 0 switch (ColorType) { case 3: return TEX_Pal; case 0: return TEX_Gray; default: return TEX_RGB; } +#else + // For now, create a true color texture to preserve all colors. + return TEX_RGB; +#endif } const BYTE *FPNGTexture::GetColumn (unsigned int column, const Span **spans_out) diff --git a/src/v_video.cpp b/src/v_video.cpp index 447988ddd6..1fec6538d5 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -1022,16 +1022,16 @@ void DFrameBuffer::CopyPixelData(BYTE * buffer, int texpitch, int texheight, int int v=(unsigned char)patch[y*step_y+x*step_x]; if (palette[v].a==0) { - buffer[pos]=palette[v].r; + buffer[pos]=palette[v].b; buffer[pos+1]=palette[v].g; - buffer[pos+2]=palette[v].b; + buffer[pos+2]=palette[v].r; buffer[pos+3]=255-palette[v].a; } else if (palette[v].a!=255) { - buffer[pos ] = (buffer[pos ] * palette[v].a + palette[v].r * (1-palette[v].a)) / 255; + buffer[pos ] = (buffer[pos ] * palette[v].a + palette[v].b * (1-palette[v].a)) / 255; buffer[pos+1] = (buffer[pos+1] * palette[v].a + palette[v].g * (1-palette[v].a)) / 255; - buffer[pos+2] = (buffer[pos+2] * palette[v].a + palette[v].b * (1-palette[v].a)) / 255; + buffer[pos+2] = (buffer[pos+2] * palette[v].a + palette[v].r * (1-palette[v].a)) / 255; buffer[pos+3] = clamp(buffer[pos+3] + (( 255-buffer[pos+3]) * (255-palette[v].a))/255, 0, 255); } }