- Added SnowKate709's APROP_MaxHealth submission.

- Fixed: FTexture::GetScaledWidth/Height always rounded down which could result in
  imprecisions (e.g. when scaling from 128 to 96.)


SVN r722 (trunk)
This commit is contained in:
Christoph Oelckers 2008-01-28 09:39:46 +00:00
parent c02ed1263f
commit ebbe9c84f8
3 changed files with 25 additions and 4 deletions

View File

@ -1,4 +1,7 @@
January 27, 2008 (Changes by Graf Zahl)
- Added SnowKate709's APROP_MaxHealth submission.
- Fixed: FTexture::GetScaledWidth/Height always rounded down which could result in
imprecisions (e.g. when scaling from 128 to 96.)
- added a mastervolume CVAR for Timidity because for me its output is considerably
louder than everything else.
- reverted removal of AddPatch call in crosshair initialization.

View File

@ -2146,6 +2146,7 @@ void DLevelScript::DoSetFont (int fontnum)
#define APROP_Frightened 14
#define APROP_Gravity 15
#define APROP_Friendly 16
#define APROP_SpawnHealth 17
#define APROP_SeeSound 5 // Sounds can only be set, not gotten
#define APROP_AttackSound 6
#define APROP_PainSound 7
@ -2259,6 +2260,14 @@ void DLevelScript::DoSetActorProperty (AActor *actor, int property, int value)
actor->flags &= ~MF_FRIENDLY;
break;
case APROP_SpawnHealth:
if (actor->IsKindOf (RUNTIME_CLASS (APlayerPawn)))
{
static_cast<APlayerPawn *>(actor)->MaxHealth = value;
}
break;
case APROP_Gravity:
actor->gravity = value;
break;
@ -2327,6 +2336,15 @@ int DLevelScript::GetActorProperty (int tid, int property)
case APROP_ChaseGoal: return !!(actor->flags5 & MF5_CHASEGOAL);
case APROP_Frightened: return !!(actor->flags4 & MF4_FRIGHTENED);
case APROP_Friendly: return !!(actor->flags & MF_FRIENDLY);
case APROP_SpawnHealth: if (actor->IsKindOf (RUNTIME_CLASS (APlayerPawn)))
{
return static_cast<APlayerPawn *>(actor)->MaxHealth;
}
else
{
return actor->GetDefault()->health;
}
case APROP_JumpZ: if (actor->IsKindOf (RUNTIME_CLASS (APlayerPawn)))
{
return static_cast<APlayerPawn *>(actor)->JumpZ; // [GRB]

View File

@ -688,11 +688,11 @@ public:
int GetWidth () { return Width; }
int GetHeight () { return Height; }
int GetScaledWidth () { return DivScale16(Width, xScale); }
int GetScaledHeight () { return DivScale16(Height, yScale); }
int GetScaledWidth () { return ((Width<<16) + (xScale>>1)) / xScale; }
int GetScaledHeight () { return ((Height<<16) + (yScale>>1)) / yScale; }
int GetScaledLeftOffset () { return DivScale16(LeftOffset, xScale); }
int GetScaledTopOffset () { return DivScale16(TopOffset, yScale); }
int GetScaledLeftOffset () { return ((LeftOffset<<16) + (xScale>>1)) / xScale; }
int GetScaledTopOffset () { return ((TopOffset<<16) + (yScale>>1)) / yScale; }
virtual void SetFrontSkyLayer();