[Scummvm-git-logs] scummvm master -> 2841b9931d643ad50fff6e2205e3b612f0f03665
sev-
noreply at scummvm.org
Sun Mar 5 20:13:05 UTC 2023
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:
18f947272a GRAPHICS: Properly handle cursor mask texture in GL context teardown/recreate.
2841b9931d GRAPHICS: Fix Normal and AdvMame scalers not applying cursor mask to additive texture
Commit: 18f947272aad12f16b844da0b04534f68e540889
https://github.com/scummvm/scummvm/commit/18f947272aad12f16b844da0b04534f68e540889
Author: elasota (ejlasota at gmail.com)
Date: 2023-03-05T21:13:01+01:00
Commit Message:
GRAPHICS: Properly handle cursor mask texture in GL context teardown/recreate.
Fixes cursor transparency breaking after toggling fullscreen mode on Windows.
Changed paths:
backends/graphics/opengl/opengl-graphics.cpp
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index e210e8c169a..718379dea5a 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -1393,6 +1393,10 @@ void OpenGLGraphicsManager::notifyContextCreate(ContextType type,
_cursor->recreate();
}
+ if (_cursorMask) {
+ _cursorMask->recreate();
+ }
+
#ifdef USE_OSD
if (_osdMessageSurface) {
_osdMessageSurface->recreate();
@@ -1417,6 +1421,10 @@ void OpenGLGraphicsManager::notifyContextDestroy() {
_cursor->destroy();
}
+ if (_cursorMask) {
+ _cursorMask->destroy();
+ }
+
#ifdef USE_OSD
if (_osdMessageSurface) {
_osdMessageSurface->destroy();
Commit: 2841b9931d643ad50fff6e2205e3b612f0f03665
https://github.com/scummvm/scummvm/commit/2841b9931d643ad50fff6e2205e3b612f0f03665
Author: elasota (ejlasota at gmail.com)
Date: 2023-03-05T21:13:01+01:00
Commit Message:
GRAPHICS: Fix Normal and AdvMame scalers not applying cursor mask to additive texture
Changed paths:
backends/graphics/opengl/texture.cpp
backends/graphics/opengl/texture.h
diff --git a/backends/graphics/opengl/texture.cpp b/backends/graphics/opengl/texture.cpp
index f1adfa9079f..67b9ae93c5e 100644
--- a/backends/graphics/opengl/texture.cpp
+++ b/backends/graphics/opengl/texture.cpp
@@ -458,16 +458,23 @@ void FakeTexture::updateGLTexture() {
byte *dst = (byte *)outSurf->getBasePtr(dirtyArea.left, dirtyArea.top);
const byte *src = (const byte *)_rgbData.getBasePtr(dirtyArea.left, dirtyArea.top);
+ applyPaletteAndMask(dst, src, outSurf->pitch, _rgbData.pitch, _rgbData.w, dirtyArea, outSurf->format, _rgbData.format);
+
+ // Do generic handling of updating the texture.
+ Texture::updateGLTexture();
+}
+
+void FakeTexture::applyPaletteAndMask(byte *dst, const byte *src, uint dstPitch, uint srcPitch, uint srcWidth, const Common::Rect &dirtyArea, const Graphics::PixelFormat &dstFormat, const Graphics::PixelFormat &srcFormat) const {
if (_palette) {
- Graphics::crossBlitMap(dst, src, outSurf->pitch, _rgbData.pitch, dirtyArea.width(), dirtyArea.height(), outSurf->format.bytesPerPixel, _palette);
+ Graphics::crossBlitMap(dst, src, dstPitch, srcPitch, dirtyArea.width(), dirtyArea.height(), dstFormat.bytesPerPixel, _palette);
} else {
- Graphics::crossBlit(dst, src, outSurf->pitch, _rgbData.pitch, dirtyArea.width(), dirtyArea.height(), outSurf->format, _rgbData.format);
+ Graphics::crossBlit(dst, src, dstPitch, srcPitch, dirtyArea.width(), dirtyArea.height(), dstFormat, srcFormat);
}
if (_mask) {
- uint maskPitch = _rgbData.w;
+ uint maskPitch = srcWidth;
uint dirtyWidth = dirtyArea.width();
- byte destBPP = outSurf->format.bytesPerPixel;
+ byte destBPP = dstFormat.bytesPerPixel;
const byte *maskRowStart = (_mask + dirtyArea.top * maskPitch + dirtyArea.left);
byte *dstRowStart = dst;
@@ -485,13 +492,10 @@ void FakeTexture::updateGLTexture() {
}
}
- dstRowStart += outSurf->pitch;
+ dstRowStart += dstPitch;
maskRowStart += maskPitch;
}
}
-
- // Do generic handling of updating the texture.
- Texture::updateGLTexture();
}
TextureRGB555::TextureRGB555()
@@ -631,11 +635,7 @@ void ScaledTexture::updateGLTexture() {
dst = (byte *)_convData->getBasePtr(dirtyArea.left + _extraPixels, dirtyArea.top + _extraPixels);
dstPitch = _convData->pitch;
- if (_palette) {
- Graphics::crossBlitMap(dst, src, dstPitch, srcPitch, dirtyArea.width(), dirtyArea.height(), _convData->format.bytesPerPixel, _palette);
- } else {
- Graphics::crossBlit(dst, src, dstPitch, srcPitch, dirtyArea.width(), dirtyArea.height(), _convData->format, _rgbData.format);
- }
+ applyPaletteAndMask(dst, src, dstPitch, srcPitch, _rgbData.w, dirtyArea, _convData->format, _rgbData.format);
src = dst;
srcPitch = dstPitch;
diff --git a/backends/graphics/opengl/texture.h b/backends/graphics/opengl/texture.h
index 815f9515220..25b611c613b 100644
--- a/backends/graphics/opengl/texture.h
+++ b/backends/graphics/opengl/texture.h
@@ -341,6 +341,8 @@ public:
void updateGLTexture() override;
protected:
+ void applyPaletteAndMask(byte *dst, const byte *src, uint dstPitch, uint srcPitch, uint srcWidth, const Common::Rect &dirtyArea, const Graphics::PixelFormat &dstFormat, const Graphics::PixelFormat &srcFormat) const;
+
Graphics::Surface _rgbData;
Graphics::PixelFormat _fakeFormat;
uint32 *_palette;
More information about the Scummvm-git-logs
mailing list