WebGLRenderer.addBlendMode() returns the previous blend mode's index (v4)
Los mantenedores suelen responder en 3 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 1/5
- Tiempo estimado
- Menos de una hora
- Aptitud para principiantes
- 46/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript
Línea de trabajo
The issue points to WebGLRenderer.addBlendMode() and shows the faulty return expression, but gives no file path or test location. Start by locating that method and the tests for blend mode registration. Confirm the returned index addresses the newly added mode and that setting, updating, and removing it leave the built-in XOR mode unchanged.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Version
- Phaser Version: 4.2.1 (also 4.0.0 and master at 02d8931)
- Operating system: any (WebGL renderer)
- Browser: any
Description
addBlendMode() returns one less than the index of the blend mode it adds:
var index = this.blendModes.push(WebGLBlendParametersFactory.createCombined(...)) - 1;
return index - 1;
push() - 1 is already the new index, so the first custom mode returns 27 (the built-in XOR slot) instead of 28. v3.90 had push() followed by a single return index - 1, which was correct.
Effects:
setBlendMode(index)uses the previous mode, so the custom one never renders.updateBlendMode(index, ...)/removeBlendMode(index)change or remove the built-inXORmode instead of the new one.
Example Test Code
const r = this.renderer;
const gl = r.gl;
const before = r.blendModes.length; // 28
const index = r.addBlendMode([ gl.DST_ALPHA, gl.ZERO ], gl.FUNC_ADD);
console.log(index, before); // 27 28, so index points at XOR, not the new mode
Additional Information
The fix is to drop the second - 1. I have it ready with tests and can open a PR if that's welcome.
- Lenguaje dominante
- JavaScript
- Estrellas
- 40.7k
- Forks
- 7.2k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de phaserjs/phaser
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 80/100
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
Los mantenedores suelen responder en 3 días
-
Type definition for TilemapLayer.getTileAt is wrongPosiblemente ocupada @hkbughk la tomó hace 34 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 3 días
-
Shader.preDestroy leaks its ShaderQuad's vertex buffer and VAO on every create/destroy cycle (4.2.1)Posiblemente ocupada @k1epg01ng129-eng la tomó hace 32 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 3 días
-
Black opaque background on transparent Phaser.Text textures in Phaser 4.2.1 on older iOS WebGLPosiblemente ocupada @SamuelMalmfors la tomó hace 14 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
phaserjs/phaser#7392 · 1 comentario ·
Los mantenedores suelen responder en 3 días
Todos los issues de phaserjs/phaser
Issues similares
-
enhancement ready
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
DCGM/semant-demo#708 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
agents area: runtime automation chore cli consistency dependencies developer-experience difficulty: easy documentation enhancement good first issue help wanted hygiene json-output priority: P3 starters tests
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Client codegen: an import repeated in an impl file is emitted twice, and the browser rejects the modulePosiblemente ocupada @MalithaPrabhashana la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
jaseci-labs/jac#10756 ·
Los mantenedores suelen responder en 1 día