'tile' --> 'getTile', 'orignalTile' --> 'getOrignalTile'

This commit is contained in:
James Chen 2013-07-10 14:17:42 +08:00
parent a6db6db334
commit d830bb5f96
4 changed files with 24 additions and 6 deletions

View File

@ -53,6 +53,7 @@ ActionCamera* ActionCamera::clone() const
ActionCamera * ActionCamera::reverse() const
{
// FIXME: This conversion isn't safe.
return (ActionCamera*)ReverseTime::create(const_cast<ActionCamera*>(this));
}
//

View File

@ -76,6 +76,7 @@ void GridAction::startWithTarget(Node *pTarget)
GridAction* GridAction::reverse() const
{
// FIXME: This conversion isn't safe.
return (GridAction*)ReverseTime::create( this->clone() );
}
@ -132,13 +133,13 @@ GridBase* TiledGrid3DAction::getGrid(void)
Quad3 TiledGrid3DAction::getTile(const Point& pos)
{
TiledGrid3D *g = (TiledGrid3D*)_target->getGrid();
return g->tile(pos);
return g->getTile(pos);
}
Quad3 TiledGrid3DAction::getOriginalTile(const Point& pos)
{
TiledGrid3D *g = (TiledGrid3D*)_target->getGrid();
return g->originalTile(pos);
return g->getOriginalTile(pos);
}
Quad3 TiledGrid3DAction::tile(const Point& pos)

View File

@ -663,7 +663,7 @@ void TiledGrid3D::setTile(const Point& pos, const Quad3& coords)
memcpy(&vertArray[idx], &coords, sizeof(Quad3));
}
Quad3 TiledGrid3D::originalTile(const Point& pos)
Quad3 TiledGrid3D::getOriginalTile(const Point& pos)
{
CCAssert( pos.x == (unsigned int)pos.x && pos.y == (unsigned int) pos.y , "Numbers must be integers");
int idx = (_gridSize.height * pos.x + pos.y) * 4 * 3;
@ -675,7 +675,7 @@ Quad3 TiledGrid3D::originalTile(const Point& pos)
return ret;
}
Quad3 TiledGrid3D::tile(const Point& pos)
Quad3 TiledGrid3D::getTile(const Point& pos)
{
CCAssert( pos.x == (unsigned int)pos.x && pos.y == (unsigned int) pos.y , "Numbers must be integers");
int idx = (_gridSize.height * pos.x + pos.y) * 4 * 3;
@ -687,6 +687,16 @@ Quad3 TiledGrid3D::tile(const Point& pos)
return ret;
}
Quad3 TiledGrid3D::originalTile(const Point& pos)
{
return getOriginalTile(pos);
}
Quad3 TiledGrid3D::tile(const Point& pos)
{
return getTile(pos);
}
void TiledGrid3D::reuse(void)
{
if (_reuseGrid > 0)

View File

@ -160,9 +160,15 @@ public:
~TiledGrid3D(void);
/** returns the tile at the given position */
Quad3 tile(const Point& pos);
CC_DEPRECATED_ATTRIBUTE Quad3 tile(const Point& pos);
/** returns the original tile (untransformed) at the given position */
Quad3 originalTile(const Point& pos);
CC_DEPRECATED_ATTRIBUTE Quad3 originalTile(const Point& pos);
/** returns the tile at the given position */
Quad3 getTile(const Point& pos);
/** returns the original tile (untransformed) at the given position */
Quad3 getOriginalTile(const Point& pos);
/** sets a new tile */
void setTile(const Point& pos, const Quad3& coords);