summaryrefslogtreecommitdiff
path: root/src/doom
diff options
context:
space:
mode:
Diffstat (limited to 'src/doom')
-rw-r--r--src/doom/d_main.c14
-rw-r--r--src/doom/doom.desktop.in7
-rw-r--r--src/doom/g_game.c24
-rw-r--r--src/doom/p_maputl.c2
-rw-r--r--src/doom/p_saveg.c4
-rw-r--r--src/doom/p_setup.c5
-rw-r--r--src/doom/p_tick.c8
-rw-r--r--src/doom/s_sound.c3
8 files changed, 50 insertions, 17 deletions
diff --git a/src/doom/d_main.c b/src/doom/d_main.c
index ca722dc6..bcdfcaa3 100644
--- a/src/doom/d_main.c
+++ b/src/doom/d_main.c
@@ -1151,6 +1151,11 @@ static void LoadIwadDeh(void)
}
}
+static void G_CheckDemoStatusAtExit (void)
+{
+ G_CheckDemoStatus();
+}
+
//
// D_DoomMain
//
@@ -1470,9 +1475,12 @@ void D_DoomMain (void)
if (p)
{
+ char *uc_filename = strdup(myargv[p + 1]);
+ M_ForceUppercase(uc_filename);
+
// With Vanilla you have to specify the file without extension,
// but make that optional.
- if (M_StringEndsWith(myargv[p + 1], ".lmp"))
+ if (M_StringEndsWith(uc_filename, ".LMP"))
{
M_StringCopy(file, myargv[p + 1], sizeof(file));
}
@@ -1481,6 +1489,8 @@ void D_DoomMain (void)
DEH_snprintf(file, sizeof(file), "%s.lmp", myargv[p+1]);
}
+ free(uc_filename);
+
if (D_AddFile(file))
{
M_StringCopy(demolumpname, lumpinfo[numlumps - 1].name,
@@ -1498,7 +1508,7 @@ void D_DoomMain (void)
printf("Playing demo %s.\n", file);
}
- I_AtExit((atexit_func_t) G_CheckDemoStatus, true);
+ I_AtExit(G_CheckDemoStatusAtExit, true);
// Generate the WAD hash table. Speed things up a bit.
W_GenerateHashTable();
diff --git a/src/doom/doom.desktop.in b/src/doom/doom.desktop.in
deleted file mode 100644
index 44b76e62..00000000
--- a/src/doom/doom.desktop.in
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Name=@PACKAGE_NAME@
-Exec=@PROGRAM_PREFIX@doom
-Icon=@PROGRAM_PREFIX@doom
-Type=Application
-Comment=@PACKAGE_SHORTDESC@
-Categories=Game;ActionGame;
diff --git a/src/doom/g_game.c b/src/doom/g_game.c
index 64f5b274..bc582a52 100644
--- a/src/doom/g_game.c
+++ b/src/doom/g_game.c
@@ -612,6 +612,30 @@ void G_DoLoadLevel (void)
skyflatnum = R_FlatNumForName(DEH_String(SKYFLATNAME));
+ // The "Sky never changes in Doom II" bug was fixed in
+ // the id Anthology version of doom2.exe for Final Doom.
+ if ((gamemode == commercial) && (gameversion == exe_final2))
+ {
+ char *skytexturename;
+
+ if (gamemap < 12)
+ {
+ skytexturename = "SKY1";
+ }
+ else if (gamemap < 21)
+ {
+ skytexturename = "SKY2";
+ }
+ else
+ {
+ skytexturename = "SKY3";
+ }
+
+ skytexturename = DEH_String(skytexturename);
+
+ skytexture = R_TextureNumForName(skytexturename);
+ }
+
levelstarttic = gametic; // for time calculation
if (wipegamestate == GS_LEVEL)
diff --git a/src/doom/p_maputl.c b/src/doom/p_maputl.c
index 098c2c73..6cc35a5a 100644
--- a/src/doom/p_maputl.c
+++ b/src/doom/p_maputl.c
@@ -846,7 +846,7 @@ static void InterceptsOverrun(int num_intercepts, intercept_t *intercept)
InterceptsMemoryOverrun(location, intercept->frac);
InterceptsMemoryOverrun(location + 4, intercept->isaline);
- InterceptsMemoryOverrun(location + 8, (int) intercept->d.thing);
+ InterceptsMemoryOverrun(location + 8, (intptr_t) intercept->d.thing);
}
diff --git a/src/doom/p_saveg.c b/src/doom/p_saveg.c
index 6a48271d..5cb81967 100644
--- a/src/doom/p_saveg.c
+++ b/src/doom/p_saveg.c
@@ -184,12 +184,12 @@ static void saveg_write_pad(void)
static void *saveg_readp(void)
{
- return (void *) saveg_read32();
+ return (void *) (intptr_t) saveg_read32();
}
static void saveg_writep(void *p)
{
- saveg_write32((int) p);
+ saveg_write32((intptr_t) p);
}
// Enum values are 32-bit integers.
diff --git a/src/doom/p_setup.c b/src/doom/p_setup.c
index 00306e84..08fed7aa 100644
--- a/src/doom/p_setup.c
+++ b/src/doom/p_setup.c
@@ -770,7 +770,10 @@ P_SetupLevel
// UNUSED W_Profile ();
P_InitThinkers ();
-
+
+ // if working with a devlopment map, reload it
+ W_Reload ();
+
// find map name
if ( gamemode == commercial)
{
diff --git a/src/doom/p_tick.c b/src/doom/p_tick.c
index 22893500..c933cfe9 100644
--- a/src/doom/p_tick.c
+++ b/src/doom/p_tick.c
@@ -93,24 +93,26 @@ void P_AllocateThinker (thinker_t* thinker)
//
void P_RunThinkers (void)
{
- thinker_t* currentthinker;
+ thinker_t *currentthinker, *nextthinker;
currentthinker = thinkercap.next;
while (currentthinker != &thinkercap)
{
+ nextthinker = currentthinker->next;
+
if ( currentthinker->function.acv == (actionf_v)(-1) )
{
// time to remove it
currentthinker->next->prev = currentthinker->prev;
currentthinker->prev->next = currentthinker->next;
- Z_Free (currentthinker);
+ Z_Free(currentthinker);
}
else
{
if (currentthinker->function.acp1)
currentthinker->function.acp1 (currentthinker);
}
- currentthinker = currentthinker->next;
+ currentthinker = nextthinker;
}
}
diff --git a/src/doom/s_sound.c b/src/doom/s_sound.c
index 5a97a2f6..884e0c1a 100644
--- a/src/doom/s_sound.c
+++ b/src/doom/s_sound.c
@@ -175,11 +175,12 @@ static void S_StopChannel(int cnum)
break;
}
}
-
+
// degrade usefulness of sound data
c->sfxinfo->usefulness--;
c->sfxinfo = NULL;
+ c->origin = NULL;
}
}