diff --git a/source/core/gamestruct.h b/source/core/gamestruct.h index bdeb4e1ed..3808c8672 100644 --- a/source/core/gamestruct.h +++ b/source/core/gamestruct.h @@ -64,7 +64,6 @@ struct GameInterface virtual void CustomMenuSelection(int menu, int item) {} virtual bool StartGame(FNewGameStartup& gs) { return false; } virtual FSavegameInfo GetSaveSig() { return { "", 0, 0}; } - virtual bool DrawSpecialScreen(const DVector2 &origin, int tilenum) { return false; } virtual double SmallFontScale() { return 1; } virtual bool SaveGame() { return true; } virtual bool LoadGame() { return true; } diff --git a/source/games/duke/src/d_menu.cpp b/source/games/duke/src/d_menu.cpp index 2f8628157..509854270 100644 --- a/source/games/duke/src/d_menu.cpp +++ b/source/games/duke/src/d_menu.cpp @@ -46,17 +46,6 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms BEGIN_DUKE_NS -//---------------------------------------------------------------------------- -// -// -// -//---------------------------------------------------------------------------- - -static void Menu_DrawBackground(const DVector2 &origin) -{ - DrawTexture(twod, tileGetTexture(TILE_MENUSCREEN), origin.X + 160, origin.Y + 100, DTA_FullscreenScale, FSMode_Fit320x200, DTA_Color, 0xff808080, DTA_CenterOffset, true, TAG_DONE); -} - //---------------------------------------------------------------------------- // // Menu related game interface functions @@ -171,171 +160,5 @@ void GameInterface::QuitToTitle() gameaction = ga_startup; } -//---------------------------------------------------------------------------- -// -// -// -//---------------------------------------------------------------------------- - -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; -} END_DUKE_NS diff --git a/source/games/duke/src/duke3d.h b/source/games/duke/src/duke3d.h index 0abfab077..a13d7604b 100644 --- a/source/games/duke/src/duke3d.h +++ b/source/games/duke/src/duke3d.h @@ -44,7 +44,6 @@ struct GameInterface : public ::GameInterface double SmallFontScale() override { return isRR() ? 0.5 : 1.; } void SerializeGameState(FSerializer& arc) override; void QuitToTitle() override; - bool DrawSpecialScreen(const DVector2& origin, int tilenum) override; FString GetCoordString() override; void ExitFromMenu() override; ReservedSpace GetReservedScreenSpace(int viewsize) override; diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 6feb0df5e..3690b4f14 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -203,6 +203,7 @@ ImageScroller "HelpMenu" { ifgame(Duke, Nam, WW2GI, Redneck, RedneckRides) { + ImageItem "TEXTSTORY" ImageItem "F1HELP" ifgame(RedneckRides) @@ -250,9 +251,18 @@ ImageScroller "CreditsMenu" { ifgame(Duke, Nam, WW2GI) { - ImageItem "CREDITPAGE1" - ImageItem "CREDITPAGE2" - ImageItem "CREDITPAGE3" + ifgame(PLUTOPAK) + { + ImageItem "CREDITPAGE1" + ImageItem "CREDITPAGE2" + ImageItem "CREDITPAGE3" + } + else + { + DukeCredits1 + DukeCredits2 + DukeCredits3 + } animatedtransition } ifgame(Redneck) diff --git a/wadsrc/static/zscript/games/duke/ui/menu.zs b/wadsrc/static/zscript/games/duke/ui/menu.zs index 6cc9fb562..778fa8f87 100644 --- a/wadsrc/static/zscript/games/duke/ui/menu.zs +++ b/wadsrc/static/zscript/games/duke/ui/menu.zs @@ -52,6 +52,31 @@ class DukeMenuDelegate : RazeMenuDelegate DrawCursor(169 - cursorOffset, ymid, cursorScale, true); return true; } + + //---------------------------------------------------------------------------- + // + // + // + //---------------------------------------------------------------------------- + + static void shadowminitext(int xx, int yy, String t, int p) + { + double x = xx / 65536.; + double y = yy / 65536.; + + Screen.DrawText(SmallFont2, Font.CR_UNDEFINED, x + 1, y + 1, t, DTA_FullscreenScale, FSMode_Fit320x200, DTA_Color, 0xff000000, DTA_Alpha, 0.5); + Screen.DrawText(SmallFont2, Font.CR_UNDEFINED, x, y, t, DTA_FullscreenScale, FSMode_Fit320x200, DTA_TranslationIndex, TRANSLATION.MakeID(Translation_Remap, p)); + } + + static void mgametextcenter(int xx, int yy, String t) + { + double x = xx / 65536. + 160. - SmallFont.StringWidth(t) * 0.5; + double y = yy / 65536.; + + Screen.DrawText(SmallFont, Font.CR_UNDEFINED, x, y + 2, t, DTA_FullscreenScale, FSMode_Fit320x200); + } + + } //---------------------------------------------------------------------------- @@ -135,3 +160,160 @@ class ListMenuItemDukeTextItem : ListMenuItemTextItem } } + +//---------------------------------------------------------------------------- +// +// Credits for Duke 1.3 +// +//---------------------------------------------------------------------------- + +class ImageScrollerPageDukeCredits1 : ImageScrollerPage +{ + + void Init(ImageScrollerDescriptor desc) + { + Super.Init(); + } + + override void Drawer(bool selected) + { + int m, l; + Screen.DrawTexture(TexMan.CheckForTexture("MENUSCREEN"), false, 160, 100, DTA_FullscreenScale, FSMode_Fit320x200, DTA_Color, 0xff808080, DTA_CenterOffset, true); + m = (20 << 16); + l = (33 << 16); + + DukeMenuDelegate.shadowminitext(m, l, "Original Concept", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Todd Replogle and Allen H. Blum III", 12); l += 7 << 16; + l += 3 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Produced & Directed By", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Greg Malone", 12); l += 7 << 16; + l += 3 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Executive Producer", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "George Broussard", 12); l += 7 << 16; + l += 3 << 16; + DukeMenuDelegate.shadowminitext(m, l, "BUILD Engine", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Ken Silverman", 12); l += 7 << 16; + l += 3 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Game Programming", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Todd Replogle", 12); l += 7 << 16; + l += 3 << 16; + DukeMenuDelegate.shadowminitext(m, l, "3D Engine/Tools/Net", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Ken Silverman", 12); l += 7 << 16; + l += 3 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Network Layer/Setup Program", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Mark Dochtermann", 12); l += 7 << 16; + l += 3 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Map Design", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Allen H. Blum III", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Richard Gray", 12); l += 7 << 16; + + m = (180 << 16); + l = (33 << 16); + + DukeMenuDelegate.shadowminitext(m, l, "3D Modeling", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Chuck Jones", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Sapphire Corporation", 12); l += 7 << 16; + l += 3 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Artwork", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Dirk Jones, Stephen Hornback", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "James Storey, David Demaret", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Douglas R. Wood", 12); l += 7 << 16; + l += 3 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Sound Engine", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Jim Dose", 12); l += 7 << 16; + l += 3 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Sound & Music Development", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Robert Prince", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Lee Jackson", 12); l += 7 << 16; + l += 3 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Voice Talent", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Lani Minella - Voice Producer", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Jon St. John as \"Duke Nukem\"", 12); l += 7 << 16; + l += 3 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Graphic Design", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Packaging, Manual, Ads", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Robert M. Atkins", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Michael Hadwin", 12); l += 7 << 16; + } +} + +class ImageScrollerPageDukeCredits2 : ImageScrollerPage +{ + + void Init(ImageScrollerDescriptor desc) + { + Super.Init(); + } + + override void Drawer(bool selected) + { + int m, l; + Screen.DrawTexture(TexMan.CheckForTexture("MENUSCREEN"), false, 160, 100, DTA_FullscreenScale, FSMode_Fit320x200, DTA_Color, 0xff808080, DTA_CenterOffset, true); + + m = (20 << 16); + l = (33 << 16); + + DukeMenuDelegate.shadowminitext(m, l, "Special Thanks To", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Steven Blackburn, Tom Hall", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Scott Miller, Joe Siegler", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Terry Nagy, Colleen Compton", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "HASH, Inc., FormGen, Inc.", 12); l += 7 << 16; + l += 3 << 16; + DukeMenuDelegate.shadowminitext(m, l, "The 3D Realms Beta Testers", 12); l += 7 << 16; + l += 3 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Nathan Anderson, Wayne Benner", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Glenn Brensinger, Rob Brown", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Erik Harris, Ken Heckbert", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Terry Herrin, Greg Hively", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Hank Leukart, Eric Baker", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Jeff Rausch, Kelly Rogers", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Mike Duncan, Doug Howell", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Bill Blair", 12); l += 7 << 16; + + m = (160 << 16); + l = (33 << 16); + + DukeMenuDelegate.shadowminitext(m, l, "Company Product Support", 12); l += 7 << 16; + l += 3 << 16; + DukeMenuDelegate.shadowminitext(m, l, "The following companies were cool", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "enough to give us lots of stuff", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "during the making of Duke Nukem 3D.", 12); l += 7 << 16; + l += 3 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Altec Lansing Multimedia", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "for tons of speakers and the", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "THX-licensed sound system.", 12); l += 7 << 16; + DukeMenuDelegate.shadowminitext(m, l, "For info call 1-800-548-0620", 12); l += 7 << 16; + l += 3 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Creative Labs, Inc.", 12); l += 7 << 16; + l += 3 << 16; + DukeMenuDelegate.shadowminitext(m, l, "Thanks for the hardware, guys.", 12); l += 7 << 16; + } +} + +class ImageScrollerPageDukeCredits3 : ImageScrollerPage +{ + + void Init(ImageScrollerDescriptor desc) + { + Super.Init(); + } + + override void Drawer(bool selected) + { + let VOLUMEONE = gameinfo.gametype & GAMEFLAG_SHAREWARE; + int m, l; + Screen.DrawTexture(TexMan.CheckForTexture("MENUSCREEN"), false, 160, 100, DTA_FullscreenScale, FSMode_Fit320x200, DTA_Color, 0xff808080, DTA_CenterOffset, true); + + DukeMenuDelegate.mgametextcenter(0, (50 << 16), "Duke Nukem 3D is a trademark of"); + DukeMenuDelegate.mgametextcenter(0, (59 << 16), "3D Realms Entertainment"); + DukeMenuDelegate.mgametextcenter(0, (77 << 16), "Duke Nukem 3D"); + DukeMenuDelegate.mgametextcenter(0, (86 << 16), "(C) 1996 3D Realms Entertainment"); + + if (VOLUMEONE) + { + DukeMenuDelegate.mgametextcenter(0, (106 << 16), "Please read LICENSE.DOC for shareware"); + DukeMenuDelegate.mgametextcenter(0, (115 << 16), "distribution grants and restrictions."); + } + DukeMenuDelegate.mgametextcenter(0, ((VOLUMEONE ? 134 : 115) << 16), "Made in Dallas, Texas USA"); + } +}