From eae8468dc2c51cd37382b726b49928b4c39baf50 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Tue, 28 Nov 2023 12:13:13 +0100 Subject: [PATCH] [phaser] Use GLTexture.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL --- spine-ts/.prettierignore | 1 + spine-ts/spine-phaser/src/SpinePlugin.ts | 2 +- spine-ts/tsfmt.json | 24 ++++++++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 spine-ts/.prettierignore create mode 100644 spine-ts/tsfmt.json diff --git a/spine-ts/.prettierignore b/spine-ts/.prettierignore new file mode 100644 index 000000000..01b7e33fd --- /dev/null +++ b/spine-ts/.prettierignore @@ -0,0 +1 @@ +**/* \ No newline at end of file diff --git a/spine-ts/spine-phaser/src/SpinePlugin.ts b/spine-ts/spine-phaser/src/SpinePlugin.ts index dcd989301..4e234278b 100644 --- a/spine-ts/spine-phaser/src/SpinePlugin.ts +++ b/spine-ts/spine-phaser/src/SpinePlugin.ts @@ -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)); } diff --git a/spine-ts/tsfmt.json b/spine-ts/tsfmt.json new file mode 100644 index 000000000..990bb18ab --- /dev/null +++ b/spine-ts/tsfmt.json @@ -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 +} \ No newline at end of file