Commit Graph
251 Commits
Author SHA1 Message Date
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
khanhduytran0 1d7e8a8214 Experimental Minecraft Downloader
This is not yet finished, there are 3 main things left
- Make sure everything works
- (Assets) download old structure
- Cleanup

What are implemented?
- Downloading file is handled with AFNetworking
- SHA1 validation, can be turned off in Preferences
- inheritsFrom support (need testing)
- Downloading assets with 20 jobs parallel

Known issue
- Assets SHA1 validating freezes the UI

Additional things
- [Custom controls] Dynamic position error is now handled instead of just crashes
- [Custom controls] The editor animation is now changed to fade in/out (for now, later might change)
- VGPU renderer is now made hidden, since it's too limited on iOS, removal planned
- [Code cleanup] Use NSDictionary instead of a set of fields for renderer list; Fix wrong field name.
- Some more stuff...
2022-04-20 20:45:47 +07: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
Adam Tunnic 70c150af38 Make the debug logging switch actually do something
Pretty much disables everything except for [Pre-Init] and [Init], as well as Renderer Init Success. Toggle debug logging off to see.

regLog(message) -> logs all the time
debugLog(message) -> logs only when debug logging is enabled
2022-03-13 21:23:02 -04:00
Adam Tunnic c343b80bd8 Demo mode works now 2022-03-13 20:27:24 -04:00
Adam TunnicandDuy Tran Khanh 81ae236181 Disable Mojang login (#331)
Merging early because... why not. Anyone that hasn't migrated now will get the warning.

Co-authored-by: Duy Tran Khanh <[email protected]>
2022-03-09 19:03:08 -05:00
Duy Tran Khanh bd134ccfde Fixes scroll crashes, move login spinner to left
Scrolling crashes: Float cannot be casted to Double
2022-02-25 19:56:24 +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
Adam Tunnic 959a4e2290 Merge branch 'backend-virgl' into main 2022-02-14 08:52:10 -05:00
Duy Tran Khanh bd6ba67745 Bug fix: Arc DNS injector breaks on Java 16+
This is caused by a missing function in our class loader.

Error:
System class loader does not define the
appendToClassPathForInstrumentation method
Unable to add
/Applications/PojavLauncher.app/libs/arc_dns_injector.jar to system
class path - the system class loader does not define the
appendToClassPathForInstrumentation method or the method failed
FATAL ERROR in native method: processing of -javaagent failed,
appending to system class path failed
2022-02-07 05:20:05 +07:00
Adam Tunnic 372831bc9e Add Arc capes 2022-02-05 11:28:51 -05:00
Duy Tran Khanh e5018cc094 Bug fix: Fabric 1.17+ crash at startup(fixes #304)
Microsoft account now set accountType to msa.
Minor change in custom control view controller.
2022-02-05 16:47:04 +07:00
Duy Tran Khanh dc5c5a9c65 [Custom controls] Added color picker for iOS < 14
Might aswell add an option to optionally use this instead of the system
color picker on iOS 14+. Used library: Alderis

Other changes
- [Custom controls] The editor is now fullscreen due to the
presentation of the color picker.
- Fixes scroll wheel input is always int
2022-02-01 21:58:54 +07:00
Duy Tran Khanh 71271fbed4 Added readable MSA errors 2022-01-26 08:49:10 +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
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 8624e54630 Bug fix: NPE when setting inherited fields
Unable to insert id=null
java.lang.NoSuchFieldException: id
	at java.lang.Class.getDeclaredField(Class.java:2070)
	at net.kdt.pojavlaunch.Tools.insertSafety(Tools.java:544)
	at net.kdt.pojavlaunch.Tools.getVersionInfo(Tools.java:466)
	at net.kdt.pojavlaunch.PLaunchApp.launchMinecraft(PLaunchApp.java:61)
	at
net.kdt.pojavlaunch.uikit.UIKit.callback_SurfaceViewController_launchMi
necraft(UIKit.java:104)
	at net.kdt.pojavlaunch.uikit.UIKit.launchUI(Native Method)
	at net.kdt.pojavlaunch.PLaunchApp.main(PLaunchApp.java:40)
2022-01-02 06:25:40 +07:00
Duy Tran Khanh 33b00e417c Fix a NullPointerException when launching ≤ 1.6.4 2021-12-26 05:43:14 +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
Adam Tunnic 2e30a1470f Merge branch 'main' of github.com:PojavLauncherTeam/PojavLauncher_iOS 2021-12-15 19:13:42 -05:00
Adam Tunnic 0b643476f4 WIP Demo mode stuff
Sign in with a Microsoft account that doesn't own the game, demo_user will be made. This is very much WIP as my iPhone 7 doesn't feel like launching PojavLauncher.
2021-12-15 13:14:48 -05:00
Duy Tran Khanh fea17bb28e Log4J RCE patch config: disable XML format output
This applies for Minecraft 1.12+
Disable XML formatting for now until we have a log viewer.
2021-12-15 05:49:46 +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
khanhduytran0 72e0c69ad1 WIP virglrenderer
Current state: bind() returns errno -1 (Operation not permitted)
2021-11-30 04:29:09 +07:00
Duy Tran Khanh 96ea5fd687 Cleanup unused files
~~also fix a bit of grammar :trollface:~~
2021-11-27 15:11:09 +07:00
Duy Tran Khanh d533bfbb10 Local account: update the error message a bit 2021-11-27 13:55:43 +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 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 7fb5b55d8b Override JNA to 5.8.0
This fixes LabyMod 1.8.9 crashing.
2021-09-27 11:06:15 +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 1c91691d96 Workaround for Forge 1.12.2 crashing 2021-08-30 14:36:12 +07:00
Duy Tran Khanh cad4f47454 Fix parsing Java version "17-ea" 2021-08-24 14:02:06 +07:00
doregon 15a6cf0acf MultiMC-like instances:
- now stores the minecraft directory in .pojavlauncher/instances/default
- configurable straight from the preferences
- migrates your existing minecraft folder to instances/default
- moves L/AS/m from Documents/ to .pojavlauncher/
- changes home directory to .pojavlauncher/
- automatically switches the L/AS/m symlink based on the current instance
- accounts stay the same between instances
2021-08-24 02:56:00 -04: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 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 d949cb4e1b Fixes Sodium 0.3 crashes on saving settings
Sodium 0.3 won't work yet
2021-08-22 14:19:57 +07:00
Duy Tran Khanh 949e562c0e Regal stuff (test) 2021-08-22 14:19:57 +07:00
Duy Tran Khanh de6479f1e6 Changes
- test regal stuff (lib not added)
- auto init symlinks for jailed JRE
2021-08-18 05:52:40 +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 2f87bbb54d Trick FlatLAF (used by LabyMod installer) to use Linux codes 2021-08-10 11:44:56 +07:00
Duy Tran Khanh 934f4f1354 FPS limiter :) 2021-08-08 17:34:09 +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
Duy Tran Khanh f2566e3da5 Basic mod installer implementation 2021-08-03 16:06:32 +07:00
Duy Tran Khanh 0668d016bf Changes
- Added Caciocavallo (libawt_xawt stubs) support library.
- Added support lauching Minecraft 1.5.2 and older (requires latest
JRE8 build)
- [Custom controls] Implemented opacity property.
- Version info is now updated through macro instead of `sed` command.
2021-08-01 10:41:02 +07:00
Duy Tran Khanh d4d13edc9a Stub glfwRequestWindowAttention 2021-07-24 16:25:42 +07:00