[Scummvm-git-logs] scummvm master -> 9e474be88acc5be0820e3c41f21abbc544b9273f
OMGPizzaGuy
48367439+OMGPizzaGuy at users.noreply.github.com
Sun Feb 7 02:56:55 UTC 2021
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
c9696cb36c GRAPHICS: Fix blending with default transColor on 32-bpp surfaces
9e474be88a ULTIMA8: Update soft render surface to remove hacks in TTF render code
Commit: c9696cb36c45057fe3fd0a87f060b89aff9d2d14
https://github.com/scummvm/scummvm/commit/c9696cb36c45057fe3fd0a87f060b89aff9d2d14
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2021-02-06T20:56:38-06:00
Commit Message:
GRAPHICS: Fix blending with default transColor on 32-bpp surfaces
Changed paths:
graphics/managed_surface.cpp
diff --git a/graphics/managed_surface.cpp b/graphics/managed_surface.cpp
index f3e6e7923c..bf1f306a59 100644
--- a/graphics/managed_surface.cpp
+++ b/graphics/managed_surface.cpp
@@ -526,7 +526,7 @@ void transBlit(const Surface &src, const Common::Rect &srcRect, Surface &dest, c
// If we're dealing with a 32-bit source surface, we need to split up the RGB,
// since we'll want to find matching RGB pixels irrespective of the alpha
- bool isTrans32 = src.format.bytesPerPixel == 4 && transColor != (uint32)-1;
+ bool isTrans32 = src.format.bytesPerPixel == 4 && transColor != (uint32)-1 && transColor > 0;
if (isTrans32) {
src.format.colorToRGB(transColor, rt1, gt1, bt1);
}
Commit: 9e474be88acc5be0820e3c41f21abbc544b9273f
https://github.com/scummvm/scummvm/commit/9e474be88acc5be0820e3c41f21abbc544b9273f
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2021-02-06T20:56:38-06:00
Commit Message:
ULTIMA8: Update soft render surface to remove hacks in TTF render code
Changed paths:
engines/ultima/ultima8/graphics/fonts/tt_font.cpp
engines/ultima/ultima8/graphics/soft_render_surface.cpp
diff --git a/engines/ultima/ultima8/graphics/fonts/tt_font.cpp b/engines/ultima/ultima8/graphics/fonts/tt_font.cpp
index 81519ec732..c2a20dd248 100644
--- a/engines/ultima/ultima8/graphics/fonts/tt_font.cpp
+++ b/engines/ultima/ultima8/graphics/fonts/tt_font.cpp
@@ -136,7 +136,6 @@ RenderedText *TTFont::renderText(const Std::string &text, unsigned int &remainin
uint32 borderColor = PF_RGBA.ARGBToColor(0xFF, 0x00, 0x00, 0x00);
Graphics::ManagedSurface *texture = new Graphics::ManagedSurface(resultWidth, resultHeight, PF_RGBA);
- texture->setTransparentColor(0);
uint32 *texBuf = (uint32 *)texture->getPixels();
Std::list<PositionedText>::const_iterator iter;
@@ -155,12 +154,10 @@ RenderedText *TTFont::renderText(const Std::string &text, unsigned int &remainin
// When not in antialiased mode, use a paletted surface where '1' is
// used for pixels of the text
textSurf.create(resultWidth, lineHeight, Graphics::PixelFormat::createFormatCLUT8());
- texture->setTransparentColor(0);
_ttfFont->drawString(&textSurf, unicodeText, 0, 0, resultWidth, 1);
} else {
// Use a high color surface with the specified _color color for text
textSurf.create(resultWidth, lineHeight, PF_RGBA);
- texture->setTransparentColor(0);
_ttfFont->drawString(&textSurf, unicodeText, 0, 0, resultWidth, _color);
};
diff --git a/engines/ultima/ultima8/graphics/soft_render_surface.cpp b/engines/ultima/ultima8/graphics/soft_render_surface.cpp
index 6c1fd5a83f..4c078bbff5 100644
--- a/engines/ultima/ultima8/graphics/soft_render_surface.cpp
+++ b/engines/ultima/ultima8/graphics/soft_render_surface.cpp
@@ -238,7 +238,12 @@ template<class uintX> void SoftRenderSurface<uintX>::DrawLine32(uint32 rgb, int3
template<class uintX> void SoftRenderSurface<uintX>::Blit(const Graphics::ManagedSurface *tex, int32 sx, int32 sy, int32 w, int32 h, int32 dx, int32 dy, bool alpha_blend) {
Common::Rect srect = Common::Rect(sx, sy, sx + w, sy + h);
Common::Point dpoint = Common::Point(_ox + dx, _oy + dy);
- _surface->blitFrom(*tex, srect, dpoint);
+ if (alpha_blend) {
+ _surface->transBlitFrom(*tex, srect, dpoint);
+ }
+ else {
+ _surface->blitFrom(*tex, srect, dpoint);
+ }
}
More information about the Scummvm-git-logs
mailing list