Commit Graph
141 Commits
Author SHA1 Message Date
Duy Tran Khanh 8aea2ee5fc Changes
Added a little more debug info
Fixes: the GUI button hides itself; Makefile jar path; Restart before
launching game
2022-07-01 12:43:30 +07:00
Duy Tran Khanh ee2c68fb98 Fixes
Makefile: fix path
Moved GameSurfaceView to a separate class
Renamed MinecraftDownloader to MinecraftResourceUtils

Fix: Some versions fails because GLFW_CLIENT_API is not set
2022-07-01 07:02:25 +07:00
Duy Tran Khanh ec8b7dc555 Side menu: some tiny changes 2022-06-16 19:57:13 +07:00
khanhduytran0 582aa18d2c Added right-size menu (incomplete)
Limitations:
- Animations might not work properly
- Only one option is available, more will be added soon
2022-06-15 21:43:54 +07:00
khanhduytran0 97433a5596 Add support for mods that use Vulkan for rendering
Known mods: Blaze4D (untested), VulkanMod, more?
- VulkanMod: needs a tiny modification to get it work with LWJGL 3.2.3
2022-06-10 12:13:23 +07:00
Duy Tran Khanh 5d7c77d697 Forge 1.17+ support 2022-05-29 20:03:04 +07:00
Duy Tran Khanh 85bc35f679 Automatically change the Java version if needed
Manually-specified Java version still applies to:
- Minecraft versions below 1.17 (default is Java 8)
- Minecraft version 1.17.x (allow choosing between Java 16 and 17)
2022-05-27 09:01:39 +07:00
khanhduytran0 bf12743457 Moved the JVM entry point to start when needed 2022-05-27 05:48:25 +07:00
Eilionoir Tunnicliff ab4bddb941 Merge branch origin/main into objc-rewrite 2022-05-22 03:12:48 -04:00
khanhduytran0 2a9d3909f8 Internal, renderer and UI changes + 1.19-pre1 support
Minecraft 1.19 support:
- Since 1.19-pre1, LWJGL 3.3.1 is used. However, LWJGL 3.2.3 still works with it, at least for this Minecraft release.
- Added a hack to skip calling to ObjC codes (skipped an asset file to skip setting the icon)
- JNA version replacing: now only change to 5.8.0 if version < 5.8.0

Internal changes:
- Cleanup: moved global functions to a new place
- Handle demo user correctly: actually authenticate the game with demo's access token and use the Xbox gamertag as the username
- Start moving strings to Localizable.strings (WIP)
- Re-wrote the Microsoft authentication and account management to Objective-C
- Assets downloading: added a tiny sleep call so that the UI won’t be frozen when too many tasks are executed at the same time

Renderers changes
- gl4es: `init_constructor` is now enabled, therefore moved the preload part to before `eglInitialize` (or EGL will be de-init after gl4es's hardware test).
- gl4es-extra (aka holy gl4es 1.1.4) is now used to replace the regular gl4es. This fixes VBO issue on version < 1.13 and some extra stuff. https://github.com/PojavLauncherTeam/gl4es-114-extra/commit/d6cf5c4
- Removed gl4es 1.1.5 and `Disable gl4es shaderconv` as it's unnecessary for now
- Removed vgpu, as it requires some missing extensions when come to shaders

User interface:
- The account selection list now displays the skin head (or the Xbox gamerpic if demo) and the account type
2022-05-22 11:31:14 +07:00
Eilionoir Tunnicliff 53613c5f18 Updates
- New wordmark on the main screen
- Remove wordmark from LaunchScreen.storyboard
- Apply depiction and icon fixes from 2.0.1
2022-04-30 19:43:24 -04:00
Duy Tran Khanh 580da57855 Set GLFW window attrib; Proper external mouse lock
Setting window attribute fixes DynamicFPS mod being broken
2022-03-17 07:24:41 +07:00
Duy Tran Khanh 5c618d907b CC: passthrough support; Lock mouse pointer
Custom controls button passthrough: currently, only passed-through
events are touch events.
Pointer locking is incomplete and might not work properly.
2022-03-03 08:16:14 +07:00
khanhduytran0 147ac079be Fixes virtual mouse, XVA entitlement (iOS 14)
Fixes virtual mouse not working when enabled from Preferences.
Added Extended Virtual Addressing Entitlement.
2022-02-25 06:58:07 +07:00
Adam Tunnic 2ed628f921 Add option to show virtual mouse at game launch 2022-02-22 00:37:47 -05:00
Duy Tran Khanh 431782d0c0 Update SurfaceViewController.m 2022-02-18 17:13:10 +07:00
Duy Tran Khanh 12862ca5f3 Update SurfaceViewController.m 2022-02-18 16:24:58 +07:00
Duy Tran Khanh 8575e9f2f6 Bug fixes
- Random infinite game launching process
- Input not working on 1.13+ when `Restart before launching game` is
enabled.
2022-02-18 16:21:48 +07:00
Duy Tran Khanh e14e945a68 Fixes swipeable button state handling 2022-02-08 07:06:58 +07:00
Duy Tran Khanh 2f292c7a15 Better click handling 2022-01-22 06:52:18 +07:00
khanhduytran0 fbde4948d5 Various bug fixes
- Input cursor movement seems too fast, attempt to reduce it by setting larger font size in the hidden text field.
- latestlog.txt doesn't log in 1.12+ since Log4j patch. Fixed by adding some config lines.
- Makefile: building is broken when run make from a path with space(s). Fixed by handling spaces with backslashes.
- text2speech is not overridden properly. Fixed by excluding it from download list and adding launcher.jar itself to the classpath.
- XML log output in < 1.12 since Log4j patch. Fixed by using our own configuration file.

Some more changes:
- Commented out a debug line in LWJGLX
- Fix a typo.
- JavaLauncher: use (ObjC)BOOL instead of (std)bool.
2022-01-17 08:18:06 +07:00
Duy Tran Khanh ef2e200e28 Bug fix: inputStringLength is not set back to 40
This caused a bug that clears the text when pressing backspace after
the keyboard is displayed again.
2022-01-12 07:02:05 +07:00
khanhduytran0 82dc17cd9c Support for input cursor movement from keyboard
New class: TrackedTextField. This class keeps track of the pointer in the text field. The hidden text field now has 40 placeholder spaces and the pointer is placed at the middle. When typing, placeholder spaces won't get removed as before. Autocorrect seem to be broken a bit for now.

Additional changes:
- Added missing GLFW functions (array version of other functions)
- Hotbar handling: doubled barWidth and barHeight

Bug fix:
- Touching onto the hotbar breaks the handling of on-screen tap/long-press gestures
2022-01-11 13:58:16 +07:00
khanhduytran0 b6f552df85 Keyboard + Mouse input handling; some cleanups
* Keyboard input: KeyboardInput.m
- Requires iOS 13.4. Used pressesBegan and pressesEnded.
- Not all keys are handled, these will be handled later.

* Mouse input
- Requires iOS 13.0 for hovering. Used UIHoverGestureRecognizer.
- Requires iOS 14.0 for L/R mouse buttons and scroll handling. Used GCMouse for now. We will use iOS 13.4(?)'s API later.
- Pointer lock is not yet handled.

These above apply to iPadOS aswell, not sure about tvOS. iPhone users need to disable "Perform Touch Gestures" in the AssistiveTouch Accessibility settings in order to get the pointer hovering to work.

* Cleanups
- Use asprintf instead of sprintf when possible
- CallbackBridge functions: removed unnecessary JNI fields.
- Condition cleanup (managing virtual mouse position).
2022-01-04 09:55:47 +07:00
Duy Tran Khanh 1b0d564379 New toggle option: Restart before launching game
This option allows the launcher to restart itself before launching the
game, therefore all changes are applied such as JVM Arguments and Java
version. The restart mechanism doesn't always work, so a toggle is
here for now.
2021-12-17 21:13:50 +07:00
Duy Tran Khanh 7d527942a2 Completely fix Log4J RCE (1.7-1.16.5) (not yet tested)
TODO: checker with SHA1
2021-12-13 20:50:42 +07:00
Duy Tran Khanh 150cf861b1 Experimental things
* Multitouch handling, allows one of these actions below to work with
moving camera at the same time.
- Switching hotbar slot; might not work properly
- Destroying block (left mouse button) with another finger
long-pressed (without pressing the PRI button)
- Right mouse trigger with another finger tapped onto the screen
(without pressing the SEC button); not working properly yet
* Sub-pixel cursor support; not yet checked
2021-12-13 07:40:12 +07:00
Duy Tran KhanhandDuy Tran Khanh 33cb7d0125 Custom Controls revisions implemenation (#292)
* Move control loaders to CustomControlsUtils.m

* WIP Drawer support (currently broken)

Also, updated MetalANGLE for helping debug stuff on crash.

* temp

* ControlDrawer: free orientation

* Avoid scrolling the hotbar in grab mode

* Popover: fix the frame inside the arrow

* Changes

- Attempt to allow Microsoft login when offline.
- Custom controls: drawer and sub-buttons are now visible.
- Pickers in Preferences: pre-select at the saved index.

* Bump version code to 4, hide sub-button by default

* Fix text trucanting

* impl scroll buttons, rewrite some parts to objc

* Virtual mouse implementation

Also, possible fix for popover crashes on iPad

Exception type: NSInternalInconsistencyException
> Reason: Tried to set <UIBarButtonItem: 0x10fee5660> menuOnTouchDown
menu=0x2810dce10 image=<UIImage:0x280149050 symbol(system:
ellipsis.circle) {20, 19} baseline=3.5,contentInsets={1, 1.5, 1,
1.5},alignmentRectInsets={-0.5, 0, -0.5, 0}
config=<traits=(UserInterfaceIdiom = Pad, DisplayScale = 2,
DisplayGamut = sRGB, HorizontalSizeClass = Regular, VerticalSizeClass
= Regular, UserInterfaceStyle = Dark, UserInterfaceLayoutDirection =
LTR, PreferredContentSizeCategory = L, AccessibilityContrast =
Normal)>> as sourceView of
<_UIAlertControllerActionSheetRegularPresentationController:
0x12043f5a0>, even though it is not a kind of UIView.

* Swap item between hands by double-tap item moment

* Basic editor (only several stuff implemented)

There's no save/load yet, so it's just a preview for now.

* Control editor (preview only)
TODO: Color picker for iOS < 14

* Save, load and set default are here

* Changes

- Ported Snap and Align from Android
- Added options: create and delete button

TODO:
- color picker for iOS < 14
- drawer editor
- maybe more

* Editor: Added orientation changer for drawer

Added some more check to determine whether dynamic position should be
visible (when the button is not a sub-button, or the parent drawer
doesn't use the FREE orientation)

* Editor: implemented adding drawer and sub-button

* Added a warning about unfinished custom controls

Co-authored-by: Duy Tran Khanh <[email protected]>
2021-11-26 10:35:21 +07:00
Duy Tran KhanhandDuy Tran Khanh db0074d1e5 Merge custom control changes (#284)
* Move control loaders to CustomControlsUtils.m

* WIP Drawer support (currently broken)

Also, updated MetalANGLE for helping debug stuff on crash.

* temp

* ControlDrawer: free orientation

* Avoid scrolling the hotbar in grab mode

* Popover: fix the frame inside the arrow

* Changes

- Attempt to allow Microsoft login when offline.
- Custom controls: drawer and sub-buttons are now visible.
- Pickers in Preferences: pre-select at the saved index.

* Bump version code to 4, hide sub-button by default

* Fix text trucanting

* impl scroll buttons, rewrite some parts to objc

* Virtual mouse implementation

Also, possible fix for popover crashes on iPad

Exception type: NSInternalInconsistencyException
> Reason: Tried to set <UIBarButtonItem: 0x10fee5660> menuOnTouchDown
menu=0x2810dce10 image=<UIImage:0x280149050 symbol(system:
ellipsis.circle) {20, 19} baseline=3.5,contentInsets={1, 1.5, 1,
1.5},alignmentRectInsets={-0.5, 0, -0.5, 0}
config=<traits=(UserInterfaceIdiom = Pad, DisplayScale = 2,
DisplayGamut = sRGB, HorizontalSizeClass = Regular, VerticalSizeClass
= Regular, UserInterfaceStyle = Dark, UserInterfaceLayoutDirection =
LTR, PreferredContentSizeCategory = L, AccessibilityContrast =
Normal)>> as sourceView of
<_UIAlertControllerActionSheetRegularPresentationController:
0x12043f5a0>, even though it is not a kind of UIView.

Co-authored-by: Duy Tran Khanh <[email protected]>
2021-10-15 05:16:17 +07:00
Duy Tran Khanh c2a0e3ae80 Changes in LauncherPreferencesViewController
- Java arguments edit text box: moved the done button to the return button.
- New option: slideable hotbar. This option allows you to use a finger to slide between hotbar slots.
- View tag IDs are moved to macros.
2021-10-03 12:35:05 +07:00
Duy Tran Khanh b7e2334639 Bug fix: scroll the hotbar
since scrolling is too fast, disable it moment
2021-10-02 14:12:26 +07:00
Duy Tran Khanh 4f59e0ffff PojavCore is now inside the main executable
This took so long since there was a failed attempt in unloading and
reloading JVM to support Forge 1.17.x. Next attempt would be rewrite
everything to Objective-C and move the JVM entry point to the start of
the game.
2021-10-01 11:14:05 +07:00
Duy Tran Khanh 64f4042103 Changes
- Downgraded to Mesa 21.0 since 21.2.? goes brrr
- Zink renderer is now visible in the renderer picker.
- Makefile: test multi-line ssh script moment
2021-09-18 19:52:09 +07:00
Duy Tran Khanh b2ffd5edc3 Changes
- libpojavexec.dylib is now PojavCore.framework.
- More changes for Zink renderer. Note that Mesa 21.0 is included instead of 21.2.1 due to the new version seems to be broken, only display glClearColor.
2021-09-17 07:00:14 +07:00
Duy Tran Khanh 5dcacb6d00 Changes
- Fixes #272
- Replaced MGLLayer with EGL calls
- Re-implemented Zink renderer to work with new Renderer selection system (currently hidden due to unfinished)
2021-09-14 10:57:24 +07:00
Duy Tran Khanh dd9be6e0c4 New renderer: Tiny GL wrapper for ANGLE
This renderer allows Minecraft 21w10a and newer to be rendered directly
in OpenGL ES through ANGLE with several wrapped functions, so the game
may runs with better performance.
Source code:
https://github.com/PojavLauncherTeam/gl4es/tree/master/tinygl4angle
2021-09-05 10:39:00 +07:00
Duy Tran Khanh 49125524d3 Preliminary support for v2 (code 3) control
TODO:
- Control editor
- Implement Drawer

FIXME:
-[MGLLayer init] crashes. Maybe replace with CAMetalLayer?
2021-08-30 07:13:39 +07:00
Duy Tran Khanh f00b09af2e Changes
- [Custom controls] Implemented `isSwipeable` property.
- VGPU has error at `sampler2DShadow`, so ignore it for now.
- WIP changes on jailed version.
2021-08-27 20:55:38 +07:00
Duy Tran Khanh f571e96662 Changes
- Replace MGLKView with UIView + MGLLayer. Attempt to fix crash at "[MGLKView initWithFrame]". Known issue: hotbar offset is a bit wrong when scale ≠ 100%
- Cleanup some unused files.
2021-08-24 11:36:01 +07:00
Duy Tran Khanh d8115fab9d Attempt to fix crash 2021-08-23 13:28:16 +07:00
Duy Tran Khanh 5ce5dbcc00 Changes
- Avoid printing "Session ID". Several Minecraft versions do that.
- Fixes Minecraft 1.13 snapshot due to the usage of LWJGL functions from an older version.
- Minecraft's built in Fullscreen Resolution scaler is available now, but not working properly.
- Regal internal changes (still fail at )
2021-08-23 11:19:54 +07:00
Duy Tran Khanh ce3cc585cf Fix crash when logging surfaceRect 2021-08-22 09:27:03 +07:00
Duy Tran Khanh a4fca52430 Check surfaceRect 2021-08-22 07:28:17 +07:00
Duy Tran Khanh fe5f9e77a9 Changes
- Added a check to prevent attempt to launch 1.17+ with Java 8.
- Added an option to disable gl4es shaderconv in order to let ANGLE
processes them directly. This option lets Minecraft 1.17+ work
without the patch resource pack, OptiFine works aswell :)
- Changing renderer library no longer requires restart the launcher.
- Fixed some alert dialogs not displaying.
- PList default values are now set every time it loads.
2021-08-13 07:25:17 +07:00
Duy Tran Khanh a739cf7202 Resolution downscaler moment 2021-08-10 19:42:10 +07:00
Duy Tran Khanh 0212022859 Bug fix: the GUI button hides itself 2021-08-08 13:02:09 +07:00
Duy Tran Khanh 8eac9fefd5 Maybe this is not needed 2021-08-07 10:29:52 +07:00
Duy Tran Khanh c617b645b9 oof 2021-08-07 10:25:34 +07:00
Duy Tran Khanh 66bee901db Layout converter v1 -> unfinished v2
"i want new keyboard for pojavluancher" x20 by @𝙵𝚊𝚔ȇ̈_A𝕣ᴄᴀᴅᴇ#7200
2021-08-07 10:17:52 +07:00
Duy Tran Khanh e079e86a80 Changes
- Automatically set overrideWidth and overrideHeight
- Multi-context moment.
Current status of Forge 1.12.2:

Exception type: EXC_BAD_ACCESS (SIGSEGV)
Exception subtype: KERN_INVALID_ADDRESS: 0x964
Exception codes: 0x0000000000000001, 0x0000000000000964
Culprit: Unknown
VM Protection: 0x964 is not in any region.

Triggered by thread: 20
Thread name:
Call stack:
0   libgl4es_115.dylib  0x000000012196738c 0x121900000 + 422796  //
realize_glenv
1   libgl4es_115.dylib  0x00000001219672dc 0x121900000 + 422620  //
realize_glenv
2   libgl4es_115.dylib  0x0000000121966e78 0x121900000 + 421496  //
fpe_glDrawArrays
3   libgl4es_115.dylib  0x000000012199d4e4 0x121900000 + 644324  //
draw_renderlist
4   libgl4es_115.dylib  0x000000012197e39c 0x121900000 + 517020  //
gl4es_flush
5   libgl4es_115.dylib  0x00000001219609e4 0x121900000 + 395748  //
proxy_glEnable
2021-08-05 15:17:56 +07:00