Run Haxe formatter

This commit is contained in:
Joshua Granick
2022-03-23 14:02:39 -07:00
parent 362be074f4
commit 1c92c707cc
37 changed files with 733 additions and 617 deletions

View File

@@ -739,7 +739,7 @@ class NativeApplication
@:keep /*private*/ class KeyEventInfo
{
public var keyCode: #if neko Float #else Int #end;
public var keyCode:#if neko Float #else Int #end;
public var modifier:Int;
public var type:KeyEventType;
public var windowID:Int;

View File

@@ -298,7 +298,8 @@ class NativeAudioSource
// of data, which typically happens if an operation (such as
// resizing a window) freezes the main thread.
// If AL is supposed to be playing but isn't, restart it here.
if (playing && handle != null && AL.getSourcei(handle, AL.SOURCE_STATE) == AL.STOPPED){
if (playing && handle != null && AL.getSourcei(handle, AL.SOURCE_STATE) == AL.STOPPED)
{
AL.sourcePlay(handle);
}
}
@@ -323,7 +324,7 @@ class NativeAudioSource
{
timer.stop();
}
setCurrentTime(0);
}

View File

@@ -241,8 +241,10 @@ class NativeHTTPRequest
// an empty string means store cookies in memory
// cookies are stored only for the current session
curl.setOption(COOKIEFILE, "");
if (cookieList != null) {
for(cookie in cookieList) {
if (cookieList != null)
{
for (cookie in cookieList)
{
// pass in each stored cookie individually
curl.setOption(COOKIELIST, cookie);
}

View File

@@ -1347,8 +1347,8 @@ class ImageDataUtil
var srcPosition,
destPosition,
srcPixel:RGBA = 0,
destPixel:RGBA = 0,
srcPixel:RGBA = 0,
destPixel:RGBA = 0,
pixelMask:UInt,
test:Bool,
value:Int;
@@ -1414,7 +1414,7 @@ class ImageDataUtil
{
var format = image.buffer.format;
var length = Std.int(data.length / 4);
var pixel:RGBA = 0;
var pixel:RGBA = 0;
for (i in 0...length)
{

View File

@@ -33,8 +33,9 @@ public static function fromSource(gl:WebGLRenderContext, source:String, type:Int
{
var message;
if (compileStatus == 0) message = "Error ";
else message = "Info ";
if (compileStatus == 0) message = "Error ";
else
message = "Info ";
if (type == gl.VERTEX_SHADER) message = "compiling vertex shader";
else if (type == gl.FRAGMENT_SHADER) message = "compiling fragment shader";
@@ -43,10 +44,8 @@ public static function fromSource(gl:WebGLRenderContext, source:String, type:Int
message += "\n" + shaderInfoLog;
if(compileStatus == 0)
Log.error(message);
else if(shaderInfoLog != null)
Log.debug(message);
if (compileStatus == 0) Log.error(message);
else if (shaderInfoLog != null) Log.debug(message);
}
return shader;

View File

@@ -1,6 +1,5 @@
package lime.net;
/**
Class used for parsing URIs and URLs.
Based on http://blog.stevenlevithan.com/archives/parseuri
@@ -126,7 +125,7 @@ class URIParser
var uri = new URIParser("https://example.com/index.php?action=upload&token=12345#header");
for( q in uri.queryArray )
trace( q.k + " = " + q.v); // action = upload
// token = 12345
// token = 12345
```
**/
public var queryArray:Array<KVPair>;

View File

@@ -13,13 +13,14 @@ typedef ApplicationData =
@:dox(hide) class _ApplicationDataType
{
public static var fields:ApplicationData = {
file: "",
init: "",
main: "",
path: "",
preloader: "",
swfVersion: 0.0,
url: ""
}
}
public static var fields:ApplicationData =
{
file: "",
init: "",
main: "",
path: "",
preloader: "",
swfVersion: 0.0,
url: ""
}
}

View File

@@ -297,8 +297,8 @@ class AssetHelper
{
if (output.tell() == 0)
{
//write some dummy text at the start of the packed asset file just to prevent
//the file from beginning with a packed file header.
// write some dummy text at the start of the packed asset file just to prevent
// the file from beginning with a packed file header.
output.writeString("lime-asset-pack");
}

View File

@@ -221,7 +221,16 @@ class CSHelper
noCompile:Bool = false)
{
var args = [
"run", project.config.getString("cs.buildLibrary", "hxcs"), buildFile, "--arch", arch, "--platform", platform, "--out", outPath, "--unsafe"
"run",
project.config.getString("cs.buildLibrary", "hxcs"),
buildFile,
"--arch",
arch,
"--platform",
platform,
"--out",
outPath,
"--unsafe"
];
if (noCompile) args.push("--no-compile");
var code = Haxelib.runCommand(path, args);

View File

@@ -382,8 +382,19 @@ class HXProject extends Script
#if lime
var args = [
name, "-main", "lime.tools.HXProject", "-cp", tempDirectory, "-neko", nekoOutput, "-cp", Path.combine(Haxelib.getPath(new Haxelib("hxp")), "src"),
"-lib", "lime", "-lib", "hxp"
name,
"-main",
"lime.tools.HXProject",
"-cp",
tempDirectory,
"-neko",
nekoOutput,
"-cp",
Path.combine(Haxelib.getPath(new Haxelib("hxp")), "src"),
"-lib",
"lime",
"-lib",
"hxp"
];
#else
var args = [

View File

@@ -12,8 +12,8 @@ class Library
public var sourcePath:String;
public var type:String;
public function new(sourcePath:String, name:String = "", type:String = null, embed:Null<Bool> = null, preload:Null<Bool> = null, generate:Null<Bool> = null,
prefix:String = "")
public function new(sourcePath:String, name:String = "", type:String = null, embed:Null<Bool> = null, preload:Null<Bool> = null,
generate:Null<Bool> = null, prefix:String = "")
{
this.sourcePath = sourcePath;

View File

@@ -14,14 +14,15 @@ typedef MetaData =
@:dox(hide) class _MetaDataType
{
public static var fields:MetaData = {
buildNumber: "",
company: "",
companyId: "",
companyUrl: "",
description: "",
packageName: "",
title: "",
version: ""
}
}
public static var fields:MetaData =
{
buildNumber: "",
company: "",
companyId: "",
companyUrl: "",
description: "",
packageName: "",
title: "",
version: ""
}
}

View File

@@ -35,35 +35,36 @@ typedef WindowData =
@:dox(hide) class _WindowDataType
{
public static var fields:WindowData = {
width: 0,
height: 0,
x: 0.0,
y: 0.0,
background: 0,
parameters: "",
fps: 0,
hardware: false,
display: 0,
resizable: false,
borderless: false,
vsync: false,
fullscreen: false,
allowHighDPI: false,
alwaysOnTop: false,
antialiasing: 0,
orientation: Orientation.AUTO,
allowShaders: false,
requireShaders: false,
depthBuffer: false,
stencilBuffer: false,
title: "",
#if (js && html5)
element: null,
#end
colorDepth: 0,
minimized: false,
maximized: false,
hidden: false
}
}
public static var fields:WindowData =
{
width: 0,
height: 0,
x: 0.0,
y: 0.0,
background: 0,
parameters: "",
fps: 0,
hardware: false,
display: 0,
resizable: false,
borderless: false,
vsync: false,
fullscreen: false,
allowHighDPI: false,
alwaysOnTop: false,
antialiasing: 0,
orientation: Orientation.AUTO,
allowShaders: false,
requireShaders: false,
depthBuffer: false,
stencilBuffer: false,
title: "",
#if (js && html5)
element: null,
#end
colorDepth: 0,
minimized: false,
maximized: false,
hidden: false
}
}

View File

@@ -41,7 +41,6 @@ import js.html.Blob;
Availability note: most file dialog operations are only available on desktop targets, though
`save()` is also available in HTML5.
**/
#if !lime_debug
@:fileXml('tags="haxe,release"')
@:noDebug
@@ -50,7 +49,6 @@ import js.html.Blob;
@:access(lime.graphics.Image)
class FileDialog
{
/**
Triggers when the user clicks "Cancel" during any operation, or when a function is unsupported
(such as `open()` on HTML5).
@@ -80,7 +78,6 @@ class FileDialog
**/
public var onSelectMultiple = new Event<Array<String>->Void>();
public function new() {}
/**

View File

@@ -97,7 +97,9 @@ abstract Float32Array(ArrayBufferView) from ArrayBufferView to ArrayBufferView
public var length(get, never):Int;
#if (haxe_ver < 4.2) @:generic #end
#if (haxe_ver < 4.2)
@:generic
#end
public inline function new<T>(?elements:Int, ?buffer:ArrayBuffer, ?array:Array<T>, #if openfl ?vector:openfl.Vector<Float>, #end ?view:ArrayBufferView,
?byteoffset:Int = 0, ?len:Null<Int>)
{

View File

@@ -94,7 +94,9 @@ abstract Float64Array(ArrayBufferView) from ArrayBufferView to ArrayBufferView
public var length(get, never):Int;
#if (haxe_ver < 4.2) @:generic #end
#if (haxe_ver < 4.2)
@:generic
#end
public inline function new<T>(?elements:Int, ?buffer:ArrayBuffer, ?array:Array<T>, #if openfl ?vector:openfl.Vector<Float>, #end ?view:ArrayBufferView,
?byteoffset:Int = 0, ?len:Null<Int>)
{

View File

@@ -94,7 +94,9 @@ abstract Int16Array(ArrayBufferView) from ArrayBufferView to ArrayBufferView
public var length(get, never):Int;
#if (haxe_ver < 4.2) @:generic #end
#if (haxe_ver < 4.2)
@:generic
#end
public inline function new<T>(?elements:Int, ?buffer:ArrayBuffer, ?array:Array<T>, #if openfl ?vector:openfl.Vector<Int>, #end ?view:ArrayBufferView,
?byteoffset:Int = 0, ?len:Null<Int>)
{

View File

@@ -85,6 +85,7 @@ abstract Int32Array(JSInt32Array) from JSInt32Array to JSInt32Array
}
#else
import lime.utils.ArrayBufferView;
@:transitive
@:forward
abstract Int32Array(ArrayBufferView) from ArrayBufferView to ArrayBufferView
@@ -93,7 +94,9 @@ abstract Int32Array(ArrayBufferView) from ArrayBufferView to ArrayBufferView
public var length(get, never):Int;
#if (haxe_ver < 4.2) @:generic #end
#if (haxe_ver < 4.2)
@:generic
#end
public inline function new<T>(?elements:Int, ?buffer:ArrayBuffer, ?array:Array<T>, #if openfl ?vector:openfl.Vector<Int>, #end ?view:ArrayBufferView,
?byteoffset:Int = 0, ?len:Null<Int>)
{

View File

@@ -92,7 +92,9 @@ abstract Int8Array(ArrayBufferView) from ArrayBufferView to ArrayBufferView
public var length(get, never):Int;
#if (haxe_ver < 4.2) @:generic #end
#if (haxe_ver < 4.2)
@:generic
#end
public inline function new<T>(?elements:Int, ?buffer:ArrayBuffer, ?array:Array<T>, #if openfl ?vector:openfl.Vector<Int>, #end ?view:ArrayBufferView,
?byteoffset:Int = 0, ?len:Null<Int>)
{

View File

@@ -309,8 +309,8 @@ class Preloader #if flash extends Sprite #end
}
#end
if (!simulateProgress #if flash && loadedStage #end
#if !disable_preloader_assets && loadedLibraries == (libraries.length + libraryNames.length) #end)
if (!simulateProgress #if flash && loadedStage #end#if !disable_preloader_assets
&& loadedLibraries == (libraries.length + libraryNames.length) #end)
{
if (!preloadComplete)
{

View File

@@ -85,6 +85,7 @@ abstract UInt16Array(JSUInt16Array) from JSUInt16Array to JSUInt16Array
}
#else
import lime.utils.ArrayBufferView;
@:transitive
@:forward
abstract UInt16Array(ArrayBufferView) from ArrayBufferView to ArrayBufferView
@@ -93,7 +94,9 @@ abstract UInt16Array(ArrayBufferView) from ArrayBufferView to ArrayBufferView
public var length(get, never):Int;
#if (haxe_ver < 4.2) @:generic #end
#if (haxe_ver < 4.2)
@:generic
#end
public inline function new<T>(?elements:Int, ?buffer:ArrayBuffer, ?array:Array<T>, #if openfl ?vector:openfl.Vector<Int>, #end ?view:ArrayBufferView,
?byteoffset:Int = 0, ?len:Null<Int>)
{

View File

@@ -85,6 +85,7 @@ abstract UInt32Array(JSUInt32Array) from JSUInt32Array to JSUInt32Array
}
#else
import lime.utils.ArrayBufferView;
@:transitive
@:forward
abstract UInt32Array(ArrayBufferView) from ArrayBufferView to ArrayBufferView
@@ -93,7 +94,9 @@ abstract UInt32Array(ArrayBufferView) from ArrayBufferView to ArrayBufferView
public var length(get, never):Int;
#if (haxe_ver < 4.2) @:generic #end
#if (haxe_ver < 4.2)
@:generic
#end
public inline function new<T>(?elements:Int, ?buffer:ArrayBuffer, ?array:Array<T>, #if openfl ?vector:openfl.Vector<Int>, #end ?view:ArrayBufferView,
?byteoffset:Int = 0, ?len:Null<Int>)
{

View File

@@ -83,6 +83,7 @@ abstract UInt8Array(JSUInt8Array) from JSUInt8Array to JSUInt8Array
}
#else
import lime.utils.ArrayBufferView;
@:transitive
@:forward
abstract UInt8Array(ArrayBufferView) from ArrayBufferView to ArrayBufferView
@@ -91,7 +92,9 @@ abstract UInt8Array(ArrayBufferView) from ArrayBufferView to ArrayBufferView
public var length(get, never):Int;
#if (haxe_ver < 4.2) @:generic #end
#if (haxe_ver < 4.2)
@:generic
#end
public inline function new<T>(?elements:Int, ?buffer:ArrayBuffer, ?array:Array<T>, #if openfl ?vector:openfl.Vector<Int>, #end ?view:ArrayBufferView,
?byteoffset:Int = 0, ?len:Null<Int>)
{

View File

@@ -94,6 +94,7 @@ abstract UInt8ClampedArray(JSUInt8ClampedArray) from JSUInt8ClampedArray to JSUI
}
#else
import lime.utils.ArrayBufferView;
@:transitive
@:forward
@:arrayAccess
@@ -103,7 +104,9 @@ abstract UInt8ClampedArray(ArrayBufferView) from ArrayBufferView to ArrayBufferV
public var length(get, never):Int;
#if (haxe_ver < 4.2) @:generic #end
#if (haxe_ver < 4.2)
@:generic
#end
public inline function new<T>(?elements:Int, ?buffer:ArrayBuffer, ?array:Array<T>, #if openfl ?vector:openfl.Vector<Int>, #end ?view:ArrayBufferView,
?byteoffset:Int = 0, ?len:Null<Int>)
{