Skip to content

Commit

Permalink
Upgrade to TS 1.8; Fix 1.8 compiler errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kamranayub committed Jun 8, 2016
1 parent 3039eb9 commit 7648641
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 25 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -34,6 +34,6 @@
"jasmine": "^2.4.1",
"travis-ci": "^2.1.0",
"tslint": "~2.3.0-beta",
"typescript": "1.6.2"
"typescript": "^1.8.10"
}
}
1 change: 0 additions & 1 deletion src/engine/Actor.ts
Expand Up @@ -812,7 +812,6 @@ module ex {
return ex.Side.Top;
}
}
return ex.Side.None;
}
/**
* Test whether the actor has collided with another actor, returns the intersection vector on collision. Returns
Expand Down
39 changes: 20 additions & 19 deletions src/engine/Input/Gamepad.ts
Expand Up @@ -260,33 +260,34 @@
this.at(i).navigatorGamepad = gamepads[i];

// Buttons
var b: string, a: string, value: number, buttonIndex: number, axesIndex: number;
var b: string, bi: string|number, a: string, ai: string|number, value: number;

for (b in Buttons) {
if (typeof Buttons[b] !== 'number') { continue; }

buttonIndex = Buttons[b];
if(gamepads[i].buttons[buttonIndex]) {
value = gamepads[i].buttons[buttonIndex].value;
if (value !== this._oldPads[i].getButton(buttonIndex)) {
if (gamepads[i].buttons[buttonIndex].pressed) {
this.at(i).updateButton(buttonIndex, value);
this.at(i).eventDispatcher.publish('button', new GamepadButtonEvent(buttonIndex, value));
} else {
this.at(i).updateButton(buttonIndex, 0);
bi = Buttons[b];
if (typeof bi === 'number') {
if(gamepads[i].buttons[bi]) {
value = gamepads[i].buttons[bi].value;
if (value !== this._oldPads[i].getButton(bi)) {
if (gamepads[i].buttons[bi].pressed) {
this.at(i).updateButton(bi, value);
this.at(i).eventDispatcher.publish('button', new GamepadButtonEvent(bi, value));
} else {
this.at(i).updateButton(bi, 0);
}
}
}
}
}

// Axes
for (a in Axes) {
if (typeof Axes[a] !== 'number') { continue; }

axesIndex = Axes[a];
value = gamepads[i].axes[axesIndex];
if (value !== this._oldPads[i].getAxes(axesIndex)) {
this.at(i).updateAxes(axesIndex, value);
this.at(i).eventDispatcher.emit('axis', new GamepadAxisEvent(axesIndex, value));
ai = Axes[a];
if (typeof ai === 'number') {
value = gamepads[i].axes[ai];
if (value !== this._oldPads[i].getAxes(ai)) {
this.at(i).updateAxes(ai, value);
this.at(i).eventDispatcher.emit('axis', new GamepadAxisEvent(ai, value));
}
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/engine/Particles.ts
Expand Up @@ -323,9 +323,9 @@ module ex {
this.deadParticles = new Util.Collection<Particle>();

// Remove offscreen culling from particle emitters
for (var trait in this.traits) {
if (this.traits[trait] instanceof ex.Traits.OffscreenCulling) {
this.traits.splice(trait, 1);
for (let i = 0; i < this.traits.length; i++) {
if (this.traits[i] instanceof ex.Traits.OffscreenCulling) {
this.traits.splice(i, 1);
}
}

Expand Down
1 change: 0 additions & 1 deletion src/engine/Util/SortedList.ts
Expand Up @@ -55,7 +55,6 @@ module ex {
} else {
return this._insert(this._root, element);
}
return false;
}

private _insert(node: BinaryTreeNode, element: any): boolean {
Expand Down

0 comments on commit 7648641

Please sign in to comment.