@dcl/ecs 7.27.1-34478989812.commit-0dce4d2 → 7.27.1-34483684888.commit-8da580d
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/engine/input.js +8 -8
- package/dist-cjs/engine/input.js +8 -8
- package/package.json +2 -2
package/dist/engine/input.js
CHANGED
|
@@ -57,22 +57,22 @@ export function createInputSystem(engine) {
|
|
|
57
57
|
const arrayCommands = Array.from(commands);
|
|
58
58
|
for (let i = arrayCommands.length - 1; i >= 0; i--) {
|
|
59
59
|
const command = arrayCommands[i];
|
|
60
|
+
// Commands are kept sorted by timestamp, so this one and every one
|
|
61
|
+
// below it belongs to a frame that was already accounted for. Stopping
|
|
62
|
+
// on the button state instead would end this entity's whole loop over
|
|
63
|
+
// a button another entity had already reported this frame.
|
|
64
|
+
if (command.timestamp <= globalState.previousFrameMaxTimestamp) {
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
60
67
|
if (command.timestamp > maxTimestamp) {
|
|
61
68
|
maxTimestamp = command.timestamp;
|
|
62
69
|
}
|
|
63
|
-
|
|
64
|
-
globalState.thisFrameCommands.push(command);
|
|
65
|
-
}
|
|
70
|
+
globalState.thisFrameCommands.push(command);
|
|
66
71
|
if (command.state === 0 /* PointerEventType.PET_UP */ || command.state === 1 /* PointerEventType.PET_DOWN */) {
|
|
67
72
|
const prevCommand = globalState.buttonState.get(command.button);
|
|
68
73
|
if (!prevCommand || command.timestamp > prevCommand.timestamp) {
|
|
69
74
|
globalState.buttonState.set(command.button, command);
|
|
70
75
|
}
|
|
71
|
-
else {
|
|
72
|
-
// since we are iterating a descending array, we can early finish the
|
|
73
|
-
// loop
|
|
74
|
-
break;
|
|
75
|
-
}
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
}
|
package/dist-cjs/engine/input.js
CHANGED
|
@@ -83,22 +83,22 @@ function createInputSystem(engine) {
|
|
|
83
83
|
const arrayCommands = Array.from(commands);
|
|
84
84
|
for (let i = arrayCommands.length - 1; i >= 0; i--) {
|
|
85
85
|
const command = arrayCommands[i];
|
|
86
|
+
// Commands are kept sorted by timestamp, so this one and every one
|
|
87
|
+
// below it belongs to a frame that was already accounted for. Stopping
|
|
88
|
+
// on the button state instead would end this entity's whole loop over
|
|
89
|
+
// a button another entity had already reported this frame.
|
|
90
|
+
if (command.timestamp <= globalState.previousFrameMaxTimestamp) {
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
86
93
|
if (command.timestamp > maxTimestamp) {
|
|
87
94
|
maxTimestamp = command.timestamp;
|
|
88
95
|
}
|
|
89
|
-
|
|
90
|
-
globalState.thisFrameCommands.push(command);
|
|
91
|
-
}
|
|
96
|
+
globalState.thisFrameCommands.push(command);
|
|
92
97
|
if (command.state === 0 /* PointerEventType.PET_UP */ || command.state === 1 /* PointerEventType.PET_DOWN */) {
|
|
93
98
|
const prevCommand = globalState.buttonState.get(command.button);
|
|
94
99
|
if (!prevCommand || command.timestamp > prevCommand.timestamp) {
|
|
95
100
|
globalState.buttonState.set(command.button, command);
|
|
96
101
|
}
|
|
97
|
-
else {
|
|
98
|
-
// since we are iterating a descending array, we can early finish the
|
|
99
|
-
// loop
|
|
100
|
-
break;
|
|
101
|
-
}
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/ecs",
|
|
3
3
|
"description": "Decentraland ECS",
|
|
4
|
-
"version": "7.27.1-
|
|
4
|
+
"version": "7.27.1-34483684888.commit-8da580d",
|
|
5
5
|
"author": "DCL",
|
|
6
6
|
"bugs": "https://github.com/decentraland/ecs/issues",
|
|
7
7
|
"files": [
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"dependencies": {},
|
|
35
35
|
"types": "./dist/index.d.ts",
|
|
36
36
|
"typings": "./dist/index.d.ts",
|
|
37
|
-
"commit": "
|
|
37
|
+
"commit": "8da580d5df79697c08d248c377b805abe5cd3461"
|
|
38
38
|
}
|