mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-10-05 05:42:18 +00:00
Minor debug improvements + misc
- Spend less time starting up when not compiled with AQUARIA_FULL/DEMO - removed entity_setTouchDamage and bone_setTouchDamage, the used variable was never read - repositioned debug overlay texts, that they are not in the way on wide resolutions - show used Lua memory in debug text - very slow slowmo on Shift+F devkey - fixed RenderObject::isfhr()/isfvr() to be really recursive (they were never used until the animation editor fixes - this rotates bones on one or more h.flipped parents in the same direction as never h.flipped ones) - removed some unused stuff
This commit is contained in:
parent
52881c97a3
commit
f2d112b693
7 changed files with 50 additions and 106 deletions
|
@ -58,41 +58,5 @@ namespace MathFunctions
|
|||
return angle;
|
||||
}
|
||||
|
||||
UNUSED static void calculateAngleBetweenVectorsInRadians(Vector vector1, Vector vector2, float &solutionAngle)
|
||||
{
|
||||
Vector dist = vector1 - vector2;
|
||||
|
||||
solutionAngle = atan2f(dist.y, fabsf(dist.x));
|
||||
|
||||
if (dist.x < 0)
|
||||
solutionAngle = PI - solutionAngle;
|
||||
/*
|
||||
solutionAngle = -solutionAngle;
|
||||
solutionAngle += PI/2;
|
||||
*/
|
||||
|
||||
/*
|
||||
if (dist.x<0)
|
||||
solutionAngle = PI - solutionAngle;
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
vector1.normalize2D();
|
||||
vector2.normalize2D();
|
||||
|
||||
solutionAngle = cosf((vector1.x*vector2.x + vector2.y*vector2.y));
|
||||
*/
|
||||
|
||||
|
||||
//solutionAngle = acosf(vector1.dot(vector2) / (sqrt(vector1.dot(vector1) * vector2.dot(vector2))));
|
||||
//solutionAngle = acosf(vector1.dot(vector2) / (vector1.getLength2D() * vector2.getLength2D()));
|
||||
/*
|
||||
solutionAngle = (solutionAngle /PI)*180;
|
||||
if (dist.x < 0)
|
||||
solutionAngle = 180-solutionAngle;
|
||||
*/
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -318,16 +318,19 @@ void Quad::destroy()
|
|||
|
||||
bool Quad::isCoordinateInside(Vector coord, int minSize)
|
||||
{
|
||||
int hw = fabsf((width)*getRealScale().x)*0.5f;
|
||||
int hh = fabsf((height)*getRealScale().y)*0.5f;
|
||||
Vector realscale = getRealScale();
|
||||
int hw = fabsf((width)*realscale.x)*0.5f;
|
||||
int hh = fabsf((height)*realscale.y)*0.5f;
|
||||
if (hw < minSize)
|
||||
hw = minSize;
|
||||
if (hh < minSize)
|
||||
hh = minSize;
|
||||
|
||||
if (coord.x >= getRealPosition().x - hw && coord.x <= getRealPosition().x + hw)
|
||||
Vector pos = getRealPosition();
|
||||
|
||||
if (coord.x >= pos.x - hw && coord.x <= pos.x + hw)
|
||||
{
|
||||
if (coord.y >= getRealPosition().y - hh && coord.y <= getRealPosition().y + hh)
|
||||
if (coord.y >= pos.y - hh && coord.y <= pos.y + hh)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include <assert.h>
|
||||
|
||||
bool RenderObject::renderCollisionShape = false;
|
||||
bool RenderObject::integerizePositionForRender = false;
|
||||
int RenderObject::lastTextureApplied = 0;
|
||||
bool RenderObject::lastTextureRepeat = false;
|
||||
bool RenderObject::renderPaths = false;
|
||||
|
@ -35,8 +34,6 @@ const bool RENDEROBJECT_FASTTRANSFORM = false;
|
|||
|
||||
RenderObjectLayer *RenderObject::rlayer = 0;
|
||||
|
||||
InterpolatedVector RenderObject::savePosition;
|
||||
|
||||
void RenderObject::toggleAlpha(float t)
|
||||
{
|
||||
if (alpha.x < 0.5f)
|
||||
|
@ -176,7 +173,6 @@ RenderObject::RenderObject()
|
|||
motionBlurFrameOffset = 0;
|
||||
motionBlur = false;
|
||||
idx = -1;
|
||||
renderBorders = false;
|
||||
#ifdef BBGE_BUILD_DIRECTX
|
||||
useDXTransform = false;
|
||||
#endif
|
||||
|
@ -218,7 +214,6 @@ RenderObject::RenderObject()
|
|||
colorIsSaved = false;
|
||||
shareAlphaWithChildren = false;
|
||||
shareColorWithChildren = false;
|
||||
touchDamage = 0;
|
||||
motionBlurTransitionTimer = 0;
|
||||
}
|
||||
|
||||
|
@ -496,18 +491,26 @@ void RenderObject::disableMotionBlur()
|
|||
|
||||
bool RenderObject::isfhr()
|
||||
{
|
||||
if (parent)
|
||||
return parent->isfhr();
|
||||
else
|
||||
return this->isfh();
|
||||
RenderObject *p = this;
|
||||
bool fh = false;
|
||||
do
|
||||
if (p->isfh())
|
||||
fh = !fh;
|
||||
while ((p = p->parent));
|
||||
return fh;
|
||||
|
||||
}
|
||||
|
||||
bool RenderObject::isfvr()
|
||||
{
|
||||
if (parent)
|
||||
return parent->isfvr();
|
||||
else
|
||||
return this->isfv();
|
||||
RenderObject *p = this;
|
||||
bool fv = false;
|
||||
do
|
||||
if (p->isfv())
|
||||
fv = !fv;
|
||||
while ((p = p->parent));
|
||||
return fv;
|
||||
|
||||
}
|
||||
|
||||
bool RenderObject::hasRenderPass(const int pass)
|
||||
|
@ -888,11 +891,6 @@ void RenderObject::renderCall()
|
|||
|
||||
|
||||
position -= offset;
|
||||
|
||||
if (integerizePositionForRender)
|
||||
{
|
||||
position = savePosition;
|
||||
}
|
||||
}
|
||||
|
||||
void RenderObject::renderCollision()
|
||||
|
|
|
@ -233,7 +233,6 @@ public:
|
|||
//-------------------------------- Methods above, fields below
|
||||
|
||||
static bool renderCollisionShape;
|
||||
static bool integerizePositionForRender;
|
||||
static bool renderPaths;
|
||||
static int lastTextureApplied;
|
||||
static bool lastTextureRepeat;
|
||||
|
@ -274,8 +273,6 @@ public:
|
|||
bool shareAlphaWithChildren;
|
||||
bool shareColorWithChildren;
|
||||
|
||||
bool renderBorders;
|
||||
|
||||
bool cull;
|
||||
int updateCull;
|
||||
int layer;
|
||||
|
@ -302,7 +299,6 @@ public:
|
|||
|
||||
CollideRects collisionRects;
|
||||
int collisionMaskRadius;
|
||||
int touchDamage;
|
||||
|
||||
float alphaMod;
|
||||
|
||||
|
@ -370,8 +366,6 @@ protected:
|
|||
StateData *stateData;
|
||||
float decayRate;
|
||||
float maxLife;
|
||||
|
||||
static InterpolatedVector savePosition;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue