From 32b85545785ca79488540dec50abbbf0068c3944 Mon Sep 17 00:00:00 2001 From: eCode Date: Thu, 11 May 2023 19:50:54 -0300 Subject: [PATCH] Revert "Merge pull request #492 from SerG-Y/master" This reverts commit 54e162e4a52b1725ea978fc80eb08082560e9a41, reversing changes made to 7903e9dae81a855a6725d13789f31ca70260ede8. --- packages/base/src/SpineBase.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/base/src/SpineBase.ts b/packages/base/src/SpineBase.ts index 5b5464b3..544f4b3f 100644 --- a/packages/base/src/SpineBase.ts +++ b/packages/base/src/SpineBase.ts @@ -11,6 +11,8 @@ import { Graphics } from '@pixi/graphics'; import { settings } from './settings'; import type { ISpineDebugRenderer } from './SpineDebugRenderer'; +const tempRgb = [0, 0, 0]; + /** * @public */ @@ -320,11 +322,10 @@ export abstract class SpineBase< // YAY! double - tint! spriteColor = slot.currentSprite.color; } else { - slot.currentSprite.tint = utils.rgb2hex([ - light[0] * slot.color.r * attColor.r, - light[1] * slot.color.g * attColor.g, - light[2] * slot.color.b * attColor.b - ]); + tempRgb[0] = light[0] * slot.color.r * attColor.r; + tempRgb[1] = light[1] * slot.color.g * attColor.g; + tempRgb[2] = light[2] * slot.color.b * attColor.b; + slot.currentSprite.tint = utils.rgb2hex(tempRgb); } slot.currentSprite.blendMode = slot.blendMode; break; @@ -379,11 +380,10 @@ export abstract class SpineBase< // pixi-heaven spriteColor = slot.currentMesh.color; } else { - slot.currentMesh.tint = utils.rgb2hex([ - light[0] * slot.color.r * attColor.r, - light[1] * slot.color.g * attColor.g, - light[2] * slot.color.b * attColor.b - ]); + tempRgb[0] = light[0] * slot.color.r * attColor.r; + tempRgb[1] = light[1] * slot.color.g * attColor.g; + tempRgb[2] = light[2] * slot.color.b * attColor.b; + slot.currentMesh.tint = utils.rgb2hex(tempRgb); } slot.currentMesh.blendMode = slot.blendMode; if (!slot.hackRegion) {