Skip to content

Commit

Permalink
current deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
hanbollar committed Apr 12, 2018
1 parent b2d3285 commit 603640c
Show file tree
Hide file tree
Showing 7 changed files with 158 additions and 177 deletions.
12 changes: 6 additions & 6 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ Change Log
* Fixed glTF support to handle skinned meshes when no skin is supplied. [#6061](https://github.com/AnalyticalGraphicsInc/cesium/issues/6061)
* Allow loadWithXhr to work with string URLs in a web worker.
* Fix Firefox WebGL console warnings. [#5912](https://github.com/AnalyticalGraphicsInc/cesium/issues/5912)

##### Deprecated :hourglass_flowing_sand:
* `Particle.size`, `ParticleSystem.rate`, `ParticleSystem.lifeTime` have been renamed to `Particle.imageSize`, `ParticleSystem.emissionRate`, and `ParticleSystem.lifetime`. Use of the `size`, `rate`, and `lifeTime` parameters is deprecated and will be removed in Cesium 1.46.
* `ParticleSystem.life`, `ParticleSystem.minimumLife`, and `ParticleSystem.maximumLife` have been renamed to `ParticleSystem.particleLife`, `ParticleSystem.minimumParticleLife`, and `ParticleSystem.maximumParticleLife`. Use of the `life`, `minimumLife`, and `maximumLife` parameters is deprecated and will be removed in Cesium 1.46.
* `ParticleSystem.forces` array has been switched out for singular function `ParticleSystems.updateCallback`. Use of the `forces` parameter is deprecated and will be removed in Cesium 1.46.
* Any width and height variables in `ParticleSystem` will no longer be individual components. `ParticleSystem.minimumWidth` and `ParticleSystem.minimumHeight` will now be `ParticleSystem.minimumImageSize`, `ParticleSystem.maximumWidth` and `ParticleSystem.maximumHeight` will now be `ParticleSystem.maximumImageSize`, and `ParticleSystem.width` and `ParticleSystem.height` will now be `ParticleSystem.imageSize`. Use of the `minimumWidth`, `minimumHeight`, `maximumWidth`, `maximumHeight`, `width`, and `height` parameters is deprecated and will be removed in Cesium 1.46.
* Fix parsing Cesium.js in older browsers that do not support all TypedArray types. [#6396](https://github.com/AnalyticalGraphicsInc/cesium/pull/6396)

##### Additions :tada:
* Added color and scale attributes to the `ParticleSystem` class constructor. When defined the variables override startColor and endColor and startScale and endScale. [#6429](https://github.com/AnalyticalGraphicsInc/cesium/pull/6429)
* Improved `MapboxImageryProvider` performance by 300% via `tiles.mapbox.com` subdomain switching. [#6426](https://github.com/AnalyticalGraphicsInc/cesium/issues/6426)

##### Deprecated :hourglass_flowing_sand:
* `Particle.size`, `ParticleSystem.rate`, `ParticleSystem.lifeTime`, `ParticleSystem.life`, `ParticleSystem.minimumLife`, and `ParticleSystem.maximumLife` have been renamed to `Particle.imageSize`, `ParticleSystem.emissionRate`, `ParticleSystem.lifetime`, `ParticleSystem.particleLife`, `ParticleSystem.minimumParticleLife`, and `ParticleSystem.maximumParticleLife`. Use of the `size`, `rate`, `lifeTime`, `life`, `minimumLife`, and `maximumLife` parameters is deprecated and will be removed in Cesium 1.46.
* `ParticleSystem.forces` array has been switched out for singular function `ParticleSystems.updateCallback`. Use of the `forces` parameter is deprecated and will be removed in Cesium 1.46.
* Any width and height variables in `ParticleSystem` will no longer be individual components. `ParticleSystem.minimumWidth` and `ParticleSystem.minimumHeight` will now be `ParticleSystem.minimumImageSize`, `ParticleSystem.maximumWidth` and `ParticleSystem.maximumHeight` will now be `ParticleSystem.maximumImageSize`, and `ParticleSystem.width` and `ParticleSystem.height` will now be `ParticleSystem.imageSize`. Use of the `minimumWidth`, `minimumHeight`, `maximumWidth`, `maximumHeight`, `width`, and `height` parameters is deprecated and will be removed in Cesium 1.46.

### 1.44 - 2018-04-02

##### Highlights :sparkler:
Expand Down
17 changes: 16 additions & 1 deletion Source/Core/FeatureDetection.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ define([
defined,
Fullscreen) {
'use strict';
/*global CanvasPixelArray*/

var theNavigator;
if (typeof navigator !== 'undefined') {
Expand Down Expand Up @@ -196,6 +197,19 @@ define([
return supportsImageRenderingPixelated() ? imageRenderingValueResult : undefined;
}

var typedArrayTypes = [];
if (typeof ArrayBuffer !== 'undefined') {
typedArrayTypes.push(Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array);

if (typeof Uint8ClampedArray !== 'undefined') {
typedArrayTypes.push(Uint8ClampedArray);
}

if (typeof CanvasPixelArray !== 'undefined') {
typedArrayTypes.push(CanvasPixelArray);
}
}

/**
* A set of functions to detect whether the current browser supports
* various features.
Expand All @@ -219,7 +233,8 @@ define([
hardwareConcurrency : defaultValue(theNavigator.hardwareConcurrency, 3),
supportsPointerEvents : supportsPointerEvents,
supportsImageRenderingPixelated: supportsImageRenderingPixelated,
imageRenderingValue: imageRenderingValue
imageRenderingValue: imageRenderingValue,
typedArrayTypes: typedArrayTypes
};

/**
Expand Down
68 changes: 23 additions & 45 deletions Source/Core/arraySlice.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,17 @@ define([
FeatureDetection) {
'use strict';

var slice = function(array, begin, end) {
/**
* Create a shallow copy of an array from begin to end.
*
* @param {Array} array The array to fill.
* @param {Number} [begin=0] The index to start at.
* @param {Number} [end=array.length] The index to end at which is not included.
*
* @returns {Array} The resulting array.
* @private
*/
function arraySlice(array, begin, end) {
//>>includeStart('debug', pragmas.debug);
Check.defined('array', array);
if (defined(begin)) {
Expand All @@ -20,54 +30,22 @@ define([
Check.typeOf.number('end', end);
}
//>>includeEnd('debug');
return array.slice(begin, end);
};

if (FeatureDetection.supportsTypedArrays()) {
var tempArray = new Uint8Array(1);
if (typeof tempArray.slice !== 'function') {
var typedArrayTypes = [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array];
slice = function(array, begin, end) {
//>>includeStart('debug', pragmas.debug);
Check.defined('array', array);
if (defined(begin)) {
Check.typeOf.number('begin', begin);
}
if (defined(end)) {
Check.typeOf.number('end', end);
}
//>>includeEnd('debug');

if (typeof array.slice === 'function') {
return array.slice(begin, end);
}

var copy = Array.prototype.slice.call(array, begin, end);
var length = typedArrayTypes.length;
for (var i = 0; i < length; ++i) {
if (array instanceof typedArrayTypes[i]) {
copy = new typedArrayTypes[i](copy);
break;
}
}
if (typeof array.slice === 'function') {
return array.slice(begin, end);
}

return copy;
};
var copy = Array.prototype.slice.call(array, begin, end);
var typedArrayTypes = FeatureDetection.typedArrayTypes;
var length = typedArrayTypes.length;
for (var i = 0; i < length; ++i) {
if (array instanceof typedArrayTypes[i]) {
copy = new typedArrayTypes[i](copy);
break;
}
}
}

/**
* Create a shallow copy of an array from begin to end.
*
* @param {Array} array The array to fill.
* @param {Number} [begin=0] The index to start at.
* @param {Number} [end=array.length] The index to end at which is not included.
*
* @returns {Array} The resulting array.
* @private
*/
function arraySlice(array, begin, end) {
return slice(array, begin, end);
return copy;
}

return arraySlice;
Expand Down
4 changes: 2 additions & 2 deletions Source/Scene/Particle.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ define([
* @param {Number} [options.startScale=1.0] The scale of the particle when it is born.
* @param {Number} [options.endScale=1.0] The scale of the particle when it dies.
* @param {Cartesian2} [options.size=new Cartesian2(1.0, 1.0)] The dimensions of particles in pixels. This has been deprecated. Use imageSize instead.
* @param {Cartesian2} [options.imageSize=new Cartesian2(1.0, 1.0)] The dimensions of the image representing the particle in pixels. Width by Height.
* @param {Cartesian2} [options.imageSize=new Cartesian2(1.0, 1.0)] The dimensions, width by height, to scale the particle image in pixels.
*/
function Particle(options) {
options = defaultValue(options, defaultValue.EMPTY_OBJECT);
Expand Down Expand Up @@ -95,7 +95,7 @@ define([
*/
this.endScale = defaultValue(options.endScale, 1.0);
/**
* The dimensions of the image representing the particle in pixels. Width by Height.
* The dimensions, width by height, to scale the particle image in pixels.
* @type {Cartesian2}
* @default new Cartesian(1.0, 1.0)
*/
Expand Down
Loading

0 comments on commit 603640c

Please sign in to comment.