foxygit / doom Log in
commit 15f26fadf4315e0336fd0e2c68e7162c29bbffcb
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Fri Sep 5 00:33:18 2008 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Fri Sep 5 00:33:18 2008 +0000

    Fix #include statements to use lower case filenames. Add automake
    configuration for building heretic/hexen code.

    Subversion-branch: /branches/raven-branch
    Subversion-revision: 1198
---
 configure.in            |  2 ++
 src/Makefile.am         |  2 ++
 src/heretic/Makefile.am | 61 +++++++++++++++++++++++++++++++++++++++++++++++++
 src/heretic/am_map.c    |  8 +++----
 src/heretic/ct_chat.c   |  4 ++--
 src/heretic/d_main.c    |  4 ++--
 src/heretic/d_net.c     |  2 +-
 src/heretic/doomdef.h   |  4 ++--
 src/heretic/f_finale.c  |  4 ++--
 src/heretic/g_game.c    |  4 ++--
 src/heretic/i_header.h  |  2 +-
 src/heretic/i_ibm.c     |  4 ++--
 src/heretic/in_lude.c   |  2 +-
 src/heretic/info.c      |  2 +-
 src/heretic/m_misc.c    |  3 +--
 src/heretic/mn_menu.c   |  6 ++---
 src/heretic/p_ceilng.c  |  4 ++--
 src/heretic/p_doors.c   |  4 ++--
 src/heretic/p_enemy.c   |  4 ++--
 src/heretic/p_floor.c   |  4 ++--
 src/heretic/p_inter.c   |  4 ++--
 src/heretic/p_lights.c  |  4 ++--
 src/heretic/p_local.h   |  4 ++--
 src/heretic/p_map.c     |  4 ++--
 src/heretic/p_maputl.c  |  4 ++--
 src/heretic/p_mobj.c    |  4 ++--
 src/heretic/p_plats.c   |  4 ++--
 src/heretic/p_pspr.c    |  4 ++--
 src/heretic/p_setup.c   |  4 ++--
 src/heretic/p_sight.c   |  4 ++--
 src/heretic/p_spec.c    |  4 ++--
 src/heretic/p_switch.c  |  4 ++--
 src/heretic/p_telept.c  |  4 ++--
 src/heretic/p_tick.c    |  4 ++--
 src/heretic/p_user.c    |  4 ++--
 src/heretic/r_bsp.c     |  4 ++--
 src/heretic/r_data.c    |  6 ++---
 src/heretic/r_draw.c    |  4 ++--
 src/heretic/r_main.c    |  4 ++--
 src/heretic/r_plane.c   |  4 ++--
 src/heretic/r_segs.c    |  4 ++--
 src/heretic/r_things.c  |  4 ++--
 src/heretic/sb_bar.c    |  4 ++--
 src/heretic/sounds.c    |  2 +-
 src/heretic/tables.c    |  2 +-
 src/heretic/v_video.c   |  2 +-
 src/heretic/w_wad.c     | 10 ++++----
 src/heretic/z_zone.c    |  2 +-
 src/hexen/m_misc.c      |  9 +-------
 src/hexen/mn_menu.c     |  2 --
 src/hexen/st_start.c    | 13 ++++-------
 src/hexen/w_wad.c       | 16 ++++---------
 52 files changed, 165 insertions(+), 117 deletions(-)

diff --git a/configure.in b/configure.in
index bf2a2c75..e6e12be4 100644
--- a/configure.in
+++ b/configure.in
@@ -79,6 +79,8 @@ textscreen/examples/Makefile
 setup/Makefile
 man/Makefile
 src/Makefile
+src/heretic/Makefile
+src/hexen/Makefile
 pcsound/Makefile
 src/resource.rc
 src/doom-screensaver.desktop
diff --git a/src/Makefile.am b/src/Makefile.am
index e43cb7f0..6a85b92a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,6 @@

+SUBDIRS=heretic hexen
+
 gamesdir = $(prefix)/games

 games_PROGRAMS = chocolate-doom chocolate-server
diff --git a/src/heretic/Makefile.am b/src/heretic/Makefile.am
new file mode 100644
index 00000000..6457dd8e
--- /dev/null
+++ b/src/heretic/Makefile.am
@@ -0,0 +1,61 @@
+
+noinst_LIBRARIES=libheretic.a
+
+SOURCE_FILES=                                        \
+                       am_data.h                     \
+am_map.c               am_map.h                      \
+ct_chat.c              ct_chat.h                     \
+d_main.c                                             \
+d_net.c                                              \
+                       doomdata.h                    \
+                       doomdef.h                     \
+                       dstrings.h                    \
+f_finale.c                                           \
+g_game.c                                             \
+                       i_header.h                    \
+info.c                 info.h                        \
+in_lude.c                                            \
+m_misc.c                                             \
+mn_menu.c                                            \
+p_ceilng.c                                           \
+p_doors.c                                            \
+p_enemy.c                                            \
+p_floor.c                                            \
+p_inter.c                                            \
+p_lights.c                                           \
+p_local.h                                            \
+p_map.c                                              \
+p_maputl.c                                           \
+p_mobj.c                                             \
+p_plats.c                                            \
+p_pspr.c                                             \
+p_setup.c                                            \
+p_sight.c                                            \
+p_spec.c               p_spec.h                      \
+p_switch.c                                           \
+p_telept.c                                           \
+p_tick.c                                             \
+p_user.c                                             \
+r_bsp.c                                              \
+r_data.c                                             \
+r_draw.c                                             \
+                       r_local.h                     \
+r_main.c                                             \
+r_plane.c                                            \
+r_segs.c                                             \
+r_things.c                                           \
+sb_bar.c                                             \
+sounds.c               sounds.h                      \
+                       soundst.h                     \
+tables.c                                             \
+v_video.c                                            \
+w_wad.c                                              \
+z_zone.c
+
+EXTRA_DIST=                                          \
+i_sound.c              i_sound.h                     \
+i_cyber.c                                            \
+i_ibm.c
+
+libheretic_a_SOURCES=$(SOURCE_FILES)
+
diff --git a/src/heretic/am_map.c b/src/heretic/am_map.c
index d9daea4b..267ac009 100644
--- a/src/heretic/am_map.c
+++ b/src/heretic/am_map.c
@@ -23,10 +23,10 @@

 // AM_map.c

-#include "DoomDef.h"
-#include "P_local.h"
-#include "AM_map.h"
-#include "AM_data.h"
+#include "doomdef.h"
+#include "p_local.h"
+#include "am_map.h"
+#include "am_data.h"
 #include <stdio.h>

 vertex_t KeyPoints[NUMKEYS];
diff --git a/src/heretic/ct_chat.c b/src/heretic/ct_chat.c
index 94d53ff2..94e92471 100644
--- a/src/heretic/ct_chat.c
+++ b/src/heretic/ct_chat.c
@@ -26,8 +26,8 @@

 #include <string.h>
 #include <ctype.h>
-#include "DoomDef.h"
-#include "P_local.h"
+#include "doomdef.h"
+#include "p_local.h"
 #include "soundst.h"

 #define QUEUESIZE		128
diff --git a/src/heretic/d_main.c b/src/heretic/d_main.c
index a6ec32b7..bf9c5a0f 100644
--- a/src/heretic/d_main.c
+++ b/src/heretic/d_main.c
@@ -31,8 +31,8 @@
 #endif
 #include <stdio.h>
 #include <stdlib.h>
-#include "DoomDef.h"
-#include "P_local.h"
+#include "doomdef.h"
+#include "p_local.h"
 #include "soundst.h"

 boolean shareware = false;      // true if only episode 1 present
diff --git a/src/heretic/d_net.c b/src/heretic/d_net.c
index 261ed2b2..b78c2c4d 100644
--- a/src/heretic/d_net.c
+++ b/src/heretic/d_net.c
@@ -24,7 +24,7 @@
 // d_net.c
 // This version has the fixed ticdup code

-#include "DoomDef.h"
+#include "doomdef.h"

 #define NCMD_EXIT               0x80000000
 #define NCMD_RETRANSMIT 0x40000000
diff --git a/src/heretic/doomdef.h b/src/heretic/doomdef.h
index 5cedbc18..a672b2e5 100644
--- a/src/heretic/doomdef.h
+++ b/src/heretic/doomdef.h
@@ -41,10 +41,10 @@
 //#define RANGECHECK

 // all external data is defined here
-#include "DoomData.h"
+#include "doomdata.h"

 // all important printed strings
-#include "DStrings.h"
+#include "dstrings.h"

 // header generated by multigen utility
 #include "info.h"
diff --git a/src/heretic/f_finale.c b/src/heretic/f_finale.c
index 8b688dcf..67e0516b 100644
--- a/src/heretic/f_finale.c
+++ b/src/heretic/f_finale.c
@@ -22,7 +22,7 @@
 //-----------------------------------------------------------------------------
 // F_finale.c

-#include "DoomDef.h"
+#include "doomdef.h"
 #include "soundst.h"
 #include <ctype.h>

@@ -153,7 +153,7 @@ void F_Ticker(void)
 =======================
 */

-//#include "HU_stuff.h"
+//#include "hu_stuff.h"
 //extern        patch_t *hu_font[HU_FONTSIZE];

 void F_TextWrite(void)
diff --git a/src/heretic/g_game.c b/src/heretic/g_game.c
index 79e5ef73..ecb3373d 100644
--- a/src/heretic/g_game.c
+++ b/src/heretic/g_game.c
@@ -25,8 +25,8 @@

 #include <stdio.h>
 #include <string.h>
-#include "DoomDef.h"
-#include "P_local.h"
+#include "doomdef.h"
+#include "p_local.h"
 #include "soundst.h"

 // Macros
diff --git a/src/heretic/i_header.h b/src/heretic/i_header.h
index 9aed0e28..2cf6af46 100644
--- a/src/heretic/i_header.h
+++ b/src/heretic/i_header.h
@@ -23,7 +23,7 @@
 #ifndef __I_HEADER_H__
 #define __I_HEADER_H__

-#include "DoomDef.h"
+#include "doomdef.h"

 //--------
 //SOUND IO
diff --git a/src/heretic/i_ibm.c b/src/heretic/i_ibm.c
index 2bceb7b0..fb667e90 100644
--- a/src/heretic/i_ibm.c
+++ b/src/heretic/i_ibm.c
@@ -28,8 +28,8 @@
 #include <stdlib.h>
 #include <stdarg.h>
 #include <graph.h>
-#include "DoomDef.h"
-#include "R_local.h"
+#include "doomdef.h"
+#include "r_local.h"
 #include "sounds.h"
 #include "i_sound.h"
 #include "dmx.h"
diff --git a/src/heretic/in_lude.c b/src/heretic/in_lude.c
index efb84ed8..80b3e4bb 100644
--- a/src/heretic/in_lude.c
+++ b/src/heretic/in_lude.c
@@ -28,7 +28,7 @@
 ========================
 */

-#include "DoomDef.h"
+#include "doomdef.h"
 #include "soundst.h"

 typedef enum
diff --git a/src/heretic/info.c b/src/heretic/info.c
index 756e385a..7e271ce3 100644
--- a/src/heretic/info.c
+++ b/src/heretic/info.c
@@ -20,7 +20,7 @@
 // 02111-1307, USA.
 //
 //-----------------------------------------------------------------------------
-#include "DoomDef.h"
+#include "doomdef.h"
 // generated by multigen

 char *sprnames[NUMSPRITES] = {
diff --git a/src/heretic/m_misc.c b/src/heretic/m_misc.c
index 9098d7ff..c621ec07 100644
--- a/src/heretic/m_misc.c
+++ b/src/heretic/m_misc.c
@@ -28,14 +28,13 @@
 #else
 #include <sys/stat.h>
 #include <sys/types.h>
-#include <direct.h>
 #include <fcntl.h>
 #include <stdlib.h>
 #endif

 #include <ctype.h>

-#include "DoomDef.h"
+#include "doomdef.h"
 #include "soundst.h"

 int myargc;
diff --git a/src/heretic/mn_menu.c b/src/heretic/mn_menu.c
index 272b38d5..a56e2dc3 100644
--- a/src/heretic/mn_menu.c
+++ b/src/heretic/mn_menu.c
@@ -24,9 +24,9 @@
 // MN_menu.c

 #include <ctype.h>
-#include "DoomDef.h"
-#include "P_local.h"
-#include "R_local.h"
+#include "doomdef.h"
+#include "p_local.h"
+#include "r_local.h"
 #include "soundst.h"

 // Macros
diff --git a/src/heretic/p_ceilng.c b/src/heretic/p_ceilng.c
index 5ce9d82c..672b8adb 100644
--- a/src/heretic/p_ceilng.c
+++ b/src/heretic/p_ceilng.c
@@ -21,8 +21,8 @@
 //
 //-----------------------------------------------------------------------------

-#include "DoomDef.h"
-#include "P_local.h"
+#include "doomdef.h"
+#include "p_local.h"
 #include "soundst.h"

 //==================================================================
diff --git a/src/heretic/p_doors.c b/src/heretic/p_doors.c
index 0bf28905..7598440e 100644
--- a/src/heretic/p_doors.c
+++ b/src/heretic/p_doors.c
@@ -23,8 +23,8 @@

 // P_doors.c

-#include "DoomDef.h"
-#include "P_local.h"
+#include "doomdef.h"
+#include "p_local.h"
 #include "soundst.h"

 //==================================================================
diff --git a/src/heretic/p_enemy.c b/src/heretic/p_enemy.c
index 77ecff41..62f8dac5 100644
--- a/src/heretic/p_enemy.c
+++ b/src/heretic/p_enemy.c
@@ -23,8 +23,8 @@

 // P_enemy.c

-#include "DoomDef.h"
-#include "P_local.h"
+#include "doomdef.h"
+#include "p_local.h"
 #include "soundst.h"

 // Macros
diff --git a/src/heretic/p_floor.c b/src/heretic/p_floor.c
index 03798973..8a32b462 100644
--- a/src/heretic/p_floor.c
+++ b/src/heretic/p_floor.c
@@ -20,8 +20,8 @@
 // 02111-1307, USA.
 //
 //-----------------------------------------------------------------------------
-#include "DoomDef.h"
-#include "P_local.h"
+#include "doomdef.h"
+#include "p_local.h"
 #include "soundst.h"

 //==================================================================
diff --git a/src/heretic/p_inter.c b/src/heretic/p_inter.c
index 353a5ae5..5e65fb5c 100644
--- a/src/heretic/p_inter.c
+++ b/src/heretic/p_inter.c
@@ -23,8 +23,8 @@

 // P_inter.c

-#include "DoomDef.h"
-#include "P_local.h"
+#include "doomdef.h"
+#include "p_local.h"
 #include "soundst.h"

 #define BONUSADD 6
diff --git a/src/heretic/p_lights.c b/src/heretic/p_lights.c
index daeb6c93..78ca77d3 100644
--- a/src/heretic/p_lights.c
+++ b/src/heretic/p_lights.c
@@ -20,8 +20,8 @@
 // 02111-1307, USA.
 //
 //-----------------------------------------------------------------------------
-#include "DoomDef.h"
-#include "P_local.h"
+#include "doomdef.h"
+#include "p_local.h"

 //==================================================================
 //==================================================================
diff --git a/src/heretic/p_local.h b/src/heretic/p_local.h
index d7aec116..00502e95 100644
--- a/src/heretic/p_local.h
+++ b/src/heretic/p_local.h
@@ -27,7 +27,7 @@
 #define __P_LOCAL__

 #ifndef __R_LOCAL__
-#include "R_local.h"
+#include "r_local.h"
 #endif

 #define STARTREDPALS	1
@@ -281,6 +281,6 @@ extern int SB_state;
 extern int ArtifactFlash;
 void SB_PaletteFlash(void);

-#include "P_spec.h"
+#include "p_spec.h"

 #endif // __P_LOCAL__
diff --git a/src/heretic/p_map.c b/src/heretic/p_map.c
index 6e8502d4..24cb7162 100644
--- a/src/heretic/p_map.c
+++ b/src/heretic/p_map.c
@@ -22,8 +22,8 @@
 //-----------------------------------------------------------------------------
 // P_map.c

-#include "DoomDef.h"
-#include "P_local.h"
+#include "doomdef.h"
+#include "p_local.h"
 #include "soundst.h"

 /*
diff --git a/src/heretic/p_maputl.c b/src/heretic/p_maputl.c
index 8e232fb9..c72a6826 100644
--- a/src/heretic/p_maputl.c
+++ b/src/heretic/p_maputl.c
@@ -23,8 +23,8 @@

 // P_maputl.c

-#include "DoomDef.h"
-#include "P_local.h"
+#include "doomdef.h"
+#include "p_local.h"


 /*
diff --git a/src/heretic/p_mobj.c b/src/heretic/p_mobj.c
index aff11167..1e4596d7 100644
--- a/src/heretic/p_mobj.c
+++ b/src/heretic/p_mobj.c
@@ -23,8 +23,8 @@

 // P_mobj.c

-#include "DoomDef.h"
-#include "P_local.h"
+#include "doomdef.h"
+#include "p_local.h"
 #include "sounds.h"
 #include "soundst.h"

diff --git a/src/heretic/p_plats.c b/src/heretic/p_plats.c
index 2278ad2e..f42b9926 100644
--- a/src/heretic/p_plats.c
+++ b/src/heretic/p_plats.c
@@ -23,8 +23,8 @@

 // P_plats.c

-#include "DoomDef.h"
-#include "P_local.h"
+#include "doomdef.h"
+#include "p_local.h"
 #include "soundst.h"

 plat_t *activeplats[MAXPLATS];
diff --git a/src/heretic/p_pspr.c b/src/heretic/p_pspr.c
index 0baa57b2..211f5231 100644
--- a/src/heretic/p_pspr.c
+++ b/src/heretic/p_pspr.c
@@ -23,8 +23,8 @@

 // P_pspr.c

-#include "DoomDef.h"
-#include "P_local.h"
+#include "doomdef.h"
+#include "p_local.h"
 #include "soundst.h"

 // Macros
diff --git a/src/heretic/p_setup.c b/src/heretic/p_setup.c
index 35797fbe..7e775ce8 100644
--- a/src/heretic/p_setup.c
+++ b/src/heretic/p_setup.c
@@ -25,8 +25,8 @@

 #include <math.h>
 #include <stdlib.h>
-#include "DoomDef.h"
-#include "P_local.h"
+#include "doomdef.h"
+#include "p_local.h"
 #include "soundst.h"

 void P_SpawnMapThing(mapthing_t * mthing);
diff --git a/src/heretic/p_sight.c b/src/heretic/p_sight.c
index cb3decde..7e589368 100644
--- a/src/heretic/p_sight.c
+++ b/src/heretic/p_sight.c
@@ -22,8 +22,8 @@
 //-----------------------------------------------------------------------------
 // P_sight.c

-#include "DoomDef.h"
-#include "P_local.h"
+#include "doomdef.h"
+#include "p_local.h"

 /*
 ==============================================================================
diff --git a/src/heretic/p_spec.c b/src/heretic/p_spec.c
index 1bc804e9..5a6aee8c 100644
--- a/src/heretic/p_spec.c
+++ b/src/heretic/p_spec.c
@@ -23,8 +23,8 @@

 // P_Spec.c

-#include "DoomDef.h"
-#include "P_local.h"
+#include "doomdef.h"
+#include "p_local.h"
 #include "soundst.h"

 // Macros
diff --git a/src/heretic/p_switch.c b/src/heretic/p_switch.c
index b717373c..7fd8e15b 100644
--- a/src/heretic/p_switch.c
+++ b/src/heretic/p_switch.c
@@ -21,8 +21,8 @@
 //
 //-----------------------------------------------------------------------------

-#include "DoomDef.h"
-#include "P_local.h"
+#include "doomdef.h"
+#include "p_local.h"
 #include "soundst.h"

 //==================================================================
diff --git a/src/heretic/p_telept.c b/src/heretic/p_telept.c
index 31d9198c..2d7c1049 100644
--- a/src/heretic/p_telept.c
+++ b/src/heretic/p_telept.c
@@ -23,8 +23,8 @@

 // P_telept.c

-#include "DoomDef.h"
-#include "P_local.h"
+#include "doomdef.h"
+#include "p_local.h"
 #include "soundst.h"

 //----------------------------------------------------------------------------
diff --git a/src/heretic/p_tick.c b/src/heretic/p_tick.c
index d6b57dcc..ea0a8e7a 100644
--- a/src/heretic/p_tick.c
+++ b/src/heretic/p_tick.c
@@ -23,8 +23,8 @@

 // P_tick.c

-#include "DoomDef.h"
-#include "P_local.h"
+#include "doomdef.h"
+#include "p_local.h"

 int leveltime;
 int TimerGame;
diff --git a/src/heretic/p_user.c b/src/heretic/p_user.c
index 21b87f6e..3c392a1b 100644
--- a/src/heretic/p_user.c
+++ b/src/heretic/p_user.c
@@ -23,8 +23,8 @@

 // P_user.c

-#include "DoomDef.h"
-#include "P_local.h"
+#include "doomdef.h"
+#include "p_local.h"
 #include "soundst.h"

 void P_PlayerNextArtifact(player_t * player);
diff --git a/src/heretic/r_bsp.c b/src/heretic/r_bsp.c
index 58219c56..be9ef769 100644
--- a/src/heretic/r_bsp.c
+++ b/src/heretic/r_bsp.c
@@ -22,8 +22,8 @@
 //-----------------------------------------------------------------------------
 // R_bsp.c

-#include "DoomDef.h"
-#include "R_local.h"
+#include "doomdef.h"
+#include "r_local.h"

 seg_t *curline;
 side_t *sidedef;
diff --git a/src/heretic/r_data.c b/src/heretic/r_data.c
index 17154022..e766becf 100644
--- a/src/heretic/r_data.c
+++ b/src/heretic/r_data.c
@@ -23,9 +23,9 @@

 // R_data.c

-#include "DoomDef.h"
-#include "R_local.h"
-#include "P_local.h"
+#include "doomdef.h"
+#include "r_local.h"
+#include "p_local.h"

 extern void CheckAbortStartup(void);

diff --git a/src/heretic/r_draw.c b/src/heretic/r_draw.c
index 3d8cb776..f955b127 100644
--- a/src/heretic/r_draw.c
+++ b/src/heretic/r_draw.c
@@ -22,8 +22,8 @@
 //-----------------------------------------------------------------------------
 // R_draw.c

-#include "DoomDef.h"
-#include "R_local.h"
+#include "doomdef.h"
+#include "r_local.h"

 /*

diff --git a/src/heretic/r_main.c b/src/heretic/r_main.c
index ec3c8482..806028b7 100644
--- a/src/heretic/r_main.c
+++ b/src/heretic/r_main.c
@@ -23,8 +23,8 @@
 // R_main.c

 #include <math.h>
-#include "DoomDef.h"
-#include "R_local.h"
+#include "doomdef.h"
+#include "r_local.h"
 /*

 */
diff --git a/src/heretic/r_plane.c b/src/heretic/r_plane.c
index 04e685a1..6014189d 100644
--- a/src/heretic/r_plane.c
+++ b/src/heretic/r_plane.c
@@ -22,8 +22,8 @@
 //-----------------------------------------------------------------------------
 // R_planes.c

-#include "DoomDef.h"
-#include "R_local.h"
+#include "doomdef.h"
+#include "r_local.h"

 planefunction_t floorfunc, ceilingfunc;

diff --git a/src/heretic/r_segs.c b/src/heretic/r_segs.c
index 5bdeee3f..91726779 100644
--- a/src/heretic/r_segs.c
+++ b/src/heretic/r_segs.c
@@ -29,8 +29,8 @@
 //**
 //**************************************************************************

-#include "DoomDef.h"
-#include "R_local.h"
+#include "doomdef.h"
+#include "r_local.h"

 // OPTIMIZE: closed two sided lines as single sided

diff --git a/src/heretic/r_things.c b/src/heretic/r_things.c
index 9aef3f81..8195a543 100644
--- a/src/heretic/r_things.c
+++ b/src/heretic/r_things.c
@@ -23,8 +23,8 @@
 // R_things.c
 #include <stdio.h>
 #include <stdlib.h>
-#include "DoomDef.h"
-#include "R_local.h"
+#include "doomdef.h"
+#include "r_local.h"

 void R_DrawColumn(void);
 void R_DrawFuzzColumn(void);
diff --git a/src/heretic/sb_bar.c b/src/heretic/sb_bar.c
index a0de30af..9655837e 100644
--- a/src/heretic/sb_bar.c
+++ b/src/heretic/sb_bar.c
@@ -23,8 +23,8 @@

 // SB_bar.c

-#include "DoomDef.h"
-#include "P_local.h"
+#include "doomdef.h"
+#include "p_local.h"
 #include "soundst.h"

 // Macros
diff --git a/src/heretic/sounds.c b/src/heretic/sounds.c
index 748b27d7..99dd102c 100644
--- a/src/heretic/sounds.c
+++ b/src/heretic/sounds.c
@@ -24,7 +24,7 @@

 // sounds.c

-#include "DoomDef.h"
+#include "doomdef.h"
 #include "sounds.h"

 // Music info
diff --git a/src/heretic/tables.c b/src/heretic/tables.c
index 30b11fb6..12ea0da8 100644
--- a/src/heretic/tables.c
+++ b/src/heretic/tables.c
@@ -20,7 +20,7 @@
 // 02111-1307, USA.
 //
 //-----------------------------------------------------------------------------
-#include "DoomDef.h"
+#include "doomdef.h"

 int finetangent[4096] = {
     -170910304, -56965752, -34178904, -24413316, -18988036, -15535599,
diff --git a/src/heretic/v_video.c b/src/heretic/v_video.c
index 3e3c9abb..09812ce0 100644
--- a/src/heretic/v_video.c
+++ b/src/heretic/v_video.c
@@ -23,7 +23,7 @@

 // V_video.c

-#include "DoomDef.h"
+#include "doomdef.h"

 #define SC_INDEX 0x3c4

diff --git a/src/heretic/w_wad.c b/src/heretic/w_wad.c
index b252735c..1c3977e3 100644
--- a/src/heretic/w_wad.c
+++ b/src/heretic/w_wad.c
@@ -26,18 +26,20 @@
 #include <libc.h>
 #include <ctype.h>

-// next doesn't need a binary flag in open call
-#define	O_BINARY	0

 #else

 #include <malloc.h>
-#include <io.h>
 #include <fcntl.h>
 #include <sys/stat.h>
 #endif

-#include "DoomDef.h"
+// next doesn't need a binary flag in open call
+#ifndef O_BINARY
+#define	O_BINARY	0
+#endif
+
+#include "doomdef.h"

 //===============
 //   TYPES
diff --git a/src/heretic/z_zone.c b/src/heretic/z_zone.c
index 6ebdcba5..75a01491 100644
--- a/src/heretic/z_zone.c
+++ b/src/heretic/z_zone.c
@@ -23,7 +23,7 @@
 // Z_zone.c

 #include <stdlib.h>
-#include "DoomDef.h"
+#include "doomdef.h"

 /*
 ==============================================================================
diff --git a/src/hexen/m_misc.c b/src/hexen/m_misc.c
index ae7485ef..9903e200 100644
--- a/src/hexen/m_misc.c
+++ b/src/hexen/m_misc.c
@@ -29,11 +29,8 @@
 #else
 #include <sys/stat.h>
 #include <sys/types.h>
-#include <direct.h>
 #include <fcntl.h>
 #include <stdlib.h>
-#include <io.h>
-#include <conio.h>
 #endif
 #include <ctype.h>
 #include "h2def.h"
@@ -567,12 +564,8 @@ default_t defaults[] = {

     {"usegamma", &usegamma, 0},

-#ifdef __NeXT__
 #define DEFAULT_SAVEPATH		"hexndata/"
-#endif
-#ifdef __WATCOMC__
-#define DEFAULT_SAVEPATH		"hexndata\\"
-#endif
+
     {"savedir", (int *) &SavePath, (int) DEFAULT_SAVEPATH},

     {"messageson", (int *) &messageson, 1},
diff --git a/src/hexen/mn_menu.c b/src/hexen/mn_menu.c
index 8f11f8f6..36fcfacc 100644
--- a/src/hexen/mn_menu.c
+++ b/src/hexen/mn_menu.c
@@ -295,7 +295,6 @@ static Menu_t *Menus[] = {
     &SaveMenu
 };

-#ifdef __WATCOMC__
 static char *GammaText[] = {
     TXT_GAMMA_LEVEL_OFF,
     TXT_GAMMA_LEVEL_1,
@@ -303,7 +302,6 @@ static char *GammaText[] = {
     TXT_GAMMA_LEVEL_3,
     TXT_GAMMA_LEVEL_4
 };
-#endif

 // CODE --------------------------------------------------------------------

diff --git a/src/hexen/st_start.c b/src/hexen/st_start.c
index 4dc642b7..54ab9006 100644
--- a/src/hexen/st_start.c
+++ b/src/hexen/st_start.c
@@ -24,18 +24,15 @@


 // HEADER FILES ------------------------------------------------------------
-#ifdef __WATCOMC__
-#include <sys\stat.h>
-#include <sys\types.h>
-#include <io.h>
-#else
-#include <libc.h>
 #include <ctype.h>
+#include <fcntl.h>
+#include <stdarg.h>
+
+#ifndef O_BINARY
 #define O_BINARY 0
 #endif
+
 #include "h2def.h"
-#include <fcntl.h>
-#include <stdarg.h>             // Needed for next as well as dos
 #include "st_start.h"


diff --git a/src/hexen/w_wad.c b/src/hexen/w_wad.c
index 7ad7bb2f..9155d9cf 100644
--- a/src/hexen/w_wad.c
+++ b/src/hexen/w_wad.c
@@ -24,23 +24,17 @@

 // HEADER FILES ------------------------------------------------------------

-#ifdef NeXT
-#include <libc.h>
-#include <ctype.h>
-#else
-#include <malloc.h>
-#include <io.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
 #include <fcntl.h>
-#include <sys/stat.h>
-#endif
+
 #include "h2def.h"

 // MACROS ------------------------------------------------------------------

-#ifdef NeXT
-// NeXT doesn't need a binary flag in open call
+#ifndef O_BINARY
 #define O_BINARY 0
-#define strcmpi strcasecmp
 #endif

 // TYPES -------------------------------------------------------------------