- Fixed: DDoomStatusBar::UpdateState() needed the same fix as DSBarInfo::updateState(), since it

received a code infusion from there.

SVN r1007 (trunk)
This commit is contained in:
Randy Heit 2008-05-31 03:49:56 +00:00
parent ded428230d
commit 6a264daa04
3 changed files with 23 additions and 26 deletions

View file

@ -5,8 +5,8 @@ May 30, 2008
playing while the sound is paused. playing while the sound is paused.
- Fixed: S_StartNamedSound() looked for SECF_SILENT in MoreFlags instead of - Fixed: S_StartNamedSound() looked for SECF_SILENT in MoreFlags instead of
Flags. Flags.
- Fixed: DSBarInfo::updateState() sprung leaks and didn't allocate enough - Fixed: DSBarInfo::updateState() and DDoomStatusBar::UpdateState() sprung
space for the fullStateName string. leaks and didn't allocate enough space for the fullStateName string.
- Disabled DUMB's mono destination mixers. It's not like I'm ever going to - Disabled DUMB's mono destination mixers. It's not like I'm ever going to
target an original SoundBlaster, so they're a waste of space to have around. target an original SoundBlaster, so they're a waste of space to have around.
This trims resample.obj down to ~60k now. This trims resample.obj down to ~60k now.

View file

@ -801,16 +801,16 @@ private:
} }
} }
bool useOuch = false; bool useOuch = false;
const char* stateName = new char[5]; const char *stateName;
if ((FaceHealth != -1 && CPlayer->health - FaceHealth > 20) || bOuchActive) if ((FaceHealth != -1 && CPlayer->health - FaceHealth > 20) || bOuchActive)
{ {
useOuch = true; useOuch = true;
stateName = "ouch"; stateName = "ouch.";
} }
else else
stateName = "pain"; stateName = "pain.";
char* fullStateName = new char[sizeof(stateName)+sizeof((const char*) CPlayer->LastDamageType) + 1]; FString fullStateName;
sprintf(fullStateName, "%s.%s", stateName, (const char*) CPlayer->LastDamageType); fullStateName << stateName << CPlayer->LastDamageType;
if(FindMugShotState(fullStateName) != NULL) if(FindMugShotState(fullStateName) != NULL)
SetMugShotState(fullStateName); SetMugShotState(fullStateName);
else else
@ -827,16 +827,16 @@ private:
else else
{ {
bool useOuch = false; bool useOuch = false;
const char* stateName = new char[5]; const char *stateName;
if ((FaceHealth != -1 && CPlayer->health - FaceHealth > 20) || bOuchActive) if ((FaceHealth != -1 && CPlayer->health - FaceHealth > 20) || bOuchActive)
{ {
useOuch = true; useOuch = true;
stateName = "ouch"; stateName = "ouch.";
} }
else else
stateName = "pain"; stateName = "pain.";
char* fullStateName = new char[sizeof(stateName)+sizeof((const char*) CPlayer->LastDamageType) + 1]; FString fullStateName;
sprintf(fullStateName, "%s.%s", stateName, (const char*) CPlayer->LastDamageType); fullStateName << stateName << CPlayer->LastDamageType;
if(FindMugShotState(fullStateName) != NULL) if(FindMugShotState(fullStateName) != NULL)
SetMugShotState(fullStateName); SetMugShotState(fullStateName);
else else
@ -863,11 +863,8 @@ private:
} }
else else
{ {
const char* stateName = new char[7]; FString fullStateName;
stateName = "death"; fullStateName << "death." << CPlayer->LastDamageType;
//new string the size of stateName and the damage type put together
char* fullStateName = new char[sizeof(stateName)+sizeof((const char*) CPlayer->LastDamageType) + 1];
sprintf(fullStateName, "%s.%s", stateName, (const char*) CPlayer->LastDamageType);
if(FindMugShotState(fullStateName) != NULL) if(FindMugShotState(fullStateName) != NULL)
SetMugShotState(fullStateName); SetMugShotState(fullStateName);
else else

View file

@ -1427,12 +1427,12 @@ int DSBarInfo::updateState(bool xdth, bool animatedgodmode)
if ((mugshotHealth != -1 && CPlayer->health - mugshotHealth > 20) || ouchActive) if ((mugshotHealth != -1 && CPlayer->health - mugshotHealth > 20) || ouchActive)
{ {
setOuch = true; setOuch = true;
stateName = "ouch"; stateName = "ouch.";
} }
else else
stateName = "pain"; stateName = "pain.";
FString fullStateName; FString fullStateName;
fullStateName << stateName << '.' << CPlayer->LastDamageType; fullStateName << stateName << CPlayer->LastDamageType;
if(FindMugShotState(fullStateName) != NULL) if(FindMugShotState(fullStateName) != NULL)
SetMugShotState(fullStateName); SetMugShotState(fullStateName);
else else
@ -1453,12 +1453,12 @@ int DSBarInfo::updateState(bool xdth, bool animatedgodmode)
if ((mugshotHealth != -1 && CPlayer->health - mugshotHealth > 20) || ouchActive) if ((mugshotHealth != -1 && CPlayer->health - mugshotHealth > 20) || ouchActive)
{ {
setOuch = true; setOuch = true;
stateName = "ouch"; stateName = "ouch.";
} }
else else
stateName = "pain"; stateName = "pain.";
FString fullStateName; FString fullStateName;
fullStateName << stateName << '.' << CPlayer->LastDamageType; fullStateName << stateName << CPlayer->LastDamageType;
if(FindMugShotState(fullStateName) != NULL) if(FindMugShotState(fullStateName) != NULL)
SetMugShotState(fullStateName); SetMugShotState(fullStateName);
else else
@ -1492,11 +1492,11 @@ int DSBarInfo::updateState(bool xdth, bool animatedgodmode)
{ {
const char *stateName; const char *stateName;
if(!xdth || !(CPlayer->cheats & CF_EXTREMELYDEAD)) if(!xdth || !(CPlayer->cheats & CF_EXTREMELYDEAD))
stateName = "death"; stateName = "death.";
else else
stateName = "xdeath"; stateName = "xdeath.";
FString fullStateName; FString fullStateName;
fullStateName << stateName << '.' << CPlayer->LastDamageType; fullStateName << stateName << CPlayer->LastDamageType;
if(FindMugShotState(fullStateName) != NULL) if(FindMugShotState(fullStateName) != NULL)
SetMugShotState(fullStateName); SetMugShotState(fullStateName);
else else