diff --git a/Project.xml b/Project.xml index b7c5c331442..6b5fbcc5cb1 100644 --- a/Project.xml +++ b/Project.xml @@ -104,7 +104,10 @@
- + + + +
diff --git a/art/ffmpeg-android/arm64/ffmpeg b/art/ffmpeg-android/arm64/ffmpeg deleted file mode 100644 index 4ea0dd818a1..00000000000 Binary files a/art/ffmpeg-android/arm64/ffmpeg and /dev/null differ diff --git a/art/ffmpeg-android/ffmpeg-arm64 b/art/ffmpeg-android/ffmpeg-arm64 new file mode 100644 index 00000000000..c38ca76995d Binary files /dev/null and b/art/ffmpeg-android/ffmpeg-arm64 differ diff --git a/art/ffmpeg-android/ffmpeg-armv7a b/art/ffmpeg-android/ffmpeg-armv7a new file mode 100644 index 00000000000..9e09d9577a9 Binary files /dev/null and b/art/ffmpeg-android/ffmpeg-armv7a differ diff --git a/art/ffmpeg-android/ffmpeg-x86 b/art/ffmpeg-android/ffmpeg-x86 new file mode 100644 index 00000000000..7cfd57c672e Binary files /dev/null and b/art/ffmpeg-android/ffmpeg-x86 differ diff --git a/art/ffmpeg-android/ffmpeg-x86_64 b/art/ffmpeg-android/ffmpeg-x86_64 new file mode 100644 index 00000000000..45a89cce016 Binary files /dev/null and b/art/ffmpeg-android/ffmpeg-x86_64 differ diff --git a/source/PlayState.hx b/source/PlayState.hx index 203f1a24a57..39c11725d83 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -6764,9 +6764,6 @@ class PlayState extends MusicBeatState ffmpegExists = true; - #if android - lime.system.JNI.createStaticMethod('org/libsdl/app/SDLActivity', 'nativeSetenv', '(Ljava/lang/String;Ljava/lang/String;)V')("LD_LIBRARY_PATH", android.content.Context.getFilesDir()); - #end process = new Process(#if android '${android.content.Context.getFilesDir()}/ffmpeg' #else 'ffmpeg' #end, [ '-v', 'quiet', @@ -6806,10 +6803,6 @@ class PlayState extends MusicBeatState if (!ClientPrefs.ffmpegMode) return; - #if android - lime.system.JNI.createStaticMethod('org/libsdl/app/SDLActivity', 'nativeSetenv', '(Ljava/lang/String;Ljava/lang/String;)V')("LD_LIBRARY_PATH", ''); - #end - if (process != null){ if (process.stdin != null) process.stdin.close(); diff --git a/source/mobile/CopyState.hx b/source/mobile/CopyState.hx index 9308a8f72b9..03b08144646 100644 --- a/source/mobile/CopyState.hx +++ b/source/mobile/CopyState.hx @@ -40,6 +40,9 @@ import sys.FileSystem; using StringTools; +#if (android && cpp) +@:headerInclude('sys/utsname.h') +#end class CopyState extends MusicBeatState { public static var locatedFiles:Array = []; @@ -56,6 +59,9 @@ class CopyState extends MusicBeatState var failedFilesStack:Array = []; var canUpdate:Bool = true; var shouldCopy:Bool = false; + #if android + var archPrefix:String = ""; + #end private static final textFilesExtensions:Array = ['ini', 'txt', 'xml', 'hxs', 'hx', 'lua', 'json', 'frag', 'vert']; @@ -73,9 +79,21 @@ class CopyState extends MusicBeatState CoolUtil.showPopUp("Seems like you have some missing files that are necessary to run the game\nPress OK to begin the copy process", "Notice!"); #if android + switch (getArch().toLowerCase()) + { + case "armv7" | "armv7l" | "armv8l": + archPrefix = "armv7a"; + case "arm64" | "aarch64" | "armv8" | : + archPrefix = "aarch64"; + case "x86" | "i386" | "i686": + archPrefix = "x86"; + case "x86_64" | "amd64": + archPrefix = "x86_64"; + } + if (!FileSystem.exists(android.content.Context.getFilesDir() + '/ffmpeg')) { - File.saveBytes(android.content.Context.getFilesDir() + '/ffmpeg', getFileBytes(getFile('ffmpeg'))); + File.saveBytes(android.content.Context.getFilesDir() + '/ffmpeg-$archPrefix', getFileBytes(getFile('ffmpeg'))); Sys.command('chmod', ['777', android.content.Context.getFilesDir() + '/ffmpeg']); } #end @@ -238,5 +256,16 @@ class CopyState extends MusicBeatState return (maxLoopTimes < 0); } + + #if (android && cpp) + @:functionCode(' + struct utsname osInfo{}; + uname(&osInfo); + return ::String(osInfo.machine); + ') + @:noCompletion + private function getArch():String + return null; + #end } #end diff --git a/source/options/GameRendererSettingsSubState.hx b/source/options/GameRendererSettingsSubState.hx index 7ad5913beec..ed43c24cb11 100644 --- a/source/options/GameRendererSettingsSubState.hx +++ b/source/options/GameRendererSettingsSubState.hx @@ -92,7 +92,7 @@ class GameRendererSettingsSubState extends BaseOptionsMenu 'vidEncoder', 'string', 'libx264', - ['libx264', 'libx264rgb', 'libx265', 'libxvid', 'libsvtav1', 'mpeg2video']); + ['libx264', 'libx264rgb' #if !android , 'libx265', 'libxvid', 'libsvtav1' #end, 'mpeg2video']); addOption(option); var option:Option = new Option('Classic Rendering Mode', //Name diff --git a/source/options/OptionsState.hx b/source/options/OptionsState.hx index cc4bc59cb7d..cfbbab15759 100644 --- a/source/options/OptionsState.hx +++ b/source/options/OptionsState.hx @@ -33,7 +33,7 @@ class OptionsState extends MusicBeatState var konamiIndex:Int = 0; // Track the progress in the Konami code sequence var konamiCode = []; var isEnteringKonamiCode:Bool = false; - var options:Array = ['Note Colors', 'Controls', 'Adjust Delay and Combo', 'Graphics', 'Optimization', 'Game Rendering', 'Visuals and UI', 'Gameplay', 'Misc', 'Mobile Options']; + var options:Array = ['Note Colors', 'Controls', 'Adjust Delay and Combo', 'Graphics', 'Optimization' #if (desktop && android), 'Game Rendering' #end, 'Visuals and UI', 'Gameplay', 'Misc', 'Mobile Options']; private var grpOptions:FlxTypedGroup; private static var curSelected:Int = 0; public static var menuBG:FlxSprite;