SBSPSS/source/player/psfloat.cpp
Charles 6867ac9812
2001-06-15 20:36:45 +00:00

118 lines
2.2 KiB
C++

/*=========================================================================
psfloat.cpp
Author: CRB
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
/*----------------------------------------------------------------------
Includes
-------- */
#include "player\psfloat.h"
#ifndef __PLAYER_PLAYER_H__
#include "player\player.h"
#endif
#ifndef __PLAYER_PMODES_H__
#include "player\pmodes.h"
#endif
#ifndef __SOUND_SOUND_H__
#include "sound\sound.h"
#endif
#ifndef __PLATFORM_PLATFORM_H__
#include "platform\platform.h"
#endif
/* Std Lib
------- */
/* Data
---- */
#ifndef __ANIM_SPONGEBOB_HEADER__
#include <ACTOR_SPONGEBOB_ANIM.h>
#endif
/*----------------------------------------------------------------------
Tyepdefs && Defines
------------------- */
/*----------------------------------------------------------------------
Structure defintions
-------------------- */
/*----------------------------------------------------------------------
Function Prototypes
------------------- */
/*----------------------------------------------------------------------
Vars
---- */
CPlayerStateFloat s_stateFloat;
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerStateFloat::enter(CPlayerModeBase *_playerMode)
{
m_isActive = true;
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerStateFloat::think(CPlayerModeBase *_playerMode)
{
if ( _playerMode->advanceAnimFrameAndCheckForEndOfAnim() )
{
_playerMode->setAnimNo( ANIM_SPONGEBOB_IDLEBREATH );
}
int controlHeld;
controlHeld=_playerMode->getPadInputHeld();
if(controlHeld&PI_LEFT)
{
_playerMode->moveLeft();
}
else if(controlHeld&PI_RIGHT)
{
_playerMode->moveRight();
}
if ( m_isActive )
{
m_isActive = false;
}
else
{
_playerMode->setState( STATE_IDLE );
}
}
/*===========================================================================
end */