- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon

maintains its own FOV scale independent from any other weapons the player
  may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
  crashed after giving you the warning.


SVN r1688 (trunk)
This commit is contained in:
Randy Heit 2009-06-30 19:20:39 +00:00
commit ed0d804792
6 changed files with 78 additions and 29 deletions

View file

@ -59,6 +59,10 @@ void AWeapon::Serialize (FArchive &arc)
<< Ammo1 << Ammo2 << SisterWeapon << GivenAsMorphWeapon
<< bAltFire
<< ReloadCounter;
if (SaveVersion >= 1688)
{
arc << FOVScale;
}
}
//===========================================================================
@ -1690,3 +1694,27 @@ const PClass *Net_ReadWeapon(BYTE **stream)
}
return Weapons_ntoh[index];
}
//===========================================================================
//
// A_ZoomFactor
//
//===========================================================================
DEFINE_ACTION_FUNCTION_PARAMS(AWeapon, A_ZoomFactor)
{
ACTION_PARAM_START(2);
ACTION_PARAM_FLOAT(zoom, 0);
ACTION_PARAM_INT(flags, 1);
if (self->player != NULL && self->player->ReadyWeapon != NULL)
{
zoom = 1 / clamp(zoom, 0.1f, 50.f);
self->player->ReadyWeapon->FOVScale = zoom;
if (flags & 1)
{
// Make the zoom instant.
self->player->FOV = self->player->DesiredFOV * zoom;
}
}
}