- Separated the skin scale values into separate X and Y values so that skins

automatically generated for different player classes can use both the
  scaling values that can be set for the actor.


SVN r947 (trunk)
This commit is contained in:
Randy Heit 2008-04-27 22:33:19 +00:00
parent 60b236fdc5
commit 1f8e471eba
7 changed files with 27 additions and 13 deletions

View file

@ -1,3 +1,8 @@
April 27, 2008
- Separated the skin scale values into separate X and Y values so that skins
automatically generated for different player classes can use both the
scaling values that can be set for the actor.
April 26, 2008
- Fixed: Any MIDI ticks that contain only events that are interpreted by
the MIDI parser and not passed on to the MIDI device would mess up timing

View file

@ -731,7 +731,8 @@ void D_ReadUserInfoStrings (int i, BYTE **stream, bool update)
GetDefaultByType (players[i].cls)->SpawnState->sprite.index)
{ // Only change the sprite if the player is using a standard one
players[i].mo->sprite = skins[info->skin].sprite;
players[i].mo->scaleX = players[i].mo->scaleY = skins[info->skin].Scale;
players[i].mo->scaleX = skins[info->skin].ScaleX;
players[i].mo->scaleY = skins[info->skin].ScaleY;
}
}
// Rebuild translation in case the new skin uses a different range

View file

@ -2129,19 +2129,21 @@ static void M_PlayerSetupDrawer ()
}
{
spriteframe_t *sprframe;
fixed_t Scale;
fixed_t ScaleX, ScaleY;
if (GetDefaultByType (PlayerClass->Type)->flags4 & MF4_NOSKIN ||
players[consoleplayer].userinfo.PlayerClass == -1 ||
PlayerState->sprite.index != GetDefaultByType (PlayerClass->Type)->SpawnState->sprite.index)
{
sprframe = &SpriteFrames[sprites[PlayerState->sprite.index].spriteframes + PlayerState->GetFrame()];
Scale = GetDefaultByType (PlayerClass->Type)->scaleX;
ScaleX = GetDefaultByType(PlayerClass->Type)->scaleX;
ScaleY = GetDefaultByType(PlayerClass->Type)->scaleY;
}
else
{
sprframe = &SpriteFrames[sprites[skins[PlayerSkin].sprite].spriteframes + PlayerState->GetFrame()];
Scale = skins[PlayerSkin].Scale;
ScaleX = skins[PlayerSkin].ScaleX;
ScaleY = skins[PlayerSkin].ScaleY;
}
if (sprframe != NULL)
@ -2156,8 +2158,8 @@ static void M_PlayerSetupDrawer ()
screen->DrawTexture (tex,
(320 - 52 - 32 + xo - 160)*CleanXfac + (SCREENWIDTH)/2,
(PSetupDef.y + LINEHEIGHT*3 + 57 - 104)*CleanYfac + (SCREENHEIGHT/2),
DTA_DestWidth, MulScale16 (tex->GetWidth() * CleanXfac, Scale),
DTA_DestHeight, MulScale16 (tex->GetHeight() * CleanYfac, Scale),
DTA_DestWidth, MulScale16 (tex->GetWidth() * CleanXfac, ScaleX),
DTA_DestHeight, MulScale16 (tex->GetHeight() * CleanYfac, ScaleY),
DTA_Translation, translationtables[TRANSLATION_Players](MAXPLAYERS),
TAG_DONE);
}

View file

@ -399,7 +399,8 @@ void AActor::Serialize (FArchive &arc)
GetDefaultByType (player->cls)->SpawnState->sprite.index)
{ // Give player back the skin
sprite = skins[player->userinfo.skin].sprite;
scaleX = scaleY = skins[player->userinfo.skin].Scale;
scaleX = skins[player->userinfo.skin].ScaleX;
scaleY = skins[player->userinfo.skin].ScaleY;
}
if (Speed == 0)
{
@ -3613,7 +3614,8 @@ APlayerPawn *P_SpawnPlayer (mapthing2_t *mthing, bool tempplayer)
// [RH] Set player sprite based on skin
mobj->sprite = skins[p->userinfo.skin].sprite;
mobj->scaleX = mobj->scaleY = skins[p->userinfo.skin].Scale;
mobj->scaleX = skins[p->userinfo.skin].ScaleX;
mobj->scaleY = skins[p->userinfo.skin].ScaleY;
p->DesiredFOV = p->FOV = 90.f;
p->camera = p->mo;

View file

@ -1329,7 +1329,7 @@ void P_CheckPlayerSprites()
if (player->userinfo.skin != 0)
{
defscaleY = skins[player->userinfo.skin].Scale;
defscaleY = skins[player->userinfo.skin].ScaleY;
}
// Set the crouch sprite

View file

@ -1063,7 +1063,8 @@ public:
BYTE range0start;
BYTE range0end;
bool othergame; // [GRB]
fixed_t Scale;
fixed_t ScaleX;
fixed_t ScaleY;
int sprite;
int crouchsprite;
int namespc; // namespace for this skin

View file

@ -509,7 +509,8 @@ void R_InitSkins (void)
}
else if (0 == stricmp (key, "scale"))
{
skins[i].Scale = clamp<fixed_t> (FLOAT2FIXED(atof (sc.String)), 1, 256*FRACUNIT);
skins[i].ScaleX = clamp<fixed_t> (FLOAT2FIXED(atof (sc.String)), 1, 256*FRACUNIT);
skins[i].ScaleY = skins[i].ScaleX;
}
else if (0 == stricmp (key, "game"))
{
@ -875,7 +876,8 @@ void R_InitSprites ()
const PClass *type = PlayerClasses[0].Type;
skins[i].range0start = type->Meta.GetMetaInt (APMETA_ColorRange) & 255;
skins[i].range0end = type->Meta.GetMetaInt (APMETA_ColorRange) >> 8;
skins[i].Scale = GetDefaultByType (type)->scaleX;
skins[i].ScaleX = GetDefaultByType (type)->scaleX;
skins[i].ScaleY = GetDefaultByType (type)->scaleY;
}
R_InitSpriteDefs ();
@ -903,7 +905,8 @@ void R_InitSprites ()
}
skins[i].range0start = basetype->Meta.GetMetaInt (APMETA_ColorRange) & 255;
skins[i].range0end = basetype->Meta.GetMetaInt (APMETA_ColorRange) >> 8;
skins[i].Scale = GetDefaultByType (basetype)->scaleX;
skins[i].ScaleX = GetDefaultByType (basetype)->scaleX;
skins[i].ScaleY = GetDefaultByType (basetype)->scaleY;
skins[i].sprite = GetDefaultByType (basetype)->SpawnState->sprite.index;
skins[i].namespc = ns_global;