Skip to content

Commit 5893e5d

Browse files
committed
Move characters inwards when using 4:3 backgrounds
1 parent c8e0a49 commit 5893e5d

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

Assets.Scripts.Core.Buriko/BurikoScriptFile.cs

+16-2
Original file line numberDiff line numberDiff line change
@@ -2788,11 +2788,17 @@ public BurikoVariable OperationMODGenericCall()
27882788
}
27892789

27902790
/// <summary>
2791-
/// This function reverts the x positions of sprites when using 4:3 backgrounds to match the original game
2791+
/// 1) This function reverts the x positions of sprites when using 4:3 backgrounds to match the original game
27922792
/// In some places, our mod has 'spread out' the sprite positions to better match 16:9 widescreen by setting
27932793
/// their X position to 240/-240 instead of 160/-160 (mostly when there are 3 characters on the screen at once).
27942794
/// However, when playing in 4:3 mode, this causes the sprites to be more cut-off than they were in the original game.
27952795
/// This function attempts to revert this specific case by changing an X of 240/-240 into 160/-160.
2796+
///
2797+
/// 2) On Batsukoishi of Rei, four characters are displayed at once with the outermost at 320 and -320.
2798+
/// In this case we move them slightly inwards so they're not cut-off.
2799+
///
2800+
/// I also tried scaling the x coordinate by 160/240 (about 2/3), but this puts the characters unnecessarily
2801+
/// close together if there are only two characters on the screen.
27962802
/// </summary>
27972803
private int MODRyukishiRevertSpritePosition(string path, int x)
27982804
{
@@ -2803,14 +2809,22 @@ private int MODRyukishiRevertSpritePosition(string path, int x)
28032809
{
28042810
if (path.StartsWith("sprite/") || path.StartsWith("portrait/")) // is from the sprite or portrait folder
28052811
{
2806-
if (x == 240)
2812+
if (x == 240) // See note 1) above
28072813
{
28082814
return 160;
28092815
}
28102816
else if (x == -240)
28112817
{
28122818
return -160;
28132819
}
2820+
else if (x == 320) // See note 2) above
2821+
{
2822+
return 240;
2823+
}
2824+
else if (x == -320)
2825+
{
2826+
return -240;
2827+
}
28142828
}
28152829
}
28162830

0 commit comments

Comments
 (0)