diff --git a/src/ct_chat.cpp b/src/ct_chat.cpp index d05e44a6..d99acda4 100644 --- a/src/ct_chat.cpp +++ b/src/ct_chat.cpp @@ -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]); } diff --git a/src/hu_scores.cpp b/src/hu_scores.cpp index 1d881bd3..9af0c0c0 100644 --- a/src/hu_scores.cpp +++ b/src/hu_scores.cpp @@ -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); } } diff --git a/src/hu_stuff.h b/src/hu_stuff.h index ce7266c7..c8e76fee 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -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); diff --git a/src/menu/videomenu.cpp b/src/menu/videomenu.cpp index 3e8f18ea..8a6e6720 100644 --- a/src/menu/videomenu.cpp +++ b/src/menu/videomenu.cpp @@ -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++) { diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index 70009f4e..3ad2770e 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -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; } diff --git a/src/s_sound.cpp b/src/s_sound.cpp index 6c548f40..9749d635 100644 --- a/src/s_sound.cpp +++ b/src/s_sound.cpp @@ -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 diff --git a/src/sound/fmodsound.cpp b/src/sound/fmodsound.cpp index b0175432..5abb67e7 100644 --- a/src/sound/fmodsound.cpp +++ b/src/sound/fmodsound.cpp @@ -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); } } diff --git a/src/sound/fmodsound.h b/src/sound/fmodsound.h index e00b2ed2..99d627e5 100644 --- a/src/sound/fmodsound.h +++ b/src/sound/fmodsound.h @@ -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; diff --git a/src/sound/i_sound.cpp b/src/sound/i_sound.cpp index 27c00e93..0fe68a25 100644 --- a/src/sound/i_sound.cpp +++ b/src/sound/i_sound.cpp @@ -199,7 +199,7 @@ public: } // Pauses or resumes *every* channel, including environmental reverb. - void SetInactive(bool inactive) + void SetInactive(SoundRenderer::EInactiveState inactive) { } diff --git a/src/sound/i_sound.h b/src/sound/i_sound.h index 660e4716..c905678a 100644 --- a/src/sound/i_sound.h +++ b/src/sound/i_sound.h @@ -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; diff --git a/src/svnrevision.h b/src/svnrevision.h index 7da89f9c..1c4d001f 100644 --- a/src/svnrevision.h +++ b/src/svnrevision.h @@ -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 diff --git a/src/wi_stuff.cpp b/src/wi_stuff.cpp index 1b81aeb0..6e841518 100644 --- a/src/wi_stuff.cpp +++ b/src/wi_stuff.cpp @@ -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