[Scummvm-git-logs] scummvm master -> dce06f179c44f5e9d3bd7ea881cfd51912cd2dd2
criezy
criezy at scummvm.org
Mon May 24 22:47:13 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:
37aa9f9081 IOS7: Support using 4bpp cursors
dce06f179c IOS7: Render the GUI in HiDPI
Commit: 37aa9f9081a9691b26bb07f6b722aef1c4e21d36
https://github.com/scummvm/scummvm/commit/37aa9f9081a9691b26bb07f6b722aef1c4e21d36
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2021-05-24T23:46:51+01:00
Commit Message:
IOS7: Support using 4bpp cursors
This fixes an assert with the new GUI (bug #12578).
This also required changing the logic to handle the cursor key color
as the new GUI does not use that key color but use the alpha channel.
The logic in the iOS backend was overwriting the alpha channel
by checking the key color, removing all the transparency. Now the
two are combined (hopefully there is no case were it uses the key
color while also using a pixel format with alpha, but not setting
this alpha, because if there is, this will now result in a fully
transparent cursor).
Changed paths:
backends/platform/ios7/ios7_osys_video.mm
diff --git a/backends/platform/ios7/ios7_osys_video.mm b/backends/platform/ios7/ios7_osys_video.mm
index 748fbd9c24..788d1b4e13 100644
--- a/backends/platform/ios7/ios7_osys_video.mm
+++ b/backends/platform/ios7/ios7_osys_video.mm
@@ -483,7 +483,7 @@ void OSystem_iOS7::setMouseCursor(const void *buf, uint w, uint h, int hotspotX,
pixelFormat.rLoss, pixelFormat.gLoss, pixelFormat.bLoss, pixelFormat.aLoss,
pixelFormat.rShift, pixelFormat.gShift, pixelFormat.bShift, pixelFormat.aShift);
#endif
- assert(pixelFormat.bytesPerPixel == 1 || pixelFormat.bytesPerPixel == 2);
+ assert(pixelFormat.bytesPerPixel == 1 || pixelFormat.bytesPerPixel == 2 || pixelFormat.bytesPerPixel == 4);
if (_mouseBuffer.w != w || _mouseBuffer.h != h || _mouseBuffer.format != pixelFormat || !_mouseBuffer.getPixels())
_mouseBuffer.create(w, h, pixelFormat);
@@ -545,17 +545,20 @@ void OSystem_iOS7::updateMouseTexture() {
} else {
if (crossBlit((byte *)mouseTexture.getPixels(), (const byte *)_mouseBuffer.getPixels(), mouseTexture.pitch,
_mouseBuffer.pitch, _mouseBuffer.w, _mouseBuffer.h, mouseTexture.format, _mouseBuffer.format)) {
- // Apply color keying since the original cursor had no alpha channel.
- const uint16 *src = (const uint16 *)_mouseBuffer.getPixels();
+ // Apply color keying
+ const uint8 * src = (const uint8 *)_mouseBuffer.getPixels();
+ int srcBpp = _mouseBuffer.format.bytesPerPixel;
+
uint8 *dstRaw = (uint8 *)mouseTexture.getPixels();
for (uint y = 0; y < _mouseBuffer.h; ++y, dstRaw += mouseTexture.pitch) {
uint16 *dst = (uint16 *)dstRaw;
- for (uint x = 0; x < _mouseBuffer.w; ++x, ++dst) {
- if (*src++ == _mouseKeyColor)
+ for (uint x = 0; x < _mouseBuffer.w; ++x, ++dst, src += srcBpp) {
+ if (
+ (srcBpp == 2 && *((const uint16*)src) == _mouseKeyColor) ||
+ (srcBpp == 4 && *((const uint32*)src) == _mouseKeyColor)
+ )
*dst &= ~1;
- else
- *dst |= 1;
}
}
} else {
Commit: dce06f179c44f5e9d3bd7ea881cfd51912cd2dd2
https://github.com/scummvm/scummvm/commit/dce06f179c44f5e9d3bd7ea881cfd51912cd2dd2
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2021-05-24T23:46:51+01:00
Commit Message:
IOS7: Render the GUI in HiDPI
Changed paths:
backends/platform/ios7/ios7_osys_main.cpp
backends/platform/ios7/ios7_video.mm
diff --git a/backends/platform/ios7/ios7_osys_main.cpp b/backends/platform/ios7/ios7_osys_main.cpp
index 36def940be..491e741a5a 100644
--- a/backends/platform/ios7/ios7_osys_main.cpp
+++ b/backends/platform/ios7/ios7_osys_main.cpp
@@ -199,6 +199,8 @@ bool OSystem_iOS7::getFeatureState(Feature f) {
return _videoContext->asprectRatioCorrection;
case kFeatureVirtualKeyboard:
return isKeyboardShown();
+ case kFeatureHiDPI:
+ return true;
default:
return false;
diff --git a/backends/platform/ios7/ios7_video.mm b/backends/platform/ios7/ios7_video.mm
index b443209f67..3e4df0d59e 100644
--- a/backends/platform/ios7/ios7_video.mm
+++ b/backends/platform/ios7/ios7_video.mm
@@ -193,9 +193,6 @@ uint getSizeNextPOT(uint size) {
- (void)createOverlaySurface {
uint overlayWidth = (uint) MAX(_renderBufferWidth, _renderBufferHeight);
uint overlayHeight = (uint) MIN(_renderBufferWidth, _renderBufferHeight);
- float hdpi_scaler = [UIScreen mainScreen].scale;
- overlayWidth = (uint)(overlayWidth / hdpi_scaler);
- overlayHeight = (uint)(overlayHeight / hdpi_scaler);
_videoContext.overlayWidth = overlayWidth;
_videoContext.overlayHeight = overlayHeight;
More information about the Scummvm-git-logs
mailing list