Skip to content

Commit

Permalink
Merge pull request #534 from andrikpowell/dsda-doom-menu-raven-fixes
Browse files Browse the repository at this point in the history
Fix HELP / README routines to match Vanilla (with Heretic / Hexen Menu Fixes and Additions)
  • Loading branch information
Pedro-Beirao authored Nov 22, 2024
2 parents 5ed9e91 + 8b86e88 commit 4eee12a
Show file tree
Hide file tree
Showing 10 changed files with 392 additions and 55 deletions.
23 changes: 21 additions & 2 deletions prboom2/src/d_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ const char *const standard_iwads[]=
"bfgdoom.wad",

"heretic.wad",
"hexen.wad"
"hexen.wad",

"heretic1.wad"
};
//e6y static
const int nstandard_iwads = sizeof standard_iwads/sizeof*standard_iwads;
Expand Down Expand Up @@ -636,6 +638,10 @@ static void D_PageDrawer(void)
return;
}

// Allows use of PWAD HELP2 screen in demosequence
if (demosequence == 4 && pwad_help2_check)
pagename = "HELP2";

// proff/nicolas 09/14/98 -- now stretchs bitmaps to fullscreen!
// CPhipps - updated for new patch drawing
// proff - added M_DrawCredits
Expand Down Expand Up @@ -1007,6 +1013,14 @@ void AddIWAD(const char *iwad)
haswolflevels = false;
}

if (i >= 12 && !strnicmp(iwad + i - 12, "heretic1.wad", 12))
{
if (!dsda_Flag(dsda_arg_heretic))
dsda_UpdateFlag(dsda_arg_heretic, true);

gamemode = shareware;
}

switch(gamemode)
{
case retail:
Expand Down Expand Up @@ -1569,7 +1583,12 @@ static void EvaluateDoomVerStr(void)
{
if (heretic)
{
doomverstr = "Heretic";
if (gamemode == retail)
doomverstr= "Heretic: Shadow of the Serpent Riders";
else if (gamemode == shareware)
doomverstr = "Heretic Shareware";
else
doomverstr = "Heretic";
}
else if (hexen)
{
Expand Down
2 changes: 2 additions & 0 deletions prboom2/src/dsda/global.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,8 @@ static dboolean dsda_AutoDetectHeretic(void)
length = strlen(arg->value.v_string);
if (length >= 11 && !strnicmp(arg->value.v_string + length - 11, "heretic.wad", 11))
return true;
else if (length >= 12 && !strnicmp(arg->value.v_string + length - 12, "heretic1.wad", 12))
return true;
}

return false;
Expand Down
2 changes: 1 addition & 1 deletion prboom2/src/f_finale.c
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ void F_Drawer (void)
{
// CPhipps - patch drawing updated
case 1:
if ( gamemode == retail || gamemode == commercial )
if ( (gamemode == retail && !pwad_help2_check) || gamemode == commercial )
V_DrawNamePatch(0, 0, 0, "CREDIT", CR_DEFAULT, VPT_STRETCH);
else
V_DrawNamePatch(0, 0, 0, "HELP2", CR_DEFAULT, VPT_STRETCH);
Expand Down
9 changes: 9 additions & 0 deletions prboom2/src/g_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@
#include "dsda/split_tracker.h"
#include "dsda/utility.h"

// Allows use of HELP2 screen for PWADs under DOOM 1
int pwad_help2_check;

struct
{
int type; // mobjtype_t
Expand Down Expand Up @@ -2732,6 +2735,12 @@ void G_ReloadDefaults(void)
// (allows functions above to load different values for demos
// and savegames without messing up defaults).

// Allows PWAD HELP2 screen for DOOM 1 wads.
// there's no easy way to set it only to complevel 0-2, so
// I just allowed it for complevel 3 if HELP2 is present
if ((compatibility_level <= 3) && (gamemode != commercial) && (gamemode != shareware) && !raven)
pwad_help2_check = W_PWADLumpNameExists("HELP2");

options = dsda_Options();

weapon_recoil = options->weapon_recoil; // weapon recoil
Expand Down
3 changes: 3 additions & 0 deletions prboom2/src/g_game.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ extern const char * comp_lev_str[];
extern int shorttics;
extern int longtics;

// Allows use of HELP2 screen for PWADs under DOOM 1
extern int pwad_help2_check;

// hexen

void G_Completed(int map, int position, int flags, angle_t angle);
Expand Down
8 changes: 8 additions & 0 deletions prboom2/src/heretic/dstrings.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@
#define HERETIC_AMSTR_MARKEDSPOT "Marked Spot"
#define HERETIC_AMSTR_MARKSCLEARED "All Marks Cleared"

//---------------------------------------------------------------------------
//
// m_menu.c
//
//---------------------------------------------------------------------------

#define HERETIC_SWSTRING "ONLY AVAILABLE IN THE REGISTERED VERSION"

//---------------------------------------------------------------------------
//
// F_finale.c
Expand Down
236 changes: 236 additions & 0 deletions prboom2/src/heretic/mn_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,222 @@ extern menu_t LoadDef;
extern menu_t SaveDef;
extern menuitem_t SoundMenu[];

/////////////////////////////
//
// Raven Prototypes
//
/////////////////////////////

void MN_GameFiles(int choice);
void MN_Info(int choice);
void MN_Info2(int choice);
void MN_Info3(int choice);
void MN_Info4(int choice);
void MN_FinishInfo(int choice);

void MN_DrawInfoAd(void);
void MN_DrawInfoHelp1(void);
void MN_DrawInfoHelp2(void);
void MN_DrawInfoCredits(void);

void MN_DrawAd(void);
void MN_DrawCredits(void);
void MN_DrawHelp1(void);
void MN_DrawHelp2(void);

extern void M_ChangeMenu(menu_t *menu, menuactive_t mnact);
extern dboolean inhelpscreens;
extern menu_t ExtHelpDef;
extern void M_NewGame(int choice);
extern void M_Options(int choice);
extern void M_QuitDOOM(int choice);
extern void M_LoadGame(int choice);
extern void M_SaveGame(int choice);


/////////////////////////////
//
// Raven Info Screens
//
/////////////////////////////

enum { infoempty1, info1_end } info_e1;
enum { infoempty2, info2_end } info_e2;
enum { infoempty3, info3_end } info_e3;
enum { infoempty4, info4_end } info_e4;

menuitem_t InfoMenu1[] = { {1,"",MN_Info2,0} };
menuitem_t InfoMenu2[] = { {1,"",MN_Info3,0} };
menuitem_t InfoMenu3[] = { {1,"",MN_Info4,0} };
menuitem_t InfoMenu4[] = { {1,"",MN_FinishInfo,0} };

menu_t InfoDef1 =
{
info1_end,
&MainDef,
InfoMenu1,
MN_DrawInfoAd,
330,175,
0
};

menu_t InfoDef2 =
{
info2_end,
&InfoDef1,
InfoMenu2,
MN_DrawInfoHelp1,
330,175,
0
};

menu_t InfoDef3 =
{
info3_end,
&InfoDef2,
InfoMenu3,
MN_DrawInfoHelp2,
330,175,
0
};

menu_t InfoDef4 =
{
info4_end,
&InfoDef3,
InfoMenu4,
MN_DrawInfoCredits,
330,175,
0
};

void MN_Info (int choice) { M_SetupNextMenu(&InfoDef1); }
void MN_Info2 (int choice) { M_SetupNextMenu(&InfoDef2); }
void MN_Info3 (int choice) { M_SetupNextMenu(&InfoDef3); }
void MN_Info4 (int choice) { M_SetupNextMenu(&InfoDef4); }
void MN_FinishInfo (int choice) { M_SetupNextMenu(&MainDef); }

void MN_DrawInfoAd(void)
{
inhelpscreens = true;
MN_DrawAd();
}

void MN_DrawInfoHelp1(void)
{
inhelpscreens = true;
MN_DrawHelp1();
}

void MN_DrawInfoHelp2(void)
{
inhelpscreens = true;
MN_DrawHelp2();
}

void MN_DrawInfoCredits(void)
{
inhelpscreens = true;
MN_DrawCredits();
}

void MN_DrawAd (void)
{
const char* ravenlump;
ravenlump = (heretic && (gamemode == shareware)) ? "ORDER" : "CREDIT";
M_ChangeMenu(NULL, mnact_full);
V_DrawRawScreen(ravenlump);
return;
}

void MN_DrawHelp1 (void)
{
M_ChangeMenu(NULL, mnact_full);
V_DrawRawScreen("HELP1");
return;
}

void MN_DrawHelp2 (void)
{
M_ChangeMenu(NULL, mnact_full);
V_DrawRawScreen("HELP2");
return;
}

void MN_DrawCredits (void)
{
M_ChangeMenu(NULL, mnact_full);
V_DrawRawScreen("CREDIT");
return;
}

/////////////////////////////
//
// RavenMainMenu (Heretic and Hexen use this)
//
/////////////////////////////

enum
{
rnewgame = 0,
roptions,
rgamefiles,
rinfo,
rquitdoom,
rmain_end
} rmain_e;

menuitem_t RavenMainMenu[]=
{
{1,"M_NGAME", M_NewGame, 'n', "NEW GAME"},
{1,"M_OPTION",M_Options, 'o', "OPTIONS"},
{1,"M_GFILES", MN_GameFiles,'g', "GAME FILES"},
{1,"M_INFO",MN_Info,'i', "INFO"},
{1,"M_QUITG", M_QuitDOOM,'q', "QUIT GAME"}
};


/////////////////////////////
//
// Raven GameFiles Menu
//
/////////////////////////////

enum
{
rloadgame,
rsavegame,
rsaveload_end
} saveload_e;

menuitem_t SaveLoadMenu[]=
{
{1,"M_LOADG", M_LoadGame,'l', "LOAD GAME"},
{1,"M_SAVEG", M_SaveGame,'s', "SAVE GAME"},
};

menu_t SaveLoadDef =
{
rsaveload_end, // number of menu items
&MainDef, // previous menu screen
SaveLoadMenu, // table that defines menu items
NULL, // drawing routine
97,64, // initial cursor position
0 // last menu item the user was on
};

void MN_GameFiles(int choice)
{
M_SetupNextMenu(&SaveLoadDef);
}


/////////////////////////////
//
// Raven MN_Init
//
/////////////////////////////

void M_DrawThermo(int x, int y, int thermWidth, int thermDot);

void MN_Init(void)
Expand Down Expand Up @@ -122,6 +338,20 @@ void MN_Init(void)

SoundMenu[0].alttext = "SFX VOLUME";
SoundMenu[2].alttext = "MUSIC VOLUME";

// Use exclusive Raven MainMenu.
MainDef.menuitems = RavenMainMenu;
MainDef.numitems = rmain_end;
SaveDef.prevMenu = &SaveLoadDef;
LoadDef.prevMenu = &SaveLoadDef;

// remove "ORDER" screen if not shareware
if (gamemode != shareware)
{
InfoDef1.routine = MN_DrawInfoHelp1;
InfoMenu1[0].routine = MN_Info3;
InfoDef2.prevMenu = &MainDef;
}
}

void MN_UpdateClass(int choice)
Expand Down Expand Up @@ -218,6 +448,12 @@ void MN_Drawer(void)
y += ITEM_HEIGHT;
}

// Don't draw selector on INFO screens for Heretic / Hexen
if (currentMenu == &InfoDef1 || currentMenu == &InfoDef2 ||
currentMenu == &InfoDef3 || currentMenu == &InfoDef4 ||
currentMenu == &ExtHelpDef)
return;

if (max)
{
y = currentMenu->y + (itemOn * ITEM_HEIGHT) + SELECTOR_YOFFSET;
Expand Down
Loading

0 comments on commit 4eee12a

Please sign in to comment.