1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-02-04 19:04:08 +00:00

remove RenderObject::isPieceFlippedHorizontal() + tiny cleanup

This commit is contained in:
fgenesis 2022-06-20 17:46:37 +02:00
parent 21c51e06cb
commit baa1170e6f
3 changed files with 9 additions and 16 deletions

View file

@ -17,8 +17,8 @@ static InGameMenu *themenu = 0;
class FoodHolder; class FoodHolder;
class PetSlot; class PetSlot;
std::vector<FoodHolder*> foodHolders; static std::vector<FoodHolder*> foodHolders;
std::vector<PetSlot*> petSlots; static std::vector<PetSlot*> petSlots;
// ---------------- Constants ---------------------------- // ---------------- Constants ----------------------------
@ -31,8 +31,8 @@ const size_t numTreasures = 16*2;
const Vector worldLeftCenter(217,250), worldRightCenter(575, 250); const Vector worldLeftCenter(217,250), worldRightCenter(575, 250);
const Vector opt_save_original = Vector(350, 350), opt_cancel_original = Vector(450, 350); const Vector opt_save_original = Vector(350, 350), opt_cancel_original = Vector(450, 350);
const int KEYCONFIG_FIRST_COL_DISTANCE = 170; static const int KEYCONFIG_FIRST_COL_DISTANCE = 170;
const int KEYCONFIG_COL_DISTANCE = 105; static const int KEYCONFIG_COL_DISTANCE = 105;
// --------- Private class defs, not used outside --------------- // --------- Private class defs, not used outside ---------------

View file

@ -122,14 +122,6 @@ RenderObject* RenderObject::getTopParent() const
return lastp; return lastp;
} }
bool RenderObject::isPieceFlippedHorizontal() const
{
RenderObject *p = getTopParent();
if (p)
return p->isfh();
return isfh();
}
Vector RenderObject::getInvRotPosition(const Vector &vec) const Vector RenderObject::getInvRotPosition(const Vector &vec) const
{ {
@ -644,7 +636,9 @@ void RenderObject::lookAt(const Vector &pos, float t, float minAngle, float maxA
p = p->parent; p = p->parent;
} }
if (isPieceFlippedHorizontal()) const bool ishfh = this->isfhr();
if (ishfh)
{ {
angle = 180-angle; angle = 180-angle;
@ -659,7 +653,7 @@ void RenderObject::lookAt(const Vector &pos, float t, float minAngle, float maxA
angle = maxAngle; angle = maxAngle;
int amt = 10; int amt = 10;
if (isPieceFlippedHorizontal()) if (ishfh)
{ {
if (pos.x < myPos.x-amt) if (pos.x < myPos.x-amt)
{ {

View file

@ -191,7 +191,6 @@ public:
Vector getWorldPosition() const; Vector getWorldPosition() const;
Vector getWorldCollidePosition(const Vector &vec=Vector(0,0,0)) const; Vector getWorldCollidePosition(const Vector &vec=Vector(0,0,0)) const;
Vector getInvRotPosition(const Vector &vec) const; Vector getInvRotPosition(const Vector &vec) const;
bool isPieceFlippedHorizontal() const;
RenderObject *getTopParent() const; RenderObject *getTopParent() const;