mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-17 08:35:37 -04:00
Fix merging
This commit is contained in:
commit
14a460a22c
@ -68,7 +68,7 @@ public class LoggerView extends ConstraintLayout {
|
|||||||
logListener = text -> {
|
logListener = text -> {
|
||||||
if(log.getVisibility() != VISIBLE) return;
|
if(log.getVisibility() != VISIBLE) return;
|
||||||
post(() -> {
|
post(() -> {
|
||||||
log.append(text);
|
log.append(text + '\n');
|
||||||
scrollView.fullScroll(View.FOCUS_DOWN);
|
scrollView.fullScroll(View.FOCUS_DOWN);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -98,8 +98,10 @@ public class MinecraftGLView extends TextureView {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(msg.what == MSG_DROP_ITEM_BUTTON_CHECK) {
|
if(msg.what == MSG_DROP_ITEM_BUTTON_CHECK) {
|
||||||
sendKeyPress(LWJGLGLFWKeycode.GLFW_KEY_Q);
|
if(CallbackBridge.isGrabbing()){
|
||||||
theHandler.sendEmptyMessageDelayed(MSG_DROP_ITEM_BUTTON_CHECK, 600);
|
sendKeyPress(LWJGLGLFWKeycode.GLFW_KEY_Q);
|
||||||
|
theHandler.sendEmptyMessageDelayed(MSG_DROP_ITEM_BUTTON_CHECK, 600);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -338,11 +340,13 @@ public class MinecraftGLView extends TextureView {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MotionEvent.ACTION_POINTER_DOWN: // 5
|
case MotionEvent.ACTION_POINTER_DOWN: // 5
|
||||||
|
//TODO Hey we could have some sort of middle click detection ?
|
||||||
|
|
||||||
scrollLastInitialX = e.getX();
|
scrollLastInitialX = e.getX();
|
||||||
scrollLastInitialY = e.getY();
|
scrollLastInitialY = e.getY();
|
||||||
//Checking if we are pressing the hotbar to select the item
|
//Checking if we are pressing the hotbar to select the item
|
||||||
hudKeyHandled = handleGuiBar((int)e.getX(e.getPointerCount()-1), (int) e.getY(e.getPointerCount()-1));
|
hudKeyHandled = handleGuiBar((int)e.getX(e.getPointerCount()-1), (int) e.getY(e.getPointerCount()-1));
|
||||||
if(hudKeyHandled == -1){
|
if(hudKeyHandled != -1){
|
||||||
sendKeyPress(hudKeyHandled);
|
sendKeyPress(hudKeyHandled);
|
||||||
if(hasDoubleTapped && hudKeyHandled == lastHotbarKey){
|
if(hasDoubleTapped && hudKeyHandled == lastHotbarKey){
|
||||||
//Prevent double tapping Event on two different slots
|
//Prevent double tapping Event on two different slots
|
||||||
@ -575,7 +579,7 @@ public class MinecraftGLView extends TextureView {
|
|||||||
int barX = (CallbackBridge.physicalWidth / 2) - (barWidth / 2);
|
int barX = (CallbackBridge.physicalWidth / 2) - (barWidth / 2);
|
||||||
if(x < barX || x >= barX + barWidth) return -1;
|
if(x < barX || x >= barX + barWidth) return -1;
|
||||||
|
|
||||||
return hotbarKeys[((x - barX) / barWidth / 9) % 9];
|
return hotbarKeys[(int) net.kdt.pojavlaunch.utils.MathUtils.map(x, barX, barX + barWidth, 0, 9)];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return the size, given the UI scale size */
|
/** Return the size, given the UI scale size */
|
||||||
|
@ -16,20 +16,25 @@ public final class ExtraCore {
|
|||||||
// No unwanted instantiation
|
// No unwanted instantiation
|
||||||
private ExtraCore(){}
|
private ExtraCore(){}
|
||||||
|
|
||||||
|
// Singleton instance
|
||||||
|
private static ExtraCore extraCoreSingleton = null;
|
||||||
|
|
||||||
// Store the key-value pair
|
// Store the key-value pair
|
||||||
private final Map<String, Object> valueMap = new ConcurrentHashMap<>();
|
private final Map<String, Object> valueMap = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
// Store what each ExtraListener listen to
|
// Store what each ExtraListener listen to
|
||||||
private final Map<String, ConcurrentLinkedQueue<WeakReference<ExtraListener>>> listenerMap = new ConcurrentHashMap<>();
|
private final Map<String, ConcurrentLinkedQueue<WeakReference<ExtraListener>>> listenerMap = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
// Inner class for singleton implementation
|
|
||||||
private static class ExtraCoreSingleton {
|
|
||||||
private static final ExtraCore extraCore = new ExtraCore();
|
|
||||||
}
|
|
||||||
|
|
||||||
// All public methods will pass through this one
|
// All public methods will pass through this one
|
||||||
private static ExtraCore getInstance(){
|
private static ExtraCore getInstance(){
|
||||||
return ExtraCoreSingleton.extraCore;
|
if(extraCoreSingleton == null){
|
||||||
|
synchronized(ExtraCore.class){
|
||||||
|
if(extraCoreSingleton == null){
|
||||||
|
extraCoreSingleton = new ExtraCore();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return extraCoreSingleton;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -36,6 +36,7 @@ public class LauncherPreferences
|
|||||||
public static boolean PREF_SUSTAINED_PERFORMANCE = false;
|
public static boolean PREF_SUSTAINED_PERFORMANCE = false;
|
||||||
public static boolean PREF_ENABLE_PROFILES = true;
|
public static boolean PREF_ENABLE_PROFILES = true;
|
||||||
public static String PREF_GLES_SHRINK_HACK = "0";
|
public static String PREF_GLES_SHRINK_HACK = "0";
|
||||||
|
public static boolean PREF_VBO_DISABLE_HACK = false;
|
||||||
|
|
||||||
|
|
||||||
public static void loadPreferences(Context ctx) {
|
public static void loadPreferences(Context ctx) {
|
||||||
@ -66,6 +67,7 @@ public class LauncherPreferences
|
|||||||
PREF_CONTROL_LEFT_OFFSET = DEFAULT_PREF.getInt("controlLeftOffset", 0);
|
PREF_CONTROL_LEFT_OFFSET = DEFAULT_PREF.getInt("controlLeftOffset", 0);
|
||||||
PREF_SUSTAINED_PERFORMANCE = DEFAULT_PREF.getBoolean("sustainedPerformance", false);
|
PREF_SUSTAINED_PERFORMANCE = DEFAULT_PREF.getBoolean("sustainedPerformance", false);
|
||||||
PREF_GLES_SHRINK_HACK = DEFAULT_PREF.getString("gl4es_shrink_hack", "0");
|
PREF_GLES_SHRINK_HACK = DEFAULT_PREF.getString("gl4es_shrink_hack", "0");
|
||||||
|
PREF_VBO_DISABLE_HACK = DEFAULT_PREF.getBoolean("vbo_disable_hack", false);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (PREF_CUSTOM_JAVA_ARGS.isEmpty()) {
|
if (PREF_CUSTOM_JAVA_ARGS.isEmpty()) {
|
||||||
|
@ -5,6 +5,7 @@ import static net.kdt.pojavlaunch.Architecture.archAsString;
|
|||||||
import static net.kdt.pojavlaunch.Architecture.is64BitsDevice;
|
import static net.kdt.pojavlaunch.Architecture.is64BitsDevice;
|
||||||
import static net.kdt.pojavlaunch.Tools.LOCAL_RENDERER;
|
import static net.kdt.pojavlaunch.Tools.LOCAL_RENDERER;
|
||||||
import static net.kdt.pojavlaunch.prefs.LauncherPreferences.PREF_GLES_SHRINK_HACK;
|
import static net.kdt.pojavlaunch.prefs.LauncherPreferences.PREF_GLES_SHRINK_HACK;
|
||||||
|
import static net.kdt.pojavlaunch.prefs.LauncherPreferences.PREF_VBO_DISABLE_HACK;
|
||||||
|
|
||||||
import android.app.*;
|
import android.app.*;
|
||||||
import android.content.*;
|
import android.content.*;
|
||||||
@ -212,13 +213,16 @@ public class JREUtils {
|
|||||||
// The shrink hack can be enabled from the experimental settings
|
// The shrink hack can be enabled from the experimental settings
|
||||||
envMap.put("LIBGL_SHRINK", PREF_GLES_SHRINK_HACK);
|
envMap.put("LIBGL_SHRINK", PREF_GLES_SHRINK_HACK);
|
||||||
|
|
||||||
|
// VBO disable hack
|
||||||
|
if(PREF_VBO_DISABLE_HACK) envMap.put("LIBGL_USEVBO","0");
|
||||||
|
|
||||||
// Fix white color on banner and sheep, since GL4ES 1.1.5
|
// Fix white color on banner and sheep, since GL4ES 1.1.5
|
||||||
envMap.put("LIBGL_NORMALIZE", "1");
|
envMap.put("LIBGL_NORMALIZE", "1");
|
||||||
|
|
||||||
envMap.put("MESA_GLSL_CACHE_DIR", activity.getCacheDir().getAbsolutePath());
|
envMap.put("MESA_GLSL_CACHE_DIR", activity.getCacheDir().getAbsolutePath());
|
||||||
if (LOCAL_RENDERER != null) {
|
if (LOCAL_RENDERER != null) {
|
||||||
envMap.put("MESA_GL_VERSION_OVERRIDE", LOCAL_RENDERER.equals("opengles3_virgl")?"4.5":"4.6");
|
envMap.put("MESA_GL_VERSION_OVERRIDE", LOCAL_RENDERER.equals("opengles3_virgl")?"4.3":"4.6");
|
||||||
envMap.put("MESA_GLSL_VERSION_OVERRIDE", LOCAL_RENDERER.equals("opengles3_virgl")?"450":"460");
|
envMap.put("MESA_GLSL_VERSION_OVERRIDE", LOCAL_RENDERER.equals("opengles3_virgl")?"430":"460");
|
||||||
}
|
}
|
||||||
envMap.put("force_glsl_extensions_warn", "true");
|
envMap.put("force_glsl_extensions_warn", "true");
|
||||||
envMap.put("allow_higher_compat_version", "true");
|
envMap.put("allow_higher_compat_version", "true");
|
||||||
|
@ -2,17 +2,21 @@ package net.kdt.pojavlaunch.utils;
|
|||||||
import static org.lwjgl.glfw.CallbackBridge.windowHeight;
|
import static org.lwjgl.glfw.CallbackBridge.windowHeight;
|
||||||
import static org.lwjgl.glfw.CallbackBridge.windowWidth;
|
import static org.lwjgl.glfw.CallbackBridge.windowWidth;
|
||||||
|
|
||||||
import java.io.*;
|
|
||||||
import java.lang.ref.WeakReference;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.FileObserver;
|
import android.os.FileObserver;
|
||||||
import android.util.*;
|
import android.util.Log;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import net.kdt.pojavlaunch.*;
|
import net.kdt.pojavlaunch.Tools;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileReader;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.lang.ref.WeakReference;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
public class MCOptionUtils
|
public class MCOptionUtils
|
||||||
{
|
{
|
||||||
@ -103,6 +107,8 @@ public class MCOptionUtils
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fileObserver.startWatching();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void notifyListeners(){
|
public static void notifyListeners(){
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -102,7 +102,7 @@
|
|||||||
<string name="mcl_setting_renderer_gles2_4">gl4es 1.1.4 (OpenGL ES 2): exports OpenGL 2.1</string>
|
<string name="mcl_setting_renderer_gles2_4">gl4es 1.1.4 (OpenGL ES 2): exports OpenGL 2.1</string>
|
||||||
<string name="mcl_setting_renderer_gles2_5">gl4es 1.1.5 (OpenGL ES 2): exports OpenGL 2.1</string>
|
<string name="mcl_setting_renderer_gles2_5">gl4es 1.1.5 (OpenGL ES 2): exports OpenGL 2.1</string>
|
||||||
<string name="mcl_setting_renderer_gles3_5">gl4es 1.1.5 (OpenGL ES 3): exports OpenGL 2.1 + partial 3.2</string>
|
<string name="mcl_setting_renderer_gles3_5">gl4es 1.1.5 (OpenGL ES 3): exports OpenGL 2.1 + partial 3.2</string>
|
||||||
<string name="mcl_setting_renderer_virgl">virglrenderer (OpenGL ES 3): exports OpenGL 4.5</string>
|
<string name="mcl_setting_renderer_virgl">virglrenderer (OpenGL ES 3): exports OpenGL 4.3</string>
|
||||||
<string name="mcl_setting_renderer_vgpu">vgpu (OpenGL ES 3): exports OpenGL 3.0</string>
|
<string name="mcl_setting_renderer_vgpu">vgpu (OpenGL ES 3): exports OpenGL 3.0</string>
|
||||||
<string name="mcl_setting_renderer_vulkan_zink">zink (Vulkan): exports OpenGL 4.6</string>
|
<string name="mcl_setting_renderer_vulkan_zink">zink (Vulkan): exports OpenGL 4.6</string>
|
||||||
<string name="mcl_setting_category_veroption">Version type will be in version list</string>
|
<string name="mcl_setting_category_veroption">Version type will be in version list</string>
|
||||||
@ -279,6 +279,7 @@
|
|||||||
<string name="preference_sustained_performance_description">Limit thermal throttling by limiting peak performance</string>
|
<string name="preference_sustained_performance_description">Limit thermal throttling by limiting peak performance</string>
|
||||||
|
|
||||||
<string name="preference_back_title">Back to the last screen</string>
|
<string name="preference_back_title">Back to the last screen</string>
|
||||||
|
<string name="gles_hack_title">GL4ES Shrink hack</string>
|
||||||
<string name="gles_hack_none">Don\'t shrink textures</string>
|
<string name="gles_hack_none">Don\'t shrink textures</string>
|
||||||
<string name="gles_hack_always">Divides all textures by 2</string>
|
<string name="gles_hack_always">Divides all textures by 2</string>
|
||||||
<string name="gles_hack_sometimes">Divides big textures by /2 or /4</string>
|
<string name="gles_hack_sometimes">Divides big textures by /2 or /4</string>
|
||||||
@ -288,4 +289,6 @@
|
|||||||
<string name="profiles_editing">Editing profile</string>
|
<string name="profiles_editing">Editing profile</string>
|
||||||
<string name="profiles_profile_name">Name</string>
|
<string name="profiles_profile_name">Name</string>
|
||||||
<string name="profiles_profile_version">Version</string>
|
<string name="profiles_profile_version">Version</string>
|
||||||
|
<string name="vbo_hack_title">Disable VBOs</string>
|
||||||
|
<string name="vbo_hack_description">Help with compatibility on some old versions</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -5,12 +5,19 @@
|
|||||||
<PreferenceCategory android:title="Experimental fuckury">
|
<PreferenceCategory android:title="Experimental fuckury">
|
||||||
|
|
||||||
<androidx.preference.ListPreference
|
<androidx.preference.ListPreference
|
||||||
android:title="GL4ES Shrink hack"
|
android:title="@string/gles_hack_title"
|
||||||
android:key="gl4es_shrink_hack"
|
android:key="gl4es_shrink_hack"
|
||||||
android:defaultValue="0"
|
android:defaultValue="0"
|
||||||
android:entryValues="@array/hack_gles_shrink_values"
|
android:entryValues="@array/hack_gles_shrink_values"
|
||||||
android:entries="@array/hack_gles_shrink"
|
android:entries="@array/hack_gles_shrink"
|
||||||
app2:useSimpleSummaryProvider="true"/>
|
app2:useSimpleSummaryProvider="true"/>
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
android:title="@string/vbo_hack_title"
|
||||||
|
android:summary="@string/vbo_hack_description"
|
||||||
|
android:defaultValue="false"
|
||||||
|
android:key="vbo_disable_hack"
|
||||||
|
/>
|
||||||
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
Loading…
x
Reference in New Issue
Block a user