[phaser] Use GLTexture.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL

This commit is contained in:
Mario Zechner 2023-11-28 12:13:13 +01:00
parent 8a80baa0ac
commit eae8468dc2
3 changed files with 26 additions and 1 deletions

1
spine-ts/.prettierignore Normal file
View File

@ -0,0 +1 @@
**/*

View File

@ -206,7 +206,7 @@ export class SpinePlugin extends Phaser.Plugins.ScenePlugin {
atlas = new TextureAtlas(atlasFile.data);
if (this.isWebGL) {
let gl = this.gl!;
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
if (GLTexture.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL) gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
for (let atlasPage of atlas.pages) {
atlasPage.setTexture(new GLTexture(gl, this.game.textures.get(atlasKey + "!" + atlasPage.name).getSourceImage() as HTMLImageElement | ImageBitmap, false));
}

24
spine-ts/tsfmt.json Normal file
View File

@ -0,0 +1,24 @@
{
"baseIndentSize": 0,
"indentSize": 4,
"tabSize": 4,
"indentStyle": 2,
"newLineCharacter": "\r\n",
"convertTabsToSpaces": false,
"insertSpaceAfterCommaDelimiter": true,
"insertSpaceAfterSemicolonInForStatements": true,
"insertSpaceBeforeAndAfterBinaryOperators": true,
"insertSpaceAfterConstructor": true,
"insertSpaceAfterKeywordsInControlFlowStatements": true,
"insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true,
"insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
"insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
"insertSpaceAfterTypeAssertion": false,
"insertSpaceBeforeFunctionParenthesis": true,
"insertSpaceBeforeTypeAnnotation": false,
"placeOpenBraceOnNewLineForFunctions": false,
"placeOpenBraceOnNewLineForControlBlocks": false
}