Skip to content

Commit

Permalink
Merge branch 'develop' into 8.2.0-Dev
Browse files Browse the repository at this point in the history
  • Loading branch information
player-03 committed Jan 14, 2024
2 parents 8b07a83 + a488988 commit 6d43728
Show file tree
Hide file tree
Showing 12 changed files with 140 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# These are supported funding model platforms

github: [jgranick]
github: [jgranick, joshtynjala]
patreon: openfl
open_collective: openfl
ko_fi: # Replace with a single Ko-fi username
Expand Down
30 changes: 19 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Rebuild Lime tools
run: |
haxelib dev lime $GITHUB_WORKSPACE
haxelib dev lime ${{ github.workspace }}
haxelib run lime rebuild tools -nocolor -verbose -nocffi
haxelib run lime setup -alias -y -nocffi
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
- name: Rebuild Lime tools
run: |
haxelib dev lime $GITHUB_WORKSPACE
haxelib dev lime ${{ github.workspace }}
haxelib run lime rebuild tools -nocolor -verbose -nocffi
haxelib run lime setup -alias -y -nocffi
Expand Down Expand Up @@ -157,7 +157,7 @@ jobs:
- name: Rebuild Lime tools
run: |
haxelib dev lime $Env:GITHUB_WORKSPACE
haxelib dev lime ${{ github.workspace }}
haxelib run lime rebuild tools -nocolor -verbose -nocffi
haxelib run lime setup -alias -y -nocffi
Expand Down Expand Up @@ -236,7 +236,7 @@ jobs:
- name: Rebuild Lime tools
run: |
haxelib dev lime $GITHUB_WORKSPACE
haxelib dev lime ${{ github.workspace }}
haxelib run lime rebuild tools -nocolor -verbose -nocffi
haxelib run lime setup -alias -y -nocffi
Expand Down Expand Up @@ -294,7 +294,7 @@ jobs:
- name: Rebuild Lime tools
run: |
haxelib dev lime $GITHUB_WORKSPACE
haxelib dev lime ${{ github.workspace }}
haxelib run lime rebuild tools -nocolor -verbose -nocffi
haxelib run lime setup -alias -y -nocffi
Expand All @@ -317,7 +317,7 @@ jobs:

package-haxelib:
needs: [linux-ndll, macos-ndll, windows-ndll, android-ndll, ios-ndll]
runs-on: macos-11
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v3
Expand All @@ -337,17 +337,20 @@ jobs:
haxelib install hxcpp 4.2.1 --quiet
haxelib install format --quiet
haxelib install hxp --quiet
haxelib install svg --quiet
haxelib install openfl --quiet
- name: Enable HXCPP compile cache
run: |
echo "HXCPP_COMPILE_CACHE=~/.hxcpp" >> $GITHUB_ENV
- name: Rebuild Lime tools
run: |
haxelib dev lime $GITHUB_WORKSPACE
haxelib dev lime ${{ github.workspace }}
haxelib run lime rebuild tools -nocolor -verbose -nocffi
haxelib run lime setup -alias -y -nocffi
cp project/lib/hashlink/other/osx/entitlements.xml templates/bin/hl/entitlements.xml
- uses: actions/download-artifact@v3
with:
name: Android-NDLL
Expand Down Expand Up @@ -403,6 +406,11 @@ jobs:
name: Linux64-Hashlink
path: templates/bin/hl/Linux64

- name: Rebuild Lime svg.n
working-directory: tools
run: |
haxe svg.hxml
- uses: actions/upload-artifact@v3
with:
name: lime-haxelib
Expand All @@ -415,7 +423,7 @@ jobs:
if-no-files-found: error

docs:
runs-on: macos-11
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v3
Expand All @@ -431,7 +439,7 @@ jobs:
- name: Install Haxe dependencies
run: |
haxelib install dox --quiet
haxelib dev lime $GITHUB_WORKSPACE
haxelib dev lime ${{ github.workspace }}
- name: Build docs
working-directory: docs
Expand Down Expand Up @@ -511,7 +519,7 @@ jobs:
flash-samples:
needs: package-haxelib
runs-on: macos-11
runs-on: ubuntu-latest
steps:

- uses: krdlab/setup-haxe@v1
Expand Down Expand Up @@ -637,7 +645,7 @@ jobs:
html5-samples:
needs: package-haxelib
runs-on: macos-11
runs-on: ubuntu-latest
steps:

- uses: krdlab/setup-haxe@v1
Expand Down
13 changes: 9 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
Changelog
=========

8.1.0 (??/??/2023)
8.1.1 (11/08/2023)
------------------

* Fixed subset of characters escaped in file paths to fix Android builds on Windows.
* Fixed playback of very long sounds by changing arithmetic to avoid integer overflow.

8.1.0 (10/16/2023)
------------------

* Added `visible` property to `Window` to allow it to be shown and hidden
Expand All @@ -14,9 +20,8 @@ Changelog
* Added `-terser` option to Lime tools for html5 builds to optionally use Terser minifier
* Added `-npx` option to Lime tools to run minifiers, or Electron, using `npx` instead of the bundled versions
* Updated the bundled version of Node.js to 18 LTS for the html5 target's HTTP server
* Modernized Android Gradle build options
* Exposed more information to _project.xml_, including `${project.platformType}` and `${config.android.target-sdk-version}`
* Added click count for mouse events, for use by OpenFL
* Exposed more information to _project.xml_, such as `${project.host}` and `${config.android.target-sdk-version}`
* Updated the Android Gradle plugin
* Disabled pointer tagging on Android
* Fixed issues in `emscripten` target and renamed it to `webassembly`
* Fixed unpopulated `responseData` on `HTTPRequest` when server returns error status code
Expand Down
42 changes: 33 additions & 9 deletions externs/air/sys/FileSystem.hx
Original file line number Diff line number Diff line change
@@ -1,41 +1,65 @@
package sys;

import flash.filesystem.File in FlashFile;
import lime.utils.Log;

@:dce
@:coreApi
class FileSystem
{
public static function exists(path:String):Bool
{
return false;
return new FlashFile(path).exists;
}

public static function rename(path:String, newPath:String):Void {}
public static function rename(path:String, newPath:String):Void
{
new FlashFile(path).moveTo(new FlashFile(newPath));
}

public static function stat(path:String):sys.FileStat
{
Log.warn("stat is not implemented");
return null;
}

public static function fullPath(relPath:String):String
{
return null;
var flashFile = new FlashFile(relPath);
flashFile.canonicalize();
return flashFile.nativePath;
}

public static function absolutePath(relPath:String):String
{
return null;
return new FlashFile(relPath).nativePath;
}

public static function isDirectory(path:String):Bool
{
return false;
return new FlashFile(path).isDirectory;
}

public static function createDirectory(path:String):Void {}
public static function createDirectory(path:String):Void
{
new FlashFile(path).createDirectory();
}

public static function deleteFile(path:String):Void {}
public static function deleteFile(path:String):Void
{
new FlashFile(path).deleteFile();
}

public static function deleteDirectory(path:String):Void {}
public static function deleteDirectory(path:String):Void
{
new FlashFile(path).deleteDirectory(false);
}

public static function readDirectory(path:String):Array<String> {}
public static function readDirectory(path:String):Array<String>
{
return new FlashFile(path).getDirectoryListing().map(function(f:FlashFile):String
{
return f.name;
});
}
}
39 changes: 35 additions & 4 deletions externs/air/sys/io/File.hx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package sys.io;

import flash.utils.ByteArray;
import flash.filesystem.File in FlashFile;
import flash.filesystem.FileMode;
import flash.filesystem.FileStream;
import lime.utils.Log;
import haxe.io.Bytes;

@:dce
@:coreApi
Expand All @@ -18,34 +21,62 @@ class File
return content;
}

public static function saveContent(path:String, content:String):Void {}
public static function saveContent(path:String, content:String):Void
{
var file = new FlashFile(path);
var stream = new FileStream();
stream.open(file, FileMode.WRITE);
stream.writeUTFBytes(content);
stream.close();
}

public static function getBytes(path:String):haxe.io.Bytes
{
return null;
var file = new FlashFile(path);
var stream = new FileStream();
stream.open(file, FileMode.READ);
var byteArray = new ByteArray();
stream.readBytes(byteArray, 0, stream.bytesAvailable);
stream.close();
return Bytes.ofData(byteArray);
}

public static function saveBytes(path:String, bytes:haxe.io.Bytes):Void {}
public static function saveBytes(path:String, bytes:haxe.io.Bytes):Void
{
var byteArray:ByteArray = bytes.getData();
var file = new FlashFile(path);
var stream = new FileStream();
stream.open(file, FileMode.WRITE);
stream.writeBytes(byteArray);
stream.close();
}

public static function read(path:String, binary:Bool = true):FileInput
{
Log.warn("read is not implemented");
return null;
}

public static function write(path:String, binary:Bool = true):FileOutput
{
Log.warn("write is not implemented");
return null;
}

public static function append(path:String, binary:Bool = true):FileOutput
{
Log.warn("append is not implemented");
return null;
}

public static function update(path:String, binary:Bool = true):FileOutput
{
Log.warn("update is not implemented");
return null;
}

public static function copy(srcPath:String, dstPath:String):Void {}
public static function copy(srcPath:String, dstPath:String):Void
{
new FlashFile(srcPath).copyTo(new FlashFile(dstPath));
}
}
2 changes: 1 addition & 1 deletion src/lime/_internal/backend/native/NativeAudioSource.hx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class NativeAudioSource
}
}

samples = Std.int((dataLength * 8) / (parent.buffer.channels * parent.buffer.bitsPerSample));
samples = Std.int((dataLength * 8.0) / (parent.buffer.channels * parent.buffer.bitsPerSample));
}

public function play():Void
Expand Down
7 changes: 7 additions & 0 deletions src/lime/media/WebAudioContext.hx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ class WebAudioContext

public function new() {}

#if (haxe_ver >= 4.2)
public function resume():Dynamic /*Promise<Void>*/
{
return null;
}
#end

public function createAnalyser():Dynamic /*AnalyserNode*/
{
return null;
Expand Down
2 changes: 1 addition & 1 deletion src/lime/tools/ProjectHelper.hx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class ProjectHelper
var object:Dynamic = project;
while (object != null && fields.length > 0)
{
object = Reflect.field(object, fields.shift());
object = Reflect.getProperty(object, fields.shift());
}

if (object != null && object != project)
Expand Down
15 changes: 13 additions & 2 deletions src/lime/ui/Joystick.hx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,19 @@ class Joystick
#if (js && html5)
@:noCompletion private static function __getDeviceData():Array<Dynamic>
{
return
(untyped navigator.getGamepads) ? untyped navigator.getGamepads() : (untyped navigator.webkitGetGamepads) ? untyped navigator.webkitGetGamepads() : null;
var res:Dynamic = null;

try
{
res = (untyped navigator.getGamepads) ? untyped navigator.getGamepads() : (untyped navigator.webkitGetGamepads) ? untyped navigator.webkitGetGamepads() : null;
}
catch (err:Dynamic)
{
// if something went wrong, treat it the same as when navigator.getGamepads doesn't exist
// we probably don't have permission to use this feature
}

return res;
}
#end

Expand Down
1 change: 0 additions & 1 deletion src/lime/utils/Float32Array.hx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ import lime.utils.ArrayBufferView;
abstract Float32Array(ArrayBufferView) from ArrayBufferView to ArrayBufferView
{
public inline static var BYTES_PER_ELEMENT:Int = 4;
public static var hello:Int;

public var length(get, never):Int;

Expand Down
5 changes: 2 additions & 3 deletions tools/platforms/AndroidPlatform.hx
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,8 @@ class AndroidPlatform extends PlatformTarget
context.ANDROID_BUILD_TOOLS_VERSION = AndroidHelper.getBuildToolsVersion(project);
}

var escaped = ~/([ #!=\\:])/g;
context.ANDROID_SDK_ESCAPED = escaped.replace(context.ENV_ANDROID_SDK, "\\$1");
context.ANDROID_NDK_ROOT_ESCAPED = escaped.replace(context.ENV_ANDROID_NDK_ROOT, "\\$1");
context.ANDROID_SDK_ESCAPED = StringTools.replace(context.ENV_ANDROID_SDK, "\\", "\\\\");
context.ANDROID_NDK_ROOT_ESCAPED = StringTools.replace(context.ENV_ANDROID_NDK_ROOT, "\\", "\\\\");

if (Reflect.hasField(context, "KEY_STORE")) context.KEY_STORE = StringTools.replace(context.KEY_STORE, "\\", "\\\\");
if (Reflect.hasField(context, "KEY_STORE_ALIAS")) context.KEY_STORE_ALIAS = StringTools.replace(context.KEY_STORE_ALIAS, "\\", "\\\\");
Expand Down
Loading

0 comments on commit 6d43728

Please sign in to comment.