瀏覽代碼

[phaser] Use GLTexture.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL

Mario Zechner 1 年之前
父節點
當前提交
eae8468dc2
共有 3 個文件被更改,包括 26 次插入1 次删除
  1. 1 0
      spine-ts/.prettierignore
  2. 1 1
      spine-ts/spine-phaser/src/SpinePlugin.ts
  3. 24 0
      spine-ts/tsfmt.json

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