Skip to content

Commit 370ccb6

Browse files
committed
Removed debug properties.
1 parent 69a0dcc commit 370ccb6

1 file changed

Lines changed: 58 additions & 66 deletions

File tree

src/input/InputManager.js

Lines changed: 58 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ var InputManager = new Class({
427427
*
428428
* @param {number} time - The time stamp value of this game step.
429429
*/
430-
update: function (time, delta)
430+
update: function (time)
431431
{
432432
var i;
433433

@@ -443,78 +443,68 @@ var InputManager = new Class({
443443

444444
var pointers = this.pointers;
445445

446-
this.mouse.pre();
447-
448446
for (i = 0; i < this.pointersTotal; i++)
449447
{
450-
pointers[i].reset(delta);
448+
pointers[i].reset();
449+
}
450+
451+
if (!this.enabled || len === 0)
452+
{
453+
return;
451454
}
452455

453-
// if (!this.enabled || len === 0)
454-
// {
455-
// return;
456-
// }
456+
this.dirty = true;
457+
458+
this.updateBounds();
457459

458-
if (this.enabled && len > 0)
460+
this.scale.x = this.game.config.width / this.bounds.width;
461+
this.scale.y = this.game.config.height / this.bounds.height;
462+
463+
// Clears the queue array, and also means we don't work on array data that could potentially
464+
// be modified during the processing phase
465+
var queue = this.queue.splice(0, len);
466+
var mouse = this.mousePointer;
467+
468+
// Process the event queue, dispatching all of the events that have stored up
469+
for (i = 0; i < len; i += 2)
459470
{
460-
this.dirty = true;
471+
var type = queue[i];
472+
var event = queue[i + 1];
461473

462-
this.updateBounds();
463-
464-
this.scale.x = this.game.config.width / this.bounds.width;
465-
this.scale.y = this.game.config.height / this.bounds.height;
466-
467-
// Clears the queue array, and also means we don't work on array data that could potentially
468-
// be modified during the processing phase
469-
var queue = this.queue.splice(0, len);
470-
var mouse = this.mousePointer;
471-
472-
// Process the event queue, dispatching all of the events that have stored up
473-
for (i = 0; i < len; i += 2)
474+
switch (type)
474475
{
475-
var type = queue[i];
476-
var event = queue[i + 1];
477-
478-
switch (type)
479-
{
480-
case CONST.MOUSE_DOWN:
481-
mouse.down(event, time);
482-
break;
483-
484-
case CONST.MOUSE_MOVE:
485-
mouse.move(event, time);
486-
break;
487-
488-
case CONST.MOUSE_UP:
489-
mouse.up(event, time);
490-
break;
491-
492-
case CONST.TOUCH_START:
493-
this.startPointer(event, time);
494-
break;
495-
496-
case CONST.TOUCH_MOVE:
497-
this.updatePointer(event, time);
498-
break;
499-
500-
case CONST.TOUCH_END:
501-
this.stopPointer(event, time);
502-
break;
503-
504-
case CONST.TOUCH_CANCEL:
505-
this.cancelPointer(event, time);
506-
break;
507-
508-
case CONST.POINTER_LOCK_CHANGE:
509-
this.events.emit('pointerlockchange', event, this.mouse.locked);
510-
break;
511-
}
512-
}
513-
}
476+
case CONST.MOUSE_DOWN:
477+
mouse.down(event, time);
478+
break;
514479

515-
for (i = 0; i < this.pointersTotal; i++)
516-
{
517-
pointers[i].updateMotion();
480+
case CONST.MOUSE_MOVE:
481+
mouse.move(event, time);
482+
break;
483+
484+
case CONST.MOUSE_UP:
485+
mouse.up(event, time);
486+
break;
487+
488+
case CONST.TOUCH_START:
489+
this.startPointer(event, time);
490+
break;
491+
492+
case CONST.TOUCH_MOVE:
493+
this.updatePointer(event, time);
494+
break;
495+
496+
case CONST.TOUCH_END:
497+
this.stopPointer(event, time);
498+
break;
499+
500+
case CONST.TOUCH_CANCEL:
501+
this.cancelPointer(event, time);
502+
break;
503+
504+
case CONST.POINTER_LOCK_CHANGE:
505+
this.events.emit('pointerlockchange', event, this.mouse.locked);
506+
break;
507+
}
518508
}
519509
},
520510

@@ -535,8 +525,6 @@ var InputManager = new Class({
535525
{
536526
this.canvas.style.cursor = this.defaultCursor;
537527
}
538-
539-
this.mouse.post();
540528
},
541529

542530
/**
@@ -1335,6 +1323,10 @@ var InputManager = new Class({
13351323
var p0 = pointer.position;
13361324
var p1 = pointer.prevPosition;
13371325

1326+
// Store previous position
1327+
p1.x = p0.x;
1328+
p1.y = p0.y;
1329+
13381330
// Translate coordinates
13391331
var x = (pageX - this.bounds.left) * this.scale.x;
13401332
var y = (pageY - this.bounds.top) * this.scale.y;

0 commit comments

Comments
 (0)