75 lines
4.7 KiB
JavaScript
75 lines
4.7 KiB
JavaScript
shadow$provide.module$node_modules$pixi_DOT_js$lib$scene$container$utils$updateRenderGroupTransforms = function(global, require, module, exports) {
|
|
function updateRenderGroupTransforms(renderGroup, updateChildRenderGroups = !1) {
|
|
updateRenderGroupTransform(renderGroup);
|
|
var childrenToUpdate = renderGroup.childrenToUpdate;
|
|
const updateTick = renderGroup.updateTick++;
|
|
for (const j in childrenToUpdate) {
|
|
const renderGroupDepth = Number(j), childrenAtDepth = childrenToUpdate[j], list = childrenAtDepth.list, index = childrenAtDepth.index;
|
|
for (let i = 0; i < index; i++) {
|
|
const child = list[i];
|
|
child.parentRenderGroup === renderGroup && child.relativeRenderGroupDepth === renderGroupDepth && updateTransformAndChildren(child, updateTick, 0);
|
|
}
|
|
clearList.clearList(list, index);
|
|
childrenAtDepth.index = 0;
|
|
}
|
|
if (updateChildRenderGroups) {
|
|
for (childrenToUpdate = 0; childrenToUpdate < renderGroup.renderGroupChildren.length; childrenToUpdate++) {
|
|
updateRenderGroupTransforms(renderGroup.renderGroupChildren[childrenToUpdate], updateChildRenderGroups);
|
|
}
|
|
}
|
|
}
|
|
function updateRenderGroupTransform(renderGroup) {
|
|
var root = renderGroup.root;
|
|
if (renderGroup.renderGroupParent) {
|
|
const renderGroupParent = renderGroup.renderGroupParent;
|
|
renderGroup.worldTransform.appendFrom(root.relativeGroupTransform, renderGroupParent.worldTransform);
|
|
renderGroup.worldColor = multiplyColors.multiplyColors(root.groupColor, renderGroupParent.worldColor);
|
|
root = root.groupAlpha * renderGroupParent.worldAlpha;
|
|
} else {
|
|
renderGroup.worldTransform.copyFrom(root.localTransform), renderGroup.worldColor = root.localColor, root = root.localAlpha;
|
|
}
|
|
root = 0 > root ? 0 : 1 < root ? 1 : root;
|
|
renderGroup.worldAlpha = root;
|
|
renderGroup.worldColorAlpha = renderGroup.worldColor + ((255 * root | 0) << 24);
|
|
}
|
|
function updateTransformAndChildren(container, updateTick, updateFlags) {
|
|
if (updateTick !== container.updateTick) {
|
|
container.updateTick = updateTick;
|
|
container.didChange = !1;
|
|
var localTransform = container.localTransform;
|
|
container.updateLocalTransform();
|
|
var parent = container.parent;
|
|
parent && !parent.renderGroup ? (updateFlags |= container._updateFlags, container.relativeGroupTransform.appendFrom(localTransform, parent.relativeGroupTransform), updateFlags & UPDATE_BLEND_COLOR_VISIBLE && updateColorBlendVisibility(container, parent, updateFlags)) : (updateFlags = container._updateFlags, container.relativeGroupTransform.copyFrom(localTransform), updateFlags & UPDATE_BLEND_COLOR_VISIBLE && updateColorBlendVisibility(container, tempContainer, updateFlags));
|
|
if (!container.renderGroup) {
|
|
localTransform = container.children;
|
|
parent = localTransform.length;
|
|
for (let i = 0; i < parent; i++) {
|
|
updateTransformAndChildren(localTransform[i], updateTick, updateFlags);
|
|
}
|
|
updateTick = container.parentRenderGroup;
|
|
container.renderPipeId && !updateTick.structureDidChange && updateTick.updateRenderable(container);
|
|
}
|
|
}
|
|
}
|
|
function updateColorBlendVisibility(container, parent, updateFlags) {
|
|
if (updateFlags & Container.UPDATE_COLOR) {
|
|
container.groupColor = multiplyColors.multiplyColors(container.localColor, parent.groupColor);
|
|
let groupAlpha = container.localAlpha * parent.groupAlpha;
|
|
groupAlpha = 0 > groupAlpha ? 0 : 1 < groupAlpha ? 1 : groupAlpha;
|
|
container.groupAlpha = groupAlpha;
|
|
container.groupColorAlpha = container.groupColor + ((255 * groupAlpha | 0) << 24);
|
|
}
|
|
updateFlags & Container.UPDATE_BLEND && (container.groupBlendMode = "inherit" === container.localBlendMode ? parent.groupBlendMode : container.localBlendMode);
|
|
updateFlags & Container.UPDATE_VISIBLE && (container.globalDisplayStatus = container.localDisplayStatus & parent.globalDisplayStatus);
|
|
container._updateFlags = 0;
|
|
}
|
|
var Container = require("module$node_modules$pixi_DOT_js$lib$scene$container$Container"), clearList = require("module$node_modules$pixi_DOT_js$lib$scene$container$utils$clearList"), multiplyColors = require("module$node_modules$pixi_DOT_js$lib$scene$container$utils$multiplyColors");
|
|
"use strict";
|
|
const tempContainer = new Container.Container(), UPDATE_BLEND_COLOR_VISIBLE = Container.UPDATE_VISIBLE | Container.UPDATE_COLOR | Container.UPDATE_BLEND;
|
|
exports.updateRenderGroupTransform = updateRenderGroupTransform;
|
|
exports.updateRenderGroupTransforms = updateRenderGroupTransforms;
|
|
exports.updateTransformAndChildren = updateTransformAndChildren;
|
|
};
|
|
|
|
//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$scene$container$utils$updateRenderGroupTransforms.js.map
|