Merge branch 'dev'
This commit is contained in:
commit
39161a2ce4
14 changed files with 103 additions and 67 deletions
14
.travis.yml
14
.travis.yml
|
@ -8,10 +8,16 @@ branches:
|
|||
- dev
|
||||
|
||||
install:
|
||||
- npm install -g grunt-cli
|
||||
- export DISPLAY=:99.0
|
||||
- sh -e /etc/init.d/xvfb start
|
||||
- npm install grunt-cli
|
||||
- npm install
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
|
||||
before_script:
|
||||
- export DISPLAY=:99.0
|
||||
- sh -e /etc/init.d/xvfb start
|
||||
|
||||
script:
|
||||
- grunt travis
|
||||
- ./node_modules/.bin/grunt travis
|
13
Gruntfile.js
13
Gruntfile.js
|
@ -103,7 +103,8 @@ module.exports = function(grunt) {
|
|||
},
|
||||
files: {
|
||||
srcBlob: '<%= dirs.src %>/**/*.js',
|
||||
testBlob: '<%= dirs.test %>/{functional,lib/pixi,unit/pixi}/**/*.js',
|
||||
testBlob: '<%= dirs.test %>/**/*.js',
|
||||
testConf: '<%= dirs.test %>/karma.conf.js',
|
||||
build: '<%= dirs.build %>/pixi.dev.js',
|
||||
buildMin: '<%= dirs.build %>/pixi.js'
|
||||
},
|
||||
|
@ -131,10 +132,16 @@ module.exports = function(grunt) {
|
|||
options: {
|
||||
jshintrc: './.jshintrc'
|
||||
},
|
||||
source: srcFiles.filter(function(v) { return v.match(/(Intro|Outro|Spine|Pixi)\.js$/) === null; }).concat('Gruntfile.js'),
|
||||
source: {
|
||||
src: srcFiles.concat('Gruntfile.js'),
|
||||
options: {
|
||||
ignores: '<%= dirs.src %>/**/{Intro,Outro,Spine,Pixi}.js'
|
||||
}
|
||||
},
|
||||
test: {
|
||||
src: ['<%= files.testBlob %>'],
|
||||
options: {
|
||||
ignores: '<%= dirs.test %>/lib/resemble.js',
|
||||
jshintrc: undefined, //don't use jshintrc for tests
|
||||
expr: true,
|
||||
undef: false,
|
||||
|
@ -184,7 +191,7 @@ module.exports = function(grunt) {
|
|||
},
|
||||
karma: {
|
||||
unit: {
|
||||
configFile: 'test/karma.conf.js',
|
||||
configFile: '<%= files.testConf %>',
|
||||
// browsers: ['Chrome'],
|
||||
singleRun: true
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (c) 2012, Mat Groves
|
||||
* http://goodboydigital.com/
|
||||
*
|
||||
* Compiled: 2014-01-10
|
||||
* Compiled: 2014-01-15
|
||||
*
|
||||
* pixi.js is licensed under the MIT License.
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
|
@ -1121,8 +1121,6 @@ PIXI.DisplayObject.prototype.updateTransform = function()
|
|||
// because we are using affine transformation, we can optimise the matrix concatenation process.. wooo!
|
||||
// mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
|
||||
this.worldAlpha = this.alpha * this.parent.worldAlpha;
|
||||
|
||||
this.vcount = PIXI.visibleCount;
|
||||
};
|
||||
|
||||
PIXI.DisplayObject.prototype.getBounds = function()
|
||||
|
@ -1167,7 +1165,6 @@ PIXI.DisplayObject.prototype._renderCanvas = function(renderSession)
|
|||
|
||||
PIXI.EmptyRectangle = new PIXI.Rectangle(0,0,0,0);
|
||||
|
||||
PIXI.visibleCount = 0;
|
||||
|
||||
/**
|
||||
* @author Mat Groves http://matgroves.com/ @Doormat23
|
||||
|
@ -1246,17 +1243,18 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', {
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
||||
{
|
||||
if(child.parent && child.parent !== this)
|
||||
if(child.parent && child !== this)
|
||||
{
|
||||
//// COULD BE THIS???
|
||||
child.parent.removeChild(child);
|
||||
// return;
|
||||
}
|
||||
|
||||
// console.log("ADDING")
|
||||
child.parent = this;
|
||||
|
||||
this.children.push(child);
|
||||
|
||||
// console.log( this.children.length);
|
||||
// update the stage refference..
|
||||
|
||||
if(this.stage)child.setStageReference(this.stage);
|
||||
|
@ -3396,7 +3394,6 @@ PIXI.Stage.prototype.setInteractionDelegate = function(domElement)
|
|||
PIXI.Stage.prototype.updateTransform = function()
|
||||
{
|
||||
this.worldAlpha = 1;
|
||||
this.vcount = PIXI.visibleCount;
|
||||
|
||||
for(var i=0,j=this.children.length; i<j; i++)
|
||||
{
|
||||
|
@ -6529,9 +6526,9 @@ PIXI.CanvasTinter.roundColor = function(color)
|
|||
|
||||
var rgbValues = PIXI.hex2rgb(color);
|
||||
|
||||
rgbValues[0] = Math.round(rgbValues[0] * step) / step;
|
||||
rgbValues[1] = Math.round(rgbValues[1] * step) / step;
|
||||
rgbValues[2] = Math.round(rgbValues[2] * step) / step;
|
||||
rgbValues[0] = Math.min(255, Math.round(rgbValues[0] / step) * step);
|
||||
rgbValues[1] = Math.min(255, Math.round(rgbValues[1] / step) * step);
|
||||
rgbValues[2] = Math.min(255, Math.round(rgbValues[2] / step) * step);
|
||||
|
||||
return PIXI.rgb2hex(rgbValues);
|
||||
};
|
||||
|
@ -6670,7 +6667,6 @@ PIXI.CanvasRenderer.prototype.render = function(stage)
|
|||
PIXI.texturesToUpdate.length = 0;
|
||||
PIXI.texturesToDestroy.length = 0;
|
||||
|
||||
PIXI.visibleCount++;
|
||||
stage.updateTransform();
|
||||
|
||||
// update the background color
|
||||
|
@ -7419,6 +7415,20 @@ PIXI.Graphics.prototype._renderWebGL = function(renderSession)
|
|||
|
||||
PIXI.WebGLGraphics.renderGraphics(this, renderSession);
|
||||
|
||||
// only rende rif it has children!
|
||||
if(this.children.length)
|
||||
{
|
||||
renderSession.spriteBatch.start();
|
||||
|
||||
// simple render children!
|
||||
for(var i=0, j=this.children.length; i<j; i++)
|
||||
{
|
||||
this.children[i]._renderWebGL(renderSession);
|
||||
}
|
||||
|
||||
renderSession.spriteBatch.stop();
|
||||
}
|
||||
|
||||
if(this._filters)renderSession.filterManager.popFilter();
|
||||
if(this._mask)renderSession.maskManager.popMask(renderSession);
|
||||
|
||||
|
@ -7444,6 +7454,12 @@ PIXI.Graphics.prototype._renderCanvas = function(renderSession)
|
|||
|
||||
context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5]);
|
||||
PIXI.CanvasGraphics.renderGraphics(this, context);
|
||||
|
||||
// simple render children!
|
||||
for(var i=0, j=this.children.length; i<j; i++)
|
||||
{
|
||||
this.children[i]._renderCanvas(renderSession);
|
||||
}
|
||||
};
|
||||
|
||||
PIXI.Graphics.prototype.getBounds = function()
|
||||
|
@ -10226,9 +10242,6 @@ PIXI.RenderTexture.prototype.renderWebGL = function(displayObject, position, cle
|
|||
displayObject.worldTransform[5] -= position.y;
|
||||
}
|
||||
|
||||
PIXI.visibleCount++;
|
||||
displayObject.vcount = PIXI.visibleCount;
|
||||
|
||||
for(var i=0,j=children.length; i<j; i++)
|
||||
{
|
||||
children[i].updateTransform();
|
||||
|
|
10
bin/pixi.js
10
bin/pixi.js
File diff suppressed because one or more lines are too long
|
@ -28,7 +28,7 @@
|
|||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"grunt": "~0.4.1",
|
||||
"grunt-contrib-jshint": "git+https://github.com/englercj/grunt-contrib-jshint.git",
|
||||
"grunt-contrib-jshint": "~0.8",
|
||||
"grunt-contrib-uglify": "~0.2",
|
||||
"grunt-contrib-connect": "~0.5",
|
||||
"grunt-contrib-yuidoc": "~0.5",
|
||||
|
@ -37,7 +37,9 @@
|
|||
"mocha": "~1.15",
|
||||
"chai": "~1.8",
|
||||
"karma": "~0.10",
|
||||
"karma-chrome-launcher": "~0.1",
|
||||
"karma-firefox-launcher": "~0.1",
|
||||
"karma-mocha": "~0.1"
|
||||
"karma-mocha": "~0.1",
|
||||
"karma-spec-reporter": "~0.0.6"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -422,8 +422,6 @@ PIXI.DisplayObject.prototype.updateTransform = function()
|
|||
// because we are using affine transformation, we can optimise the matrix concatenation process.. wooo!
|
||||
// mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
|
||||
this.worldAlpha = this.alpha * this.parent.worldAlpha;
|
||||
|
||||
this.vcount = PIXI.visibleCount;
|
||||
};
|
||||
|
||||
PIXI.DisplayObject.prototype.getBounds = function()
|
||||
|
@ -468,4 +466,3 @@ PIXI.DisplayObject.prototype._renderCanvas = function(renderSession)
|
|||
|
||||
PIXI.EmptyRectangle = new PIXI.Rectangle(0,0,0,0);
|
||||
|
||||
PIXI.visibleCount = 0;
|
||||
|
|
|
@ -75,7 +75,7 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', {
|
|||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.addChild = function(child)
|
||||
{
|
||||
if(child.parent && child.parent !== this)
|
||||
if(child.parent && child !== this)
|
||||
{
|
||||
//// COULD BE THIS???
|
||||
child.parent.removeChild(child);
|
||||
|
|
|
@ -84,7 +84,6 @@ PIXI.Stage.prototype.setInteractionDelegate = function(domElement)
|
|||
PIXI.Stage.prototype.updateTransform = function()
|
||||
{
|
||||
this.worldAlpha = 1;
|
||||
this.vcount = PIXI.visibleCount;
|
||||
|
||||
for(var i=0,j=this.children.length; i<j; i++)
|
||||
{
|
||||
|
|
|
@ -331,6 +331,20 @@ PIXI.Graphics.prototype._renderWebGL = function(renderSession)
|
|||
|
||||
PIXI.WebGLGraphics.renderGraphics(this, renderSession);
|
||||
|
||||
// only rende rif it has children!
|
||||
if(this.children.length)
|
||||
{
|
||||
renderSession.spriteBatch.start();
|
||||
|
||||
// simple render children!
|
||||
for(var i=0, j=this.children.length; i<j; i++)
|
||||
{
|
||||
this.children[i]._renderWebGL(renderSession);
|
||||
}
|
||||
|
||||
renderSession.spriteBatch.stop();
|
||||
}
|
||||
|
||||
if(this._filters)renderSession.filterManager.popFilter();
|
||||
if(this._mask)renderSession.maskManager.popMask(renderSession);
|
||||
|
||||
|
@ -356,6 +370,12 @@ PIXI.Graphics.prototype._renderCanvas = function(renderSession)
|
|||
|
||||
context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5]);
|
||||
PIXI.CanvasGraphics.renderGraphics(this, context);
|
||||
|
||||
// simple render children!
|
||||
for(var i=0, j=this.children.length; i<j; i++)
|
||||
{
|
||||
this.children[i]._renderCanvas(renderSession);
|
||||
}
|
||||
};
|
||||
|
||||
PIXI.Graphics.prototype.getBounds = function()
|
||||
|
|
|
@ -123,7 +123,6 @@ PIXI.CanvasRenderer.prototype.render = function(stage)
|
|||
PIXI.texturesToUpdate.length = 0;
|
||||
PIXI.texturesToDestroy.length = 0;
|
||||
|
||||
PIXI.visibleCount++;
|
||||
stage.updateTransform();
|
||||
|
||||
// update the background color
|
||||
|
|
|
@ -171,9 +171,9 @@ PIXI.CanvasTinter.roundColor = function(color)
|
|||
|
||||
var rgbValues = PIXI.hex2rgb(color);
|
||||
|
||||
rgbValues[0] = Math.round(rgbValues[0] * step) / step;
|
||||
rgbValues[1] = Math.round(rgbValues[1] * step) / step;
|
||||
rgbValues[2] = Math.round(rgbValues[2] * step) / step;
|
||||
rgbValues[0] = Math.min(255, Math.round(rgbValues[0] / step) * step);
|
||||
rgbValues[1] = Math.min(255, Math.round(rgbValues[1] / step) * step);
|
||||
rgbValues[2] = Math.min(255, Math.round(rgbValues[2] / step) * step);
|
||||
|
||||
return PIXI.rgb2hex(rgbValues);
|
||||
};
|
||||
|
|
|
@ -135,9 +135,6 @@ PIXI.RenderTexture.prototype.renderWebGL = function(displayObject, position, cle
|
|||
displayObject.worldTransform[5] -= position.y;
|
||||
}
|
||||
|
||||
PIXI.visibleCount++;
|
||||
displayObject.vcount = PIXI.visibleCount;
|
||||
|
||||
for(var i=0,j=children.length; i<j; i++)
|
||||
{
|
||||
children[i].updateTransform();
|
||||
|
|
|
@ -1,27 +1,22 @@
|
|||
'use strict';
|
||||
|
||||
var path = require('path');
|
||||
var server = require('karma').server;
|
||||
|
||||
module.exports = function (grunt) {
|
||||
grunt.registerMultiTask('karma', 'run karma.', function() {
|
||||
var done = this.async();
|
||||
var options = this.options({
|
||||
background: false
|
||||
});
|
||||
var data = this.data;
|
||||
'use strict';
|
||||
|
||||
//merge options onto data, with data taking precedence
|
||||
data = grunt.util._.merge(options, data);
|
||||
data.configFile = path.resolve(data.configFile);
|
||||
if (data.configFile) {
|
||||
data.configFile = grunt.template.process(data.configFile);
|
||||
var path = require('path');
|
||||
var server = require('karma').server;
|
||||
|
||||
grunt.registerMultiTask('karma', 'run karma.', function(target) {
|
||||
//merge data onto options, with data taking precedence
|
||||
var options = grunt.util._.merge(this.options(), this.data),
|
||||
done = this.async();
|
||||
|
||||
if (options.configFile) {
|
||||
options.configFile = grunt.template.process(options.configFile);
|
||||
options.configFile = path.resolve(options.configFile);
|
||||
}
|
||||
|
||||
server.start(
|
||||
data,
|
||||
function(code) {
|
||||
done(!code);
|
||||
});
|
||||
done = this.async();
|
||||
server.start(options, function(code) {
|
||||
done(!code);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
|
@ -17,12 +17,12 @@ module.exports = function(config) {
|
|||
],
|
||||
|
||||
// list of files to exclude
|
||||
exclude : [],
|
||||
//exclude : [],
|
||||
|
||||
// use dolts reporter, as travis terminal does not support escaping sequences
|
||||
// possible values: 'dots', 'progress', 'junit', 'teamcity'
|
||||
// CLI --reporters progress
|
||||
reporters : ['progress'],
|
||||
reporters : ['spec'],
|
||||
|
||||
// web server port
|
||||
// CLI --port 9876
|
||||
|
@ -39,7 +39,7 @@ module.exports = function(config) {
|
|||
// level of logging
|
||||
// possible values: karma.LOG_DISABLE || karma.LOG_ERROR || karma.LOG_WARN || karma.LOG_INFO || karma.LOG_DEBUG
|
||||
// CLI --log-level debug
|
||||
logLevel : config.LOG_DEBUG,
|
||||
logLevel : config.LOG_INFO,
|
||||
|
||||
// enable / disable watching file and executing tests whenever any file changes
|
||||
// CLI --auto-watch --no-auto-watch
|
||||
|
@ -69,14 +69,15 @@ module.exports = function(config) {
|
|||
reportSlowerThan : 500,
|
||||
|
||||
preprocessors : {
|
||||
// '**/client/js/*.js': 'coverage'
|
||||
// '**/client/js/*.js': 'coverage'
|
||||
},
|
||||
|
||||
plugins : [
|
||||
'karma-mocha',
|
||||
// 'karma-chrome-launcher',
|
||||
'karma-chrome-launcher',
|
||||
'karma-firefox-launcher',
|
||||
'karma-mocha',
|
||||
// 'karma-phantomjs-launcher'
|
||||
'karma-spec-reporter'
|
||||
]
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue