Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add integer scaling feature and make client window resizable #557

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

SadPencil
Copy link
Member

@SadPencil SadPencil commented Sep 10, 2024

This PR adds integer scaling support for rendering the client. This feature is by default turned off.
Also, the following default options can be defined in [UserDefaults] section in ClientDefinitions.ini file by modders:

  • BorderlessWindowedClient
  • IntegerScaledClient
  • WriteInstallationPathToRegistry

Users can override these options in user settings.

Also, this PR makes the client window resizable for DX and XNA builds. Note: the render resolution is not changed upon a window resizing event. It can only be changed when client restarts itself. This should not be a big issue since the minimum and maximum render resolution are close.


To turn on integer scaling feature, modders need to specify

[UserDefaults]
IntegerScaledClient=true

in ClientDefinitions.ini file.

Users can override this option from user ini settings file (e.g., Settings.ini):

[Video]
IntegerScaledClient=true

Project Phantom as an example:

ClientDefinitions.ini:

[Settings]
MinimumRenderWidth=1280
MinimumRenderHeight=768
MaximumRenderWidth=1366
MaximumRenderHeight=800
RecommendedResolutions=1280x768,1280x800,1366x800

[UserDefaults]
IntegerScaledClient=true

Snipaste_2024-09-11_02-03-51
Snipaste_2024-09-11_02-04-42
Snipaste_2024-09-11_02-05-17
Snipaste_2024-09-11_02-06-18

Requires:

Rampastring/Rampastring.XNAUI#34

diff --git a/Rampastring.XNAUI.csproj b/Rampastring.XNAUI.csproj
index b4a94f6..156de3a 100644
--- a/Rampastring.XNAUI.csproj
+++ b/Rampastring.XNAUI.csproj
@@ -151,4 +151,9 @@
     <PackageReference Include="SixLabors.ImageSharp" Version="2.1.7" />
     <PackageReference Include="TextCopy" Version="6.2.1" />
   </ItemGroup>
+       <PropertyGroup>
+               <VersionPrefix>2.3.21</VersionPrefix>
+               <VersionSuffix>private-intscale-061a412</VersionSuffix>
+       </PropertyGroup>
+
 </Project>

@SadPencil SadPencil marked this pull request as ready for review September 10, 2024 18:07
Copy link

github-actions bot commented Sep 10, 2024

Nightly build for this pull request:

@SadPencil SadPencil marked this pull request as draft September 10, 2024 18:19
@SadPencil
Copy link
Member Author

SadPencil commented Sep 10, 2024

TODO: remove PreferedRenderWidth and PreferedRenderHeight

Find a way to minimize black surroundings

@SadPencil SadPencil marked this pull request as ready for review September 11, 2024 05:34
@SadPencil
Copy link
Member Author

Ready for review. Require XNAUI PR 34 be merged first.

@SadPencil
Copy link
Member Author

SadPencil commented Sep 11, 2024

MinimumRenderWidth=1280
MinimumRenderHeight=768
MaximumRenderWidth=1366
MaximumRenderHeight=800

11.09. 13:44:44.808 InitGraphicsMode: 1366x768
11.09. 13:44:44.817 Setting render resolution to 1366x768. Integer scaling: True

11.09. 13:45:01.690 InitGraphicsMode: 1280x960
11.09. 13:45:01.699 Setting render resolution to 1280x800. Integer scaling: True

11.09. 13:46:09.920 InitGraphicsMode: 1400x1050
11.09. 13:46:09.931 Setting render resolution to 1366x800. Integer scaling: True

11.09. 13:46:49.921 InitGraphicsMode: 1600x900
11.09. 13:46:49.930 Setting render resolution to 1366x800. Integer scaling: True

11.09. 13:48:59.331 InitGraphicsMode: 1920x1080
11.09. 13:48:59.340 Setting render resolution to 1366x800. Integer scaling: True

11.09. 13:49:23.797 InitGraphicsMode: 2560x1440
11.09. 13:49:23.807 Setting render resolution to 1366x800. Integer scaling: True

11.09. 13:49:42.087 InitGraphicsMode: 2560x1600
11.09. 13:49:42.096 Setting render resolution to 1280x800. Integer scaling: True

11.09. 13:50:21.140 InitGraphicsMode: 3840x2160
11.09. 13:50:21.150 Setting render resolution to 1366x800. Integer scaling: True

All results are expected

@SadPencil SadPencil changed the title Integer scale enhancement Add integer scaling feature Sep 11, 2024
@SadPencil SadPencil added this to the 2.11.2.0 milestone Sep 17, 2024
@SadPencil SadPencil marked this pull request as draft September 19, 2024 06:55
@SadPencil SadPencil marked this pull request as ready for review September 19, 2024 08:46
@SadPencil SadPencil changed the title Add integer scaling feature Add integer scaling feature and make client window resizable Sep 19, 2024
@SadPencil SadPencil marked this pull request as draft September 19, 2024 15:30
@SadPencil SadPencil marked this pull request as ready for review September 19, 2024 16:27
Upgrade XNAUI to 2.3.22
@SadPencil SadPencil modified the milestones: 2.11.3.0, 2.11.2.0 Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant