From 9769464ecf7ae3c92c628deed8164b61f567923a Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Mon, 8 Feb 2010 19:16:27 +0000 Subject: Call DEH_Init on Heretic startup so that patches will be loaded. Subversion-branch: /branches/raven-branch Subversion-revision: 1864 --- src/heretic/d_main.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/heretic/d_main.c') diff --git a/src/heretic/d_main.c b/src/heretic/d_main.c index 10f5fd3e..ddcbca20 100644 --- a/src/heretic/d_main.c +++ b/src/heretic/d_main.c @@ -33,6 +33,7 @@ #include "config.h" #include "ct_chat.h" #include "doomdef.h" +#include "deh_main.h" #include "d_iwad.h" #include "i_endoom.h" #include "i_joystick.h" @@ -890,6 +891,11 @@ void D_DoomMain(void) printf("Z_Init: Init zone memory allocation daemon.\n"); Z_Init(); +#ifdef FEATURE_DEHACKED + printf("DEH_Init: Init Dehacked support.\n"); + DEH_Init(); +#endif + printf("W_Init: Init WADfiles.\n"); iwadfile = D_FindIWAD(IWAD_MASK_HERETIC, &gamemission); -- cgit v1.2.3 From 56412813c70ba44a6f6a74cee5bf460ca6a31402 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Mon, 8 Feb 2010 21:14:30 +0000 Subject: Add Heretic implementation of HHE "Text" section, add DEH_String() around appropriate strings to allow string replacements. Subversion-branch: /branches/raven-branch Subversion-revision: 1867 --- src/heretic/d_main.c | 72 ++++++++++++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) (limited to 'src/heretic/d_main.c') diff --git a/src/heretic/d_main.c b/src/heretic/d_main.c index ddcbca20..52e4239f 100644 --- a/src/heretic/d_main.c +++ b/src/heretic/d_main.c @@ -185,12 +185,12 @@ void D_Display(void) { if (!netgame) { - V_DrawPatch(160, viewwindowy + 5, W_CacheLumpName("PAUSED", + V_DrawPatch(160, viewwindowy + 5, W_CacheLumpName(DEH_String("PAUSED"), PU_CACHE)); } else { - V_DrawPatch(160, 70, W_CacheLumpName("PAUSED", PU_CACHE)); + V_DrawPatch(160, 70, W_CacheLumpName(DEH_String("PAUSED"), PU_CACHE)); } } // Handle player messages @@ -316,7 +316,7 @@ void D_PageDrawer(void) V_DrawRawScreen(W_CacheLumpName(pagename, PU_CACHE)); if (demosequence == 1) { - V_DrawPatch(4, 160, W_CacheLumpName("ADVISOR", PU_CACHE)); + V_DrawPatch(4, 160, W_CacheLumpName(DEH_String("ADVISOR"), PU_CACHE)); } UpdateState |= I_FULLSCRN; } @@ -348,45 +348,45 @@ void D_DoAdvanceDemo(void) case 0: pagetic = 210; gamestate = GS_DEMOSCREEN; - pagename = "TITLE"; + pagename = DEH_String("TITLE"); S_StartSong(mus_titl, false); break; case 1: pagetic = 140; gamestate = GS_DEMOSCREEN; - pagename = "TITLE"; + pagename = DEH_String("TITLE"); break; case 2: BorderNeedRefresh = true; UpdateState |= I_FULLSCRN; - G_DeferedPlayDemo("demo1"); + G_DeferedPlayDemo(DEH_String("demo1")); break; case 3: pagetic = 200; gamestate = GS_DEMOSCREEN; - pagename = "CREDIT"; + pagename = DEH_String("CREDIT"); break; case 4: BorderNeedRefresh = true; UpdateState |= I_FULLSCRN; - G_DeferedPlayDemo("demo2"); + G_DeferedPlayDemo(DEH_String("demo2")); break; case 5: pagetic = 200; gamestate = GS_DEMOSCREEN; if (gamemode == shareware) { - pagename = "ORDER"; + pagename = DEH_String("ORDER"); } else { - pagename = "CREDIT"; + pagename = DEH_String("CREDIT"); } break; case 6: BorderNeedRefresh = true; UpdateState |= I_FULLSCRN; - G_DeferedPlayDemo("demo3"); + G_DeferedPlayDemo(DEH_String("demo3")); break; } } @@ -639,7 +639,7 @@ void initStartup(void) // Blit main screen textScreen = TXT_GetScreenData(); - loading = W_CacheLumpName("LOADING", PU_CACHE); + loading = W_CacheLumpName(DEH_String("LOADING"), PU_CACHE); memcpy(textScreen, loading, 4000); // Print version string @@ -699,7 +699,7 @@ void tprintf(char *msg, int initflag) // haleyjd: moved up, removed WATCOMC code void CleanExit(void) { - printf("Exited from HERETIC.\n"); + printf(DEH_String("Exited from HERETIC.\n")); exit(1); } @@ -783,7 +783,7 @@ static void D_Endoom(void) return; } - endoom_data = W_CacheLumpName("ENDTEXT", PU_STATIC); + endoom_data = W_CacheLumpName(DEH_String("ENDTEXT"), PU_STATIC); I_Endoom(endoom_data); } @@ -848,7 +848,7 @@ void D_DoomMain(void) // // init subsystems // - printf("V_Init: allocate screens.\n"); + printf(DEH_String("V_Init: allocate screens.\n")); V_Init(); // Check for -CDROM @@ -873,7 +873,7 @@ void D_DoomMain(void) if (cdrom) { - M_SetConfigDir("c:\\heretic.cd\\"); + M_SetConfigDir(DEH_String("c:\\heretic.cd")); } else { @@ -881,14 +881,14 @@ void D_DoomMain(void) } // Load defaults before initing other systems - printf("M_LoadDefaults: Load system defaults.\n"); + printf(DEH_String("M_LoadDefaults: Load system defaults.\n")); D_BindVariables(); M_SetConfigFilenames("heretic.cfg", PROGRAM_PREFIX "heretic.cfg"); M_LoadDefaults(); I_AtExit(M_SaveDefaults, false); - printf("Z_Init: Init zone memory allocation daemon.\n"); + printf(DEH_String("Z_Init: Init zone memory allocation daemon.\n")); Z_Init(); #ifdef FEATURE_DEHACKED @@ -896,7 +896,7 @@ void D_DoomMain(void) DEH_Init(); #endif - printf("W_Init: Init WADfiles.\n"); + printf(DEH_String("W_Init: Init WADfiles.\n")); iwadfile = D_FindIWAD(IWAD_MASK_HERETIC, &gamemission); @@ -933,12 +933,12 @@ void D_DoomMain(void) } if (p && p < myargc - 1) { - sprintf(file, "%s.lmp", myargv[p + 1]); + sprintf(file, DEH_String("%s.lmp"), myargv[p + 1]); D_AddFile(file); - printf("Playing demo %s.lmp.\n", myargv[p + 1]); + printf(DEH_String("Playing demo %s.lmp.\n"), myargv[p + 1]); } - if (W_CheckNumForName("E2M1") == -1) + if (W_CheckNumForName(DEH_String("E2M1")) == -1) { gamemode = shareware; gamedescription = "Heretic (shareware)"; @@ -966,54 +966,54 @@ void D_DoomMain(void) // smsg[0] = 0; if (deathmatch) - status("DeathMatch..."); + status(DEH_String("DeathMatch...")); if (nomonsters) - status("No Monsters..."); + status(DEH_String("No Monsters...")); if (respawnparm) - status("Respawning..."); + status(DEH_String("Respawning...")); if (autostart) { char temp[64]; - sprintf(temp, "Warp to Episode %d, Map %d, Skill %d ", + sprintf(temp, DEH_String("Warp to Episode %d, Map %d, Skill %d "), startepisode, startmap, startskill + 1); status(temp); } wadprintf(); // print the added wadfiles - tprintf("MN_Init: Init menu system.\n", 1); + tprintf(DEH_String("MN_Init: Init menu system.\n"), 1); MN_Init(); CT_Init(); - tprintf("R_Init: Init Heretic refresh daemon.", 1); - hprintf("Loading graphics"); + tprintf(DEH_String("R_Init: Init Heretic refresh daemon."), 1); + hprintf(DEH_String("Loading graphics")); R_Init(); tprintf("\n", 0); - tprintf("P_Init: Init Playloop state.\n", 1); - hprintf("Init game engine."); + tprintf(DEH_String("P_Init: Init Playloop state.\n"), 1); + hprintf(DEH_String("Init game engine.")); P_Init(); IncThermo(); - tprintf("I_Init: Setting up machine state.\n", 1); + tprintf(DEH_String("I_Init: Setting up machine state.\n"), 1); I_CheckIsScreensaver(); I_InitTimer(); I_InitJoystick(); IncThermo(); - tprintf("S_Init: Setting up sound.\n", 1); + tprintf(DEH_String("S_Init: Setting up sound.\n"), 1); S_Init(); //IO_StartupTimer(); S_Start(); - tprintf("D_CheckNetGame: Checking network game status.\n", 1); - hprintf("Checking network game status."); + tprintf(DEH_String("D_CheckNetGame: Checking network game status.\n"), 1); + hprintf(DEH_String("Checking network game status.")); D_CheckNetGame(); IncThermo(); // haleyjd: removed WATCOMC - tprintf("SB_Init: Loading patches.\n", 1); + tprintf(DEH_String("SB_Init: Loading patches.\n"), 1); SB_Init(); IncThermo(); -- cgit v1.2.3 From 38c31575d255e1b2ff71f9de2c4d16664e8fb1e9 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 18 Apr 2010 17:15:20 +0000 Subject: Add WAD merging command line options to Heretic. Subversion-branch: /branches/raven-branch Subversion-revision: 1903 --- src/heretic/d_main.c | 127 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) (limited to 'src/heretic/d_main.c') diff --git a/src/heretic/d_main.c b/src/heretic/d_main.c index 52e4239f..5fa2d5f9 100644 --- a/src/heretic/d_main.c +++ b/src/heretic/d_main.c @@ -46,6 +46,7 @@ #include "m_controls.h" #include "p_local.h" #include "s_sound.h" +#include "w_merge.h" #include "v_video.h" #define STARTUP_WINDOW_X 17 @@ -908,6 +909,132 @@ void D_DoomMain(void) D_AddFile(iwadfile); +#ifdef FEATURE_WAD_MERGE + + // Merged PWADs are loaded first, because they are supposed to be + // modified IWADs. + + //! + // @arg + // @category mod + // + // Simulates the behavior of deutex's -merge option, merging a PWAD + // into the main IWAD. Multiple files may be specified. + // + + p = M_CheckParm("-merge"); + + if (p > 0) + { + for (p = p + 1; p + // @category mod + // + // Simulates the behavior of NWT's -merge option. Multiple files + // may be specified. + + p = M_CheckParm("-nwtmerge"); + + if (p > 0) + { + for (p = p + 1; p + // @category mod + // + // Simulates the behavior of NWT's -af option, merging flats into + // the main IWAD directory. Multiple files may be specified. + // + + p = M_CheckParm("-af"); + + if (p > 0) + { + for (p = p + 1; p + // @category mod + // + // Simulates the behavior of NWT's -as option, merging sprites + // into the main IWAD directory. Multiple files may be specified. + // + + p = M_CheckParm("-as"); + + if (p > 0) + { + for (p = p + 1; p + // @category mod + // + // Equivalent to "-af -as ". + // + + p = M_CheckParm("-aa"); + + if (p > 0) + { + for (p = p + 1; p - // @category mod - // - // Simulates the behavior of deutex's -merge option, merging a PWAD - // into the main IWAD. Multiple files may be specified. - // - - p = M_CheckParm("-merge"); - - if (p > 0) - { - for (p = p + 1; p - // @category mod - // - // Simulates the behavior of NWT's -merge option. Multiple files - // may be specified. - - p = M_CheckParm("-nwtmerge"); - - if (p > 0) - { - for (p = p + 1; p - // @category mod - // - // Simulates the behavior of NWT's -af option, merging flats into - // the main IWAD directory. Multiple files may be specified. - // - - p = M_CheckParm("-af"); - - if (p > 0) - { - for (p = p + 1; p - // @category mod - // - // Simulates the behavior of NWT's -as option, merging sprites - // into the main IWAD directory. Multiple files may be specified. - // - - p = M_CheckParm("-as"); - - if (p > 0) - { - for (p = p + 1; p - // @category mod - // - // Equivalent to "-af -as ". - // - - p = M_CheckParm("-aa"); - - if (p > 0) - { - for (p = p + 1; p