From 9b22faf139752c2c8d83c3e98e1ad13898562ff3 Mon Sep 17 00:00:00 2001 From: moly <0700689@live.abertay.ac.uk> Date: Mon, 14 Jan 2013 18:33:38 +0000 Subject: [PATCH] no need to fill a camera twice if not blending alpha --- org/flixel/FlxCamera.as | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/org/flixel/FlxCamera.as b/org/flixel/FlxCamera.as index c69222d3..a02a020f 100644 --- a/org/flixel/FlxCamera.as +++ b/org/flixel/FlxCamera.as @@ -671,8 +671,16 @@ package org.flixel */ public function fill(Color:uint,BlendAlpha:Boolean=true):void { - _fill.fillRect(_flashRect,Color); - buffer.copyPixels(_fill,_flashRect,_flashPoint,null,null,BlendAlpha); + var alpha:uint = Color >>> 24; + if(alpha == 255 || !BlendAlpha) + { + buffer.fillRect(_flashRect,Color); + } + else + { + _fill.fillRect(_flashRect,Color); + buffer.copyPixels(_fill,_flashRect,_flashPoint,null,null,BlendAlpha); + } } /**