Add latest changes from v3_openjdk

This commit is contained in:
artdeell 2023-10-14 08:43:31 +03:00
commit 20a83d377e
18 changed files with 57 additions and 50 deletions

View File

@ -63,7 +63,7 @@ If you want to build from source code, follow the steps below.
- (If needed) update the Version file with the current date</br>
### LWJGL
- **Coming soon**
The build instructions for the custom LWJGL are available over the [LWJGL repository](https://github.com/PojavLauncherTeam/lwjgl3)
### The Launcher
- Because languages are auto-added by Crowdin, you need to run the language list generator before building. In the project directory, run:

View File

@ -199,7 +199,7 @@ dependencies {
implementation 'com.github.PojavLauncherTeam:portrait-ssp:6c02fd739b'
implementation 'com.github.Mathias-Boulay:ExtendedView:1.0.0'
implementation 'com.github.Mathias-Boulay:android_gamepad_remapper:eb92e3a5bb'
implementation 'com.github.Mathias-Boulay:virtual-joystick-android:cb7bf45ba5'
implementation 'com.github.Mathias-Boulay:virtual-joystick-android:2e7aa25e50'
// implementation 'com.intuit.sdp:sdp-android:1.0.5'

View File

@ -8,7 +8,11 @@ import java.util.Map;
@Keep
public class JAssets {
/* Used by older versions of mc, when the files were named and under .minecraft/resources */
@SerializedName("map_to_resources") public boolean mapToResources;
public Map<String, JAssetInfo> objects;
/* Used by the legacy.json (~1.6.X) asset file, used for paths at the root of the .minecraft/assets folder */
public boolean virtual;
}

View File

@ -109,10 +109,10 @@ public class ControlData {
}
public ControlData(String name, int[] keycodes, String dynamicX, String dynamicY, float width, float height, boolean isToggle) {
this(name, keycodes, dynamicX, dynamicY, width, height, isToggle, 1, 0x4D000000, 0xFFFFFFFF, 0, 0, true, true);
this(name, keycodes, dynamicX, dynamicY, width, height, isToggle, 1, 0x4D000000, 0xFFFFFFFF, 0, 0, true, true, false, false);
}
public ControlData(String name, int[] keycodes, String dynamicX, String dynamicY, float width, float height, boolean isToggle, float opacity, int bgColor, int strokeColor, float strokeWidth, float cornerRadius, boolean displayInGame, boolean displayInMenu) {
public ControlData(String name, int[] keycodes, String dynamicX, String dynamicY, float width, float height, boolean isToggle, float opacity, int bgColor, int strokeColor, float strokeWidth, float cornerRadius, boolean displayInGame, boolean displayInMenu, boolean isSwipable, boolean mousePassthrough) {
this.name = name;
this.keycodes = inflateKeycodeArray(keycodes);
this.dynamicX = dynamicX;
@ -128,6 +128,8 @@ public class ControlData {
this.cornerRadius = cornerRadius;
this.displayInGame = displayInGame;
this.displayInMenu = displayInMenu;
this.isSwipeable = isSwipable;
this.passThruEnabled = mousePassthrough;
}
//Deep copy constructor
@ -146,7 +148,9 @@ public class ControlData {
controlData.strokeWidth,
controlData.cornerRadius,
controlData.displayInGame,
controlData.displayInMenu
controlData.displayInMenu,
controlData.isSwipeable,
controlData.passThruEnabled
);
}

View File

@ -9,7 +9,8 @@ public class ControlJoystickData extends ControlData {
super();
}
public ControlJoystickData(ControlData properties) {
public ControlJoystickData(ControlJoystickData properties) {
super(properties);
forwardLock = properties.forwardLock;
}
}

View File

@ -204,7 +204,15 @@ public class ControlLayout extends FrameLayout {
}
private void addJoystickView(ControlJoystickData data){
addView(new ControlJoystick(this, data));
ControlJoystick view = new ControlJoystick(this, data);
if (!mModifiable) {
view.setAlpha(view.getProperties().opacity);
view.setFocusable(false);
view.setFocusableInTouchMode(false);
}
addView(view);
}

View File

@ -102,8 +102,8 @@ public class ControlJoystick extends JoystickView implements ControlInterface {
@Override
public void cloneButton() {
ControlData data = new ControlJoystickData(getProperties());
getControlLayoutParent().addJoystickButton((ControlJoystickData) data);
ControlJoystickData data = new ControlJoystickData(mControlData);
getControlLayoutParent().addJoystickButton(data);
}

View File

@ -47,7 +47,7 @@ public class ActionRow extends LinearLayout {
};
private final ActionButtonInterface[] actionButtons = new ActionButtonInterface[3];
private View mFollowedView = null;
private final int mSide = SIDE_TOP;
private final int mSide = SIDE_AUTO;
/** Add action buttons and configure them */
private void init(){
@ -123,10 +123,7 @@ public class ActionRow extends LinearLayout {
ViewGroup parent = ((ViewGroup) mFollowedView.getParent());
if(parent == null) return mSide;//Value should not matter
int side = mFollowedView.getX() + getWidth()/2f > parent.getWidth()/2f
? SIDE_LEFT
: SIDE_RIGHT;
int side = SIDE_TOP;
float futurePos = getYPosition(side);
if(futurePos + getHeight() > (parent.getHeight() + getHeight()/2f)){
side = SIDE_TOP;

View File

@ -104,7 +104,7 @@ public class LauncherPreferences {
PREF_FORCE_VSYNC = DEFAULT_PREF.getBoolean("force_vsync", false);
PREF_BUTTON_ALL_CAPS = DEFAULT_PREF.getBoolean("buttonAllCaps", true);
PREF_DUMP_SHADERS = DEFAULT_PREF.getBoolean("dump_shaders", false);
PREF_DEADZONE_SCALE = DEFAULT_PREF.getInt("gamepad_deadzone_scale", 100)/100f;
PREF_DEADZONE_SCALE = ((float) DEFAULT_PREF.getInt("gamepad_deadzone_scale", 100))/100f;
PREF_BIG_CORE_AFFINITY = DEFAULT_PREF.getBoolean("bigCoreAffinity", false);
PREF_ZINK_PREFER_SYSTEM_DRIVER = DEFAULT_PREF.getBoolean("zinkPreferSystemDriver", false);
PREF_DOWNLOAD_SOURCE = DEFAULT_PREF.getString("downloadSource", "default");

View File

@ -56,7 +56,7 @@ public class LauncherPreferenceControlFragment extends LauncherPreferenceFragmen
CustomSeekBarPreference deadzoneSeek = requirePreference("gamepad_deadzone_scale",
CustomSeekBarPreference.class);
deadzoneSeek.setRange(50, 200);
deadzoneSeek.setValue((int) joystickDeadzone * 100);
deadzoneSeek.setValue((int) (joystickDeadzone * 100f));
deadzoneSeek.setSuffix(" %");
@ -73,6 +73,7 @@ public class LauncherPreferenceControlFragment extends LauncherPreferenceFragmen
gyroSensitivitySeek.setRange(25, 300);
gyroSensitivitySeek.setValue((int) (gyroSpeed*100f));
gyroSensitivitySeek.setSuffix(" %");
CustomSeekBarPreference gyroSampleRateSeek = requirePreference("gyroSampleRate",
CustomSeekBarPreference.class);
gyroSampleRateSeek.setRange(5, 50);

View File

@ -245,7 +245,7 @@ public class AsyncMinecraftDownloader {
JAssetInfo asset = assetsObjects.get(assetKey);
assetsSizeBytes += asset.size;
String assetPath = asset.hash.substring(0, 2) + "/" + asset.hash;
File outFile = assets.mapToResources ? new File(outputDir,"/"+assetKey) : new File(objectsDir, assetPath);
File outFile = (assets.mapToResources || assets.virtual) ? new File(outputDir,"/"+assetKey) : new File(objectsDir , assetPath);
boolean skip = outFile.exists();// skip if the file exists
if(LauncherPreferences.PREF_CHECK_LIBRARY_SHA && skip)
@ -261,8 +261,7 @@ public class AsyncMinecraftDownloader {
executor.execute(()->{
try {
if (!assets.mapToResources) downloadAsset(asset, objectsDir, downloadedSize);
else downloadAssetMapped(asset, assetKey, outputDir, downloadedSize);
downloadAssetFile(outFile, assetPath, downloadedSize);
}catch (IOException e) {
Log.e("AsyncMcManager", e.toString());
localInterrupt.set(true);
@ -290,32 +289,18 @@ public class AsyncMinecraftDownloader {
}
public void downloadAsset(JAssetInfo asset, File objectsDir, AtomicInteger downloadCounter) throws IOException {
String assetPath = asset.hash.substring(0, 2) + "/" + asset.hash;
File outFile = new File(objectsDir, assetPath);
downloadFileMirrored(DownloadMirror.DOWNLOAD_CLASS_ASSETS, MINECRAFT_RES + assetPath, outFile, getByteBuffer(),
new Tools.DownloaderFeedback() {
int prevCurr;
@Override
public void updateProgress(int curr, int max) {
downloadCounter.addAndGet(curr - prevCurr);
prevCurr = curr;
}
});
}
public void downloadAssetMapped(JAssetInfo asset, String assetName, File resDir, AtomicInteger downloadCounter) throws IOException {
String assetPath = asset.hash.substring(0, 2) + "/" + asset.hash;
File outFile = new File(resDir,"/"+assetName);
public void downloadAssetFile(File outFile, String assetPath, AtomicInteger downloadCounter) throws IOException {
downloadFileMirrored(DownloadMirror.DOWNLOAD_CLASS_ASSETS, MINECRAFT_RES + assetPath, outFile, getByteBuffer(),
new Tools.DownloaderFeedback() {
int prevCurr;
@Override
public void updateProgress(int curr, int max) {
downloadCounter.addAndGet(curr - prevCurr);
prevCurr = curr;
}
});
new Tools.DownloaderFeedback() {
int prevCurr;
@Override
public void updateProgress(int curr, int max) {
downloadCounter.addAndGet(curr - prevCurr);
prevCurr = curr;
}
}
);
}
protected void downloadLibrary(DependentLibrary libItem, String libArtifact, File outLib) throws Throwable{

View File

@ -352,4 +352,11 @@
<string name="preference_verify_manifest_description">When enabled, the launcher will check the game version manifest along with the libraries.</string>
<string name="notif_download_finished">The game is ready to launch</string>
<string name="notif_download_finished_desc">Click here to start it!</string>
<string name="preference_category_gestures">Gestures</string>
<string name="preference_category_buttons">Buttons</string>
<string name="preference_category_experimental_settings">Experimental fuckury</string>
<string name="preference_category_java_tweaks">Java Tweaks</string>
<string name="preference_category_main_categories">Categories</string>
<string name="preference_category_miscellaneous">Miscellaneous settings</string>
<string name="preference_category_video">Video settings</string>
</resources>

View File

@ -14,7 +14,7 @@
</Preference>
<PreferenceCategory
android:title="Gestures ">
android:title="@string/preference_category_gestures">
<androidx.preference.SwitchPreferenceCompat
android:defaultValue="false"
@ -42,7 +42,7 @@
</PreferenceCategory>
<PreferenceCategory
android:title="Buttons">
android:title="@string/preference_category_buttons">
<net.kdt.pojavlaunch.prefs.CustomSeekBarPreference
android:key="buttonscale"

View File

@ -2,7 +2,7 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app2="http://schemas.android.com/apk/res-auto">
<net.kdt.pojavlaunch.prefs.BackButtonPreference/>
<PreferenceCategory android:title="Experimental fuckury">
<PreferenceCategory android:title="@string/preference_category_experimental_settings">
<SwitchPreferenceCompat
android:key="dump_shaders"

View File

@ -4,7 +4,7 @@
<net.kdt.pojavlaunch.prefs.BackButtonPreference/>
<PreferenceCategory android:title="Java Tweaks">
<PreferenceCategory android:title="@string/preference_category_java_tweaks">
<Preference
android:key="install_jre"
android:persistent="false"

View File

@ -10,7 +10,7 @@
<net.kdt.pojavlaunch.prefs.BackButtonPreference/>
<PreferenceCategory
android:title="Categories"
android:title="@string/preference_category_main_categories"
>
<Preference

View File

@ -4,7 +4,7 @@
<net.kdt.pojavlaunch.prefs.BackButtonPreference/>
<PreferenceCategory android:title="Miscellaneous settings">
<PreferenceCategory android:title="@string/preference_category_miscellaneous">
<SwitchPreference
android:defaultValue="true"
android:icon="@drawable/ic_setting_hash_verification"

View File

@ -4,7 +4,7 @@
<net.kdt.pojavlaunch.prefs.BackButtonPreference/>
<PreferenceCategory android:title="Video settings" >
<PreferenceCategory android:title="@string/preference_category_video" >
<androidx.preference.ListPreference
android:title="@string/mcl_setting_category_renderer"
android:key="renderer"