Compile fix

This commit is contained in:
Joshua Granick
2018-02-05 22:28:36 -08:00
parent 298c3f5452
commit 5ad0fded29

View File

@@ -24,11 +24,9 @@ abstract RGBA(#if flash Int #else UInt #end) from Int to Int from UInt to UInt {
private static function __init__ ():Void {
__initColors();
}
private static function __initColors() {
#if (js && modular)
__initColors ();
#else
__alpha16 = new UInt32Array (256);
for (i in 0...256) {
@@ -50,9 +48,40 @@ abstract RGBA(#if flash Int #else UInt #end) from Int to Int from UInt to UInt {
__clamp[i] = 0xFF;
}
#end
}
#if (js && modular)
private static function __initColors () {
__alpha16 = new UInt32Array (256);
for (i in 0...256) {
__alpha16[i] = Math.ceil ((i) * ((1 << 16) / 0xFF));
}
__clamp = new UInt8Array (0xFF + 0xFF);
for (i in 0...0xFF) {
__clamp[i] = i;
}
for (i in 0xFF...(0xFF + 0xFF + 1)) {
__clamp[i] = 0xFF;
}
}
#end
public inline function new (rgba:Int = 0) {
this = rgba;