mirror of
https://github.com/photonstorm/phaser
synced 2025-02-17 06:28:30 +00:00
Allow config setting values. Gets custom pipelines working again.
This commit is contained in:
parent
5a5bea1ce5
commit
05985417b3
1 changed files with 8 additions and 8 deletions
|
@ -6,6 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Class = require('../../../utils/Class');
|
var Class = require('../../../utils/Class');
|
||||||
|
var GetFastValue = require('../../../utils/object/GetFastValue');
|
||||||
var ModelViewProjection = require('./components/ModelViewProjection');
|
var ModelViewProjection = require('./components/ModelViewProjection');
|
||||||
var TransformMatrix = require('../../../gameobjects/components/TransformMatrix');
|
var TransformMatrix = require('../../../gameobjects/components/TransformMatrix');
|
||||||
var ShaderSourceFS = require('../shaders/TextureTint-frag.js');
|
var ShaderSourceFS = require('../shaders/TextureTint-frag.js');
|
||||||
|
@ -55,12 +56,11 @@ var TextureTintPipeline = new Class({
|
||||||
game: config.game,
|
game: config.game,
|
||||||
renderer: config.renderer,
|
renderer: config.renderer,
|
||||||
gl: config.renderer.gl,
|
gl: config.renderer.gl,
|
||||||
topology: config.renderer.gl.TRIANGLES,
|
topology: GetFastValue(config, 'topology', config.renderer.gl.TRIANGLES),
|
||||||
vertShader: ShaderSourceVS,
|
vertShader: GetFastValue(config, 'vertShader', ShaderSourceVS),
|
||||||
fragShader: ShaderSourceFS,
|
fragShader: GetFastValue(config, 'fragShader', ShaderSourceFS),
|
||||||
vertexCapacity: 6 * rendererConfig.batchSize,
|
vertexCapacity: GetFastValue(config, 'vertexCapacity', 6 * rendererConfig.batchSize),
|
||||||
vertexSize: Float32Array.BYTES_PER_ELEMENT * 5 + Uint8Array.BYTES_PER_ELEMENT * 4,
|
vertexSize: GetFastValue(config, 'vertexSize', Float32Array.BYTES_PER_ELEMENT * 5 + Uint8Array.BYTES_PER_ELEMENT * 4),
|
||||||
|
|
||||||
attributes: [
|
attributes: [
|
||||||
{
|
{
|
||||||
name: 'inPosition',
|
name: 'inPosition',
|
||||||
|
@ -400,7 +400,7 @@ var TextureTintPipeline = new Class({
|
||||||
*/
|
*/
|
||||||
batchSprite: function (sprite, camera, parentTransformMatrix)
|
batchSprite: function (sprite, camera, parentTransformMatrix)
|
||||||
{
|
{
|
||||||
this.renderer.setPipeline(this);
|
this.renderer.setPipeline(this, sprite);
|
||||||
|
|
||||||
var camMatrix = this._tempMatrix1;
|
var camMatrix = this._tempMatrix1;
|
||||||
var spriteMatrix = this._tempMatrix2;
|
var spriteMatrix = this._tempMatrix2;
|
||||||
|
@ -689,7 +689,7 @@ var TextureTintPipeline = new Class({
|
||||||
camera,
|
camera,
|
||||||
parentTransformMatrix)
|
parentTransformMatrix)
|
||||||
{
|
{
|
||||||
this.renderer.setPipeline(this);
|
this.renderer.setPipeline(this, gameObject);
|
||||||
|
|
||||||
var camMatrix = this._tempMatrix1;
|
var camMatrix = this._tempMatrix1;
|
||||||
var spriteMatrix = this._tempMatrix2;
|
var spriteMatrix = this._tempMatrix2;
|
||||||
|
|
Loading…
Add table
Reference in a new issue