This commit is contained in:
Paul 2001-01-31 22:50:59 +00:00
parent dad689a2d2
commit 621edaf8f9
4 changed files with 11 additions and 20 deletions

View File

@ -390,9 +390,10 @@ const PlayerMetrics *CPlayer::getPlayerMetrics()
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayer::setState(PLAYER_STATE _state)
int CPlayer::setState(PLAYER_STATE _state)
{
CPlayerState *nextState;
int ret=false;
nextState=s_modes[m_currentMode].m_states[_state];
if(nextState)
@ -400,7 +401,9 @@ void CPlayer::setState(PLAYER_STATE _state)
m_currentStateClass=nextState;
m_currentStateClass->enter(this);
m_currentState=_state;
ret=true;
}
return ret;
}
@ -431,20 +434,8 @@ void CPlayer::setFacing(int _facing)
{
if(m_facing!=_facing)
{
switch(_facing)
{
case FACING_LEFT:
m_facing=FACING_LEFT;
m_skel.setAng(512);//1024);
break;
case FACING_RIGHT:
m_facing=FACING_RIGHT;
m_skel.setAng(3096+512);//-1024);
break;
default:
ASSERT(0);
break;
}
m_facing=_facing;
m_skel.setDir(_facing);
}
}
int CPlayer::getAnimFrame()

View File

@ -132,7 +132,7 @@ protected:
const PlayerMetrics *getPlayerMetrics();
// State
void setState(PLAYER_STATE _state);
int setState(PLAYER_STATE _state);
void setMode(PLAYER_MODE _mode);
int getFacing();
void setFacing(int _facing);

View File

@ -63,9 +63,9 @@ const PlayerMetrics *CPlayerState::getPlayerMetrics(CPlayer *_player)
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerState::setState(CPlayer *_player,int _state)
int CPlayerState::setState(CPlayer *_player,int _state)
{
_player->setState((PLAYER_STATE)_state);
return _player->setState((PLAYER_STATE)_state);
}

View File

@ -43,7 +43,7 @@ public:
protected:
const struct PlayerMetrics *getPlayerMetrics(class CPlayer *_player);
void setState(class CPlayer *_player,int _state);
int setState(class CPlayer *_player,int _state);
int getFacing(class CPlayer *_player);
void setFacing(class CPlayer *_player,int _facing);
int getAnimNo(class CPlayer *_player);