avm2.intrinsics.memory
. Also where I could find how it's implemented? I can see this https://github.com/openfl/openfl/blob/develop/openfl/_legacy/Memory.hx but it looks quite cryptic to me.
Anyway, just for your reference:
/// <summary>
/// Concatenates the ColorTranform object specified by the second parameter with the current ColorTransform object and sets the current object as the result, which is an additive combination of the two color transformations. When you apply the concatenated ColorTransform object, the effect is the same as applying the second color transformation after the original color transformation.
/// </summary>
/// <param name="t">The ColorTransform to concat.</param>
public void Concat(ColorTransform t)
{
mRedOffset = t.RedOffset * mRedMultiplier + mRedOffset;
mGreenOffset = t.GreenOffset * mGreenMultiplier + mGreenOffset;
mBlueOffset = t.BlueOffset * mBlueMultiplier + mBlueOffset;
mAlphaOffset = t.AlphaOffset * mAlphaMultiplier + mAlphaOffset;
mRedMultiplier *= t.RedMultiplier;
mGreenMultiplier *= t.GreenMultiplier;
mBlueMultiplier *= t.BlueMultiplier;
mAlphaMultiplier *= t.mAlphaMultiplier;
}
Fixes my own inconsistencies (tested against FlashPlayer 28)
As opposed to:
public function concat (second:ColorTransform):Void {
redMultiplier *= second.redMultiplier;
greenMultiplier *= second.greenMultiplier;
blueMultiplier *= second.blueMultiplier;
alphaMultiplier *= second.alphaMultiplier;
redOffset = second.redMultiplier * redOffset + second.redOffset;
greenOffset = second.greenMultiplier * greenOffset + second.greenOffset;
blueOffset = second.blueMultiplier * blueOffset + second.blueOffset;
alphaOffset = second.alphaMultiplier * alphaOffset + second.alphaOffset;
}
In OpenFL. Hope that helps.
I’m trying to figure out how I can make the background of an X11 window transparent. I know the AIR target will do it but I don’t want to build for AIR. I’ve downloaded the lime repo and trying to hack around with it a bit to see if I can add support for this. Do any of you have any thoughts on how I could do this?
I’d like to be able to add something like <window transparent=“true”/> or if we do <window background=“null” /> in the project.xml file it would basically set the os window to be transparent.
@jgranick - Very strange result from Flash:
var s: Sprite = new Sprite();
var t: Transform = new Transform(s);
trace(t.colorTransform);
trace(t.concatenatedColorTransform);
trace(t.concatenatedMatrix);
trace(t.matrix);
//(redMultiplier=1, greenMultiplier=1, blueMultiplier=1, alphaMultiplier=1, redOffset=0, greenOffset=0, blueOffset=0, alphaOffset=0)
//(redMultiplier=1, greenMultiplier=1, blueMultiplier=1, alphaMultiplier=1, redOffset=0, greenOffset=0, blueOffset=0, alphaOffset=0)
//(a=5, b=0, c=0, d=5, tx=0, ty=0)
//(a=1, b=0, c=0, d=1, tx=0, ty=0)
a = d = 5 ?? WTF :worried:
Anyway, obviously that can't be correct? Also, of course, this is not the output from OpenFl.
var s: Sprite = new Sprite();
addChild(s);
trace(s.transform.colorTransform);
trace(s.transform.concatenatedColorTransform);
trace(s.transform.concatenatedMatrix);
trace(s.transform.matrix);
//(redMultiplier=1, greenMultiplier=1, blueMultiplier=1, alphaMultiplier=1, redOffset=0, greenOffset=0, blueOffset=0, alphaOffset=0)
//(redMultiplier=1, greenMultiplier=1, blueMultiplier=1, alphaMultiplier=1, redOffset=0, greenOffset=0, blueOffset=0, alphaOffset=0)
//(a=1, b=0, c=0, d=1, tx=0, ty=0)
//(a=1, b=0, c=0, d=1, tx=0, ty=0)
#if (html5 && lime >= "5.0.0")
GL.bufferDataWEBGL(target, srcData, usage);
#elseif (lime >= "4.0.0")
GL.bufferData(target, size, srcData, usage);
#else
GL.bufferData(target, srcData, usage);
#end
100 0 0 0 NaN 612 0 1 0 NaN 100 128 0 1 NaN 100 128 0 1 NaN 612 0 1 0 NaN 612 128 1 1 NaN
GL.vertexAttribPointer
(since this whole thing works as intended on non-HTML5 targets)
aTexCoord
and aPosition
seem to read off the same bytes although they have been declared as different vertex attrib pointers
aColor
is doing, but it's probably the same problem