Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit cb7a333

Browse filesBrowse files
Merge pull request #6836 from livecodepanos/bugfix-21767
[21767] Support for splash images for iPhone XR and XSMAX
2 parents 8c1c9d7 + 8585863 commit cb7a333
Copy full SHA for cb7a333

File tree

Expand file treeCollapse file tree

2 files changed

+49
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+49
-3
lines changed

‎engine/src/mbliphoneapp.mm

Copy file name to clipboardExpand all lines: engine/src/mbliphoneapp.mm
+37-1Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1518,7 +1518,7 @@ - (void)switchImageToOrientation: (UIInterfaceOrientation)p_new_orientation
15181518
t_image_names[1] = nil;
15191519
}
15201520

1521-
// the iPhone X allows for portrait and landscape splash screens
1521+
// the iPhone X/XS allows for portrait and landscape splash screens
15221522
else if ([[UIScreen mainScreen] bounds] . size . height == 812 || [[UIScreen mainScreen] bounds] . size . width == 812)
15231523
{
15241524
switch(p_new_orientation)
@@ -1536,6 +1536,42 @@ - (void)switchImageToOrientation: (UIInterfaceOrientation)p_new_orientation
15361536
}
15371537
t_image_names[1] = nil;
15381538
}
1539+
1540+
// iPhone XR: 414x896 points are rendered in 2x, resulting in 828x1792 pixels
1541+
// iPhone XSMAX: 414x896 points are rendered in 3x, resulting in 1242x2688 pixels
1542+
else if ([[UIScreen mainScreen] bounds] . size . height == 896 || [[UIScreen mainScreen] bounds] . size . width == 896)
1543+
{
1544+
switch(p_new_orientation)
1545+
{
1546+
case UIInterfaceOrientationPortrait:
1547+
case UIInterfaceOrientationPortraitUpsideDown:
1548+
if ([[UIScreen mainScreen] scale] == 3.0)
1549+
{
1550+
t_image_names[0] = @"Default-896h@3x.png";
1551+
t_image_angles[0] = 0.0f;
1552+
}
1553+
else if ([[UIScreen mainScreen] scale] == 2.0)
1554+
{
1555+
t_image_names[0] = @"Default-896h@2x.png";
1556+
t_image_angles[0] = 0.0f;
1557+
}
1558+
break;
1559+
case UIInterfaceOrientationLandscapeLeft:
1560+
case UIInterfaceOrientationLandscapeRight:
1561+
if ([[UIScreen mainScreen] scale] == 3.0)
1562+
{
1563+
t_image_names[0] = @"Default-414h@3x.png";
1564+
t_image_angles[0] = 0.0f;
1565+
}
1566+
else if ([[UIScreen mainScreen] scale] == 2.0)
1567+
{
1568+
t_image_names[0] = @"Default-414h@2x.png";
1569+
t_image_angles[0] = 0.0f;
1570+
}
1571+
break;
1572+
}
1573+
t_image_names[1] = nil;
1574+
}
15391575

15401576
else
15411577
{

‎ide-support/revsaveasiosstandalone.livecodescript

Copy file name to clipboardExpand all lines: ide-support/revsaveasiosstandalone.livecodescript
+12-2Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -976,8 +976,10 @@ private command revCopyMobileNewSplash pSettings, pBaseFolder, pAppBundle
976976
return & "ipad pro 12.9 portrait splash,-iPadProPortrait@2x" & return & "ipad pro 12.9 landscape splash,-iPadProLandscape@2x" & \
977977
return & "iphone 4inch splash,-568h@2x" & return & "iphone 6 splash,-667h@2x" & \
978978
return & "iphone 6 plus portrait splash,-736h@3x" & return & "iphone 6 plus landscape splash,-414h@3x" & \
979-
return & "iphone X portrait splash,-812h@3x" & return & "iphone X landscape splash,-375h@3x")
980-
get pSettings["ios," & item 1 of tType]
979+
return & "iphone X portrait splash,-812h@3x" & return & "iphone X landscape splash,-375h@3x" & \
980+
return & "iphone XR portrait splash,-896h@2x" & return & "iphone XR landscape splash,-414h@2x" & \
981+
return & "iphone XSMAX portrait splash,-896h@3x" & return & "iphone X landscape splash,-414h@3x")
982+
get pSettings["ios," & item 1 of tType]
981983
if not (it begins with "/") then
982984
put pBaseFolder & slash before it
983985
end if
@@ -1707,9 +1709,17 @@ private command revCreateMobilePlist pSettings, pAppBundle, pTarget, pFonts, pPl
17071709
if tIPhoneOrientation contains "Portrait" then
17081710
put "Default-736h@3x|Default-736h|{414, 736}|Portrait" & return after tSplashScreens
17091711
put "Default-812h@3x|Default-812h|{375, 812}|Portrait" & return after tSplashScreens
1712+
// iPhone XR
1713+
put "Default-896h@2x|Default-896h|{414, 896}|Portrait" & return after tSplashScreens
1714+
// iPhone XSMAX
1715+
put "Default-896h@3x|Default-896h|{414, 896}|Portrait" & return after tSplashScreens
17101716
else
17111717
put "Default-414h@3x|Default-414h|{414, 736}|Landscape" & return after tSplashScreens
17121718
put "Default-375h@3x|Default-375h|{375, 812}|Landscape" & return after tSplashScreens
1719+
// iPhone XR
1720+
put "Default-414h@2x|Default-414h|{414, 896}|Landscape" & return after tSplashScreens
1721+
// iPhone XSMAX
1722+
put "Default-414h@3x|Default-414h|{414, 896}|Landscape" & return after tSplashScreens
17131723
end if
17141724
end if
17151725
if 2 is among the items of tDeviceFamily then

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.