diff options
-rw-r--r-- | man/manpage.template | 4 | ||||
-rw-r--r-- | pcsound/pcsound_sdl.c | 31 | ||||
-rw-r--r-- | src/doom/p_enemy.c | 122 | ||||
-rw-r--r-- | src/setup/display.c | 3 |
4 files changed, 88 insertions, 72 deletions
diff --git a/man/manpage.template b/man/manpage.template index 0b090cf9..052ccb63 100644 --- a/man/manpage.template +++ b/man/manpage.template @@ -18,9 +18,9 @@ behavior. .TP \fBDOOMWADDIR\fR, \fBDOOMWADPATH\fR These environment variables provide paths to search for Doom .WAD files when -looking for a game IWAD file or a PWAD file specified with the '-file' option. +looking for a game IWAD file or a PWAD file specified with the `-file' option. \fBDOOMWADDIR\fR specifies a single path in which to look for WAD files, -while \fBDOOMWWADDIR\fR specifies a colon-separated list of paths to search. +while \fBDOOMWWADPATH\fR specifies a colon-separated list of paths to search. .TP \fBPCSOUND_DRIVER\fR When running in PC speaker sound effect mode, this environment variable diff --git a/pcsound/pcsound_sdl.c b/pcsound/pcsound_sdl.c index 546e6a36..6ba06785 100644 --- a/pcsound/pcsound_sdl.c +++ b/pcsound/pcsound_sdl.c @@ -32,7 +32,7 @@ #include "pcsound.h" #include "pcsound_internal.h" -#define SOUND_SLICE_TIME 100 /* ms */ +#define MAX_SOUND_SLICE_TIME 70 /* ms */ #define SQUARE_WAVE_AMP 0x2000 // If true, we initialised SDL and have the responsibility to shut it @@ -164,6 +164,33 @@ static void PCSound_SDL_Shutdown(void) } } +// Calculate slice size, based on MAX_SOUND_SLICE_TIME. +// The result must be a power of two. + +static int GetSliceSize(void) +{ + int limit; + int n; + + limit = (pcsound_sample_rate * MAX_SOUND_SLICE_TIME) / 1000; + + // Try all powers of two, not exceeding the limit. + + for (n=0;; ++n) + { + // 2^n <= limit < 2^n+1 ? + + if ((1 << (n + 1)) > limit) + { + return (1 << n); + } + } + + // Should never happen? + + return 1024; +} + static int PCSound_SDL_Init(pcsound_callback_func callback_func) { int slicesize; @@ -179,7 +206,7 @@ static int PCSound_SDL_Init(pcsound_callback_func callback_func) return 0; } - slicesize = (SOUND_SLICE_TIME * pcsound_sample_rate) / 1000; + slicesize = GetSliceSize(); if (Mix_OpenAudio(pcsound_sample_rate, AUDIO_S16SYS, 2, slicesize) < 0) { diff --git a/src/doom/p_enemy.c b/src/doom/p_enemy.c index 0253095b..10846d20 100644 --- a/src/doom/p_enemy.c +++ b/src/doom/p_enemy.c @@ -1612,6 +1612,57 @@ void A_Explode (mobj_t* thingy) P_RadiusAttack(thingy, thingy->target, 128); } +// Check whether the death of the specified monster type is allowed +// to trigger the end of episode special action. +// +// This behavior changed in v1.9, the most notable effect of which +// was to break uac_dead.wad + +static boolean CheckBossEnd(mobjtype_t motype) +{ + if (gameversion < exe_ultimate) + { + if (gamemap != 8) + { + return false; + } + + // Baron death on later episodes is nothing special. + + if (motype == MT_BRUISER && gameepisode != 1) + { + return false; + } + + return true; + } + else + { + // New logic that appeared in Ultimate Doom. + // Looks like the logic was overhauled while adding in the + // episode 4 support. Now bosses only trigger on their + // specific episode. + + switch(gameepisode) + { + case 1: + return gamemap == 8 && motype == MT_BRUISER; + + case 2: + return gamemap == 8 && motype == MT_CYBORG; + + case 3: + return gamemap == 8 && motype == MT_SPIDER; + + case 4: + return (gamemap == 6 && motype == MT_CYBORG) + || (gamemap == 8 && motype == MT_SPIDER); + + default: + return gamemap == 8; + } + } +} // // A_BossDeath @@ -1636,75 +1687,12 @@ void A_BossDeath (mobj_t* mo) } else { - switch(gameepisode) - { - case 1: - if (gamemap != 8) - return; - - // fraggle: disable this as it breaks uac_dead.wad. - // There is at least one version of Doom 1.9 which it is - // possible to play uac_dead through on. I think this was - // added here for Ultimate Doom. - // - // See lmps/doom/ultimate/uac_dead.zip in idgames for - // an example of a demo which goes out of sync if this - // is left in here. - // - // For the time being, I'm making the assumption that - // doing this is not going to break anything else. - // - // 2005/10/24: Modify this to test the gameversion setting - - if (gameversion >= exe_ultimate && mo->type != MT_BRUISER) - return; - break; - - case 2: - if (gamemap != 8) - return; - - if (mo->type != MT_CYBORG) - return; - break; - - case 3: - if (gamemap != 8) - return; - - if (mo->type != MT_SPIDER) - return; - - break; - - case 4: - switch(gamemap) - { - case 6: - if (mo->type != MT_CYBORG) - return; - break; - - case 8: - if (mo->type != MT_SPIDER) - return; - break; - - default: - return; - break; - } - break; - - default: - if (gamemap != 8) - return; - break; - } - + if (!CheckBossEnd(mo->type)) + { + return; + } } - // make sure there is a player alive for victory for (i=0 ; i<MAXPLAYERS ; i++) if (playeringame[i] && players[i].health > 0) diff --git a/src/setup/display.c b/src/setup/display.c index ce576795..3efe3ec1 100644 --- a/src/setup/display.c +++ b/src/setup/display.c @@ -389,7 +389,8 @@ void ConfigDisplay(void) window = TXT_NewWindow("Display Configuration"); - TXT_SetWindowPosition(window, TXT_HORIZ_CENTER, TXT_VERT_TOP, 40, 5); + TXT_SetWindowPosition(window, TXT_HORIZ_CENTER, TXT_VERT_TOP, + TXT_SCREEN_W / 2, 5); TXT_AddWidgets(window, fs_checkbox = TXT_NewCheckBox("Fullscreen", &fullscreen), |