* Updated to ZDoom r3818:

- The Channel Group Target Unit is now only deactivated when the gamestate is GS_LEVEL. Otherwise, it just gets muted. 
- Changed vid_tft's default to true. How many people still run 1280x1024 on a CRT these days?
- Fixed: M_InitVideoModesMenu() needs to call vid_tft's callback.
- Player icons that are taller than the small font will now expand the vertical size of the player bars on the scoreboard.
- Fixed: Having +showscores down during the intermission would draw both the regular intermission scoreboard plus the HUD scoreboard.
- Fixed: hu_scores used the player icon's unscaled width when calculating sizes.

- Fixed: P_TouchSpecialThing() considered all pickup items to be 32 units tall for the sake of touching, even if they were taller.

git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1441 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
gez 2012-08-10 21:16:25 +00:00
parent 97aa505bb5
commit d3f6f84034
12 changed files with 94 additions and 35 deletions

View file

@ -273,7 +273,9 @@ void CT_Drawer (void)
if (players[consoleplayer].camera != NULL &&
(Button_ShowScores.bDown ||
players[consoleplayer].camera->health <= 0))
players[consoleplayer].camera->health <= 0) &&
// Don't draw during intermission, since it has its own scoreboard in wi_stuff.cpp.
gamestate != GS_INTERMISSION)
{
HU_DrawScores (&players[consoleplayer]);
}

View file

@ -60,7 +60,7 @@
static void HU_DoDrawScores (player_t *, player_t *[MAXPLAYERS]);
static void HU_DrawTimeRemaining (int y);
static void HU_DrawPlayer (player_t *, bool, int, int, int, int, int, int, int);
static void HU_DrawPlayer (player_t *, bool, int, int, int, int, int, int, int, int);
// EXTERNAL DATA DECLARATIONS ----------------------------------------------
@ -178,10 +178,11 @@ void HU_DrawScores (player_t *player)
//
//==========================================================================
void HU_GetPlayerWidths(int &maxnamewidth, int &maxscorewidth)
void HU_GetPlayerWidths(int &maxnamewidth, int &maxscorewidth, int &maxiconheight)
{
maxnamewidth = SmallFont->StringWidth("Name");
maxscorewidth = 0;
maxiconheight = 0;
for (int i = 0; i < MAXPLAYERS; i++)
{
@ -195,11 +196,18 @@ void HU_GetPlayerWidths(int &maxnamewidth, int &maxscorewidth)
if (players[i].mo->ScoreIcon.isValid())
{
FTexture *pic = TexMan[players[i].mo->ScoreIcon];
width = pic->GetWidth() - pic->GetScaledLeftOffset() + 2;
width = pic->GetScaledWidth() - pic->GetScaledLeftOffset() + 2;
if (width > maxscorewidth)
{
maxscorewidth = width;
}
// The icon's top offset does not count toward its height, because
// zdoom.pk3's standard Hexen class icons are designed that way.
int height = pic->GetScaledHeight() - pic->GetScaledTopOffset();
if (height > maxiconheight)
{
maxiconheight = height;
}
}
}
}
@ -214,11 +222,11 @@ void HU_GetPlayerWidths(int &maxnamewidth, int &maxscorewidth)
static void HU_DoDrawScores (player_t *player, player_t *sortedplayers[MAXPLAYERS])
{
int color;
int height = SmallFont->GetHeight() * CleanYfac;
int height, lineheight;
unsigned int i;
int maxnamewidth, maxscorewidth;
int maxnamewidth, maxscorewidth, maxiconheight;
int numTeams = 0;
int x, y, bottom;
int x, y, ypadding, bottom;
int col2, col3, col4;
if (deathmatch)
@ -233,7 +241,10 @@ static void HU_DoDrawScores (player_t *player, player_t *sortedplayers[MAXPLAYER
color = sb_cooperative_headingcolor;
}
HU_GetPlayerWidths(maxnamewidth, maxscorewidth);
HU_GetPlayerWidths(maxnamewidth, maxscorewidth, maxiconheight);
height = SmallFont->GetHeight() * CleanYfac;
lineheight = MAX(height, maxiconheight * CleanYfac);
ypadding = (lineheight - height + 1) / 2;
bottom = gamestate != GS_INTERMISSION ? ST_Y : SCREENHEIGHT;
y = MAX(48*CleanYfac, (bottom - MAXPLAYERS * (height + CleanYfac + 1)) / 2);
@ -320,8 +331,8 @@ static void HU_DoDrawScores (player_t *player, player_t *sortedplayers[MAXPLAYER
{
if (playeringame[sortedplayers[i] - players])
{
HU_DrawPlayer (sortedplayers[i], player==sortedplayers[i], x, col2, col3, col4, maxnamewidth, y, height);
y += height + CleanYfac;
HU_DrawPlayer (sortedplayers[i], player==sortedplayers[i], x, col2, col3, col4, maxnamewidth, y, ypadding, lineheight);
y += lineheight + CleanYfac;
}
}
}
@ -365,7 +376,7 @@ static void HU_DrawTimeRemaining (int y)
//
//==========================================================================
static void HU_DrawPlayer (player_t *player, bool highlight, int col1, int col2, int col3, int col4, int maxnamewidth, int y, int height)
static void HU_DrawPlayer (player_t *player, bool highlight, int col1, int col2, int col3, int col4, int maxnamewidth, int y, int ypadding, int height)
{
int color;
char str[80];
@ -386,7 +397,7 @@ static void HU_DrawPlayer (player_t *player, bool highlight, int col1, int col2,
HU_DrawColorBar(col1, y, height, (int)(player - players));
mysnprintf (str, countof(str), "%d", deathmatch ? player->fragcount : player->killcount);
screen->DrawText (SmallFont, color, col2, y, player->playerstate == PST_DEAD && !deathmatch ? "DEAD" : str,
screen->DrawText (SmallFont, color, col2, y + ypadding, player->playerstate == PST_DEAD && !deathmatch ? "DEAD" : str,
DTA_CleanNoMove, true, TAG_DONE);
if (player->mo->ScoreIcon.isValid())
@ -397,13 +408,13 @@ static void HU_DrawPlayer (player_t *player, bool highlight, int col1, int col2,
TAG_DONE);
}
screen->DrawText (SmallFont, color, col4, y, player->userinfo.netname,
screen->DrawText (SmallFont, color, col4, y + ypadding, player->userinfo.netname,
DTA_CleanNoMove, true, TAG_DONE);
if (teamplay && Teams[player->userinfo.team].GetLogo ().IsNotEmpty ())
{
FTexture *pic = TexMan[Teams[player->userinfo.team].GetLogo ().GetChars ()];
screen->DrawTexture (pic, col1 - (pic->GetWidth() + 2) * CleanXfac, y,
screen->DrawTexture (pic, col1 - (pic->GetScaledWidth() + 2) * CleanXfac, y,
DTA_CleanNoMove, true, TAG_DONE);
}
}

View file

@ -46,7 +46,7 @@ extern int chatmodeon;
// [RH] Draw deathmatch scores
void HU_DrawScores (player_t *me);
void HU_GetPlayerWidths(int &maxnamewidth, int &maxscorewidth);
void HU_GetPlayerWidths(int &maxnamewidth, int &maxscorewidth, int &maxiconheight);
void HU_DrawColorBar(int x, int y, int height, int playernum);
int HU_GetRowColor(player_t *player, bool hightlight);

View file

@ -99,7 +99,7 @@ CUSTOM_CVAR (Int, menu_screenratios, -1, CVAR_ARCHIVE)
}
}
CUSTOM_CVAR (Bool, vid_tft, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CUSTOM_CVAR (Bool, vid_tft, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
{
FOptionMenuDescriptor *opt = GetVideoModeMenu();
if (opt != NULL)
@ -316,6 +316,7 @@ void M_InitVideoModesMenu ()
size_t currval = 0;
M_RefreshModesList();
vid_tft.Callback();
for (unsigned int i = 1; i <= 32 && currval < countof(BitTranslate); i++)
{

View file

@ -86,7 +86,9 @@ void P_TouchSpecialThing (AActor *special, AActor *toucher)
{
fixed_t delta = special->z - toucher->z;
if (delta > toucher->height || delta < -32*FRACUNIT)
// The pickup is at or above the toucher's feet OR
// The pickup is below the toucher.
if (delta > toucher->height || delta < MIN(-32*FRACUNIT, -special->height))
{ // out of reach
return;
}

View file

@ -1764,7 +1764,7 @@ void S_SetSoundPaused (int state)
S_ResumeSound(true);
if (GSnd != NULL)
{
GSnd->SetInactive(false);
GSnd->SetInactive(SoundRenderer::INACTIVE_Active);
}
if (!netgame
#ifdef _DEBUG
@ -1783,7 +1783,9 @@ void S_SetSoundPaused (int state)
S_PauseSound(false, true);
if (GSnd != NULL)
{
GSnd->SetInactive(true);
GSnd->SetInactive(gamestate == GS_LEVEL ?
SoundRenderer::INACTIVE_Complete :
SoundRenderer::INACTIVE_Mute);
}
if (!netgame
#ifdef _DEBUG

View file

@ -672,6 +672,7 @@ bool FMODSoundRenderer::Init()
PrevEnvironment = DefaultEnvironments[0];
DSPClock.AsOne = 0;
ChannelGroupTargetUnit = NULL;
ChannelGroupTargetUnitOutput = NULL;
SfxReverbHooked = false;
SfxReverbPlaceholder = NULL;
OutputPlugin = 0;
@ -1155,6 +1156,15 @@ bool FMODSoundRenderer::Init()
{
ChannelGroupTargetUnit = NULL;
}
else
{
FMOD::DSP *dontcare;
result = ChannelGroupTargetUnit->getOutput(0, &dontcare, &ChannelGroupTargetUnitOutput);
if (result != FMOD_OK)
{
ChannelGroupTargetUnitOutput = NULL;
}
}
}
}
@ -2123,11 +2133,33 @@ void FMODSoundRenderer::SetSfxPaused(bool paused, int slot)
//
//==========================================================================
void FMODSoundRenderer::SetInactive(bool inactive)
void FMODSoundRenderer::SetInactive(SoundRenderer::EInactiveState inactive)
{
float mix;
bool active;
if (inactive == INACTIVE_Active)
{
mix = 1;
active = true;
}
else if (inactive == INACTIVE_Complete)
{
mix = 1;
active = false;
}
else // inactive == INACTIVE_Mute
{
mix = 0;
active = true;
}
if (ChannelGroupTargetUnitOutput != NULL)
{
ChannelGroupTargetUnitOutput->setMix(mix);
}
if (ChannelGroupTargetUnit != NULL)
{
ChannelGroupTargetUnit->setActive(!inactive);
ChannelGroupTargetUnit->setActive(active);
}
}

View file

@ -49,7 +49,7 @@ public:
void SetSfxPaused (bool paused, int slot);
// Pauses or resumes *every* channel, including environmental reverb.
void SetInactive (bool inactive);
void SetInactive (EInactiveState inactive);
// Updates the position of a sound channel.
void UpdateSoundParams3D (SoundListener *listener, FISoundChannel *chan, bool areasound, const FVector3 &pos, const FVector3 &vel);
@ -107,6 +107,7 @@ private:
FMOD::ChannelGroup *MusicGroup;
FMOD::DSP *WaterLP, *WaterReverb;
FMOD::DSPConnection *SfxConnection;
FMOD::DSPConnection *ChannelGroupTargetUnitOutput;
FMOD::DSP *ChannelGroupTargetUnit;
FMOD::DSP *SfxReverbPlaceholder;
bool SfxReverbHooked;

View file

@ -199,7 +199,7 @@ public:
}
// Pauses or resumes *every* channel, including environmental reverb.
void SetInactive(bool inactive)
void SetInactive(SoundRenderer::EInactiveState inactive)
{
}

View file

@ -126,7 +126,13 @@ public:
virtual void SetSfxPaused (bool paused, int slot) = 0;
// Pauses or resumes *every* channel, including environmental reverb.
virtual void SetInactive(bool inactive) = 0;
enum EInactiveState
{
INACTIVE_Active, // sound is active
INACTIVE_Complete, // sound is completely paused
INACTIVE_Mute // sound is only muted
};
virtual void SetInactive(EInactiveState inactive) = 0;
// Updates the volume, separation, and pitch of a sound channel.
virtual void UpdateSoundParams3D (SoundListener *listener, FISoundChannel *chan, bool areasound, const FVector3 &pos, const FVector3 &vel) = 0;

View file

@ -3,5 +3,5 @@
// This file was automatically generated by the
// updaterevision tool. Do not edit by hand.
#define ZD_SVN_REVISION_STRING "3813"
#define ZD_SVN_REVISION_NUMBER 3813
#define ZD_SVN_REVISION_STRING "3818"
#define ZD_SVN_REVISION_NUMBER 3818

View file

@ -1588,8 +1588,8 @@ void WI_updateNetgameStats ()
void WI_drawNetgameStats ()
{
int i, x, y, height;
int maxnamewidth, maxscorewidth;
int i, x, y, ypadding, height, lineheight;
int maxnamewidth, maxscorewidth, maxiconheight;
int pwidth = IntermissionFont->GetCharWidth('%');
int icon_x, name_x, kills_x, bonus_x, secret_x;
int bonus_len, secret_len;
@ -1602,8 +1602,10 @@ void WI_drawNetgameStats ()
y = WI_drawLF();
HU_GetPlayerWidths(maxnamewidth, maxscorewidth);
HU_GetPlayerWidths(maxnamewidth, maxscorewidth, maxiconheight);
height = SmallFont->GetHeight() * CleanYfac;
lineheight = MAX(height, maxiconheight * CleanYfac);
ypadding = (lineheight - height + 1) / 2;
y += 16*CleanYfac;
bonus_label = (gameinfo.gametype & GAME_Raven) ? "BONUS" : "ITEMS";
@ -1642,27 +1644,27 @@ void WI_drawNetgameStats ()
continue;
player = &players[i];
HU_DrawColorBar(x, y, height, i);
HU_DrawColorBar(x, y, lineheight, i);
color = (EColorRange)HU_GetRowColor(player, i == consoleplayer);
if (player->mo->ScoreIcon.isValid())
{
FTexture *pic = TexMan[player->mo->ScoreIcon];
screen->DrawTexture(pic, icon_x, y, DTA_CleanNoMove, true, TAG_DONE);
}
screen->DrawText(SmallFont, color, name_x, y, player->userinfo.netname, DTA_CleanNoMove, true, TAG_DONE);
WI_drawPercent(SmallFont, kills_x, y, cnt_kills[i], wbs->maxkills, false, color);
screen->DrawText(SmallFont, color, name_x, y + ypadding, player->userinfo.netname, DTA_CleanNoMove, true, TAG_DONE);
WI_drawPercent(SmallFont, kills_x, y + ypadding, cnt_kills[i], wbs->maxkills, false, color);
missed_kills -= cnt_kills[i];
if (ng_state >= 4)
{
WI_drawPercent(SmallFont, bonus_x, y, cnt_items[i], wbs->maxitems, false, color);
WI_drawPercent(SmallFont, bonus_x, y + ypadding, cnt_items[i], wbs->maxitems, false, color);
missed_items -= cnt_items[i];
if (ng_state >= 6)
{
WI_drawPercent(SmallFont, secret_x, y, cnt_secret[i], wbs->maxsecret, false, color);
WI_drawPercent(SmallFont, secret_x, y + ypadding, cnt_secret[i], wbs->maxsecret, false, color);
missed_secrets -= cnt_secret[i];
}
}
y += height + CleanYfac;
y += lineheight + CleanYfac;
}
// Draw "MISSED" line