Skip to content

Commit

Permalink
17.2.0 dist files
Browse files Browse the repository at this point in the history
  • Loading branch information
obiot committed Apr 21, 2024
1 parent 51ad03d commit 3d34143
Show file tree
Hide file tree
Showing 548 changed files with 2,580 additions and 2,168 deletions.
2 changes: 1 addition & 1 deletion dist/melonjs.mjs/_virtual/_commonjsHelpers.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* melonJS Game Engine - v17.1.0
* melonJS Game Engine - v17.2.0
* http://www.melonjs.org
* melonjs is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
Expand Down
2 changes: 1 addition & 1 deletion dist/melonjs.mjs/_virtual/earcut.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* melonJS Game Engine - v17.1.0
* melonJS Game Engine - v17.2.0
* http://www.melonjs.org
* melonjs is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
Expand Down
2 changes: 1 addition & 1 deletion dist/melonjs.mjs/_virtual/howler.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* melonJS Game Engine - v17.1.0
* melonJS Game Engine - v17.2.0
* http://www.melonjs.org
* melonjs is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
Expand Down
2 changes: 1 addition & 1 deletion dist/melonjs.mjs/_virtual/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* melonJS Game Engine - v17.1.0
* melonJS Game Engine - v17.2.0
* http://www.melonjs.org
* melonjs is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
Expand Down
2 changes: 1 addition & 1 deletion dist/melonjs.mjs/_virtual/re.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* melonJS Game Engine - v17.1.0
* melonJS Game Engine - v17.2.0
* http://www.melonjs.org
* melonjs is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
Expand Down
4 changes: 2 additions & 2 deletions dist/melonjs.mjs/application/application.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* melonJS Game Engine - v17.1.0
* melonJS Game Engine - v17.2.0
* http://www.melonjs.org
* melonjs is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
Expand Down Expand Up @@ -187,7 +187,7 @@ class Application {

// identify parent element and/or the html target for resizing
this.parentElement = getElement(this.settings.parent);
if (typeof this.settings.scaleTarget !== "undefined" ) {
if (typeof this.settings.scaleTarget !== "undefined") {
this.settings.scaleTarget = getElement(this.settings.scaleTarget);
}

Expand Down
4 changes: 2 additions & 2 deletions dist/melonjs.mjs/application/header.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* melonJS Game Engine - v17.1.0
* melonJS Game Engine - v17.2.0
* http://www.melonjs.org
* melonjs is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
Expand Down Expand Up @@ -27,7 +27,7 @@ function consoleHeader(app) {
language
);

console.log( "resolution: " + "requested " + app.settings.width + "x" + app.settings.height +
console.log("resolution: " + "requested " + app.settings.width + "x" + app.settings.height +
", got " + app.renderer.width + "x" + app.renderer.height
);
}
Expand Down
2 changes: 1 addition & 1 deletion dist/melonjs.mjs/application/resize.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* melonJS Game Engine - v17.1.0
* melonJS Game Engine - v17.2.0
* http://www.melonjs.org
* melonjs is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
Expand Down
2 changes: 1 addition & 1 deletion dist/melonjs.mjs/application/settings.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* melonJS Game Engine - v17.1.0
* melonJS Game Engine - v17.2.0
* http://www.melonjs.org
* melonjs is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
Expand Down
22 changes: 13 additions & 9 deletions dist/melonjs.mjs/audio/audio.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* melonJS Game Engine - v17.1.0
* melonJS Game Engine - v17.2.0
* http://www.melonjs.org
* melonjs is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
Expand Down Expand Up @@ -283,14 +283,15 @@ function rate(sound_name, ...args) {
* @memberof audio
* @param {string} sound_name - audio clip name - case sensitive
* @param {number} [pan] - the panning value - A value of -1.0 is all the way left and 1.0 is all the way right.
* @param {number} [id] - the sound instance ID. If none is passed, all sounds in group will be changed.
* @return {number} the current panning value
* @example
* me.audio.stereo("cling", -1);
*/
function stereo(sound_name, pan) {
function stereo(sound_name, pan, id) {
let sound = audioTracks[sound_name];
if (sound && typeof sound !== "undefined") {
return sound.stereo(pan);
return sound.stereo(pan, id);
} else {
throw new Error("audio clip " + sound_name + " does not exist");
}
Expand All @@ -303,12 +304,13 @@ function stereo(sound_name, pan) {
* @param {Number} x - the x-position of the audio source.
* @param {Number} y - the y-position of the audio source.
* @param {Number} z - the z-position of the audio source.
* @param {number} [id] - the sound instance ID. If none is passed, all sounds in group will be changed.
* @return {Array} the current 3D spatial position: [x, y, z]
*/
function position(sound_name, x, y, z) {
function position(sound_name, x, y, z, id) {
let sound = audioTracks[sound_name];
if (sound && typeof sound !== "undefined") {
return sound.pos(x, y, z);
return sound.pos(x, y, z, id);
} else {
throw new Error("audio clip " + sound_name + " does not exist");
}
Expand All @@ -322,12 +324,13 @@ function position(sound_name, x, y, z) {
* @param {Number} x - the x-orientation of the audio source.
* @param {Number} y - the y-orientation of the audio source.
* @param {Number} z - the z-orientation of the audio source.
* @param {number} [id] - the sound instance ID. If none is passed, all sounds in group will be changed.
* @return {Array} the current 3D spatial orientation: [x, y, z]
*/
function orientation(sound_name, x, y, z) {
function orientation(sound_name, x, y, z, id) {
let sound = audioTracks[sound_name];
if (sound && typeof sound !== "undefined") {
return sound.orientation(x, y, z);
return sound.orientation(x, y, z, id);
} else {
throw new Error("audio clip " + sound_name + " does not exist");
}
Expand All @@ -347,6 +350,7 @@ function orientation(sound_name, x, y, z) {
* @param {string} [settings.refDistance=1] - A reference distance for reducing volume as source moves further from the listener. This is simply a variable of the distance model and has a different effect depending on which model is used and the scale of your coordinates. Generally, volume will be equal to 1 at this distance.
* @param {string} [settings.rolloffFactor=1] - How quickly the volume reduces as source moves from listener. This is simply a variable of the distance model and can be in the range of `[0, 1]` with `linear` and `[0, ∞]` with `inverse` and `exponential`.
* @param {string} [settings.panningModel="HRTF"] - Determines which spatialization algorithm is used to position audio. Can be `HRTF` or `equalpower`.
* @param {number} [id] - the sound instance ID. If none is passed, all sounds in group will be changed.
* @return {Object} current panner attributes.
* @example
* me.audio.panner("cling", {
Expand All @@ -356,10 +360,10 @@ function orientation(sound_name, x, y, z) {
* distanceModel: 'exponential'
* });
*/
function panner(sound_name, attributes) {
function panner(sound_name, attributes, id) {
let sound = audioTracks[sound_name];
if (sound && typeof sound !== "undefined") {
return sound.pannerAttr(attributes);
return sound.pannerAttr(attributes, id);
} else {
throw new Error("audio clip " + sound_name + " does not exist");
}
Expand Down
2 changes: 1 addition & 1 deletion dist/melonjs.mjs/camera/camera2d.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* melonJS Game Engine - v17.1.0
* melonJS Game Engine - v17.2.0
* http://www.melonjs.org
* melonjs is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
Expand Down
2 changes: 1 addition & 1 deletion dist/melonjs.mjs/const.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* melonJS Game Engine - v17.1.0
* melonJS Game Engine - v17.2.0
* http://www.melonjs.org
* melonjs is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
Expand Down
2 changes: 1 addition & 1 deletion dist/melonjs.mjs/geometries/ellipse.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* melonJS Game Engine - v17.1.0
* melonJS Game Engine - v17.2.0
* http://www.melonjs.org
* melonjs is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
Expand Down
2 changes: 1 addition & 1 deletion dist/melonjs.mjs/geometries/line.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* melonJS Game Engine - v17.1.0
* melonJS Game Engine - v17.2.0
* http://www.melonjs.org
* melonjs is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
Expand Down
34 changes: 17 additions & 17 deletions dist/melonjs.mjs/geometries/path2d.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* melonJS Game Engine - v17.1.0
* melonJS Game Engine - v17.2.0
* http://www.melonjs.org
* melonjs is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
Expand Down Expand Up @@ -71,12 +71,12 @@ class Path2D {
break;
case "H":
// H take 1 coordinate
lastPoint = points.length === 0 ? startPoint : points[points.length-1];
lastPoint = points.length === 0 ? startPoint : points[points.length - 1];
this.lineTo(lastPoint.x + coordinates[0], lastPoint.y);
break;
case "V":
// V take 1 coordinate
lastPoint = points.length === 0 ? startPoint : points[points.length-1];
lastPoint = points.length === 0 ? startPoint : points[points.length - 1];
this.lineTo(lastPoint.x, lastPoint.y + coordinates[0]);
break;
case "M":
Expand Down Expand Up @@ -128,7 +128,7 @@ class Path2D {
let points = this.points;
if (points.length > 0) {
let firstPoint = points[0];
if (!firstPoint.equals(points[points.length-1])) {
if (!firstPoint.equals(points[points.length - 1])) {
this.lineTo(firstPoint.x, firstPoint.y);
}
this.isDirty = true;
Expand All @@ -153,14 +153,14 @@ class Path2D {
}

// calculate all vertices
for (let i = 0; i < indicesLength; i++ ) {
for (let i = 0; i < indicesLength; i++) {
let point = points[indices[i]];
vertices[i].set(point.x, point.y);
}

// recycle overhead from a previous triangulation
while (vertices.length > indicesLength) {
pool.push(vertices[vertices.length-1]);
pool.push(vertices[vertices.length - 1]);
vertices.length -= 1;
}
this.isDirty = false;
Expand All @@ -187,7 +187,7 @@ class Path2D {
lineTo(x, y) {
let points = this.points;
let startPoint = this.startPoint;
let lastPoint = points.length === 0 ? startPoint : points[points.length-1];
let lastPoint = points.length === 0 ? startPoint : points[points.length - 1];

if (!startPoint.equals(lastPoint)) {
points.push(pool.pull("Point", startPoint.x, startPoint.y));
Expand Down Expand Up @@ -216,7 +216,7 @@ class Path2D {
// based on from https://github.com/karellodewijk/canvas-webgl/blob/master/canvas-webgl.js
//bring angles all in [0, 2*PI] range
if (startAngle === endAngle) return;
const fullCircle = anticlockwise ? Math.abs(startAngle-endAngle) >= (TAU) : Math.abs(endAngle-startAngle) >= (TAU);
const fullCircle = anticlockwise ? Math.abs(startAngle - endAngle) >= (TAU) : Math.abs(endAngle - startAngle) >= (TAU);

startAngle = startAngle % (TAU);
endAngle = endAngle % (TAU);
Expand All @@ -225,7 +225,7 @@ class Path2D {
if (endAngle < 0) endAngle += TAU;

if (startAngle >= endAngle) {
endAngle+= TAU;
endAngle += TAU;
}

let diff = endAngle - startAngle;
Expand Down Expand Up @@ -266,7 +266,7 @@ class Path2D {
arcTo(x1, y1, x2, y2, radius) {
let points = this.points;
let startPoint = this.startPoint;
let lastPoint = points.length === 0 ? startPoint : points[points.length-1];
let lastPoint = points.length === 0 ? startPoint : points[points.length - 1];

// based on from https://github.com/karellodewijk/canvas-webgl/blob/master/canvas-webgl.js
let x0 = lastPoint.x, y0 = lastPoint.y;
Expand All @@ -281,8 +281,8 @@ class Path2D {
let angle = Math.atan2(a1, a0) - Math.atan2(b1, b0);

//work out tangent points using tan(θ) = opposite / adjacent; angle/2 because hypotenuse is the bisection of a,b
let tan_angle_div2 = Math.tan(angle/2);
let adj_l = (radius/tan_angle_div2);
let tan_angle_div2 = Math.tan(angle / 2);
let adj_l = (radius / tan_angle_div2);

let tangent1_pointx = x1 + a0 * adj_l, tangent1_pointy = y1 + a1 * adj_l;
let tangent2_pointx = x1 + b0 * adj_l, tangent2_pointy = y1 + b1 * adj_l;
Expand Down Expand Up @@ -317,15 +317,15 @@ class Path2D {
ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise = false) {
// based on from https://github.com/karellodewijk/canvas-webgl/blob/master/canvas-webgl.js
if (startAngle === endAngle) return;
let fullCircle = anticlockwise ? Math.abs(startAngle-endAngle) >= (TAU) : Math.abs(endAngle-startAngle) >= (TAU);
let fullCircle = anticlockwise ? Math.abs(startAngle - endAngle) >= (TAU) : Math.abs(endAngle - startAngle) >= (TAU);

//bring angles all in [0, 2*PI] range
startAngle = startAngle % (TAU);
endAngle = endAngle % (TAU);
if (startAngle < 0) startAngle += TAU;
if (endAngle < 0) endAngle += TAU;

if (startAngle>=endAngle) {
if (startAngle >= endAngle) {
endAngle += TAU;
}

Expand Down Expand Up @@ -355,7 +355,7 @@ class Path2D {
const _y1 = radiusY * Math.sin(angle);
const _x2 = x + _x1 * cos_rotation - _y1 * sin_rotation;
const _y2 = y + _x1 * sin_rotation + _y1 * cos_rotation;
this.lineTo( _x2, _y2);
this.lineTo(_x2, _y2);
angle += angleStep;
}
// close the ellipse
Expand All @@ -373,7 +373,7 @@ class Path2D {
quadraticCurveTo(cpX, cpY, x, y) {
const points = this.points;
const startPoint = this.startPoint;
const lastPoint = points.length === 0 ? startPoint : points[points.length-1];
const lastPoint = points.length === 0 ? startPoint : points[points.length - 1];
const endPoint = pool.pull("Point").set(x, y);
const controlPoint = pool.pull("Point").set(cpX, cpY);
const resolution = this.arcResolution;
Expand Down Expand Up @@ -401,7 +401,7 @@ class Path2D {
bezierCurveTo(cp1X, cp1Y, cp2X, cp2Y, x, y) {
const points = this.points;
const startPoint = this.startPoint;
const lastPoint = points.length === 0 ? startPoint : points[points.length-1];
const lastPoint = points.length === 0 ? startPoint : points[points.length - 1];
const endPoint = pool.pull("Point").set(x, y);
const controlPoint1 = pool.pull("Point").set(cp1X, cp1Y);
const controlPoint2 = pool.pull("Point").set(cp2X, cp2Y);
Expand Down
2 changes: 1 addition & 1 deletion dist/melonjs.mjs/geometries/point.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* melonJS Game Engine - v17.1.0
* melonJS Game Engine - v17.2.0
* http://www.melonjs.org
* melonjs is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
Expand Down
2 changes: 1 addition & 1 deletion dist/melonjs.mjs/geometries/poly.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* melonJS Game Engine - v17.1.0
* melonJS Game Engine - v17.2.0
* http://www.melonjs.org
* melonjs is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
Expand Down
2 changes: 1 addition & 1 deletion dist/melonjs.mjs/geometries/rectangle.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* melonJS Game Engine - v17.1.0
* melonJS Game Engine - v17.2.0
* http://www.melonjs.org
* melonjs is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
Expand Down
2 changes: 1 addition & 1 deletion dist/melonjs.mjs/geometries/roundrect.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* melonJS Game Engine - v17.1.0
* melonJS Game Engine - v17.2.0
* http://www.melonjs.org
* melonjs is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
Expand Down
10 changes: 4 additions & 6 deletions dist/melonjs.mjs/geometries/toarccanvas.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* melonJS Game Engine - v17.1.0
* melonJS Game Engine - v17.2.0
* http://www.melonjs.org
* melonjs is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
Expand Down Expand Up @@ -60,7 +60,7 @@ function endpointToCenterParameterization(x1, y1, x2, y2, largeArcFlag, sweepFla

const [rx, ry] = correctRadii(srx, sry, x1p, y1p);

const sign = largeArcFlag !== sweepFlag ? 1 : -1;
const sign = -1;
const n = pow(rx) * pow(ry) - pow(rx) * pow(y1p) - pow(ry) * pow(x1p);
const d = pow(rx) * pow(y1p) + pow(ry) * pow(x1p);

Expand All @@ -80,11 +80,9 @@ function endpointToCenterParameterization(x1, y1, x2, y2, largeArcFlag, sweepFla
const deltaAngle0 = vec2Angle(a, b) % (2 * Math.PI);

const deltaAngle =
!sweepFlag && deltaAngle0 > 0
deltaAngle0 > 0
? deltaAngle0 - 2 * Math.PI
: sweepFlag && deltaAngle0 < 0
? deltaAngle0 + 2 * Math.PI
: deltaAngle0;
: deltaAngle0;

const endAngle = startAngle + deltaAngle;

Expand Down
Loading

0 comments on commit 3d34143

Please sign in to comment.