diff --git a/examples/wip/TRSIPlasmaFilter.js b/examples/wip/filters/TRSIPlasmaFilter.js
similarity index 100%
rename from examples/wip/TRSIPlasmaFilter.js
rename to examples/wip/filters/TRSIPlasmaFilter.js
diff --git a/examples/wip/binarySerpentsFilter.js b/examples/wip/filters/binarySerpentsFilter.js
similarity index 100%
rename from examples/wip/binarySerpentsFilter.js
rename to examples/wip/filters/binarySerpentsFilter.js
diff --git a/examples/wip/c64PlasmaFilter.js b/examples/wip/filters/c64PlasmaFilter.js
similarity index 100%
rename from examples/wip/c64PlasmaFilter.js
rename to examples/wip/filters/c64PlasmaFilter.js
diff --git a/examples/wip/caustic lights.js b/examples/wip/filters/caustic lights.js
similarity index 100%
rename from examples/wip/caustic lights.js
rename to examples/wip/filters/caustic lights.js
diff --git a/examples/wip/checkerWaveFilter.js b/examples/wip/filters/checkerWaveFilter.js
similarity index 100%
rename from examples/wip/checkerWaveFilter.js
rename to examples/wip/filters/checkerWaveFilter.js
diff --git a/examples/wip/classicTunnelFilter.js b/examples/wip/filters/classicTunnelFilter.js
similarity index 100%
rename from examples/wip/classicTunnelFilter.js
rename to examples/wip/filters/classicTunnelFilter.js
diff --git a/examples/wip/colorBoxFilter.js b/examples/wip/filters/colorBoxFilter.js
similarity index 100%
rename from examples/wip/colorBoxFilter.js
rename to examples/wip/filters/colorBoxFilter.js
diff --git a/examples/wip/colorWaveFilter.js b/examples/wip/filters/colorWaveFilter.js
similarity index 100%
rename from examples/wip/colorWaveFilter.js
rename to examples/wip/filters/colorWaveFilter.js
diff --git a/examples/wip/colorbars_demo.js b/examples/wip/filters/colorbars_demo.js
similarity index 100%
rename from examples/wip/colorbars_demo.js
rename to examples/wip/filters/colorbars_demo.js
diff --git a/examples/wip/deformStarFilter.js b/examples/wip/filters/deformStarFilter.js
similarity index 100%
rename from examples/wip/deformStarFilter.js
rename to examples/wip/filters/deformStarFilter.js
diff --git a/examples/wip/fakeLenseFilter.js b/examples/wip/filters/fakeLenseFilter.js
similarity index 100%
rename from examples/wip/fakeLenseFilter.js
rename to examples/wip/filters/fakeLenseFilter.js
diff --git a/examples/wip/filter.js b/examples/wip/filters/filter.js
similarity index 100%
rename from examples/wip/filter.js
rename to examples/wip/filters/filter.js
diff --git a/examples/wip/fireFilter.js b/examples/wip/filters/fireFilter.js
similarity index 100%
rename from examples/wip/fireFilter.js
rename to examples/wip/filters/fireFilter.js
diff --git a/examples/wip/fire_demo.js b/examples/wip/filters/fire_demo.js
similarity index 100%
rename from examples/wip/fire_demo.js
rename to examples/wip/filters/fire_demo.js
diff --git a/examples/wip/flameFilter.js b/examples/wip/filters/flameFilter.js
similarity index 100%
rename from examples/wip/flameFilter.js
rename to examples/wip/filters/flameFilter.js
diff --git a/examples/wip/flowerFilter.js b/examples/wip/filters/flowerFilter.js
similarity index 100%
rename from examples/wip/flowerFilter.js
rename to examples/wip/filters/flowerFilter.js
diff --git a/examples/wip/fractalRayMarchFilter.js b/examples/wip/filters/fractalRayMarchFilter.js
similarity index 100%
rename from examples/wip/fractalRayMarchFilter.js
rename to examples/wip/filters/fractalRayMarchFilter.js
diff --git a/examples/wip/heroku.js b/examples/wip/filters/heroku.js
similarity index 100%
rename from examples/wip/heroku.js
rename to examples/wip/filters/heroku.js
diff --git a/examples/wip/hueRotationFilter.js b/examples/wip/filters/hueRotationFilter.js
similarity index 100%
rename from examples/wip/hueRotationFilter.js
rename to examples/wip/filters/hueRotationFilter.js
diff --git a/examples/wip/hypnoticRipplesFilter.js b/examples/wip/filters/hypnoticRipplesFilter.js
similarity index 100%
rename from examples/wip/hypnoticRipplesFilter.js
rename to examples/wip/filters/hypnoticRipplesFilter.js
diff --git a/examples/wip/icosohedronFilter.js b/examples/wip/filters/icosohedronFilter.js
similarity index 100%
rename from examples/wip/icosohedronFilter.js
rename to examples/wip/filters/icosohedronFilter.js
diff --git a/examples/wip/filters/index.php b/examples/wip/filters/index.php
new file mode 100644
index 00000000..7938ad82
--- /dev/null
+++ b/examples/wip/filters/index.php
@@ -0,0 +1,109 @@
+ $value)
+ {
+ if (is_array($value) && count($value) > 0)
+ {
+ $total += count($value);
+ }
+ }
+
+ function getFile() {
+
+ global $files, $dir, $filename, $title, $code;
+
+ if (isset($_GET['d']) && isset($_GET['f']))
+ {
+ $dir = urldecode($_GET['d']);
+ $filename = urldecode($_GET['d']) . '/' . urldecode($_GET['f']);
+ $title = urldecode($_GET['t']);
+
+ if (file_exists($filename))
+ {
+ $code = file_get_contents($filename);
+ $files = dirToArray($dir);
+ }
+ }
+
+ }
+
+ function dirToArray($dir) {
+
+ $ignore = array('.', '..', '_site', 'assets', 'states', 'book');
+ $result = array();
+ $root = scandir($dir);
+ $dirs = array_diff($root, $ignore);
+
+ foreach ($dirs as $key => $value)
+ {
+ if (is_dir($dir . DIRECTORY_SEPARATOR . $value))
+ {
+ $result[$value] = dirToArray($dir . DIRECTORY_SEPARATOR . $value);
+ }
+ else
+ {
+ if (substr($value, -3) == '.js')
+ {
+ $result[] = $value;
+ }
+ }
+ }
+
+ return $result;
+ }
+
+ function printJSLinks($dir, $files) {
+
+ $output = "";
+
+ foreach ($files as $key => $value)
+ {
+ $value2 = substr($value, 0, -3);
+ $file = urlencode($value);
+
+ $output .= "$value2
";
+ }
+
+ return $output;
+
+ }
+?>
+
+
+
+
+ phaser
+
+
+
+
+
+
+
+
+
+
+ work in progress filters
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/wip/lightbeam_demo.js b/examples/wip/filters/lightbeam_demo.js
similarity index 100%
rename from examples/wip/lightbeam_demo.js
rename to examples/wip/filters/lightbeam_demo.js
diff --git a/examples/wip/mengerTunnelFilter.js b/examples/wip/filters/mengerTunnelFilter.js
similarity index 100%
rename from examples/wip/mengerTunnelFilter.js
rename to examples/wip/filters/mengerTunnelFilter.js
diff --git a/examples/wip/metaBallsFilter.js b/examples/wip/filters/metaBallsFilter.js
similarity index 100%
rename from examples/wip/metaBallsFilter.js
rename to examples/wip/filters/metaBallsFilter.js
diff --git a/examples/wip/mouseStarFilter.js b/examples/wip/filters/mouseStarFilter.js
similarity index 100%
rename from examples/wip/mouseStarFilter.js
rename to examples/wip/filters/mouseStarFilter.js
diff --git a/examples/wip/mysteryVortexFilter.js b/examples/wip/filters/mysteryVortexFilter.js
similarity index 100%
rename from examples/wip/mysteryVortexFilter.js
rename to examples/wip/filters/mysteryVortexFilter.js
diff --git a/examples/wip/planeDeformationFilter.js b/examples/wip/filters/planeDeformationFilter.js
similarity index 100%
rename from examples/wip/planeDeformationFilter.js
rename to examples/wip/filters/planeDeformationFilter.js
diff --git a/examples/wip/plasma3DFilter.js b/examples/wip/filters/plasma3DFilter.js
similarity index 100%
rename from examples/wip/plasma3DFilter.js
rename to examples/wip/filters/plasma3DFilter.js
diff --git a/examples/wip/plasmaBeamFilter.js b/examples/wip/filters/plasmaBeamFilter.js
similarity index 100%
rename from examples/wip/plasmaBeamFilter.js
rename to examples/wip/filters/plasmaBeamFilter.js
diff --git a/examples/wip/plasmaFilter.js b/examples/wip/filters/plasmaFilter.js
similarity index 100%
rename from examples/wip/plasmaFilter.js
rename to examples/wip/filters/plasmaFilter.js
diff --git a/examples/wip/plasmaFlowerFilter.js b/examples/wip/filters/plasmaFlowerFilter.js
similarity index 100%
rename from examples/wip/plasmaFlowerFilter.js
rename to examples/wip/filters/plasmaFlowerFilter.js
diff --git a/examples/wip/plasma_demo.js b/examples/wip/filters/plasma_demo.js
similarity index 100%
rename from examples/wip/plasma_demo.js
rename to examples/wip/filters/plasma_demo.js
diff --git a/examples/wip/pulsingInterferenceFilter.js b/examples/wip/filters/pulsingInterferenceFilter.js
similarity index 100%
rename from examples/wip/pulsingInterferenceFilter.js
rename to examples/wip/filters/pulsingInterferenceFilter.js
diff --git a/examples/wip/rayTracedBallsFilter.js b/examples/wip/filters/rayTracedBallsFilter.js
similarity index 100%
rename from examples/wip/rayTracedBallsFilter.js
rename to examples/wip/filters/rayTracedBallsFilter.js
diff --git a/examples/wip/retroPlasmaFilter.js b/examples/wip/filters/retroPlasmaFilter.js
similarity index 100%
rename from examples/wip/retroPlasmaFilter.js
rename to examples/wip/filters/retroPlasmaFilter.js
diff --git a/examples/wip/rotationalFractalsFilter.js b/examples/wip/filters/rotationalFractalsFilter.js
similarity index 100%
rename from examples/wip/rotationalFractalsFilter.js
rename to examples/wip/filters/rotationalFractalsFilter.js
diff --git a/examples/wip/rotoZoomerFilter.js b/examples/wip/filters/rotoZoomerFilter.js
similarity index 100%
rename from examples/wip/rotoZoomerFilter.js
rename to examples/wip/filters/rotoZoomerFilter.js
diff --git a/examples/wip/shadertoy-effect.js b/examples/wip/filters/shadertoy-effect.js
similarity index 100%
rename from examples/wip/shadertoy-effect.js
rename to examples/wip/filters/shadertoy-effect.js
diff --git a/examples/wip/shinyTaffyFilter.js b/examples/wip/filters/shinyTaffyFilter.js
similarity index 100%
rename from examples/wip/shinyTaffyFilter.js
rename to examples/wip/filters/shinyTaffyFilter.js
diff --git a/examples/wip/sineWaveFilter.js b/examples/wip/filters/sineWaveFilter.js
similarity index 100%
rename from examples/wip/sineWaveFilter.js
rename to examples/wip/filters/sineWaveFilter.js
diff --git a/examples/wip/sineWaveFixedBaseFilter.js b/examples/wip/filters/sineWaveFixedBaseFilter.js
similarity index 100%
rename from examples/wip/sineWaveFixedBaseFilter.js
rename to examples/wip/filters/sineWaveFixedBaseFilter.js
diff --git a/examples/wip/softTunnelFilter.js b/examples/wip/filters/softTunnelFilter.js
similarity index 100%
rename from examples/wip/softTunnelFilter.js
rename to examples/wip/filters/softTunnelFilter.js
diff --git a/examples/wip/spaceRacingLiteFilter.js b/examples/wip/filters/spaceRacingLiteFilter.js
similarity index 100%
rename from examples/wip/spaceRacingLiteFilter.js
rename to examples/wip/filters/spaceRacingLiteFilter.js
diff --git a/examples/wip/starNestFilter.js b/examples/wip/filters/starNestFilter.js
similarity index 100%
rename from examples/wip/starNestFilter.js
rename to examples/wip/filters/starNestFilter.js
diff --git a/examples/wip/starNurseryFilter.js b/examples/wip/filters/starNurseryFilter.js
similarity index 100%
rename from examples/wip/starNurseryFilter.js
rename to examples/wip/filters/starNurseryFilter.js
diff --git a/examples/wip/starfieldFilter.js b/examples/wip/filters/starfieldFilter.js
similarity index 100%
rename from examples/wip/starfieldFilter.js
rename to examples/wip/filters/starfieldFilter.js
diff --git a/examples/wip/starsBackgroundFilter.js b/examples/wip/filters/starsBackgroundFilter.js
similarity index 100%
rename from examples/wip/starsBackgroundFilter.js
rename to examples/wip/filters/starsBackgroundFilter.js
diff --git a/examples/wip/tex00.jpg b/examples/wip/filters/tex00.jpg
similarity index 100%
rename from examples/wip/tex00.jpg
rename to examples/wip/filters/tex00.jpg
diff --git a/examples/wip/tex01.jpg b/examples/wip/filters/tex01.jpg
similarity index 100%
rename from examples/wip/tex01.jpg
rename to examples/wip/filters/tex01.jpg
diff --git a/examples/wip/tex02.jpg b/examples/wip/filters/tex02.jpg
similarity index 100%
rename from examples/wip/tex02.jpg
rename to examples/wip/filters/tex02.jpg
diff --git a/examples/wip/tex03.jpg b/examples/wip/filters/tex03.jpg
similarity index 100%
rename from examples/wip/tex03.jpg
rename to examples/wip/filters/tex03.jpg
diff --git a/examples/wip/tex04.jpg b/examples/wip/filters/tex04.jpg
similarity index 100%
rename from examples/wip/tex04.jpg
rename to examples/wip/filters/tex04.jpg
diff --git a/examples/wip/tex05.jpg b/examples/wip/filters/tex05.jpg
similarity index 100%
rename from examples/wip/tex05.jpg
rename to examples/wip/filters/tex05.jpg
diff --git a/examples/wip/tex06.jpg b/examples/wip/filters/tex06.jpg
similarity index 100%
rename from examples/wip/tex06.jpg
rename to examples/wip/filters/tex06.jpg
diff --git a/examples/wip/tex07.jpg b/examples/wip/filters/tex07.jpg
similarity index 100%
rename from examples/wip/tex07.jpg
rename to examples/wip/filters/tex07.jpg
diff --git a/examples/wip/tex08.jpg b/examples/wip/filters/tex08.jpg
similarity index 100%
rename from examples/wip/tex08.jpg
rename to examples/wip/filters/tex08.jpg
diff --git a/examples/wip/tex09.jpg b/examples/wip/filters/tex09.jpg
similarity index 100%
rename from examples/wip/tex09.jpg
rename to examples/wip/filters/tex09.jpg
diff --git a/examples/wip/tex10.png b/examples/wip/filters/tex10.png
similarity index 100%
rename from examples/wip/tex10.png
rename to examples/wip/filters/tex10.png
diff --git a/examples/wip/tex11.png b/examples/wip/filters/tex11.png
similarity index 100%
rename from examples/wip/tex11.png
rename to examples/wip/filters/tex11.png
diff --git a/examples/wip/tex12.png b/examples/wip/filters/tex12.png
similarity index 100%
rename from examples/wip/tex12.png
rename to examples/wip/filters/tex12.png
diff --git a/examples/wip/tex14.png b/examples/wip/filters/tex14.png
similarity index 100%
rename from examples/wip/tex14.png
rename to examples/wip/filters/tex14.png
diff --git a/examples/wip/tex15.png b/examples/wip/filters/tex15.png
similarity index 100%
rename from examples/wip/tex15.png
rename to examples/wip/filters/tex15.png
diff --git a/examples/wip/tex16.png b/examples/wip/filters/tex16.png
similarity index 100%
rename from examples/wip/tex16.png
rename to examples/wip/filters/tex16.png
diff --git a/examples/wip/trippyLinesFilter.js b/examples/wip/filters/trippyLinesFilter.js
similarity index 100%
rename from examples/wip/trippyLinesFilter.js
rename to examples/wip/filters/trippyLinesFilter.js
diff --git a/examples/wip/tunnelFilter.js b/examples/wip/filters/tunnelFilter.js
similarity index 100%
rename from examples/wip/tunnelFilter.js
rename to examples/wip/filters/tunnelFilter.js
diff --git a/examples/wip/tunnel_demo.js b/examples/wip/filters/tunnel_demo.js
similarity index 100%
rename from examples/wip/tunnel_demo.js
rename to examples/wip/filters/tunnel_demo.js
diff --git a/examples/wip/vortexFilter.js b/examples/wip/filters/vortexFilter.js
similarity index 100%
rename from examples/wip/vortexFilter.js
rename to examples/wip/filters/vortexFilter.js
diff --git a/examples/wip/wobbleFilter.js b/examples/wip/filters/wobbleFilter.js
similarity index 100%
rename from examples/wip/wobbleFilter.js
rename to examples/wip/filters/wobbleFilter.js
diff --git a/examples/wip/index.php b/examples/wip/index.php
index 7fa7f2b6..58a4a658 100644
--- a/examples/wip/index.php
+++ b/examples/wip/index.php
@@ -32,7 +32,7 @@
function dirToArray($dir) {
- $ignore = array('.', '..', '_site', 'assets', 'states', 'book');
+ $ignore = array('.', '..', '_site', 'assets', 'states', 'book', 'filters');
$result = array();
$root = scandir($dir);
$dirs = array_diff($root, $ignore);
diff --git a/examples/wip/removeFilter.js b/examples/wip/removeFilter.js
new file mode 100644
index 00000000..d5d11586
--- /dev/null
+++ b/examples/wip/removeFilter.js
@@ -0,0 +1,47 @@
+
+var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update });
+
+var logo;
+var background;
+var filter;
+
+function preload() {
+
+ game.load.image('phaser', 'assets/sprites/phaser2.png');
+ game.load.script('fire', '../filters/Fire.js');
+
+}
+
+function create() {
+
+
+ background = game.add.sprite(0, 0);
+ background.width = 800;
+ background.height = 600;
+
+ filter = game.add.filter('Fire', 800, 600);
+ filter.alpha = 0.0;
+
+ background.filters = [filter];
+
+ logo = game.add.sprite(game.world.centerX, game.world.centerY, 'phaser');
+ logo.anchor.setTo(0.5, 0.5);
+
+ game.input.onDown.add(removeBackground, this);
+
+}
+
+function update() {
+
+ filter.update();
+
+}
+
+function removeBackground() {
+
+ console.log('removeBackground');
+
+ // background.destroy();
+ background.removeFilter(filter);
+
+}
diff --git a/examples/wip/template.js b/examples/wip/template.js
new file mode 100644
index 00000000..544dd8f3
--- /dev/null
+++ b/examples/wip/template.js
@@ -0,0 +1,22 @@
+
+var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update, render: render });
+
+function preload() {
+
+
+}
+
+var sprite;
+
+function create() {
+
+}
+
+function update() {
+
+
+}
+
+function render() {
+
+}
diff --git a/src/gameobjects/Sprite.js b/src/gameobjects/Sprite.js
index 71cdd228..4ebded88 100644
--- a/src/gameobjects/Sprite.js
+++ b/src/gameobjects/Sprite.js
@@ -860,6 +860,13 @@ Phaser.Sprite.prototype.destroy = function() {
this.animations.destroy();
}
+ if (this._filters)
+ {
+ console.log('removeFilter', this._filters);
+ this.removeFilter(this._filters);
+ console.log(this._filters);
+ }
+
this.alive = false;
this.exists = false;
this.visible = false;
diff --git a/src/pixi/InteractionManager.js b/src/pixi/InteractionManager.js
index ad111752..bc655d28 100644
--- a/src/pixi/InteractionManager.js
+++ b/src/pixi/InteractionManager.js
@@ -246,7 +246,7 @@ PIXI.InteractionManager.prototype.update = function()
// loks like there was a hit!
if(item.__hit)
{
- if(item.buttonMode) this.interactionDOMElement.style.cursor = "pointer";
+ if(item.buttonMode) this.interactionDOMElement.style.cursor = item.defaultCursor;
if(!item.__isOver)
{
diff --git a/src/pixi/core/Circle.js b/src/pixi/core/Circle.js
index 3844f426..e2728335 100644
--- a/src/pixi/core/Circle.js
+++ b/src/pixi/core/Circle.js
@@ -14,24 +14,24 @@
PIXI.Circle = function(x, y, radius)
{
/**
- * @property x
- * @type Number
- * @default 0
- */
+ * @property x
+ * @type Number
+ * @default 0
+ */
this.x = x || 0;
/**
- * @property y
- * @type Number
- * @default 0
- */
+ * @property y
+ * @type Number
+ * @default 0
+ */
this.y = y || 0;
/**
- * @property radius
- * @type Number
- * @default 0
- */
+ * @property radius
+ * @type Number
+ * @default 0
+ */
this.radius = radius || 0;
}
diff --git a/src/pixi/core/Ellipse.js b/src/pixi/core/Ellipse.js
index 0d05b3ed..1a95d20a 100644
--- a/src/pixi/core/Ellipse.js
+++ b/src/pixi/core/Ellipse.js
@@ -15,31 +15,31 @@
PIXI.Ellipse = function(x, y, width, height)
{
/**
- * @property x
- * @type Number
- * @default 0
- */
+ * @property x
+ * @type Number
+ * @default 0
+ */
this.x = x || 0;
/**
- * @property y
- * @type Number
- * @default 0
- */
+ * @property y
+ * @type Number
+ * @default 0
+ */
this.y = y || 0;
/**
- * @property width
- * @type Number
- * @default 0
- */
+ * @property width
+ * @type Number
+ * @default 0
+ */
this.width = width || 0;
/**
- * @property height
- * @type Number
- * @default 0
- */
+ * @property height
+ * @type Number
+ * @default 0
+ */
this.height = height || 0;
}
diff --git a/src/pixi/display/DisplayObject.js b/src/pixi/display/DisplayObject.js
index 4cc10273..2a8f6d86 100644
--- a/src/pixi/display/DisplayObject.js
+++ b/src/pixi/display/DisplayObject.js
@@ -122,6 +122,8 @@ PIXI.DisplayObject = function()
*/
this._interactive = false;
+ this.defaultCursor = "pointer";
+
/**
* [read-only] Current transform of the object based on world (parent) factors
*
@@ -368,6 +370,12 @@ Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', {
*/
PIXI.DisplayObject.prototype.addFilter = function(data)
{
+ //if(this.filter)return;
+ //this.filter = true;
+// data[0].target = this;
+
+console.log('addFilter');
+console.log(data);
// insert a filter block..
// TODO Onject pool thease bad boys..
@@ -386,6 +394,8 @@ PIXI.DisplayObject.prototype.addFilter = function(data)
start.open = true;
start.target = this;
+
+console.log('start', start);
/*
* insert start
@@ -455,6 +465,7 @@ PIXI.DisplayObject.prototype.addFilter = function(data)
// if webGL...
if(this.__renderGroup)
{
+ console.log('__renderGroup');
this.__renderGroup.addFilterBlocks(start, end);
}
@@ -470,13 +481,20 @@ PIXI.DisplayObject.prototype.removeFilter = function(data)
{
//if(!this.filter)return;
//this.filter = false;
- console.log("YUOIO")
+ // console.log("YUOIO")
// modify the list..
+
+console.log('DisplayObject removeFilter');
+console.log(data);
+
var startBlock = data.start;
+console.log('start', startBlock);
var nextObject = startBlock._iNext;
var previousObject = startBlock._iPrev;
+
+
if(nextObject)nextObject._iPrev = previousObject;
if(previousObject)previousObject._iNext = nextObject;
diff --git a/src/pixi/display/DisplayObjectContainer.js b/src/pixi/display/DisplayObjectContainer.js
index 04a4df59..bb972f43 100644
--- a/src/pixi/display/DisplayObjectContainer.js
+++ b/src/pixi/display/DisplayObjectContainer.js
@@ -166,7 +166,7 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
updateLast = updateLast.parent;
}
}
- else if(index === 0)
+ else if(index == 0)
{
previousObject = this;
}
@@ -295,14 +295,17 @@ PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
if(this.last == childLast)
{
+
var tempLast = childFirst._iPrev;
// need to make sure the parents last is updated too
var updateLast = this;
- while(updateLast.last == childLast.last)
+
+ while(updateLast.last == childLast)
{
updateLast.last = tempLast;
updateLast = updateLast.parent;
if(!updateLast)break;
+
}
}
diff --git a/src/pixi/display/Sprite.js b/src/pixi/display/Sprite.js
index bb36f1b1..e567c795 100644
--- a/src/pixi/display/Sprite.js
+++ b/src/pixi/display/Sprite.js
@@ -26,9 +26,9 @@ PIXI.Sprite = function(texture)
* Setting than anchor to 0.5,0.5 means the textures origin is centered
* Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
*
- * @property anchor
- * @type Point
- */
+ * @property anchor
+ * @type Point
+ */
this.anchor = new PIXI.Point();
/**
diff --git a/src/pixi/extras/Spine.js b/src/pixi/extras/Spine.js
index 2249dda5..27995ae6 100644
--- a/src/pixi/extras/Spine.js
+++ b/src/pixi/extras/Spine.js
@@ -296,7 +296,7 @@ spine.Animation.prototype = {
spine.binarySearch = function (values, target, step) {
var low = 0;
var high = Math.floor(values.length / step) - 2;
- if (high === 0) return step;
+ if (high == 0) return step;
var current = high >>> 1;
while (true) {
if (values[(current + 1) * step] <= target)
@@ -368,7 +368,7 @@ spine.Curves.prototype = {
var lastY = y - dfy;
return lastY + (y - lastY) * (percent - lastX) / (x - lastX);
}
- if (i === 0) break;
+ if (i == 0) break;
i--;
dfx += ddfx;
dfy += ddfy;
@@ -711,7 +711,7 @@ spine.Skeleton.prototype = {
},
/** @return May return null. */
getRootBone: function () {
- return this.bones.length === 0 ? null : this.bones[0];
+ return this.bones.length == 0 ? null : this.bones[0];
},
/** @return May be null. */
findBone: function (boneName) {
@@ -983,7 +983,7 @@ spine.AnimationState.prototype = {
entry.loop = loop;
if (!delay || delay <= 0) {
- var previousAnimation = this.queue.length === 0 ? this.current : this.queue[this.queue.length - 1].animation;
+ var previousAnimation = this.queue.length == 0 ? this.current : this.queue[this.queue.length - 1].animation;
if (previousAnimation != null)
delay = previousAnimation.duration - this.data.getMix(previousAnimation, animation) + (delay || 0);
else
@@ -1232,7 +1232,7 @@ spine.Atlas = function (atlasText, textureLoader) {
var line = reader.readLine();
if (line == null) break;
line = reader.trim(line);
- if (line.length === 0)
+ if (line.length == 0)
page = null;
else if (!page) {
page = new spine.AtlasPage();
@@ -1421,7 +1421,7 @@ spine.AtlasReader.prototype = {
for (; i < 3; i++) {
var comma = line.indexOf(",", lastMatch);
if (comma == -1) {
- if (i === 0) throw "Invalid line: " + line;
+ if (i == 0) throw "Invalid line: " + line;
break;
}
tuple[i] = this.trim(line.substr(lastMatch, comma - lastMatch));
diff --git a/src/pixi/filters/CrossHatchFilter.js b/src/pixi/filters/CrossHatchFilter.js
index b5009114..2d26715e 100644
--- a/src/pixi/filters/CrossHatchFilter.js
+++ b/src/pixi/filters/CrossHatchFilter.js
@@ -29,25 +29,25 @@ PIXI.CrossHatchFilter = function()
" gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);",
" ",
" if (lum < 1.00) {",
- " if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) === 0.0) {",
+ " if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) {",
" gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);",
" }",
" }",
" ",
" if (lum < 0.75) {",
- " if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) === 0.0) {",
+ " if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) {",
" gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);",
" }",
" }",
" ",
" if (lum < 0.50) {",
- " if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) === 0.0) {",
+ " if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0) {",
" gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);",
" }",
" }",
" ",
" if (lum < 0.3) {",
- " if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) === 0.0) {",
+ " if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0) {",
" gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);",
" }",
" }",
diff --git a/src/pixi/loaders/AssetLoader.js b/src/pixi/loaders/AssetLoader.js
index d984d889..57c4e8ab 100644
--- a/src/pixi/loaders/AssetLoader.js
+++ b/src/pixi/loaders/AssetLoader.js
@@ -24,26 +24,26 @@ PIXI.AssetLoader = function(assetURLs, crossorigin)
/**
* The array of asset URLs that are going to be loaded
- *
+ *
* @property assetURLs
* @type Array
*/
this.assetURLs = assetURLs;
/**
- * Whether the requests should be treated as cross origin
- *
- * @property crossorigin
- * @type Boolean
- */
+ * Whether the requests should be treated as cross origin
+ *
+ * @property crossorigin
+ * @type Boolean
+ */
this.crossorigin = crossorigin;
/**
- * Maps file extension to loader types
- *
- * @property loadersByType
- * @type Object
- */
+ * Maps file extension to loader types
+ *
+ * @property loadersByType
+ * @type Object
+ */
this.loadersByType = {
"jpg": PIXI.ImageLoader,
"jpeg": PIXI.ImageLoader,
@@ -113,7 +113,7 @@ PIXI.AssetLoader.prototype.onAssetLoaded = function()
this.dispatchEvent({type: "onProgress", content: this});
if(this.onProgress) this.onProgress();
- if(this.loadCount === 0)
+ if(this.loadCount == 0)
{
this.dispatchEvent({type: "onComplete", content: this});
if(this.onComplete) this.onComplete();
diff --git a/src/pixi/loaders/BitmapFontLoader.js b/src/pixi/loaders/BitmapFontLoader.js
index f0b0aef9..ef050943 100644
--- a/src/pixi/loaders/BitmapFontLoader.js
+++ b/src/pixi/loaders/BitmapFontLoader.js
@@ -17,43 +17,43 @@
PIXI.BitmapFontLoader = function(url, crossorigin)
{
/*
- * i use texture packer to load the assets..
- * http://www.codeandweb.com/texturepacker
- * make sure to set the format as "JSON"
- */
+ * i use texture packer to load the assets..
+ * http://www.codeandweb.com/texturepacker
+ * make sure to set the format as "JSON"
+ */
PIXI.EventTarget.call(this);
/**
- * The url of the bitmap font data
- *
- * @property url
- * @type String
- */
+ * The url of the bitmap font data
+ *
+ * @property url
+ * @type String
+ */
this.url = url;
/**
- * Whether the requests should be treated as cross origin
- *
- * @property crossorigin
- * @type Boolean
- */
+ * Whether the requests should be treated as cross origin
+ *
+ * @property crossorigin
+ * @type Boolean
+ */
this.crossorigin = crossorigin;
/**
- * [read-only] The base url of the bitmap font data
- *
- * @property baseUrl
- * @type String
- * @readOnly
- */
+ * [read-only] The base url of the bitmap font data
+ *
+ * @property baseUrl
+ * @type String
+ * @readOnly
+ */
this.baseUrl = url.replace(/[^\/]*$/, "");
/**
- * [read-only] The texture of the bitmap font
- *
- * @property baseUrl
- * @type String
- */
+ * [read-only] The texture of the bitmap font
+ *
+ * @property baseUrl
+ * @type String
+ */
this.texture = null;
};
diff --git a/src/pixi/loaders/ImageLoader.js b/src/pixi/loaders/ImageLoader.js
index 2372b10c..d8a41374 100644
--- a/src/pixi/loaders/ImageLoader.js
+++ b/src/pixi/loaders/ImageLoader.js
@@ -18,18 +18,18 @@ PIXI.ImageLoader = function(url, crossorigin)
PIXI.EventTarget.call(this);
/**
- * The texture being loaded
- *
- * @property texture
- * @type Texture
- */
+ * The texture being loaded
+ *
+ * @property texture
+ * @type Texture
+ */
this.texture = PIXI.Texture.fromImage(url, crossorigin);
/**
- * if the image is loaded with loadFramedSpriteSheet
- * frames will contain the sprite sheet frames
- *
- */
+ * if the image is loaded with loadFramedSpriteSheet
+ * frames will contain the sprite sheet frames
+ *
+ */
this.frames = [];
};
diff --git a/src/pixi/loaders/SpriteSheetLoader.js b/src/pixi/loaders/SpriteSheetLoader.js
index 9490d57c..169fb70d 100644
--- a/src/pixi/loaders/SpriteSheetLoader.js
+++ b/src/pixi/loaders/SpriteSheetLoader.js
@@ -52,19 +52,19 @@ PIXI.SpriteSheetLoader = function (url, crossorigin) {
this.baseUrl = url.replace(/[^\/]*$/, "");
/**
- * The texture being loaded
- *
- * @property texture
- * @type Texture
- */
+ * The texture being loaded
+ *
+ * @property texture
+ * @type Texture
+ */
this.texture = null;
/**
- * The frames of the sprite sheet
- *
- * @property frames
- * @type Object
- */
+ * The frames of the sprite sheet
+ *
+ * @property frames
+ * @type Object
+ */
this.frames = {};
};
diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js
index c15d701a..8e8c3dd2 100644
--- a/src/pixi/primitives/Graphics.js
+++ b/src/pixi/primitives/Graphics.js
@@ -19,45 +19,45 @@ PIXI.Graphics = function()
this.renderable = true;
/**
- * The alpha of the fill of this graphics object
- *
- * @property fillAlpha
- * @type Number
- */
+ * The alpha of the fill of this graphics object
+ *
+ * @property fillAlpha
+ * @type Number
+ */
this.fillAlpha = 1;
/**
- * The width of any lines drawn
- *
- * @property lineWidth
- * @type Number
- */
+ * The width of any lines drawn
+ *
+ * @property lineWidth
+ * @type Number
+ */
this.lineWidth = 0;
/**
- * The color of any lines drawn
- *
- * @property lineColor
- * @type String
- */
+ * The color of any lines drawn
+ *
+ * @property lineColor
+ * @type String
+ */
this.lineColor = "black";
/**
- * Graphics data
- *
- * @property graphicsData
- * @type Array
- * @private
- */
+ * Graphics data
+ *
+ * @property graphicsData
+ * @type Array
+ * @private
+ */
this.graphicsData = [];
/**
- * Current path
- *
- * @property currentPath
- * @type Object
- * @private
- */
+ * Current path
+ *
+ * @property currentPath
+ * @type Object
+ * @private
+ */
this.currentPath = {points:[]};
}
@@ -75,7 +75,7 @@ PIXI.Graphics.prototype.constructor = PIXI.Graphics;
*/
PIXI.Graphics.prototype.lineStyle = function(lineWidth, color, alpha)
{
- if(this.currentPath.points.length === 0)this.graphicsData.pop();
+ if(this.currentPath.points.length == 0)this.graphicsData.pop();
this.lineWidth = lineWidth || 0;
this.lineColor = color || 0;
@@ -96,7 +96,7 @@ PIXI.Graphics.prototype.lineStyle = function(lineWidth, color, alpha)
*/
PIXI.Graphics.prototype.moveTo = function(x, y)
{
- if(this.currentPath.points.length === 0)this.graphicsData.pop();
+ if(this.currentPath.points.length == 0)this.graphicsData.pop();
this.currentPath = this.currentPath = {lineWidth:this.lineWidth, lineColor:this.lineColor, lineAlpha:this.lineAlpha,
fillColor:this.fillColor, fillAlpha:this.fillAlpha, fill:this.filling, points:[], type:PIXI.Graphics.POLY};
@@ -157,7 +157,7 @@ PIXI.Graphics.prototype.endFill = function()
*/
PIXI.Graphics.prototype.drawRect = function( x, y, width, height )
{
- if(this.currentPath.points.length === 0)this.graphicsData.pop();
+ if(this.currentPath.points.length == 0)this.graphicsData.pop();
this.currentPath = {lineWidth:this.lineWidth, lineColor:this.lineColor, lineAlpha:this.lineAlpha,
fillColor:this.fillColor, fillAlpha:this.fillAlpha, fill:this.filling,
@@ -177,7 +177,7 @@ PIXI.Graphics.prototype.drawRect = function( x, y, width, height )
*/
PIXI.Graphics.prototype.drawCircle = function( x, y, radius)
{
- if(this.currentPath.points.length === 0)this.graphicsData.pop();
+ if(this.currentPath.points.length == 0)this.graphicsData.pop();
this.currentPath = {lineWidth:this.lineWidth, lineColor:this.lineColor, lineAlpha:this.lineAlpha,
fillColor:this.fillColor, fillAlpha:this.fillAlpha, fill:this.filling,
@@ -198,7 +198,7 @@ PIXI.Graphics.prototype.drawCircle = function( x, y, radius)
*/
PIXI.Graphics.prototype.drawElipse = function( x, y, width, height)
{
- if(this.currentPath.points.length === 0)this.graphicsData.pop();
+ if(this.currentPath.points.length == 0)this.graphicsData.pop();
this.currentPath = {lineWidth:this.lineWidth, lineColor:this.lineColor, lineAlpha:this.lineAlpha,
fillColor:this.fillColor, fillAlpha:this.fillAlpha, fill:this.filling,
diff --git a/src/pixi/renderers/webgl/PixiShader.js b/src/pixi/renderers/webgl/PixiShader.js
index 3b4ceb98..f7fbf850 100644
--- a/src/pixi/renderers/webgl/PixiShader.js
+++ b/src/pixi/renderers/webgl/PixiShader.js
@@ -226,6 +226,7 @@ PIXI.PixiShader.prototype.syncUniforms = function()
// This would probably be faster in an array and it would guarantee key order
for (var key in this.uniforms)
{
+
uniform = this.uniforms[key];
if (uniform.glValueLength == 1)
diff --git a/src/pixi/renderers/webgl/WebGLBatch.js b/src/pixi/renderers/webgl/WebGLBatch.js
index 32f82946..fa09fc43 100644
--- a/src/pixi/renderers/webgl/WebGLBatch.js
+++ b/src/pixi/renderers/webgl/WebGLBatch.js
@@ -9,7 +9,7 @@ PIXI._batchs = [];
*/
PIXI._getBatch = function(gl)
{
- if(PIXI._batchs.length === 0)
+ if(PIXI._batchs.length == 0)
{
return new PIXI.WebGLBatch(gl);
}
@@ -189,7 +189,7 @@ PIXI.WebGLBatch.prototype.remove = function(sprite)
{
this.size--;
- if(this.size === 0)
+ if(this.size == 0)
{
sprite.batch = null;
sprite.__prev = null;
@@ -522,7 +522,7 @@ PIXI.WebGLBatch.prototype.render = function(start, end)
this.dirty = false;
}
- if (this.size === 0)return;
+ if (this.size == 0)return;
this.update();
var gl = this.gl;
diff --git a/src/pixi/renderers/webgl/WebGLFilterManager.js b/src/pixi/renderers/webgl/WebGLFilterManager.js
index f3e9027c..a98afb45 100644
--- a/src/pixi/renderers/webgl/WebGLFilterManager.js
+++ b/src/pixi/renderers/webgl/WebGLFilterManager.js
@@ -45,8 +45,15 @@ PIXI.WebGLFilterManager.prototype.pushFilter = function(filterBlock)
var texture = this.texturePool.pop();
- if(!texture)texture = new PIXI.FilterTexture(this.width, this.height);
-
+ if(!texture)
+ {
+ texture = new PIXI.FilterTexture(this.width, this.height);
+ }
+ else
+ {
+ texture.resize(this.width, this.height);
+ }
+
gl.bindTexture(gl.TEXTURE_2D, texture.texture);
this.getBounds(filterBlock.target);
@@ -508,6 +515,8 @@ PIXI.FilterTexture = function(width, height)
PIXI.FilterTexture.prototype.resize = function(width, height)
{
+ if(this.width == width && this.height == height)return;
+
this.width = width;
this.height = height;
diff --git a/src/pixi/renderers/webgl/WebGLGraphics.js b/src/pixi/renderers/webgl/WebGLGraphics.js
index 2c4a1284..1d949853 100644
--- a/src/pixi/renderers/webgl/WebGLGraphics.js
+++ b/src/pixi/renderers/webgl/WebGLGraphics.js
@@ -280,7 +280,7 @@ PIXI.WebGLGraphics.buildLine = function(graphicsData, webGLData)
var wrap = true;
var points = graphicsData.points;
- if(points.length === 0)return;
+ if(points.length == 0)return;
// if the line width is an odd number add 0.5 to align to a whole pixel
if(graphicsData.lineWidth%2)
diff --git a/src/pixi/renderers/webgl/WebGLRenderGroup.js b/src/pixi/renderers/webgl/WebGLRenderGroup.js
index 83ecf45f..7a52a9f2 100644
--- a/src/pixi/renderers/webgl/WebGLRenderGroup.js
+++ b/src/pixi/renderers/webgl/WebGLRenderGroup.js
@@ -25,7 +25,7 @@ PIXI.WebGLRenderGroup = function(gl, transparent)
this.batchs = [];
this.toRemove = [];
- // console.log(this.transparent)
+ console.log(this.transparent)
this.filterManager = new PIXI.WebGLFilterManager(this.transparent);
}
@@ -775,7 +775,7 @@ PIXI.WebGLRenderGroup.prototype.removeObject = function(displayObject)
// ok so.. check to see if you adjacent batchs should be joined.
// TODO may optimise?
- if(index === 0 || index == this.batchs.length-1)
+ if(index == 0 || index == this.batchs.length-1)
{
// wha - eva! just get of the empty batch!
this.batchs.splice(index, 1);
@@ -848,7 +848,7 @@ PIXI.WebGLRenderGroup.prototype.initTilingSprite = function(sprite)
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, sprite._indexBuffer);
gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, sprite.indices, gl.STATIC_DRAW);
-// return ( (x > 0) && ((x & (x - 1)) === 0) );
+// return ( (x > 0) && ((x & (x - 1)) == 0) );
if(sprite.texture.baseTexture._glTexture)
{
diff --git a/src/pixi/renderers/webgl/WebGLRenderer.js b/src/pixi/renderers/webgl/WebGLRenderer.js
index 9cdff41c..e11cd44f 100644
--- a/src/pixi/renderers/webgl/WebGLRenderer.js
+++ b/src/pixi/renderers/webgl/WebGLRenderer.js
@@ -111,7 +111,7 @@ PIXI.WebGLRenderer.prototype.constructor = PIXI.WebGLRenderer;
*/
PIXI.WebGLRenderer.getBatch = function()
{
- if(PIXI._batchs.length === 0)
+ if(PIXI._batchs.length == 0)
{
return new PIXI.WebGLBatch(PIXI.WebGLRenderer.gl);
}
diff --git a/src/pixi/textures/BaseTexture.js b/src/pixi/textures/BaseTexture.js
index 22ac5a03..e58bc116 100644
--- a/src/pixi/textures/BaseTexture.js
+++ b/src/pixi/textures/BaseTexture.js
@@ -111,6 +111,19 @@ PIXI.BaseTexture.prototype.destroy = function()
PIXI.texturesToDestroy.push(this);
}
+/**
+ *
+ *
+ * @method destroy
+ */
+
+PIXI.BaseTexture.prototype.updateSourceImage = function(newSrc)
+{
+ this.hasLoaded = false;
+ this.source.src = null;
+ this.source.src = newSrc;
+}
+
/**
* Helper function that returns a base texture based on an image url
* If the image is not in the base texture cache it will be created and loaded
diff --git a/src/pixi/textures/Texture.js b/src/pixi/textures/Texture.js
index 6ac48717..11d82a0b 100644
--- a/src/pixi/textures/Texture.js
+++ b/src/pixi/textures/Texture.js
@@ -115,8 +115,7 @@ PIXI.Texture.prototype.setFrame = function(frame)
if(frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)
{
- console.log(frame);
- throw new Error("Texture Error: frame does not fit inside the base Texture dimensions ", frame);
+ throw new Error("Texture Error: frame does not fit inside the base Texture dimensions " + this);
}
this.updateFrame = true;