melonjs 10.2.2 → 10.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/melonjs.js +14 -20
- package/dist/melonjs.min.js +2 -2
- package/dist/melonjs.module.d.ts +3 -10
- package/dist/melonjs.module.js +13 -21
- package/package.json +3 -3
- package/src/loader/loadingscreen.js +6 -5
- package/src/physics/quadtree.js +1 -1
- package/src/video/video.js +1 -1
- package/src/video/webgl/webgl_compositor.js +1 -10
package/dist/melonjs.module.d.ts
CHANGED
|
@@ -8400,14 +8400,7 @@ export class WebGLCompositor {
|
|
|
8400
8400
|
* @ignore
|
|
8401
8401
|
*/
|
|
8402
8402
|
init(renderer: any): void;
|
|
8403
|
-
|
|
8404
|
-
* The number of quads held in the batch
|
|
8405
|
-
* @name length
|
|
8406
|
-
* @memberOf me.WebGLCompositor
|
|
8407
|
-
* @type {number}
|
|
8408
|
-
* @readonly
|
|
8409
|
-
*/
|
|
8410
|
-
readonly currentTextureUnit: number;
|
|
8403
|
+
currentTextureUnit: any;
|
|
8411
8404
|
boundTextures: any[];
|
|
8412
8405
|
renderer: any;
|
|
8413
8406
|
gl: any;
|
|
@@ -8503,7 +8496,7 @@ export class WebGLCompositor {
|
|
|
8503
8496
|
/**
|
|
8504
8497
|
* @ignore
|
|
8505
8498
|
*/
|
|
8506
|
-
uploadTexture(texture: any, w: any, h: any, b: any, force: any):
|
|
8499
|
+
uploadTexture(texture: any, w: any, h: any, b: any, force: any): any;
|
|
8507
8500
|
/**
|
|
8508
8501
|
* Select the shader to use for compositing
|
|
8509
8502
|
* @name useShader
|
|
@@ -13022,7 +13015,7 @@ declare class BasePlugin {
|
|
|
13022
13015
|
* this can be overridden by the plugin
|
|
13023
13016
|
* @public
|
|
13024
13017
|
* @type {string}
|
|
13025
|
-
* @default "10.2.
|
|
13018
|
+
* @default "10.2.3"
|
|
13026
13019
|
* @name me.plugin.Base#version
|
|
13027
13020
|
*/
|
|
13028
13021
|
public version: string;
|
package/dist/melonjs.module.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v10.2.
|
|
2
|
+
* melonJS Game Engine - v10.2.3
|
|
3
3
|
* http://www.melonjs.org
|
|
4
4
|
* melonjs is licensed under the MIT License.
|
|
5
5
|
* http://www.opensource.org/licenses/mit-license
|
|
@@ -16715,7 +16715,7 @@ class QuadTree {
|
|
|
16715
16715
|
if (item.isFloating === true) {
|
|
16716
16716
|
pos = viewport.localToWorld(bounds.left, bounds.top, QT_VECTOR);
|
|
16717
16717
|
} else {
|
|
16718
|
-
pos = QT_VECTOR.set(
|
|
16718
|
+
pos = QT_VECTOR.set(item.left, item.top);
|
|
16719
16719
|
}
|
|
16720
16720
|
|
|
16721
16721
|
var index = -1,
|
|
@@ -18412,9 +18412,10 @@ class IconLogo extends Renderable {
|
|
|
18412
18412
|
super(x, y, 100, 85);
|
|
18413
18413
|
|
|
18414
18414
|
this.iconCanvas = createCanvas(
|
|
18415
|
-
nextPowerOfTwo(this.width),
|
|
18416
|
-
nextPowerOfTwo(this.height),
|
|
18417
|
-
|
|
18415
|
+
renderer.WebGLVersion > 1 ? this.width : nextPowerOfTwo(this.width),
|
|
18416
|
+
renderer.WebGLVersion > 1 ? this.height : nextPowerOfTwo(this.height),
|
|
18417
|
+
false
|
|
18418
|
+
);
|
|
18418
18419
|
|
|
18419
18420
|
var context = renderer.getContext2d(this.iconCanvas);
|
|
18420
18421
|
|
|
@@ -18496,7 +18497,7 @@ class DefaultLoadingScreen extends Stage {
|
|
|
18496
18497
|
textAlign: "left",
|
|
18497
18498
|
textBaseline : "top",
|
|
18498
18499
|
text: "melon",
|
|
18499
|
-
offScreenCanvas:
|
|
18500
|
+
offScreenCanvas: renderer.WebGLVersion >= 1
|
|
18500
18501
|
}
|
|
18501
18502
|
);
|
|
18502
18503
|
logo1.anchorPoint.set(0, 0);
|
|
@@ -18511,7 +18512,7 @@ class DefaultLoadingScreen extends Stage {
|
|
|
18511
18512
|
textBaseline : "top",
|
|
18512
18513
|
bold: true,
|
|
18513
18514
|
text: "JS",
|
|
18514
|
-
offScreenCanvas:
|
|
18515
|
+
offScreenCanvas: renderer.WebGLVersion >= 1
|
|
18515
18516
|
}
|
|
18516
18517
|
);
|
|
18517
18518
|
logo2.anchorPoint.set(0, 0);
|
|
@@ -29007,15 +29008,6 @@ class WebGLCompositor {
|
|
|
29007
29008
|
// local reference
|
|
29008
29009
|
var gl = renderer.gl;
|
|
29009
29010
|
|
|
29010
|
-
/**
|
|
29011
|
-
* The number of quads held in the batch
|
|
29012
|
-
* @name length
|
|
29013
|
-
* @memberOf me.WebGLCompositor
|
|
29014
|
-
* @type {number}
|
|
29015
|
-
* @readonly
|
|
29016
|
-
*/
|
|
29017
|
-
//this.length = 0;
|
|
29018
|
-
|
|
29019
29011
|
// list of active texture units
|
|
29020
29012
|
this.currentTextureUnit = -1;
|
|
29021
29013
|
this.boundTextures = [];
|
|
@@ -29113,9 +29105,9 @@ class WebGLCompositor {
|
|
|
29113
29105
|
for (var i = 0; i < this.renderer.maxTextures; i++) {
|
|
29114
29106
|
var texture = this.boundTextures[i];
|
|
29115
29107
|
if (texture !== null) {
|
|
29108
|
+
this.boundTextures[i] = null;
|
|
29116
29109
|
this.gl.deleteTexture(texture);
|
|
29117
29110
|
}
|
|
29118
|
-
this.boundTextures[i] = null;
|
|
29119
29111
|
}
|
|
29120
29112
|
this.currentTextureUnit = -1;
|
|
29121
29113
|
|
|
@@ -30944,7 +30936,7 @@ function init(width, height, options) {
|
|
|
30944
30936
|
* @param {boolean} [offscreen=false] will returns an OffscreenCanvas if supported
|
|
30945
30937
|
* @returns {HTMLCanvasElement|OffscreenCanvas}
|
|
30946
30938
|
*/
|
|
30947
|
-
function createCanvas(width, height, offscreen) {
|
|
30939
|
+
function createCanvas(width, height, offscreen = false) {
|
|
30948
30940
|
var _canvas;
|
|
30949
30941
|
|
|
30950
30942
|
if (width === 0 || height === 0) {
|
|
@@ -31502,10 +31494,10 @@ class BasePlugin {
|
|
|
31502
31494
|
* this can be overridden by the plugin
|
|
31503
31495
|
* @public
|
|
31504
31496
|
* @type {string}
|
|
31505
|
-
* @default "10.2.
|
|
31497
|
+
* @default "10.2.3"
|
|
31506
31498
|
* @name me.plugin.Base#version
|
|
31507
31499
|
*/
|
|
31508
|
-
this.version = "10.2.
|
|
31500
|
+
this.version = "10.2.3";
|
|
31509
31501
|
}
|
|
31510
31502
|
}
|
|
31511
31503
|
|
|
@@ -36006,7 +35998,7 @@ var deprecated = /*#__PURE__*/Object.freeze({
|
|
|
36006
35998
|
* @name version
|
|
36007
35999
|
* @type {string}
|
|
36008
36000
|
*/
|
|
36009
|
-
const version = "10.2.
|
|
36001
|
+
const version = "10.2.3";
|
|
36010
36002
|
|
|
36011
36003
|
|
|
36012
36004
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "melonjs",
|
|
3
|
-
"version": "10.2.
|
|
3
|
+
"version": "10.2.3",
|
|
4
4
|
"description": "melonJS Game Engine",
|
|
5
5
|
"homepage": "http://www.melonjs.org/",
|
|
6
6
|
"keywords": [
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
"@rollup/plugin-replace": "^3.0.0",
|
|
65
65
|
"cheerio": "^1.0.0-rc.10",
|
|
66
66
|
"del-cli": "^4.0.1",
|
|
67
|
-
"eslint": "^8.
|
|
68
|
-
"eslint-plugin-jsdoc": "^37.2.
|
|
67
|
+
"eslint": "^8.5.0",
|
|
68
|
+
"eslint-plugin-jsdoc": "^37.2.8",
|
|
69
69
|
"jasmine-core": "^3.10.1",
|
|
70
70
|
"jsdoc": "^3.6.7",
|
|
71
71
|
"karma": "^6.3.9",
|
|
@@ -71,9 +71,10 @@ class IconLogo extends Renderable {
|
|
|
71
71
|
super(x, y, 100, 85);
|
|
72
72
|
|
|
73
73
|
this.iconCanvas = createCanvas(
|
|
74
|
-
nextPowerOfTwo(this.width),
|
|
75
|
-
nextPowerOfTwo(this.height),
|
|
76
|
-
|
|
74
|
+
renderer.WebGLVersion > 1 ? this.width : nextPowerOfTwo(this.width),
|
|
75
|
+
renderer.WebGLVersion > 1 ? this.height : nextPowerOfTwo(this.height),
|
|
76
|
+
false
|
|
77
|
+
);
|
|
77
78
|
|
|
78
79
|
var context = renderer.getContext2d(this.iconCanvas);
|
|
79
80
|
|
|
@@ -156,7 +157,7 @@ class DefaultLoadingScreen extends Stage {
|
|
|
156
157
|
textAlign: "left",
|
|
157
158
|
textBaseline : "top",
|
|
158
159
|
text: "melon",
|
|
159
|
-
offScreenCanvas:
|
|
160
|
+
offScreenCanvas: renderer.WebGLVersion >= 1
|
|
160
161
|
}
|
|
161
162
|
);
|
|
162
163
|
logo1.anchorPoint.set(0, 0);
|
|
@@ -171,7 +172,7 @@ class DefaultLoadingScreen extends Stage {
|
|
|
171
172
|
textBaseline : "top",
|
|
172
173
|
bold: true,
|
|
173
174
|
text: "JS",
|
|
174
|
-
offScreenCanvas:
|
|
175
|
+
offScreenCanvas: renderer.WebGLVersion >= 1
|
|
175
176
|
}
|
|
176
177
|
);
|
|
177
178
|
logo2.anchorPoint.set(0, 0);
|
package/src/physics/quadtree.js
CHANGED
|
@@ -130,7 +130,7 @@ class QuadTree {
|
|
|
130
130
|
if (item.isFloating === true) {
|
|
131
131
|
pos = viewport.localToWorld(bounds.left, bounds.top, QT_VECTOR);
|
|
132
132
|
} else {
|
|
133
|
-
pos = QT_VECTOR.set(
|
|
133
|
+
pos = QT_VECTOR.set(item.left, item.top);
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
var index = -1,
|
package/src/video/video.js
CHANGED
|
@@ -386,7 +386,7 @@ export function init(width, height, options) {
|
|
|
386
386
|
* @param {boolean} [offscreen=false] will returns an OffscreenCanvas if supported
|
|
387
387
|
* @returns {HTMLCanvasElement|OffscreenCanvas}
|
|
388
388
|
*/
|
|
389
|
-
export function createCanvas(width, height, offscreen) {
|
|
389
|
+
export function createCanvas(width, height, offscreen = false) {
|
|
390
390
|
var _canvas;
|
|
391
391
|
|
|
392
392
|
if (width === 0 || height === 0) {
|
|
@@ -75,15 +75,6 @@ class WebGLCompositor {
|
|
|
75
75
|
// local reference
|
|
76
76
|
var gl = renderer.gl;
|
|
77
77
|
|
|
78
|
-
/**
|
|
79
|
-
* The number of quads held in the batch
|
|
80
|
-
* @name length
|
|
81
|
-
* @memberOf me.WebGLCompositor
|
|
82
|
-
* @type {number}
|
|
83
|
-
* @readonly
|
|
84
|
-
*/
|
|
85
|
-
//this.length = 0;
|
|
86
|
-
|
|
87
78
|
// list of active texture units
|
|
88
79
|
this.currentTextureUnit = -1;
|
|
89
80
|
this.boundTextures = [];
|
|
@@ -181,9 +172,9 @@ class WebGLCompositor {
|
|
|
181
172
|
for (var i = 0; i < this.renderer.maxTextures; i++) {
|
|
182
173
|
var texture = this.boundTextures[i];
|
|
183
174
|
if (texture !== null) {
|
|
175
|
+
this.boundTextures[i] = null;
|
|
184
176
|
this.gl.deleteTexture(texture);
|
|
185
177
|
}
|
|
186
|
-
this.boundTextures[i] = null;
|
|
187
178
|
}
|
|
188
179
|
this.currentTextureUnit = -1;
|
|
189
180
|
|