diff options
Diffstat (limited to 'src/hexen')
-rw-r--r-- | src/hexen/.gitignore | 6 | ||||
-rw-r--r-- | src/hexen/h2_main.c | 28 | ||||
-rw-r--r-- | src/hexen/mn_menu.c | 47 | ||||
-rw-r--r-- | src/hexen/p_acs.c | 2 | ||||
-rw-r--r-- | src/hexen/p_spec.c | 2 | ||||
-rw-r--r-- | src/hexen/r_things.c | 5 | ||||
-rw-r--r-- | src/hexen/s_sound.c | 16 |
7 files changed, 52 insertions, 54 deletions
diff --git a/src/hexen/.gitignore b/src/hexen/.gitignore index d7e732ad..d4e88e5a 100644 --- a/src/hexen/.gitignore +++ b/src/hexen/.gitignore @@ -1,7 +1,5 @@ Makefile Makefile.in .deps -*.rc -chocolate-doom -chocolate-server -*.exe +tags +TAGS diff --git a/src/hexen/h2_main.c b/src/hexen/h2_main.c index ef223c0e..abc58f15 100644 --- a/src/hexen/h2_main.c +++ b/src/hexen/h2_main.c @@ -46,6 +46,7 @@ #include "m_controls.h" #include "p_local.h" #include "v_video.h" +#include "w_main.h" // MACROS ------------------------------------------------------------------ @@ -88,7 +89,6 @@ static void PageDrawer(void); static void HandleArgs(void); static void CheckRecordFrom(void); static void DrawAndBlit(void); -static void ExecOptionFILE(char **args, int tag); static void ExecOptionSCRIPTS(char **args, int tag); static void ExecOptionSKILL(char **args, int tag); static void ExecOptionPLAYDEMO(char **args, int tag); @@ -133,7 +133,6 @@ static int pagetic; static char *pagename; static execOpt_t ExecOptions[] = { - {"-file", ExecOptionFILE, 1, 0}, {"-scripts", ExecOptionSCRIPTS, 1, 0}, {"-skill", ExecOptionSKILL, 1, 0}, {"-playdemo", ExecOptionPLAYDEMO, 1, 0}, @@ -157,6 +156,7 @@ void D_BindVariables(void) M_BindMapControls(); M_BindMenuControls(); M_BindWeaponControls(); + M_BindChatControls(MAXPLAYERS); M_BindHereticControls(); M_BindHexenControls(); @@ -422,6 +422,9 @@ static void HandleArgs(void) cmdfrag = M_ParmExists("-cmdfrag"); + // Check WAD file command line options + W_ParseCommandLine(); + // Process command line options for (opt = ExecOptions; opt->name != NULL; opt++) { @@ -485,27 +488,6 @@ static void ExecOptionSKILL(char **args, int tag) //========================================================================== // -// ExecOptionFILE -// -//========================================================================== - -static void ExecOptionFILE(char **args, int tag) -{ - char *filename; - int p; - - p = M_CheckParm("-file"); - while (++p != myargc && myargv[p][0] != '-') - { - filename = D_TryFindWADByName(myargv[p]); - - D_AddFile(filename); - } -} - - -//========================================================================== -// // ExecOptionPLAYDEMO // //========================================================================== diff --git a/src/hexen/mn_menu.c b/src/hexen/mn_menu.c index 09a8f1ea..9f37df66 100644 --- a/src/hexen/mn_menu.c +++ b/src/hexen/mn_menu.c @@ -679,6 +679,32 @@ static void DrawSaveMenu(void) DrawFileSlots(&SaveMenu); } +static boolean ReadDescriptionForSlot(int slot, char *description) +{ + FILE *fp; + boolean found; + char name[100]; + char versionText[HXS_VERSION_TEXT_LENGTH]; + + sprintf(name, "%shex%d.hxs", SavePath, slot); + + fp = fopen(name, "rb"); + + if (fp == NULL) + { + return false; + } + + found = fread(description, HXS_DESCRIPTION_LENGTH, 1, fp) == 1 + && fread(versionText, HXS_VERSION_TEXT_LENGTH, 1, fp) == 1; + + found = found && strcmp(versionText, HXS_VERSION_TEXT) == 0; + + fclose(fp); + + return found; +} + //=========================================================================== // // MN_LoadSlotText @@ -689,29 +715,12 @@ static void DrawSaveMenu(void) void MN_LoadSlotText(void) { - int slot; - FILE *fp; - char name[100]; - char versionText[HXS_VERSION_TEXT_LENGTH]; char description[HXS_DESCRIPTION_LENGTH]; - boolean found; + int slot; for (slot = 0; slot < 6; slot++) { - found = false; - sprintf(name, "%shex%d.hxs", SavePath, slot); - fp = fopen(name, "rb"); - if (fp) - { - fread(description, HXS_DESCRIPTION_LENGTH, 1, fp); - fread(versionText, HXS_VERSION_TEXT_LENGTH, 1, fp); - fclose(fp); - if (!strcmp(versionText, HXS_VERSION_TEXT)) - { - found = true; - } - } - if (found) + if (ReadDescriptionForSlot(slot, description)) { memcpy(SlotText[slot], description, SLOTTEXTLEN); SlotStatus[slot] = 1; diff --git a/src/hexen/p_acs.c b/src/hexen/p_acs.c index 618bbd05..9ca9f6af 100644 --- a/src/hexen/p_acs.c +++ b/src/hexen/p_acs.c @@ -509,7 +509,7 @@ static boolean AddToACSStore(int map, int number, byte * args) } ACSStore[index].map = map; ACSStore[index].script = number; - *((int *) ACSStore[index].args) = *((int *) args); + memcpy(ACSStore[index].args, args, sizeof(int)); return true; } diff --git a/src/hexen/p_spec.c b/src/hexen/p_spec.c index ca0bbfb8..03c98cbc 100644 --- a/src/hexen/p_spec.c +++ b/src/hexen/p_spec.c @@ -245,6 +245,8 @@ fixed_t P_FindNextHighestFloor(sector_t * sec, int currentheight) fixed_t height = currentheight; fixed_t heightlist[20]; // 20 adjoining sectors max! + heightlist[0] = 0; + for (i = 0, h = 0; i < sec->linecount; i++) { check = sec->lines[i]; diff --git a/src/hexen/r_things.c b/src/hexen/r_things.c index 0517fd49..aeba11c4 100644 --- a/src/hexen/r_things.c +++ b/src/hexen/r_things.c @@ -158,7 +158,7 @@ void R_InstallSpriteLump(int lump, unsigned frame, unsigned rotation, void R_InitSpriteDefs(char **namelist) { char **check; - int i, l, intname, frame, rotation; + int i, l, frame, rotation; int start, end; // count the number of sprite names @@ -184,13 +184,12 @@ void R_InitSpriteDefs(char **namelist) memset(sprtemp, -1, sizeof(sprtemp)); maxframe = -1; - intname = *(int *) namelist[i]; // // scan the lumps, filling in the frames for whatever is found // for (l = start + 1; l < end; l++) - if (*(int *) lumpinfo[l].name == intname) + if (!strncmp(lumpinfo[l].name, namelist[i], 4)) { frame = lumpinfo[l].name[4] - 'A'; rotation = lumpinfo[l].name[5] - '0'; diff --git a/src/hexen/s_sound.c b/src/hexen/s_sound.c index fdd01ba5..f11e4ee9 100644 --- a/src/hexen/s_sound.c +++ b/src/hexen/s_sound.c @@ -736,7 +736,7 @@ void S_Init(void) { snd_Channels = 8; } - I_SetMusicVolume(snd_MusicVolume); + I_SetMusicVolume(snd_MusicVolume * 8); I_AtExit(S_ShutDown, true); @@ -787,8 +787,16 @@ void S_GetChannelInfo(SoundInfo_t * s) c->priority = Channel[i].priority; c->name = S_sfx[c->id].name; c->mo = Channel[i].mo; - c->distance = P_AproxDistance(c->mo->x - viewx, c->mo->y - viewy) - >> FRACBITS; + + if (c->mo != NULL) + { + c->distance = P_AproxDistance(c->mo->x - viewx, c->mo->y - viewy) + >> FRACBITS; + } + else + { + c->distance = 0; + } } } @@ -829,7 +837,7 @@ void S_SetMusicVolume(void) } else { - I_SetMusicVolume(snd_MusicVolume); + I_SetMusicVolume(snd_MusicVolume * 8); } if (snd_MusicVolume == 0) { |