This commit is contained in:
parent
dad689a2d2
commit
621edaf8f9
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -410,7 +413,7 @@ void CPlayer::setState(PLAYER_STATE _state)
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CPlayer::setMode(PLAYER_MODE _mode)
|
||||
void CPlayer::setMode(PLAYER_MODE _mode)
|
||||
{
|
||||
m_currentMode=_mode;
|
||||
setState(m_currentState);
|
||||
@ -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()
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user