1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-12-25 14:15:46 +00:00

Make some ints floats.

This commit is contained in:
fgenesis 2013-07-20 20:17:57 +02:00
parent 9f4c55c177
commit c2506d5bb2
12 changed files with 18 additions and 18 deletions

View file

@ -48,7 +48,7 @@ Beam::Beam(Vector pos, float angle) : Quad()
beamWidth = 16; beamWidth = 16;
} }
void Beam::setBeamWidth(int w) void Beam::setBeamWidth(float w)
{ {
beamWidth = w; beamWidth = w;
} }

View file

@ -205,7 +205,7 @@ void CollideEntity::updateMovement(float dt)
if (vel.x != 0 || vel.y != 0) if (vel.x != 0 || vel.y != 0)
{ {
const int hw = collideRadius; const float hw = collideRadius;
bool freeRange = false; bool freeRange = false;
if (isv(EV_COLLIDELEVEL,1)) if (isv(EV_COLLIDELEVEL,1))

View file

@ -2716,7 +2716,7 @@ void Game::setTimerText(float time)
timerText->setText(os.str()); timerText->setText(os.str());
} }
void Game::generateCollisionMask(Quad *q, int overrideCollideRadius) void Game::generateCollisionMask(Quad *q, float overrideCollideRadius /* = 0 */)
{ {
#ifdef BBGE_BUILD_OPENGL #ifdef BBGE_BUILD_OPENGL
if (q->texture) if (q->texture)
@ -8151,7 +8151,7 @@ bool Game::collideCircleVsCircle(Entity *a, Entity *b)
return (a->position - b->position).isLength2DIn(a->collideRadius + b->collideRadius); return (a->position - b->position).isLength2DIn(a->collideRadius + b->collideRadius);
} }
bool Game::collideHairVsCircle(Entity *a, int num, const Vector &pos2, int radius, float perc, int *colSegment) bool Game::collideHairVsCircle(Entity *a, int num, const Vector &pos2, float radius, float perc, int *colSegment)
{ {
if (perc == 0) if (perc == 0)
perc = 1; perc = 1;
@ -10879,7 +10879,7 @@ Vector Game::getClosestPointOnLine(Vector a, Vector b, Vector p)
return a + V; return a + V;
} }
bool Game::collideCircleWithGrid(const Vector& position, int r) bool Game::collideCircleWithGrid(const Vector& position, float r)
{ {
Vector tile = position; Vector tile = position;
TileVector t(tile); TileVector t(tile);

View file

@ -670,9 +670,9 @@ public:
void registerSporeDrop(const Vector &pos, int t); void registerSporeDrop(const Vector &pos, int t);
bool collideBoxWithGrid(const Vector& position, int w, int h); bool collideBoxWithGrid(const Vector& position, int w, int h);
bool collideCircleWithGrid(const Vector& position, int r); bool collideCircleWithGrid(const Vector& position, float r);
bool collideHairVsCircle(Entity *a, int num, const Vector &pos2, int radius, float perc=0, int *colSegment=0); bool collideHairVsCircle(Entity *a, int num, const Vector &pos2, float radius, float perc=0, int *colSegment=0);
bool collideCircleVsCircle(Entity *a, Entity *b); bool collideCircleVsCircle(Entity *a, Entity *b);
Bone *collideSkeletalVsCircle(Entity *skeletal, Entity *circle); Bone *collideSkeletalVsCircle(Entity *skeletal, Entity *circle);
@ -823,7 +823,7 @@ public:
void setTimerTextAlpha(float a, float t); void setTimerTextAlpha(float a, float t);
void setTimerText(float time); void setTimerText(float time);
void generateCollisionMask(Quad *q, int overrideCollideRadius=0); void generateCollisionMask(Quad *q, float overrideCollideRadius=0);
std::string sceneNatureForm; std::string sceneNatureForm;
std::string fromScene, toNode; std::string fromScene, toNode;
int toFlip; int toFlip;

View file

@ -56,7 +56,7 @@ Path::Path()
spiritFreeze = true; spiritFreeze = true;
} }
void Path::clampPosition(Vector *pos, int radius) void Path::clampPosition(Vector *pos, float radius)
{ {
if (pathShape == PATHSHAPE_CIRCLE) if (pathShape == PATHSHAPE_CIRCLE)
{ {

View file

@ -76,7 +76,7 @@ public:
~Path(); ~Path();
void destroy(); void destroy();
void init(); void init();
void clampPosition(Vector *pos, int rad=0); void clampPosition(Vector *pos, float rad=0);
void song(SongType song); void song(SongType song);
void songNote(int note); void songNote(int note);
void songNoteDone(int note, float len); void songNoteDone(int note, float len);

View file

@ -227,7 +227,7 @@ void ScriptedEntity::setupEntity(const std::string &tex, int lcode)
this->layer = dsq->getEntityLayerToLayer(lcode); this->layer = dsq->getEntityLayerToLayer(lcode);
} }
void ScriptedEntity::setupBasicEntity(const std::string& texture, int health, int manaBall, int exp, int money, int collideRadius, int state, int w, int h, int expType, bool hitEntity, int updateCull, int layer) void ScriptedEntity::setupBasicEntity(const std::string& texture, int health, int manaBall, int exp, int money, float collideRadius, int state, int w, int h, int expType, bool hitEntity, int updateCull, int layer)
{ {
//this->updateCull = updateCull; //this->updateCull = updateCull;
updateCull = -1; updateCull = -1;

View file

@ -37,7 +37,7 @@ public:
void resetTimer(float t); void resetTimer(float t);
void setEntityLayer(int layer); void setEntityLayer(int layer);
void setupEntity(const std::string &tex, int layer=0); void setupEntity(const std::string &tex, int layer=0);
void setupBasicEntity(const std::string& texture, int health, int manaBall, int exp, int money, int collideRadius, int state, int w, int h, int expType, bool hitEntity, int updateCull, int layer); void setupBasicEntity(const std::string& texture, int health, int manaBall, int exp, int money, float collideRadius, int state, int w, int h, int expType, bool hitEntity, int updateCull, int layer);
void initSegments(int numSegments, int minDist, int maxDist, std::string bodyTex, std::string tailTex, int w, int h, float taper, bool reverseSegments); void initSegments(int numSegments, int minDist, int maxDist, std::string bodyTex, std::string tailTex, int w, int h, float taper, bool reverseSegments);
void registerNewPart(RenderObject *r, const std::string &name); void registerNewPart(RenderObject *r, const std::string &name);
typedef std::map<std::string, RenderObject*> PartMap; typedef std::map<std::string, RenderObject*> PartMap;

View file

@ -166,9 +166,9 @@ public:
void setDamage(float dmg); void setDamage(float dmg);
void setFirer(Entity *e); void setFirer(Entity *e);
void setBeamWidth(int w); void setBeamWidth(float w);
protected: protected:
int beamWidth; float beamWidth;
void onRender(); void onRender();
void onEndOfLife(); void onEndOfLife();
void onUpdate(float dt); void onUpdate(float dt);

View file

@ -289,13 +289,13 @@ public:
//D3DXMATRIX matrix; //D3DXMATRIX matrix;
#endif #endif
int collideRadius; float collideRadius;
Vector collidePosition; Vector collidePosition;
std::vector<Vector> collisionMask; std::vector<Vector> collisionMask;
std::vector<Vector> transformedCollisionMask; std::vector<Vector> transformedCollisionMask;
CollideRects collisionRects; CollideRects collisionRects;
int collisionMaskRadius; float collisionMaskRadius;
float alphaMod; float alphaMod;

View file

@ -1079,7 +1079,7 @@ Bone *SkeletalSprite::getBoneByIdx(int idx)
return 0; return 0;
} }
Bone *SkeletalSprite::initBone(int idx, std::string gfx, int pidx, int rbp, std::string name, int cr, bool fh, bool fv, const Vector &cp) Bone *SkeletalSprite::initBone(int idx, std::string gfx, int pidx, int rbp, std::string name, float cr, bool fh, bool fv, const Vector &cp)
{ {
Bone *b = new Bone; Bone *b = new Bone;
b->boneIdx = idx; b->boneIdx = idx;

View file

@ -270,7 +270,7 @@ protected:
int selectedBone; int selectedBone;
friend class AnimationLayer; friend class AnimationLayer;
std::vector<AnimationLayer> animLayers; std::vector<AnimationLayer> animLayers;
Bone* initBone(int idx, std::string gfx, int pidx, int rbp=0, std::string name="", int cr=0, bool fh=false, bool fv=false, const Vector &cp=Vector(0,0,0)); Bone* initBone(int idx, std::string gfx, int pidx, int rbp=0, std::string name="", float cr=0, bool fh=false, bool fv=false, const Vector &cp=Vector(0,0,0));
void deleteBones(); void deleteBones();
void onUpdate(float dt); void onUpdate(float dt);
}; };