mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-27 14:21:46 +00:00
- Fixed: Ouch state was far to easy to achieve.
SVN r1013 (trunk)
This commit is contained in:
parent
47aacc45c8
commit
8d5d742287
7 changed files with 19 additions and 11 deletions
|
@ -1,4 +1,5 @@
|
||||||
June 1, 2008 (Changes by Graf Zahl)
|
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.
|
- Made all the basic texture classes local to their implementation.
|
||||||
They are not needed anywhere else.
|
They are not needed anywhere else.
|
||||||
- Changed the HackHack hack for corrupt 256 pixel high textures that
|
- Changed the HackHack hack for corrupt 256 pixel high textures that
|
||||||
|
|
|
@ -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
|
enum
|
||||||
|
|
|
@ -201,7 +201,7 @@ struct FMugShot
|
||||||
{
|
{
|
||||||
FMugShot();
|
FMugShot();
|
||||||
void Tick(player_t *player);
|
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);
|
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);
|
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 ShowPop (int popnum);
|
||||||
virtual void ReceivedWeapon (AWeapon *weapon);
|
virtual void ReceivedWeapon (AWeapon *weapon);
|
||||||
virtual bool MustDrawLog(EHudState state);
|
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();
|
void DrawLog();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -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
|
// 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
|
// 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,
|
// Returns true if the requested state was switched to or is already playing,
|
||||||
// and false if the requested state could not be set.
|
// 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.
|
// Search for full name.
|
||||||
FMugShotState *state = FindMugShotState(FName(state_name, true));
|
FMugShotState *state = FindMugShotState(FName(state_name, true));
|
||||||
|
@ -306,6 +308,11 @@ bool FMugShot::SetState(const char *state_name, bool wait_till_done)
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
else if(reset)
|
||||||
|
{
|
||||||
|
state->Reset();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
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 = "pain.";
|
||||||
}
|
}
|
||||||
full_state_name += player->LastDamageType;
|
full_state_name += player->LastDamageType;
|
||||||
if (SetState(full_state_name))
|
if (SetState(full_state_name, false, true))
|
||||||
{
|
{
|
||||||
bDamageFaceActive = (CurrentState != NULL);
|
bDamageFaceActive = (CurrentState != NULL);
|
||||||
LastDamageAngle = damage_angle;
|
LastDamageAngle = damage_angle;
|
||||||
|
|
|
@ -339,7 +339,7 @@ public:
|
||||||
void ReceivedWeapon (AWeapon *weapon);
|
void ReceivedWeapon (AWeapon *weapon);
|
||||||
void FlashItem(const PClass *itemtype);
|
void FlashItem(const PClass *itemtype);
|
||||||
void ShowPop(int popnum);
|
void ShowPop(int popnum);
|
||||||
void SetMugShotState(const char* stateName, bool waitTillDone=false);
|
void SetMugShotState(const char* stateName, bool waitTillDone=false, bool reset=false);
|
||||||
private:
|
private:
|
||||||
void doCommands(SBarInfoBlock &block, int xOffset=0, int yOffset=0, int alpha=FRACUNIT);
|
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);
|
void DrawGraphic(FTexture* texture, int x, int y, int xOffset, int yOffset, int alpha, bool translate=false, bool dim=false, bool center=false);
|
||||||
|
|
|
@ -265,9 +265,9 @@ void DSBarInfo::AttachToPlayer (player_t *player)
|
||||||
MugShot.CurrentState = NULL;
|
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 ()
|
void DSBarInfo::Tick ()
|
||||||
|
|
|
@ -1331,7 +1331,7 @@ bool DBaseStatusBar::MustDrawLog(EHudState)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DBaseStatusBar::SetMugShotState(const char *stateName, bool waitTillDone)
|
void DBaseStatusBar::SetMugShotState(const char *stateName, bool waitTillDone, bool reset)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue