- re-added menu opening sound for Duke and RR.

This commit is contained in:
Christoph Oelckers 2020-02-11 18:11:38 +01:00
parent f0039afa5e
commit 37f3bb37d4
4 changed files with 55 additions and 91 deletions

View file

@ -95,43 +95,7 @@ void Menu_Init(void)
if (!minitext_lowercase) if (!minitext_lowercase)
MF_Minifont.textflags |= TEXT_UPPERCASE; MF_Minifont.textflags |= TEXT_UPPERCASE;
#if 0
// prepare sound setup
#ifndef EDUKE32_STANDALONE
if (WW2GI)
ME_SOUND_DUKETALK.name = "GI talk:";
else if (NAM)
ME_SOUND_DUKETALK.name = "Grunt talk:";
#endif
// prepare shareware
if (VOLUMEONE)
{
// blue out episodes beyond the first
for (i = 1; i < g_volumeCnt; ++i)
{
if (MEL_EPISODE[i])
{
ME_EPISODE[i].entry = &MEO_EPISODE_SHAREWARE;
ME_EPISODE[i].flags |= MEF_LookDisabled;
}
}
M_EPISODE.numEntries = g_volumeCnt; // remove User Map (and spacer)
MEOS_NETOPTIONS_EPISODE.numOptions = 1;
MenuEntry_DisableOnCondition(&ME_NETOPTIONS_EPISODE, 1);
}
// prepare pre-Atomic
if (!VOLUMEALL || !PLUTOPAK)
{
// prepare credits
M_CREDITS.title = M_CREDITS2.title = M_CREDITS3.title = s_Credits;
}
#endif
} }
static void Menu_DrawBackground(const DVector2 &origin) static void Menu_DrawBackground(const DVector2 &origin)
@ -480,24 +444,27 @@ void GameInterface::MenuSound(EMenuSounds snd)
{ {
switch (snd) switch (snd)
{ {
case CursorSound: case ActivateSound:
S_PlaySound(KICK_HIT, CHAN_AUTO, CHANF_UI); S_MenuSound();
break; break;
case AdvanceSound: case CursorSound:
S_PlaySound(PISTOL_BODYHIT, CHAN_AUTO, CHANF_UI); S_PlaySound(KICK_HIT, CHAN_AUTO, CHANF_UI);
break; break;
case CloseSound: case AdvanceSound:
S_PlaySound(EXITMENUSOUND, CHAN_AUTO, CHANF_UI); S_PlaySound(PISTOL_BODYHIT, CHAN_AUTO, CHANF_UI);
break; break;
default: case CloseSound:
return; S_PlaySound(EXITMENUSOUND, CHAN_AUTO, CHANF_UI);
break;
default:
return;
} }
} }
void GameInterface::MenuClosed() void GameInterface::MenuClosed()
{ {
@ -594,7 +561,6 @@ FSavegameInfo GameInterface::GetSaveSig()
return { SAVESIG_DN3D, MINSAVEVER_DN3D, SAVEVER_DN3D }; return { SAVESIG_DN3D, MINSAVEVER_DN3D, SAVEVER_DN3D };
} }
void GameInterface::DrawMenuCaption(const DVector2& origin, const char* text) void GameInterface::DrawMenuCaption(const DVector2& origin, const char* text)
{ {
Menu_DrawTopBar(origin); Menu_DrawTopBar(origin);
@ -623,7 +589,7 @@ static void shadowminitext(int32_t x, int32_t y, const char* t, int32_t p)
// with custom implementations. // with custom implementations.
// //
// This is needed because the credits screens in Duke Nukem // This is needed because the credits screens in Duke Nukem
// are eithrr done by providing an image or by printing text, based on the version used. // are either done by providing an image or by printing text, based on the version used.
// //
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------

View file

@ -551,7 +551,7 @@ void S_MenuSound(void)
}; };
int s = VM_OnEventWithReturn(EVENT_OPENMENUSOUND, g_player[screenpeek].ps->i, screenpeek, FURY ? -1 : menusnds[SoundNum++ % ARRAY_SIZE(menusnds)]); int s = VM_OnEventWithReturn(EVENT_OPENMENUSOUND, g_player[screenpeek].ps->i, screenpeek, FURY ? -1 : menusnds[SoundNum++ % ARRAY_SIZE(menusnds)]);
if (s != -1) if (s != -1)
S_PlaySound(s); S_PlaySound(s, CHAN_AUTO, CHANF_UI);
} }
//========================================================================== //==========================================================================

View file

@ -96,25 +96,7 @@ void Menu_Init(void)
if (!minitext_lowercase) if (!minitext_lowercase)
MF_Minifont.textflags |= TEXT_UPPERCASE; MF_Minifont.textflags |= TEXT_UPPERCASE;
#if 0
// prepare sound setup
#ifndef EDUKE32_STANDALONE
if (WW2GI)
ME_SOUND_DUKETALK.name = "GI talk:";
else if (NAM)
ME_SOUND_DUKETALK.name = "Grunt talk:";
ME_SOUND_DUKETALK.name = "Leonard Talk:";
#endif
// prepare pre-Atomic
if (!VOLUMEALL || !PLUTOPAK)
{
// prepare credits
M_CREDITS.title = M_CREDITS2.title = M_CREDITS3.title = s_Credits;
}
#endif
if (RR) if (RR)
{ {
@ -175,7 +157,8 @@ static void Menu_GetFmt(const MenuFont_t* font, uint8_t const status, int32_t* s
static vec2_t Menu_Text(int32_t x, int32_t y, const MenuFont_t* font, const char* t, uint8_t status, int32_t ydim_upper, int32_t ydim_lower) static vec2_t Menu_Text(int32_t x, int32_t y, const MenuFont_t* font, const char* t, uint8_t status, int32_t ydim_upper, int32_t ydim_lower)
{ {
int32_t s, p, ybetween = font->between.y; int32_t s, p, ybetween = font->between.y;
int32_t f = font->textflags | TEXT_RRMENUTEXTHACK; int32_t f = font->textflags;
if (RR) f |= TEXT_RRMENUTEXTHACK;
if (status & MT_XCenter) if (status & MT_XCenter)
f |= TEXT_XCENTER; f |= TEXT_XCENTER;
if (status & MT_XRight) if (status & MT_XRight)
@ -287,9 +270,20 @@ class RedneckMainMenu : public RedneckListMenu
{ {
RedneckListMenu::PreDraw(); RedneckListMenu::PreDraw();
if (RRRA) if (RRRA)
{
rotatesprite_fs(int(origin.X * 65536) + ((MENU_MARGIN_CENTER - 5) << 16), int(origin.Y * 65536) + ((57) << 16), 16592L, 0, THREEDEE, 0, 0, 10); rotatesprite_fs(int(origin.X * 65536) + ((MENU_MARGIN_CENTER - 5) << 16), int(origin.Y * 65536) + ((57) << 16), 16592L, 0, THREEDEE, 0, 0, 10);
else }
else if (RR)
{
rotatesprite_fs(int(origin.X * 65536) + ((MENU_MARGIN_CENTER + 5) << 16), int(origin.Y * 65536) + ((24) << 16), 23592L, 0, INGAMEDUKETHREEDEE, 0, 0, 10); rotatesprite_fs(int(origin.X * 65536) + ((MENU_MARGIN_CENTER + 5) << 16), int(origin.Y * 65536) + ((24) << 16), 23592L, 0, INGAMEDUKETHREEDEE, 0, 0, 10);
}
else
{
rotatesprite_fs(int(origin.X * 65536) + (MENU_MARGIN_CENTER<<16), int(origin.Y * 65536) + ((28)<<16), 65536L,0,INGAMEDUKETHREEDEE,0,0,10);
if (PLUTOPAK) // JBF 20030804
rotatesprite_fs(int(origin.X * 65536) + ((MENU_MARGIN_CENTER+100)<<16), int(origin.Y * 65536) + (36<<16), 65536L,0,PLUTOPAKSPRITE+2,(sintable[((int32_t) totalclock<<4)&2047]>>11),0,2+8);
}
} }
}; };
@ -338,7 +332,6 @@ void GameInterface::DrawNativeMenuText(int fontnum, int state, double xpos, doub
} }
void GameInterface::MenuOpened() void GameInterface::MenuOpened()
{ {
S_PauseSounds(true); S_PauseSounds(true);
@ -360,20 +353,24 @@ void GameInterface::MenuSound(EMenuSounds snd)
{ {
switch (snd) switch (snd)
{ {
case CursorSound: case ActivateSound:
S_PlaySound(RR ? 335 : KICK_HIT, CHAN_AUTO, CHANF_UI); S_MenuSound();
break; break;
case AdvanceSound: case CursorSound:
S_PlaySound(RR? 341 : PISTOL_BODYHIT, CHAN_AUTO, CHANF_UI); S_PlaySound(RR ? 335 : KICK_HIT, CHAN_AUTO, CHANF_UI);
break; break;
case CloseSound: case AdvanceSound:
S_PlaySound(EXITMENUSOUND, CHAN_AUTO, CHANF_UI); S_PlaySound(RR ? 341 : PISTOL_BODYHIT, CHAN_AUTO, CHANF_UI);
break; break;
default: case CloseSound:
return; S_PlaySound(EXITMENUSOUND, CHAN_AUTO, CHANF_UI);
break;
default:
return;
} }
} }
@ -426,19 +423,19 @@ void GameInterface::StartGame(FGameStartup& gs)
switch (gs.Skill) switch (gs.Skill)
{ {
case 0: case 0:
skillsound = 427; skillsound = RR? 427 : JIBBED_ACTOR6;
break; break;
case 1: case 1:
skillsound = 428; skillsound = RR? 428 : BONUS_SPEECH1;
break; break;
case 2: case 2:
skillsound = 196; skillsound = RR? 196 : DUKE_GETWEAPON2;
break; break;
case 3: case 3:
skillsound = 195; skillsound = RR? 195 : JIBBED_ACTOR5;
break; break;
case 4: case 4:
skillsound = 197; skillsound = RR? 197 : JIBBED_ACTOR5; // Does not exist in DN3D.
break; break;
} }
@ -485,6 +482,7 @@ void GameInterface::DrawCenteredTextScreen(const DVector2 &origin, const char *t
for (int i = 0; text[i]; i++) if (text[i] == '\n') lines++; for (int i = 0; text[i]; i++) if (text[i] == '\n') lines++;
int height = lines * Menu_GetFontHeight(NIT_SmallFont); int height = lines * Menu_GetFontHeight(NIT_SmallFont);
position -= height >> 17; position -= height >> 17;
if (!RR) Menu_DrawCursorLeft(160 << 16, 130 << 16, 65536);
} }
G_ScreenText(MF_Bluefont.tilenum, int((origin.X + 160) * 65536), int((origin.Y + position) * 65536), MF_Bluefont.zoom, 0, 0, text, 0, MF_Bluefont.pal, G_ScreenText(MF_Bluefont.tilenum, int((origin.X + 160) * 65536), int((origin.Y + position) * 65536), MF_Bluefont.zoom, 0, 0, text, 0, MF_Bluefont.pal,
2 | 8 | 16 | ROTATESPRITE_FULL16, 0, MF_Bluefont.emptychar.x, MF_Bluefont.emptychar.y, MF_Bluefont.between.x, MF_Bluefont.between.y, 2 | 8 | 16 | ROTATESPRITE_FULL16, 0, MF_Bluefont.emptychar.x, MF_Bluefont.emptychar.y, MF_Bluefont.between.x, MF_Bluefont.between.y,

View file

@ -550,7 +550,7 @@ void S_MenuSound(void)
}; };
int s = RR ? 390 : menusnds[SoundNum++ % ARRAY_SIZE(menusnds)]; int s = RR ? 390 : menusnds[SoundNum++ % ARRAY_SIZE(menusnds)];
if (s != -1) if (s != -1)
S_PlaySound(s); S_PlaySound(s, CHAN_AUTO, CHANF_UI);
} }
//========================================================================== //==========================================================================