Changes to fix divide by 0 warning under VS.

This commit is contained in:
Robert Osfield
2005-10-24 18:51:36 +00:00
parent 51f74bd37a
commit 758ee8ed80
2 changed files with 3 additions and 3 deletions

View File

@@ -548,8 +548,8 @@ namespace osgParticle
inline void Particle::setTextureTile(int sTile, int tTile, int numTiles)
{
_s_tile = 1.0f / static_cast<float>(sTile);
_t_tile = 1.0f / static_cast<float>(tTile);
_s_tile = (sTile>0) ? 1.0f / static_cast<float>(sTile) : 1.0f;
_t_tile = (tTile>0) ? 1.0f / static_cast<float>(tTile) : 1.0f;
if (numTiles <= 0)
{
_num_tile = sTile * tTile;