Skip to content

Commit c12b4cf

Browse files
committed
Swizzle RGB
1 parent 52acf60 commit c12b4cf

3 files changed

Lines changed: 7 additions & 9 deletions

File tree

src/cameras/2d/effects/Fade.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,12 +315,12 @@ var Fade = new Class({
315315

316316
var camera = this.camera;
317317
var red = this.red / 255;
318-
var blue = this.blue / 255;
319318
var green = this.green / 255;
319+
var blue = this.blue / 255;
320320

321321
pipeline.drawFillRect(
322322
camera.x, camera.y, camera.width, camera.height,
323-
getTintFunction(red, green, blue, 1),
323+
getTintFunction(blue, green, red, 1),
324324
this.alpha
325325
);
326326

src/cameras/2d/effects/Flash.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,12 +283,12 @@ var Flash = new Class({
283283

284284
var camera = this.camera;
285285
var red = this.red / 255;
286-
var blue = this.blue / 255;
287286
var green = this.green / 255;
287+
var blue = this.blue / 255;
288288

289289
pipeline.drawFillRect(
290290
camera.x, camera.y, camera.width, camera.height,
291-
getTintFunction(red, green, blue, 1),
291+
getTintFunction(blue, green, red, 1),
292292
this.alpha
293293
);
294294

src/renderer/webgl/WebGLRenderer.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2143,11 +2143,11 @@ var WebGLRenderer = new Class({
21432143

21442144
if (color.alphaGL > 0)
21452145
{
2146-
var pipeline = this.pipelines.setCameraPipeline();
2146+
var pipeline = this.pipelines.setMulti();
21472147

21482148
pipeline.drawFillRect(
21492149
cx, cy, cw, ch,
2150-
Utils.getTintFromFloats(color.redGL, color.greenGL, color.blueGL, 1),
2150+
Utils.getTintFromFloats(color.blueGL, color.greenGL, color.redGL, 1),
21512151
color.alphaGL
21522152
);
21532153
}
@@ -2197,7 +2197,7 @@ var WebGLRenderer = new Class({
21972197
{
21982198
if (camera.flashEffect.isRunning || camera.fadeEffect.isRunning)
21992199
{
2200-
var pipeline = this.pipelines.setCameraPipeline();
2200+
var pipeline = this.pipelines.setMulti();
22012201

22022202
camera.flashEffect.postRenderWebGL(pipeline, Utils.getTintFromFloats);
22032203
camera.fadeEffect.postRenderWebGL(pipeline, Utils.getTintFromFloats);
@@ -2219,8 +2219,6 @@ var WebGLRenderer = new Class({
22192219
camera.emit(CameraEvents.POST_RENDER, camera);
22202220

22212221
this.pipelines.postBatchCamera(camera);
2222-
2223-
this.resetTextures();
22242222
}
22252223
},
22262224

0 commit comments

Comments
 (0)