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: Params:
Returns: Returns:
---------------------------------------------------------------------- */ ---------------------------------------------------------------------- */
void CPlayer::setState(PLAYER_STATE _state) int CPlayer::setState(PLAYER_STATE _state)
{ {
CPlayerState *nextState; CPlayerState *nextState;
int ret=false;
nextState=s_modes[m_currentMode].m_states[_state]; nextState=s_modes[m_currentMode].m_states[_state];
if(nextState) if(nextState)
@ -400,7 +401,9 @@ void CPlayer::setState(PLAYER_STATE _state)
m_currentStateClass=nextState; m_currentStateClass=nextState;
m_currentStateClass->enter(this); m_currentStateClass->enter(this);
m_currentState=_state; m_currentState=_state;
ret=true;
} }
return ret;
} }
@ -410,7 +413,7 @@ void CPlayer::setState(PLAYER_STATE _state)
Params: Params:
Returns: Returns:
---------------------------------------------------------------------- */ ---------------------------------------------------------------------- */
void CPlayer::setMode(PLAYER_MODE _mode) void CPlayer::setMode(PLAYER_MODE _mode)
{ {
m_currentMode=_mode; m_currentMode=_mode;
setState(m_currentState); setState(m_currentState);
@ -431,20 +434,8 @@ void CPlayer::setFacing(int _facing)
{ {
if(m_facing!=_facing) if(m_facing!=_facing)
{ {
switch(_facing) m_facing=_facing;
{ m_skel.setDir(_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;
}
} }
} }
int CPlayer::getAnimFrame() int CPlayer::getAnimFrame()

View file

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

View file

@ -63,9 +63,9 @@ const PlayerMetrics *CPlayerState::getPlayerMetrics(CPlayer *_player)
Params: Params:
Returns: 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: protected:
const struct PlayerMetrics *getPlayerMetrics(class CPlayer *_player); 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); int getFacing(class CPlayer *_player);
void setFacing(class CPlayer *_player,int _facing); void setFacing(class CPlayer *_player,int _facing);
int getAnimNo(class CPlayer *_player); int getAnimNo(class CPlayer *_player);