Эх сурвалжийг харах

[phaser] Use GLTexture.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL

Mario Zechner 1 жил өмнө
parent
commit
eae8468dc2

+ 1 - 0
spine-ts/.prettierignore

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

+ 1 - 1
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));
 				}

+ 24 - 0
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
+}