- Fixed: Ouch state was far to easy to achieve.

SVN r1013 (trunk)
This commit is contained in:
Christoph Oelckers 2008-06-01 22:41:46 +00:00
parent 47aacc45c8
commit 8d5d742287
7 changed files with 19 additions and 11 deletions

View file

@ -1,4 +1,5 @@
June 1, 2008 (Changes by Graf Zahl)
- Fixed: Ouch state was far to easy to achieve.
- Made all the basic texture classes local to their implementation.
They are not needed anywhere else.
- Changed the HackHack hack for corrupt 256 pixel high textures that

View file

@ -724,9 +724,9 @@ private:
}
}
void SetMugShotState (const char *state_name, bool wait_till_done)
void SetMugShotState (const char *state_name, bool wait_till_done, bool reset)
{
MugShot.SetState(state_name, wait_till_done);
MugShot.SetState(state_name, wait_till_done, reset);
}
enum

View file

@ -201,7 +201,7 @@ struct FMugShot
{
FMugShot();
void Tick(player_t *player);
bool SetState(const char *state_name, bool wait_till_done=false);
bool SetState(const char *state_name, bool wait_till_done=false, bool reset=false);
int UpdateState(player_t *player, bool xdeath, bool animated_god_mode);
FTexture *GetFace(player_t *player, const char *default_face, int accuracy, bool xdeath, bool animated_god_mode);
@ -293,7 +293,7 @@ public:
virtual void ShowPop (int popnum);
virtual void ReceivedWeapon (AWeapon *weapon);
virtual bool MustDrawLog(EHudState state);
virtual void SetMugShotState (const char *state_name, bool wait_till_done=false);
virtual void SetMugShotState (const char *state_name, bool wait_till_done=false, bool reset=false);
void DrawLog();
protected:

View file

@ -270,13 +270,15 @@ void FMugShot::Tick(player_t *player)
//
// Sets the mug shot state and resets it if it is not the state we are
// already on. Wait_till_done is basically a priority variable; when set to
// true the state won't change unless the previous state is finished.
// true the state won't change unless the previous state is finished. Reset
// overrides the behavior of only switching when the state is not the one we
// are already on.
// Returns true if the requested state was switched to or is already playing,
// and false if the requested state could not be set.
//
//===========================================================================
bool FMugShot::SetState(const char *state_name, bool wait_till_done)
bool FMugShot::SetState(const char *state_name, bool wait_till_done, bool reset)
{
// Search for full name.
FMugShotState *state = FindMugShotState(FName(state_name, true));
@ -306,6 +308,11 @@ bool FMugShot::SetState(const char *state_name, bool wait_till_done)
}
return false;
}
else if(reset)
{
state->Reset();
return true;
}
return true;
}
@ -379,7 +386,7 @@ int FMugShot::UpdateState(player_t *player, bool xdeath, bool animated_god_mode)
full_state_name = "pain.";
}
full_state_name += player->LastDamageType;
if (SetState(full_state_name))
if (SetState(full_state_name, false, true))
{
bDamageFaceActive = (CurrentState != NULL);
LastDamageAngle = damage_angle;

View file

@ -339,7 +339,7 @@ public:
void ReceivedWeapon (AWeapon *weapon);
void FlashItem(const PClass *itemtype);
void ShowPop(int popnum);
void SetMugShotState(const char* stateName, bool waitTillDone=false);
void SetMugShotState(const char* stateName, bool waitTillDone=false, bool reset=false);
private:
void doCommands(SBarInfoBlock &block, int xOffset=0, int yOffset=0, int alpha=FRACUNIT);
void DrawGraphic(FTexture* texture, int x, int y, int xOffset, int yOffset, int alpha, bool translate=false, bool dim=false, bool center=false);

View file

@ -265,9 +265,9 @@ void DSBarInfo::AttachToPlayer (player_t *player)
MugShot.CurrentState = NULL;
}
void DSBarInfo::SetMugShotState (const char *state_name, bool wait_till_done)
void DSBarInfo::SetMugShotState (const char *state_name, bool wait_till_done, bool reset)
{
MugShot.SetState(state_name, wait_till_done);
MugShot.SetState(state_name, wait_till_done, reset);
}
void DSBarInfo::Tick ()

View file

@ -1331,7 +1331,7 @@ bool DBaseStatusBar::MustDrawLog(EHudState)
return true;
}
void DBaseStatusBar::SetMugShotState(const char *stateName, bool waitTillDone)
void DBaseStatusBar::SetMugShotState(const char *stateName, bool waitTillDone, bool reset)
{
}