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

[V2.6] Controls Revision #2900

Merged

Conversation

Mathias-Boulay
Copy link
Contributor

@Mathias-Boulay Mathias-Boulay commented Mar 14, 2022

Controls Revision 2.6

Oh hey there, this pull request has sat for some time by now.
Anyway, I've concocted some fixes that should have been part of the changelog to Controls V2.X. But as this point, Controls v2.X would have never came out.

1.13+ mouse fix

Some people have noticed by now (#2587,#2885), but since the dawn of time triggering mouse actions while minecraft 1.13+ was loading may result in no working mouse at all.

1.14.1/2 mouse fix

Never bothered to push this fix until now, although better late than never. (or is it ever ?)
So yeah, praise to the lord of try{}catch{} statements.

Fix gesture: Drop hotbar item

There were cases where the hotbar items were contiously dropped despite the finger being removed, when sliding out of the hotbar before removing your finger.

Ability to change surface

Until now, the surface was provided by the TextureView, which is known to be a little slower than the SurfaceView.
However, the SurfaceView strain the smartphone in a different way than the TextureView, making the latter still preferable in most situations.

So both surfaces will be available in the settings, defaulting to the TextureView.
enter image description here
[TODO: The SurfaceView's surface lifecycle is much shorter, I need to implement proper surface swapping ?]

Better resize, perhaps ?

I unexpectedly realised minecraft doesn't like to have its framebuffer resized when in fullscreen.
So I took the other way around and added a few things:

  • The fullscreen mode is disabled by default, allowing for resizing a window.
  • AWT based windowing is now able to be automatically resized !
  • Yeah, the controls are also "properly" relocated, I did it after the screen.enter image description here

Better jar installer

Low end devices usually struggled maintaining more than 20 FPS. Furthermore, the window size was usually way too small and unpractical. So I fixed all of that.
It is now working at ~14 times the details speed, while at the same time fitting the window much better, regardless of the window !

Before: 46 fps 🐌, the window isn't fitting perfectly...
enter image description here

After: 639 FPS 🚀, the window is automatically fitting much better 😄
enter image description here
Note: Manual scaling isn't needed anymore, since the window fits much better than before.

One last thing. The mouse touchpad should now be mapped on 1:1 to your finger movements, making easier installing mods !
Actually, I have yet another thing !
Turns out that I added support for AWT chars, used by the mod installer. So now you can type text for whatever non standard usage you have.
enter image description here

New framerate limiter

A common use of the framerate limiter is to reduce the device power usage. However, the current implementation was not CPU friendly, by sleeping the rendering thread multiple times for ONE rendered frame 👀

This isn't ideal for the scheduler, which has to dispatch CPU cycles as effectively as possible. The new implementation uses one Thread sleep per frame, allowing the CPU time to be properly allocated to whatever is needed on the system.

Align mod installer buttons to the in game counterparts.

Everything is in the title to be honest. However, note the colors are inversed in state due to the default state. If you missed it, the image is available in a previous section.

Dev side: Auto lwjgl jar update

Trying out every minor change in the lwjgl project was slowly driving insane.
So I implemented the auto update, you just need to press the green Android Build button as usual 😄

With this whole issue out of the way, I'll go fix some other stuff.

@Mathias-Boulay Mathias-Boulay marked this pull request as draft March 15, 2022 18:13
@Mathias-Boulay Mathias-Boulay changed the title [FIX] Control Spin off I guess Controls Revision 2.6 Mar 19, 2022
@Mathias-Boulay Mathias-Boulay changed the title Controls Revision 2.6 [V2.6] Controls Revision Mar 25, 2022
@Mathias-Boulay Mathias-Boulay marked this pull request as ready for review March 25, 2022 10:15
@kuzy21
Copy link

kuzy21 commented Mar 29, 2022

So um is it done because it looks successful

@Mathias-Boulay Mathias-Boulay merged commit 81169bc into PojavLauncherTeam:v3_openjdk Apr 2, 2022
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.

None yet

3 participants