1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-01-26 02:07:26 +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 PetSlot;
std::vector<FoodHolder*> foodHolders;
std::vector<PetSlot*> petSlots;
static std::vector<FoodHolder*> foodHolders;
static std::vector<PetSlot*> petSlots;
// ---------------- Constants ----------------------------
@ -31,8 +31,8 @@ const size_t numTreasures = 16*2;
const Vector worldLeftCenter(217,250), worldRightCenter(575, 250);
const Vector opt_save_original = Vector(350, 350), opt_cancel_original = Vector(450, 350);
const int KEYCONFIG_FIRST_COL_DISTANCE = 170;
const int KEYCONFIG_COL_DISTANCE = 105;
static const int KEYCONFIG_FIRST_COL_DISTANCE = 170;
static const int KEYCONFIG_COL_DISTANCE = 105;
// --------- Private class defs, not used outside ---------------
@ -959,7 +959,7 @@ void InGameMenu::reset()
optsfxdly = 0;
playingSongInMenu = -1;
menuSelectDelay = 0;
dropIngrNames.clear();
create();

View file

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

View file

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