Skip to content

Commit

Permalink
fix a few things caught by the TypeScript compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
flyover committed Jan 11, 2016
1 parent c36b2f0 commit a99dc98
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions spine.js
Original file line number Diff line number Diff line change
Expand Up @@ -1544,17 +1544,14 @@ spine.Event.prototype.copy = function (other)
*/
spine.Event.prototype.load = function (json)
{
if (typeof(json['name']) === 'string')
{
this.name = spine.loadString(json, 'name', "");
}
if (typeof(json['int']) === 'string')
this.name = spine.loadString(json, 'name', "");
if (typeof(json['int']) === 'number')
{
this.int_value = spine.loadInt(json, 'int', 0);
}
if (typeof(json['float']) === 'string')
if (typeof(json['float']) === 'number')
{
this.float_value = spine.loadFloat(json['float'], 0);
this.float_value = spine.loadFloat(json, 'float', 0);
}
if (typeof(json['string']) === 'string')
{
Expand Down Expand Up @@ -1764,7 +1761,7 @@ spine.FlipXKeyframe.prototype.flip_x = false;
spine.FlipXKeyframe.prototype.load = function (json)
{
goog.base(this, 'load', json);
this.flip = spine.loadBool(json, 'x', false);
this.flip_x = spine.loadBool(json, 'x', false);
return this;
}

Expand All @@ -1789,7 +1786,7 @@ spine.FlipYKeyframe.prototype.flip_y = false;
spine.FlipYKeyframe.prototype.load = function (json)
{
goog.base(this, 'load', json);
this.flip = spine.loadBool(json, 'y', false);
this.flip_y = spine.loadBool(json, 'y', false);
return this;
}

Expand Down Expand Up @@ -2067,15 +2064,12 @@ spine.EventKeyframe.prototype.string_value = "";
spine.EventKeyframe.prototype.load = function (json)
{
goog.base(this, 'load', json);
if (typeof(json['name']) === 'string')
{
this.name = spine.loadString(json, 'name', "");
}
if (typeof(json['int']) === 'string')
this.name = spine.loadString(json, 'name', "");
if (typeof(json['int']) === 'number')
{
this.int_value = spine.loadInt(json, 'int', 0);
}
if (typeof(json['float']) === 'string')
if (typeof(json['float']) === 'number')
{
this.float_value = spine.loadFloat(json, 'float', 0);
}
Expand Down Expand Up @@ -3155,15 +3149,15 @@ spine.Pose.prototype.strike = function ()
{
var flip_x_keyframe0 = anim_bone.flip_x_keyframes[keyframe_index];
// no tweening bone flip x
pose_bone.local_space.flip.x = (flip_x_keyframe0.flip)?(-1):(1);
pose_bone.local_space.flip.x = (flip_x_keyframe0.flip_x)?(-1):(1);
}

var keyframe_index = spine.Keyframe.find(anim_bone.flip_y_keyframes, time);
if (keyframe_index !== -1)
{
var flip_y_keyframe0 = anim_bone.flip_y_keyframes[keyframe_index];
// no tweening bone flip y
pose_bone.local_space.flip.y = (flip_y_keyframe0.flip)?(-1):(1);
pose_bone.local_space.flip.y = (flip_y_keyframe0.flip_y)?(-1):(1);
}
}
});
Expand Down

0 comments on commit a99dc98

Please sign in to comment.