- Fixed: The skin loader assumed that all skin textures are in Doom patch
format. Now it calls FTexture::CreateTexture to do proper checks. - Removed the PickupSound method from FakeInventory and changed it so that it uses AInventory::PickupSound to store its custom pickup sound. - Removed the PickupMessage method from FakeInventory. This can be handled by the standard pickup message code now that it uses the meta data for the message. - Fixed: The maximum indices for StrifeTypes were inconsistent. Now the allowed range is 0-1000 in all situations. - Fixed: Setting a local SNDINFO for a map deleted all skin based sounds. - Added a crouchsprite property to the skin info. - Fixed: Crouching sprites must be checked each frame, not just each tic. - Added an srand call to D_DoomMain in order to randomize the values returned by rand which is being used to shuffle the playlist. SVN r185 (trunk)
This commit is contained in:
parent
e2179d5c2d
commit
bb5a44fc90
14 changed files with 228 additions and 103 deletions
112
src/p_user.cpp
112
src/p_user.cpp
|
|
@ -254,20 +254,6 @@ void APlayerPawn::BeginPlay ()
|
|||
|
||||
void APlayerPawn::Tick()
|
||||
{
|
||||
int crouchspriteno;
|
||||
|
||||
// FIXME: Handle skins
|
||||
|
||||
if (sprite == SpawnState->sprite.index && crouchsprite > 0)
|
||||
{
|
||||
crouchspriteno = crouchsprite;
|
||||
}
|
||||
else
|
||||
{
|
||||
// no sprite -> squash the existing one
|
||||
crouchspriteno = 0;
|
||||
}
|
||||
|
||||
if (player != NULL && player->mo == this && player->morphTics == 0 && player->playerstate != PST_DEAD)
|
||||
{
|
||||
height = FixedMul(GetDefault()->height, player->crouchfactor);
|
||||
|
|
@ -277,30 +263,10 @@ void APlayerPawn::Tick()
|
|||
if (health > 0) height = GetDefault()->height;
|
||||
}
|
||||
Super::Tick();
|
||||
|
||||
// Here's the place where crouching sprites should be handled
|
||||
if (player != NULL && player->crouchfactor<FRACUNIT*3/4)
|
||||
{
|
||||
if (crouchsprite != 0)
|
||||
{
|
||||
sprite = crouchsprite;
|
||||
yscale = GetDefault()->yscale;
|
||||
}
|
||||
else if (player->playerstate != PST_DEAD)
|
||||
{
|
||||
yscale = player->crouchfactor < FRACUNIT*3/4 ? GetDefault()->yscale/2 : GetDefault()->yscale;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sprite == crouchsprite)
|
||||
{
|
||||
sprite = SpawnState->sprite.index;
|
||||
}
|
||||
yscale = GetDefault()->yscale;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// APlayerPawn :: AddInventory
|
||||
|
|
@ -630,6 +596,80 @@ void APlayerPawn::SpecialInvulnerabilityHandling (EInvulState setting, fixed_t *
|
|||
if (setting == INVUL_GetAlpha && pAlpha!=NULL) *pAlpha=FIXED_MAX; // indicates no change
|
||||
}
|
||||
|
||||
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// P_CheckPlayerSprites
|
||||
//
|
||||
// Here's the place where crouching sprites are handled
|
||||
// This must be called each frame before rendering
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
void P_CheckPlayerSprites()
|
||||
{
|
||||
for(int i=0; i<MAXPLAYERS; i++)
|
||||
{
|
||||
player_t * player = &players[i];
|
||||
APlayerPawn * mo = player->mo;
|
||||
|
||||
if (playeringame[i] && mo != NULL)
|
||||
{
|
||||
int crouchspriteno;
|
||||
int defyscale = mo->GetDefault()->yscale;
|
||||
|
||||
if (player->userinfo.skin != 0)
|
||||
{
|
||||
defyscale = skins[player->userinfo.skin].scale;
|
||||
}
|
||||
|
||||
// FIXME: Handle skins
|
||||
|
||||
if (player->crouchfactor < FRACUNIT*3/4)
|
||||
{
|
||||
|
||||
if (mo->sprite == mo->SpawnState->sprite.index || mo->sprite == mo->crouchsprite)
|
||||
{
|
||||
crouchspriteno = mo->crouchsprite;
|
||||
}
|
||||
else if (mo->sprite == skins[player->userinfo.skin].sprite ||
|
||||
mo->sprite == skins[player->userinfo.skin].crouchsprite)
|
||||
{
|
||||
crouchspriteno = skins[player->userinfo.skin].crouchsprite;
|
||||
}
|
||||
else
|
||||
{
|
||||
// no sprite -> squash the existing one
|
||||
crouchspriteno = -1;
|
||||
}
|
||||
|
||||
if (crouchspriteno > 0)
|
||||
{
|
||||
mo->sprite = crouchspriteno;
|
||||
mo->yscale = defyscale;
|
||||
}
|
||||
else if (player->playerstate != PST_DEAD)
|
||||
{
|
||||
mo->yscale = player->crouchfactor < FRACUNIT*3/4 ? defyscale/2 : defyscale;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mo->sprite == mo->crouchsprite)
|
||||
{
|
||||
mo->sprite = mo->SpawnState->sprite.index;
|
||||
}
|
||||
else if (mo->sprite == skins[player->userinfo.skin].crouchsprite)
|
||||
{
|
||||
mo->sprite = skins[player->userinfo.skin].sprite;
|
||||
}
|
||||
mo->yscale = defyscale;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
=
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue