From c33c1fa07680ef07540fb1c48a323bdc816e3e77 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 6 Feb 2010 15:54:13 +0000 Subject: Fix Heretic/Hexen "noise" sound debug cheats. Subversion-branch: /branches/raven-branch Subversion-revision: 1850 --- src/hexen/s_sound.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/hexen') diff --git a/src/hexen/s_sound.c b/src/hexen/s_sound.c index fdd01ba5..74774fb3 100644 --- a/src/hexen/s_sound.c +++ b/src/hexen/s_sound.c @@ -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; + } } } -- cgit v1.2.3 From 2bfd7c43fee19b16da7d0a0354765fc8e8a4dfc0 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 18 Apr 2010 21:29:42 +0000 Subject: Split out WAD command line parsing code into common code shared between games. Subversion-branch: /branches/raven-branch Subversion-revision: 1910 --- src/hexen/h2_main.c | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) (limited to 'src/hexen') diff --git a/src/hexen/h2_main.c b/src/hexen/h2_main.c index ef223c0e..a20bd91a 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}, @@ -422,6 +421,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++) { @@ -483,27 +485,6 @@ static void ExecOptionSKILL(char **args, int tag) autostart = true; } -//========================================================================== -// -// 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 -- cgit v1.2.3 From 63ff4879e6c7811d9e8cf357b4e44701964adf21 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 18 Apr 2010 22:37:48 +0000 Subject: Fix svn:ignore properties. Subversion-branch: /branches/raven-branch Subversion-revision: 1912 --- src/hexen/.gitignore | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/hexen') diff --git a/src/hexen/.gitignore b/src/hexen/.gitignore index d7e732ad..2e0aa797 100644 --- a/src/hexen/.gitignore +++ b/src/hexen/.gitignore @@ -2,6 +2,3 @@ Makefile Makefile.in .deps *.rc -chocolate-doom -chocolate-server -*.exe -- cgit v1.2.3 From af48a6309cf1f03b5136e26a5fc27a38e490d808 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Fri, 30 Apr 2010 21:48:34 +0000 Subject: Scale up music volume from configuration file value in Heretic/Hexen. Subversion-branch: /branches/raven-branch Subversion-revision: 1925 --- src/hexen/s_sound.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/hexen') diff --git a/src/hexen/s_sound.c b/src/hexen/s_sound.c index 74774fb3..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); @@ -837,7 +837,7 @@ void S_SetMusicVolume(void) } else { - I_SetMusicVolume(snd_MusicVolume); + I_SetMusicVolume(snd_MusicVolume * 8); } if (snd_MusicVolume == 0) { -- cgit v1.2.3 From 7a3249ce14ac528a5cdf9ca2d0a62535cf2bb1cd Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Mon, 3 May 2010 18:23:15 +0000 Subject: Fix compiler warnings. Subversion-branch: /branches/raven-branch Subversion-revision: 1934 --- src/hexen/mn_menu.c | 47 ++++++++++++++++++++++++++++------------------- src/hexen/p_acs.c | 2 +- src/hexen/p_spec.c | 2 ++ src/hexen/r_things.c | 5 ++--- 4 files changed, 33 insertions(+), 23 deletions(-) (limited to 'src/hexen') 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'; -- cgit v1.2.3 From f391d85c96afa91a2302c58191ce8d401fdba2e2 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 12 Jun 2010 19:38:49 +0000 Subject: Add tags files to svn:ignore. Subversion-branch: /branches/raven-branch Subversion-revision: 1938 --- src/hexen/.gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/hexen') diff --git a/src/hexen/.gitignore b/src/hexen/.gitignore index 2e0aa797..d4e88e5a 100644 --- a/src/hexen/.gitignore +++ b/src/hexen/.gitignore @@ -1,4 +1,5 @@ Makefile Makefile.in .deps -*.rc +tags +TAGS -- cgit v1.2.3