@JTranscSync public JTranscCharset(String[] names, int min, float avg, int max) { this.names = names; this.min = min; this.avg= avg; this.max = max; }
@JTranscSync static public void mixUnsigned(int count, byte[] target, int targetpos, byte[] a, int apos, byte[] b, int bpos, double ratio) { double ratiob = 1.0 - ratio; for (int n = 0; n < count; n++) target[targetpos + n] = (byte) ((a[apos + n] & 0xFF) * ratio + (b[bpos + n] & 0xFF) * ratiob); }
@JTranscSync public JTranscCharBuffer() { size = DEFAULT_SIZE; buffer = new char[size]; }
@JTranscSync public JTranscCharBuffer(int size) { this.size = size < DEFAULT_SIZE ? DEFAULT_SIZE : size; buffer = new char[this.size]; }
@JTranscSync public static void writeCharBE(byte[] out, int offset, char value) { out[offset + 0] = (byte) ((value >>> 8) & 0xFF); out[offset + 1] = (byte) ((value >>> 0) & 0xFF); }
@JTranscSync public static void writeShortBE(byte[] out, int offset, short value) { out[offset + 0] = (byte) ((value >>> 8) & 0xFF); out[offset + 1] = (byte) ((value >>> 0) & 0xFF); }
@JTranscSync public static void writeIntBE(byte[] out, int offset, int value) { out[offset + 0] = (byte) ((value >>> 24) & 0xFF); out[offset + 1] = (byte) ((value >>> 16) & 0xFF); out[offset + 2] = (byte) ((value >>> 8) & 0xFF); out[offset + 3] = (byte) ((value >>> 0) & 0xFF); }
@JTranscInline @JTranscSync public static byte int3(int x) { return (byte) (x >> 24); }
@JTranscInline @JTranscSync public static byte int0(int x) { return (byte) (x >> 0); }
@HaxeMethodBody("return N.box(Reflect.getProperty(this._wrapped, p0._str));") @JTranscMethodBody(target = "js", value = "return N.box({{ JC_COMMA }}this._wrapped[N.istr(p0)]);") @JTranscSync public Object get(String field) { try { Field f = item.getClass().getField(field); f.setAccessible(true); return f.get(this.item); } catch (Throwable e) { return null; } }
@JTranscSync public static void writeDouble(byte[] out, int offset, double value, boolean isLittleEndian) { if (isLittleEndian) { writeLongLE(out, offset, Double.doubleToRawLongBits(value)); } else { writeLongBE(out, offset, Double.doubleToRawLongBits(value)); } }
@HaxeMethodBody("return null;") @JTranscMethodBody(target = "js", value = "return null;") @JTranscSync public ByteBuffer getByteBufferOrNull() { return data; }
@JTranscInline @JTranscSync static public int sxi8(int value) { return JTranscBits.sxi8(value); }
@JTranscInline @HaxeMethodBody("this._data.setUInt16(p0, p1);") @JTranscMethodBody(target = "js", value = "this.view.setInt16(p0, p1, true);") @JTranscSync final public void setInt16(int index, int value) { data.putShort(index, (short) value); }
@JTranscInline @HaxeMethodBody("return this._data.getInt64(p0 << 3);") // @TODO: Optimize @JTranscMethodBody(target = "js", value = "return Int64.make(this.s32[p0 << 1 + 0], this.s32[p0 << 1 +1]);") @JTranscSync final public long getAlignedInt64(int index8) { return dataLong.get(index8); }
@JTranscInline @HaxeMethodBody("return this.floatData.get(p0);") @JTranscMethodBody(target = "js", value = "return this.f32[p0];") @JTranscSync final public float getAlignedFloat32(int index4) { return dataFloat.get(index4); }
@JTranscInline @HaxeMethodBody("this._data.setInt64(p0 << 3, p1);") // @TODO: Optimize @JTranscMethodBody(target = "js", value = "this.s32[p0 << 1 + 0] = p1.low; this.s32[p0 << 1 + 1] = p1.high;") @JTranscSync final public void setAlignedInt64(int index8, long value) { dataLong.put(index8, value); }
@JTranscInline @HaxeMethodBodyList({ @HaxeMethodBody(target = "flash", value = "return flash.Memory.getI32(p0 << 2);"), @HaxeMethodBody("return intMem.get(p0);"), }) @JTranscSync static public int li32(int address4) { return mem.getAlignedInt32(address4); }
@JTranscInline @HaxeMethodBodyList({ @HaxeMethodBody(target = "flash", value = "return flash.Memory.getFloat(p0 << 2);"), @HaxeMethodBody("return floatMem.get(p0);"), }) @JTranscSync static public float lf32(int address4) { return mem.getAlignedFloat32(address4); }
@JTranscSync public void setToMultiply(MutableFloat32x4 vector, MutableMatrixFloat32x4x4 matrix) { this.setTo( MutableFloat32x4Utils.getAddMul(vector, matrix.getX()), MutableFloat32x4Utils.getAddMul(vector, matrix.getY()), MutableFloat32x4Utils.getAddMul(vector, matrix.getZ()), MutableFloat32x4Utils.getAddMul(vector, matrix.getW()) ); }