2020-06-11 07:22:16 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
2020-07-02 08:59:22 +00:00
|
|
|
Copyright (C) 1996, 2003 - 3D Realms Entertainment
|
|
|
|
Copyright (C) 2020 - Christoph Oelckers
|
2020-06-11 07:22:16 +00:00
|
|
|
|
2020-07-02 08:59:22 +00:00
|
|
|
This file is part of Enhanced Duke Nukem 3D version 1.5 - Atomic Edition
|
|
|
|
|
|
|
|
Duke Nukem 3D is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
2020-06-11 07:22:16 +00:00
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2020-07-02 08:59:22 +00:00
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
2020-06-11 07:22:16 +00:00
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
2020-07-02 08:59:22 +00:00
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
|
|
|
Original Source: 1996 - Todd Replogle
|
|
|
|
Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
|
|
|
|
|
2020-06-11 07:22:16 +00:00
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#include "ns.h" // Must come before everything else!
|
|
|
|
|
2020-08-16 07:46:37 +00:00
|
|
|
#include "g_input.h"
|
2020-06-21 20:18:12 +00:00
|
|
|
#include "duke3d.h"
|
2020-06-11 07:22:16 +00:00
|
|
|
|
|
|
|
#include "superfasthash.h"
|
|
|
|
#include "gamecvars.h"
|
|
|
|
#include "gamecontrol.h"
|
|
|
|
#include "c_bind.h"
|
|
|
|
#include "menu/menu.h"
|
|
|
|
#include "gstrings.h"
|
|
|
|
#include "version.h"
|
2020-07-03 21:56:14 +00:00
|
|
|
#include "names.h"
|
2020-07-07 18:27:21 +00:00
|
|
|
#include "mapinfo.h"
|
2020-07-21 20:59:24 +00:00
|
|
|
#include "gamestate.h"
|
2020-06-11 07:22:16 +00:00
|
|
|
#include "../../glbackend/glbackend.h"
|
|
|
|
|
|
|
|
|
|
|
|
BEGIN_DUKE_NS
|
|
|
|
|
2020-07-01 23:17:45 +00:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//----------------------------------------------------------------------------
|
2020-06-11 07:22:16 +00:00
|
|
|
|
|
|
|
static void Menu_DrawBackground(const DVector2 &origin)
|
|
|
|
{
|
2020-08-24 18:25:53 +00:00
|
|
|
DrawTexture(twod, tileGetTexture(TILE_MENUSCREEN), origin.X + 160, origin.Y + 100, DTA_FullscreenScale, FSMode_Fit320x200, DTA_Color, 0xff808080, DTA_CenterOffset, true, TAG_DONE);
|
2020-06-11 07:22:16 +00:00
|
|
|
}
|
|
|
|
|
2020-07-01 23:17:45 +00:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//----------------------------------------------------------------------------
|
2020-06-11 07:22:16 +00:00
|
|
|
|
2020-07-01 23:17:45 +00:00
|
|
|
static void Menu_DrawCursor(double x, double y, double scale, bool right)
|
2020-06-11 07:22:16 +00:00
|
|
|
{
|
2020-08-25 18:20:35 +00:00
|
|
|
int mclock = I_GetBuildTime();
|
2020-07-01 23:17:45 +00:00
|
|
|
const int frames = isRR() ? 16 : 7;
|
|
|
|
int picnum;
|
2020-08-25 18:20:35 +00:00
|
|
|
if (!right) picnum = TILE_SPINNINGNUKEICON + ((mclock >> 3) % frames);
|
|
|
|
else picnum = TILE_SPINNINGNUKEICON + frames - 1 - ((frames - 1 + (mclock >> 3)) % frames);
|
|
|
|
int light = int(224 + 31 * sin(mclock / 20.));
|
2020-07-01 23:17:45 +00:00
|
|
|
PalEntry pe(255, light, light, light);
|
2020-08-24 18:25:53 +00:00
|
|
|
DrawTexture(twod, tileGetTexture(picnum), x, y, DTA_FullscreenScale, FSMode_Fit320x200, DTA_ScaleX, scale, DTA_ScaleY, scale, DTA_Color, pe, DTA_CenterOffsetRel, true, TAG_DONE);
|
2020-06-11 07:22:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// Implements the native looking menu used for the main menu
|
|
|
|
// and the episode/skill selection screens, i.e. the parts
|
|
|
|
// that need to look authentic
|
|
|
|
//
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2020-06-21 20:18:12 +00:00
|
|
|
class DukeListMenu : public DListMenu
|
2020-06-11 07:22:16 +00:00
|
|
|
{
|
|
|
|
using Super = DListMenu;
|
|
|
|
protected:
|
|
|
|
|
|
|
|
void Ticker() override
|
|
|
|
{
|
|
|
|
// Lay out the menu.
|
2020-07-01 23:17:45 +00:00
|
|
|
int y_upper = mDesc->mYpos;
|
|
|
|
int y_lower = y_upper + mDesc->mYbotton;
|
|
|
|
int y = 0;
|
|
|
|
int spacing = 0;
|
2020-07-02 08:59:22 +00:00
|
|
|
const int height = 15; // cannot take value from the font because it would be inconsistent
|
2020-06-11 07:22:16 +00:00
|
|
|
|
2020-07-01 23:17:45 +00:00
|
|
|
int totalheight = 0, numvalidentries = mDesc->mItems.Size();
|
2020-06-11 07:22:16 +00:00
|
|
|
|
|
|
|
for (unsigned e = 0; e < mDesc->mItems.Size(); ++e)
|
|
|
|
{
|
|
|
|
auto entry = mDesc->mItems[e];
|
|
|
|
entry->mHidden = false;
|
|
|
|
entry->SetHeight(height);
|
|
|
|
totalheight += height;
|
|
|
|
}
|
2020-07-01 23:17:45 +00:00
|
|
|
if (mDesc->mSpacing <= 0) spacing = std::max(0, (y_lower - y_upper - totalheight) / (numvalidentries > 1 ? numvalidentries - 1 : 1));
|
|
|
|
if (spacing <= 0) spacing = mDesc->mSpacing;
|
2020-06-11 07:22:16 +00:00
|
|
|
|
|
|
|
int totalHeight;
|
|
|
|
for (unsigned e = 0; e < mDesc->mItems.Size(); ++e)
|
|
|
|
{
|
|
|
|
auto entry = mDesc->mItems[e];
|
|
|
|
if (!entry->mHidden)
|
|
|
|
{
|
|
|
|
entry->SetY(y_upper + y);
|
|
|
|
y += height;
|
|
|
|
totalHeight = y;
|
2020-07-01 23:17:45 +00:00
|
|
|
y += spacing;
|
2020-06-11 07:22:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-07-01 23:17:45 +00:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2020-06-21 20:18:12 +00:00
|
|
|
class DukeMainMenu : public DukeListMenu
|
2020-06-11 07:22:16 +00:00
|
|
|
{
|
2020-07-06 11:26:26 +00:00
|
|
|
virtual void Init(DMenu* parent = nullptr, FListMenuDescriptor* desc = nullptr) override
|
2020-06-11 07:22:16 +00:00
|
|
|
{
|
2020-06-21 20:18:12 +00:00
|
|
|
DukeListMenu::Init(parent, desc);
|
2020-06-11 07:22:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void PreDraw() override
|
|
|
|
{
|
2020-06-21 20:18:12 +00:00
|
|
|
DukeListMenu::PreDraw();
|
2020-07-02 08:59:22 +00:00
|
|
|
double x = origin.X + 160;
|
2020-07-06 11:26:26 +00:00
|
|
|
if (isRRRA())
|
2020-06-11 07:22:16 +00:00
|
|
|
{
|
2020-08-24 18:25:53 +00:00
|
|
|
DrawTexture(twod, tileGetTexture(TILE_THREEDEE), x-5, origin.Y+57, DTA_FullscreenScale, FSMode_Fit320x200Top, DTA_ScaleX, 0.253, DTA_ScaleY, 0.253, DTA_CenterOffsetRel, true, TAG_DONE);
|
2020-06-11 07:22:16 +00:00
|
|
|
}
|
2020-07-01 23:17:45 +00:00
|
|
|
else if (isRR())
|
2020-06-11 07:22:16 +00:00
|
|
|
{
|
2020-08-24 18:25:53 +00:00
|
|
|
DrawTexture(twod, tileGetTexture(TILE_INGAMEDUKETHREEDEE), x+5, origin.Y + 24, DTA_FullscreenScale, FSMode_Fit320x200Top, DTA_ScaleX, 0.36, DTA_ScaleY, 0.36, DTA_CenterOffsetRel, true, TAG_DONE);
|
2020-06-11 07:22:16 +00:00
|
|
|
}
|
|
|
|
else
|
2020-07-20 21:21:27 +00:00
|
|
|
{
|
2020-08-24 18:25:53 +00:00
|
|
|
DrawTexture(twod, tileGetTexture(TILE_INGAMEDUKETHREEDEE), x, origin.Y + 29, DTA_FullscreenScale, FSMode_Fit320x200Top, DTA_CenterOffsetRel, true, TAG_DONE);
|
2020-07-02 08:59:22 +00:00
|
|
|
if (PLUTOPAK)
|
|
|
|
{
|
2020-08-25 18:20:35 +00:00
|
|
|
int mclock = I_GetBuildTime();
|
|
|
|
int light = 224 + 31 * sin(mclock / 40.);
|
2020-07-02 08:59:22 +00:00
|
|
|
PalEntry pe(255, light, light, light);
|
2020-08-24 18:25:53 +00:00
|
|
|
DrawTexture(twod, tileGetTexture(TILE_PLUTOPAKSPRITE + 2), x + 100, origin.Y + 36, DTA_FullscreenScale, FSMode_Fit320x200Top, DTA_Color, pe, DTA_CenterOffsetRel, true, TAG_DONE);
|
2020-07-02 08:59:22 +00:00
|
|
|
}
|
2020-07-20 21:21:27 +00:00
|
|
|
}
|
2020-06-11 07:22:16 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// Menu related game interface functions
|
|
|
|
//
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2020-07-01 23:17:45 +00:00
|
|
|
void GameInterface::DrawNativeMenuText(int fontnum, int state, double oxpos, double ypos, float fontscale, const char* text, int flags)
|
2020-06-11 07:22:16 +00:00
|
|
|
{
|
2020-07-01 23:17:45 +00:00
|
|
|
double xpos = oxpos;
|
|
|
|
int trans;
|
|
|
|
PalEntry pe;
|
2020-06-11 07:22:16 +00:00
|
|
|
|
2020-07-01 23:17:45 +00:00
|
|
|
double scale = isRR() ? 0.4 : 1.;
|
|
|
|
if (flags & LMF_Centered) xpos -= BigFont->StringWidth(text) * scale * 0.5;
|
2020-06-11 07:22:16 +00:00
|
|
|
|
2020-07-01 23:17:45 +00:00
|
|
|
if (state == NIT_InactiveState)
|
|
|
|
{
|
|
|
|
trans = TRANSLATION(Translation_Remap, 1);
|
|
|
|
pe = 0xffffffff;
|
|
|
|
}
|
|
|
|
else if (state == NIT_SelectedState)
|
|
|
|
{
|
|
|
|
trans = 0;
|
2020-08-25 18:20:35 +00:00
|
|
|
int mclock = I_GetBuildTime();
|
|
|
|
int light = 224 + 31 * sin(mclock / 20.);
|
2020-07-01 23:17:45 +00:00
|
|
|
pe = PalEntry(255, light, light, light);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
trans = 0;
|
|
|
|
pe = 0xffa0a0a0;
|
|
|
|
}
|
2020-06-11 07:22:16 +00:00
|
|
|
|
2020-08-24 18:25:53 +00:00
|
|
|
DrawText(twod, BigFont, CR_UNDEFINED, xpos, ypos, text, DTA_FullscreenScale, FSMode_Fit320x200, DTA_ScaleX, scale, DTA_ScaleY, scale, DTA_Color, pe,
|
2020-07-01 23:17:45 +00:00
|
|
|
DTA_TranslationIndex, trans, TAG_DONE);
|
2020-06-11 07:22:16 +00:00
|
|
|
|
2020-07-01 23:17:45 +00:00
|
|
|
if (state == NIT_SelectedState)
|
2020-06-11 07:22:16 +00:00
|
|
|
{
|
2020-07-01 23:17:45 +00:00
|
|
|
const int cursorOffset = 110;
|
|
|
|
const double cursorScale = isRR() ? 0.2 : 1.0;
|
|
|
|
const double ymid = ypos + 7; // half height must be hardcoded or layouts will break.
|
|
|
|
if (flags & LMF_Centered)
|
2020-06-11 07:22:16 +00:00
|
|
|
{
|
2020-07-01 23:17:45 +00:00
|
|
|
Menu_DrawCursor(oxpos + cursorOffset, ymid, cursorScale, false);
|
|
|
|
Menu_DrawCursor(oxpos - cursorOffset, ymid, cursorScale, true);
|
2020-06-11 07:22:16 +00:00
|
|
|
}
|
|
|
|
else
|
2020-07-01 23:17:45 +00:00
|
|
|
Menu_DrawCursor(oxpos - cursorOffset, ymid, cursorScale, false);
|
2020-06-11 07:22:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void GameInterface::MenuOpened()
|
|
|
|
{
|
2020-07-05 22:54:06 +00:00
|
|
|
if (ud.multimode < 2)
|
2020-06-11 07:22:16 +00:00
|
|
|
{
|
|
|
|
screenpeek = myconnectindex;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void GameInterface::MenuSound(EMenuSounds snd)
|
|
|
|
{
|
|
|
|
switch (snd)
|
|
|
|
{
|
|
|
|
case ActivateSound:
|
|
|
|
S_MenuSound();
|
|
|
|
break;
|
|
|
|
|
2020-08-04 22:32:29 +00:00
|
|
|
case ChooseSound:
|
2020-06-11 07:22:16 +00:00
|
|
|
case CursorSound:
|
2020-07-01 23:17:45 +00:00
|
|
|
S_PlaySound(isRR() ? 335 : KICK_HIT, CHAN_AUTO, CHANF_UI);
|
2020-06-11 07:22:16 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case AdvanceSound:
|
2020-07-01 23:17:45 +00:00
|
|
|
S_PlaySound(isRR() ? 341 : PISTOL_BODYHIT, CHAN_AUTO, CHANF_UI);
|
2020-06-11 07:22:16 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case CloseSound:
|
2020-08-02 20:14:58 +00:00
|
|
|
case BackSound:
|
2020-06-11 07:22:16 +00:00
|
|
|
S_PlaySound(EXITMENUSOUND, CHAN_AUTO, CHANF_UI);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void GameInterface::MenuClosed()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
bool GameInterface::CanSave()
|
|
|
|
{
|
2020-08-14 20:41:32 +00:00
|
|
|
if (ud.recstat == 2 || gamestate != GS_LEVEL) return false;
|
2020-07-07 21:01:34 +00:00
|
|
|
auto &myplayer = ps[myconnectindex];
|
2020-08-14 20:41:32 +00:00
|
|
|
return (sprite[myplayer.i].extra > 0);
|
2020-08-31 18:25:08 +00:00
|
|
|
}
|
2020-06-11 07:22:16 +00:00
|
|
|
|
2020-09-25 17:36:50 +00:00
|
|
|
bool GameInterface::StartGame(FNewGameStartup& gs)
|
2020-06-11 07:22:16 +00:00
|
|
|
{
|
2020-09-25 17:36:50 +00:00
|
|
|
if (gs.Episode >= 1)
|
|
|
|
{
|
|
|
|
if (g_gameType & GAMEFLAG_SHAREWARE)
|
|
|
|
{
|
|
|
|
M_StartMessage(GStrings("BUYDUKE"), 1, -1);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-11 07:22:16 +00:00
|
|
|
int32_t skillsound = PISTOL_BODYHIT;
|
|
|
|
|
|
|
|
soundEngine->StopAllChannels();
|
2020-07-02 08:59:22 +00:00
|
|
|
|
|
|
|
static const short sounds_d[] = { JIBBED_ACTOR6, BONUS_SPEECH1, DUKE_GETWEAPON2, JIBBED_ACTOR5, JIBBED_ACTOR5 };
|
|
|
|
static const short sounds_r[] = { 427, 428, 196, 195, 197 };
|
|
|
|
if (gs.Skill >=0 && gs.Skill <= 5) skillsound = isRR()? sounds_r[gs.Skill] : sounds_d[gs.Skill];
|
2020-06-11 07:22:16 +00:00
|
|
|
|
2020-09-02 08:00:07 +00:00
|
|
|
if (menu_sounds && skillsound >= 0 && SoundEnabled() && !netgame)
|
2020-06-11 07:22:16 +00:00
|
|
|
{
|
2020-07-02 08:59:22 +00:00
|
|
|
S_PlaySound(skillsound, CHAN_AUTO, CHANF_UI);
|
2020-06-11 07:22:16 +00:00
|
|
|
|
2020-07-02 08:59:22 +00:00
|
|
|
while (S_CheckSoundPlaying(skillsound))
|
2020-06-11 07:22:16 +00:00
|
|
|
{
|
2020-08-29 22:55:49 +00:00
|
|
|
gi->UpdateSounds();
|
2020-08-26 02:15:33 +00:00
|
|
|
soundEngine->UpdateSounds(I_GetTime());
|
2020-08-16 07:46:37 +00:00
|
|
|
I_GetEvent();
|
2020-06-11 07:22:16 +00:00
|
|
|
}
|
2020-09-02 08:00:07 +00:00
|
|
|
Net_ClearFifo();
|
2020-06-11 07:22:16 +00:00
|
|
|
}
|
2020-07-07 18:27:21 +00:00
|
|
|
auto map = FindMapByLevelNum(levelnum(gs.Episode, gs.Level));
|
|
|
|
if (map)
|
|
|
|
{
|
2020-09-03 21:10:28 +00:00
|
|
|
DeferedStartGame(map, gs.Skill);
|
2020-09-25 17:36:50 +00:00
|
|
|
return true;
|
2020-07-07 18:27:21 +00:00
|
|
|
}
|
2020-09-25 17:36:50 +00:00
|
|
|
return false;
|
2020-06-11 07:22:16 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
FSavegameInfo GameInterface::GetSaveSig()
|
|
|
|
{
|
|
|
|
return { SAVESIG_RR, MINSAVEVER_RR, SAVEVER_RR };
|
|
|
|
}
|
|
|
|
|
|
|
|
void GameInterface::DrawMenuCaption(const DVector2& origin, const char* text)
|
|
|
|
{
|
2020-08-24 18:25:53 +00:00
|
|
|
DrawTexture(twod, tileGetTexture(TILE_MENUBAR), origin.X + 160, origin.Y + 19, DTA_FullscreenScale, FSMode_Fit320x200Top, DTA_Color, 0xff808080, DTA_CenterOffsetRel, 1, TAG_DONE);
|
2020-07-01 23:17:45 +00:00
|
|
|
|
|
|
|
FString t = text;
|
|
|
|
size_t newlen = t.Len();
|
|
|
|
if (t[t.Len() - 1] == ':') newlen--;
|
|
|
|
if (newlen > 63) newlen = 63;
|
|
|
|
t.Truncate(newlen);
|
|
|
|
double scale = isRR() ? 0.4 : 1.0;
|
|
|
|
double x = 160 + origin.X - BigFont->StringWidth(t) * scale * 0.5;
|
2020-08-24 18:25:53 +00:00
|
|
|
DrawText(twod, BigFont, CR_UNTRANSLATED, x, origin.Y + 12, t, DTA_FullscreenScale, FSMode_Fit320x200Top, DTA_ScaleX, scale, DTA_ScaleY, scale, TAG_DONE);
|
2020-06-11 07:22:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void GameInterface::DrawCenteredTextScreen(const DVector2 &origin, const char *text, int position, bool bg)
|
|
|
|
{
|
|
|
|
if (bg) Menu_DrawBackground(origin);
|
2020-07-02 08:59:22 +00:00
|
|
|
else if (!isRR())
|
2020-06-11 07:22:16 +00:00
|
|
|
{
|
2020-07-02 08:59:22 +00:00
|
|
|
Menu_DrawCursor(160, 130, 1, false);
|
2020-06-11 07:22:16 +00:00
|
|
|
}
|
2020-07-02 08:59:22 +00:00
|
|
|
::GameInterface::DrawCenteredTextScreen(origin, text, position, bg);
|
2020-06-11 07:22:16 +00:00
|
|
|
}
|
|
|
|
|
2020-08-23 18:44:17 +00:00
|
|
|
void GameInterface::DrawPlayerSprite(const DVector2& origin, bool onteam)
|
|
|
|
{
|
2020-08-25 18:20:35 +00:00
|
|
|
int mclock = I_GetBuildTime();
|
2020-08-23 18:44:17 +00:00
|
|
|
int color = TRANSLATION(Translation_Remap, playercolor2lookup(playercolor));
|
2020-08-25 18:20:35 +00:00
|
|
|
int tile = isRR() ? 3845 + 36 - ((((8 - (mclock >> 4))) & 7) * 5) : 1441 - ((((4 - (mclock >> 4))) & 3) * 5);
|
2020-08-23 18:44:17 +00:00
|
|
|
auto tex = tileGetTexture(tile);
|
|
|
|
if (!tex) return;
|
|
|
|
double x = origin.X + 260, y = origin.Y + tex->GetDisplayHeight() * (isRR()? 0.25 : 0.5);
|
|
|
|
double scale = isRR() ? 0.375 : 0.75;
|
|
|
|
|
2020-08-24 18:25:53 +00:00
|
|
|
DrawTexture(twod, tex, x, y, DTA_FullscreenScale, FSMode_Fit320x200, DTA_TranslationIndex, color, DTA_ScaleX, scale, DTA_ScaleY, scale, TAG_DONE);
|
2020-08-23 18:44:17 +00:00
|
|
|
}
|
2020-06-11 07:22:16 +00:00
|
|
|
|
|
|
|
void GameInterface::QuitToTitle()
|
|
|
|
{
|
2020-09-04 18:46:44 +00:00
|
|
|
gameaction = ga_startup;
|
2020-06-11 07:22:16 +00:00
|
|
|
}
|
|
|
|
|
2020-09-25 18:22:30 +00:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void shadowminitext(int32_t xx, int32_t yy, const char* t, int32_t p)
|
|
|
|
{
|
|
|
|
double x = FixedToFloat(xx);
|
|
|
|
double y = FixedToFloat(yy);
|
|
|
|
|
|
|
|
DrawText(twod, SmallFont2, CR_UNDEFINED, x + 1, y + 1, t, DTA_FullscreenScale, FSMode_Fit320x200, DTA_Color, 0xff000000, DTA_Alpha, 0.5, TAG_DONE);
|
|
|
|
DrawText(twod, SmallFont2, CR_UNDEFINED, x, y, t, DTA_FullscreenScale, FSMode_Fit320x200, DTA_TranslationIndex, TRANSLATION(Translation_Remap, p), TAG_DONE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void mgametextcenter(int32_t xx, int32_t yy, const char* t)
|
|
|
|
{
|
|
|
|
double x = FixedToFloat(xx) + 160. - SmallFont->StringWidth(t) * 0.5;
|
|
|
|
double y = FixedToFloat(yy);
|
|
|
|
|
|
|
|
DrawText(twod, SmallFont, CR_UNDEFINED, x, y + 2, t, DTA_FullscreenScale, FSMode_Fit320x200, TAG_DONE);
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// allows the front end to override certain fullscreen image menus
|
|
|
|
// with custom implementations.
|
|
|
|
//
|
|
|
|
// This is needed because the credits screens in Duke Nukem
|
|
|
|
// are either done by providing an image or by printing text, based on the version used.
|
|
|
|
//
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
bool GameInterface::DrawSpecialScreen(const DVector2& origin, int tilenum)
|
|
|
|
{
|
|
|
|
// Older versions of Duke Nukem create the credits screens manually.
|
|
|
|
// On the latest version there's real graphics for this.
|
|
|
|
bool haveCredits = !(g_gameType & GAMEFLAG_DUKE) || (VOLUMEALL && PLUTOPAK);
|
|
|
|
|
|
|
|
int32_t m, l;
|
|
|
|
if (!haveCredits)
|
|
|
|
{
|
|
|
|
if (tilenum == 2504)
|
|
|
|
{
|
|
|
|
Menu_DrawBackground(origin);
|
|
|
|
DrawMenuCaption(origin, GStrings("MNU_CREDITS"));
|
|
|
|
m = int(origin.X * 65536) + (20 << 16);
|
|
|
|
l = int(origin.Y * 65536) + (33 << 16);
|
|
|
|
|
|
|
|
shadowminitext(m, l, "Original Concept", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Todd Replogle and Allen H. Blum III", 12); l += 7 << 16;
|
|
|
|
l += 3 << 16;
|
|
|
|
shadowminitext(m, l, "Produced & Directed By", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Greg Malone", 12); l += 7 << 16;
|
|
|
|
l += 3 << 16;
|
|
|
|
shadowminitext(m, l, "Executive Producer", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "George Broussard", 12); l += 7 << 16;
|
|
|
|
l += 3 << 16;
|
|
|
|
shadowminitext(m, l, "BUILD Engine", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Ken Silverman", 12); l += 7 << 16;
|
|
|
|
l += 3 << 16;
|
|
|
|
shadowminitext(m, l, "Game Programming", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Todd Replogle", 12); l += 7 << 16;
|
|
|
|
l += 3 << 16;
|
|
|
|
shadowminitext(m, l, "3D Engine/Tools/Net", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Ken Silverman", 12); l += 7 << 16;
|
|
|
|
l += 3 << 16;
|
|
|
|
shadowminitext(m, l, "Network Layer/Setup Program", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Mark Dochtermann", 12); l += 7 << 16;
|
|
|
|
l += 3 << 16;
|
|
|
|
shadowminitext(m, l, "Map Design", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Allen H. Blum III", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Richard Gray", 12); l += 7 << 16;
|
|
|
|
|
|
|
|
m = int(origin.X * 65536) + (180 << 16);
|
|
|
|
l = int(origin.Y * 65536) + (33 << 16);
|
|
|
|
|
|
|
|
shadowminitext(m, l, "3D Modeling", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Chuck Jones", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Sapphire Corporation", 12); l += 7 << 16;
|
|
|
|
l += 3 << 16;
|
|
|
|
shadowminitext(m, l, "Artwork", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Dirk Jones, Stephen Hornback", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "James Storey, David Demaret", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Douglas R. Wood", 12); l += 7 << 16;
|
|
|
|
l += 3 << 16;
|
|
|
|
shadowminitext(m, l, "Sound Engine", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Jim Dose", 12); l += 7 << 16;
|
|
|
|
l += 3 << 16;
|
|
|
|
shadowminitext(m, l, "Sound & Music Development", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Robert Prince", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Lee Jackson", 12); l += 7 << 16;
|
|
|
|
l += 3 << 16;
|
|
|
|
shadowminitext(m, l, "Voice Talent", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Lani Minella - Voice Producer", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Jon St. John as \"Duke Nukem\"", 12); l += 7 << 16;
|
|
|
|
l += 3 << 16;
|
|
|
|
shadowminitext(m, l, "Graphic Design", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Packaging, Manual, Ads", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Robert M. Atkins", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Michael Hadwin", 12); l += 7 << 16;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else if (tilenum == 2505)
|
|
|
|
{
|
|
|
|
Menu_DrawBackground(origin);
|
|
|
|
DrawMenuCaption(origin, GStrings("MNU_CREDITS"));
|
|
|
|
m = int(origin.X * 65536) + (20 << 16);
|
|
|
|
l = int(origin.Y * 65536) + (33 << 16);
|
|
|
|
|
|
|
|
shadowminitext(m, l, "Special Thanks To", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Steven Blackburn, Tom Hall", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Scott Miller, Joe Siegler", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Terry Nagy, Colleen Compton", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "HASH, Inc., FormGen, Inc.", 12); l += 7 << 16;
|
|
|
|
l += 3 << 16;
|
|
|
|
shadowminitext(m, l, "The 3D Realms Beta Testers", 12); l += 7 << 16;
|
|
|
|
l += 3 << 16;
|
|
|
|
shadowminitext(m, l, "Nathan Anderson, Wayne Benner", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Glenn Brensinger, Rob Brown", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Erik Harris, Ken Heckbert", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Terry Herrin, Greg Hively", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Hank Leukart, Eric Baker", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Jeff Rausch, Kelly Rogers", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Mike Duncan, Doug Howell", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "Bill Blair", 12); l += 7 << 16;
|
|
|
|
|
|
|
|
m = int(origin.X * 65536) + (160 << 16);
|
|
|
|
l = int(origin.Y * 65536) + (33 << 16);
|
|
|
|
|
|
|
|
shadowminitext(m, l, "Company Product Support", 12); l += 7 << 16;
|
|
|
|
l += 3 << 16;
|
|
|
|
shadowminitext(m, l, "The following companies were cool", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "enough to give us lots of stuff", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "during the making of Duke Nukem 3D.", 12); l += 7 << 16;
|
|
|
|
l += 3 << 16;
|
|
|
|
shadowminitext(m, l, "Altec Lansing Multimedia", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "for tons of speakers and the", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "THX-licensed sound system.", 12); l += 7 << 16;
|
|
|
|
shadowminitext(m, l, "For info call 1-800-548-0620", 12); l += 7 << 16;
|
|
|
|
l += 3 << 16;
|
|
|
|
shadowminitext(m, l, "Creative Labs, Inc.", 12); l += 7 << 16;
|
|
|
|
l += 3 << 16;
|
|
|
|
shadowminitext(m, l, "Thanks for the hardware, guys.", 12); l += 7 << 16;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else if (tilenum == 2506)
|
|
|
|
{
|
|
|
|
Menu_DrawBackground(origin);
|
|
|
|
DrawMenuCaption(origin, GStrings("MNU_CREDITS"));
|
|
|
|
mgametextcenter(int(origin.X * 65536), int(origin.Y * 65536) + (50 << 16), "Duke Nukem 3D is a trademark of");
|
|
|
|
mgametextcenter(int(origin.X * 65536), int(origin.Y * 65536) + (59 << 16), "3D Realms Entertainment");
|
|
|
|
mgametextcenter(int(origin.X * 65536), int(origin.Y * 65536) + (77 << 16), "Duke Nukem 3D");
|
|
|
|
mgametextcenter(int(origin.X * 65536), int(origin.Y * 65536) + (86 << 16), "(C) 1996 3D Realms Entertainment");
|
|
|
|
|
|
|
|
if (VOLUMEONE)
|
|
|
|
{
|
|
|
|
mgametextcenter(int(origin.X * 65536), int(origin.Y * 65536) + (106 << 16), "Please read LICENSE.DOC for shareware");
|
|
|
|
mgametextcenter(int(origin.X * 65536), int(origin.Y * 65536) + (115 << 16), "distribution grants and restrictions.");
|
|
|
|
}
|
|
|
|
mgametextcenter(int(origin.X * 65536), int(origin.Y * 65536) + ((VOLUMEONE ? 134 : 115) << 16), "Made in Dallas, Texas USA");
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2020-06-11 07:22:16 +00:00
|
|
|
END_DUKE_NS
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// Class registration
|
|
|
|
//
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
2020-06-21 20:18:12 +00:00
|
|
|
static TMenuClassDescriptor<Duke3d::DukeMainMenu> _mm("Duke.MainMenu");
|
|
|
|
static TMenuClassDescriptor<Duke3d::DukeListMenu> _lm("Duke.ListMenu");
|
2020-05-17 11:57:40 +00:00
|
|
|
|
2020-06-21 20:18:12 +00:00
|
|
|
static TMenuClassDescriptor<DImageScrollerMenu> _ism("Duke.ImageScrollerMenu"); // does not implement a new class, we only need the descriptor.
|
2020-06-11 07:22:16 +00:00
|
|
|
|
|
|
|
void RegisterDuke3dMenus()
|
|
|
|
{
|
|
|
|
menuClasses.Push(&_mm);
|
|
|
|
menuClasses.Push(&_lm);
|
|
|
|
menuClasses.Push(&_ism);
|
|
|
|
}
|