|
|
@@ -182,8 +182,8 @@ bool SpriteSheet2D::EndLoadFromPListFile()
|
|
|
offset.y_ = -sourceColorRect.top_;
|
|
|
|
|
|
IntVector2 sourceSize = frameInfo["sourceSize"]->GetIntVector2();
|
|
|
- hotSpot.x_ = ((float)offset.x_ + sourceSize.x_ / 2) / rectangle.Width();
|
|
|
- hotSpot.y_ = 1.0f - ((float)offset.y_ + sourceSize.y_ / 2) / rectangle.Height();
|
|
|
+ hotSpot.x_ = (offset.x_ + sourceSize.x_ / 2.f) / rectangle.Width();
|
|
|
+ hotSpot.y_ = 1.0f - (offset.y_ + sourceSize.y_ / 2.f) / rectangle.Height();
|
|
|
}
|
|
|
|
|
|
DefineSprite(name, rectangle, hotSpot, offset);
|
|
|
@@ -254,8 +254,8 @@ bool SpriteSheet2D::EndLoadFromXMLFile()
|
|
|
offset.y_ = subTextureElem.GetInt("frameY");
|
|
|
int frameWidth = subTextureElem.GetInt("frameWidth");
|
|
|
int frameHeight = subTextureElem.GetInt("frameHeight");
|
|
|
- hotSpot.x_ = ((float)offset.x_ + frameWidth / 2) / width;
|
|
|
- hotSpot.y_ = 1.0f - ((float)offset.y_ + frameHeight / 2) / height;
|
|
|
+ hotSpot.x_ = (offset.x_ + frameWidth / 2.f) / width;
|
|
|
+ hotSpot.y_ = 1.0f - (offset.y_ + frameHeight / 2.f) / height;
|
|
|
}
|
|
|
|
|
|
DefineSprite(name, rectangle, hotSpot, offset);
|
|
|
@@ -333,8 +333,8 @@ bool SpriteSheet2D::EndLoadFromJSONFile()
|
|
|
offset.y_ = subTextureVal.Get("frameY").GetInt();
|
|
|
int frameWidth = frameWidthVal.GetInt();
|
|
|
int frameHeight = frameHeightVal.GetInt();
|
|
|
- hotSpot.x_ = ((float)offset.x_ + frameWidth / 2) / width;
|
|
|
- hotSpot.y_ = 1.0f - ((float)offset.y_ + frameHeight / 2) / height;
|
|
|
+ hotSpot.x_ = (offset.x_ + frameWidth / 2.f) / width;
|
|
|
+ hotSpot.y_ = 1.0f - (offset.y_ + frameHeight / 2.f) / height;
|
|
|
}
|
|
|
|
|
|
DefineSprite(name, rectangle, hotSpot, offset);
|