shithub: choc

Download patch

ref: 1445d6595a19e1b46658beefe276840d01ac9c17
parent: 37865c5d5b53fd0427b6f22d0a13f830a74c3064
author: Simon Howard <[email protected]>
date: Sun Sep 7 17:19:41 EDT 2008

Move m_bbox.[ch] back to common (needed by v_video.c). Remove some
common->doom header dependencies.

Subversion-branch: /branches/raven-branch
Subversion-revision: 1211

--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -39,6 +39,7 @@
 i_timer.c            i_timer.h             \
 i_video.c            i_video.h             \
 m_argv.c             m_argv.h              \
+m_bbox.c             m_bbox.h              \
 m_cheat.c            m_cheat.h             \
 m_config.c           m_config.h            \
 m_fixed.c            m_fixed.h             \
--- a/src/doom/Makefile.am
+++ b/src/doom/Makefile.am
@@ -22,7 +22,6 @@
 hu_lib.c           hu_lib.h     \
 hu_stuff.c         hu_stuff.h   \
 info.c             info.h       \
-m_bbox.c           m_bbox.h     \
 m_menu.c           m_menu.h     \
 p_ceilng.c                      \
 p_doors.c                       \
--- a/src/doom/d_main.h
+++ b/src/doom/d_main.h
@@ -33,14 +33,6 @@
 
 
 
-//
-// D_DoomMain()
-// Not a globally visible function, just included for source reference,
-// calls all startup code, parses command line options.
-// If not overrided by user input, calls N_AdvanceDemo.
-//
-void D_DoomMain (void);
-
 // Read events from all input devices
 
 void D_ProcessEvents (void); 
--- a/src/doom/m_bbox.c
+++ /dev/null
@@ -1,62 +1,0 @@
-// Emacs style mode select   -*- C++ -*- 
-//-----------------------------------------------------------------------------
-//
-// Copyright(C) 1993-1996 Id Software, Inc.
-// Copyright(C) 2005 Simon Howard
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA.
-//
-// DESCRIPTION:
-//	Main loop menu stuff.
-//	Random number LUT.
-//	Default Config File.
-//	PCX Screenshots.
-//
-//-----------------------------------------------------------------------------
-
-
-
-#include "m_bbox.h"
-
-
-
-
-void M_ClearBox (fixed_t *box)
-{
-    box[BOXTOP] = box[BOXRIGHT] = INT_MIN;
-    box[BOXBOTTOM] = box[BOXLEFT] = INT_MAX;
-}
-
-void
-M_AddToBox
-( fixed_t*	box,
-  fixed_t	x,
-  fixed_t	y )
-{
-    if (x<box[BOXLEFT])
-	box[BOXLEFT] = x;
-    else if (x>box[BOXRIGHT])
-	box[BOXRIGHT] = x;
-    if (y<box[BOXBOTTOM])
-	box[BOXBOTTOM] = y;
-    else if (y>box[BOXTOP])
-	box[BOXTOP] = y;
-}
-
-
-
-
-
--- a/src/doom/m_bbox.h
+++ /dev/null
@@ -1,55 +1,0 @@
-// Emacs style mode select   -*- C++ -*- 
-//-----------------------------------------------------------------------------
-//
-// Copyright(C) 1993-1996 Id Software, Inc.
-// Copyright(C) 2005 Simon Howard
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA.
-//
-// DESCRIPTION:
-//    Nil.
-//    
-//-----------------------------------------------------------------------------
-
-
-#ifndef __M_BBOX__
-#define __M_BBOX__
-
-#include <limits.h>
-
-#include "m_fixed.h"
-
-
-// Bounding box coordinate storage.
-enum
-{
-    BOXTOP,
-    BOXBOTTOM,
-    BOXLEFT,
-    BOXRIGHT
-};	// bbox coordinates
-
-// Bounding box functions.
-void M_ClearBox (fixed_t*	box);
-
-void
-M_AddToBox
-( fixed_t*	box,
-  fixed_t	x,
-  fixed_t	y );
-
-
-#endif
--- a/src/i_joystick.c
+++ b/src/i_joystick.c
@@ -31,10 +31,8 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "doomdef.h"
 #include "doomtype.h"
 #include "d_event.h"
-#include "d_main.h"
 #include "i_joystick.h"
 
 // When an axis is within the dead zone, it is set to zero.
--- a/src/i_main.c
+++ b/src/i_main.c
@@ -37,7 +37,14 @@
 #include "doomtype.h"
 #include "i_system.h"
 #include "m_argv.h"
-#include "d_main.h"
+
+//
+// D_DoomMain()
+// Not a globally visible function, just included for source reference,
+// calls all startup code, parses command line options.
+//
+
+void D_DoomMain (void);
 
 int main(int argc, char **argv) 
 { 
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -43,7 +43,6 @@
 #include "i_video.h"
 #include "i_scale.h"
 #include "m_argv.h"
-#include "s_sound.h"
 #include "v_video.h"
 #include "w_wad.h"
 #include "z_zone.h"
--- /dev/null
+++ b/src/m_bbox.c
@@ -1,0 +1,62 @@
+// Emacs style mode select   -*- C++ -*- 
+//-----------------------------------------------------------------------------
+//
+// Copyright(C) 1993-1996 Id Software, Inc.
+// Copyright(C) 2005 Simon Howard
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+// 02111-1307, USA.
+//
+// DESCRIPTION:
+//	Main loop menu stuff.
+//	Random number LUT.
+//	Default Config File.
+//	PCX Screenshots.
+//
+//-----------------------------------------------------------------------------
+
+
+
+#include "m_bbox.h"
+
+
+
+
+void M_ClearBox (fixed_t *box)
+{
+    box[BOXTOP] = box[BOXRIGHT] = INT_MIN;
+    box[BOXBOTTOM] = box[BOXLEFT] = INT_MAX;
+}
+
+void
+M_AddToBox
+( fixed_t*	box,
+  fixed_t	x,
+  fixed_t	y )
+{
+    if (x<box[BOXLEFT])
+	box[BOXLEFT] = x;
+    else if (x>box[BOXRIGHT])
+	box[BOXRIGHT] = x;
+    if (y<box[BOXBOTTOM])
+	box[BOXBOTTOM] = y;
+    else if (y>box[BOXTOP])
+	box[BOXTOP] = y;
+}
+
+
+
+
+
--- /dev/null
+++ b/src/m_bbox.h
@@ -1,0 +1,55 @@
+// Emacs style mode select   -*- C++ -*- 
+//-----------------------------------------------------------------------------
+//
+// Copyright(C) 1993-1996 Id Software, Inc.
+// Copyright(C) 2005 Simon Howard
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+// 02111-1307, USA.
+//
+// DESCRIPTION:
+//    Nil.
+//    
+//-----------------------------------------------------------------------------
+
+
+#ifndef __M_BBOX__
+#define __M_BBOX__
+
+#include <limits.h>
+
+#include "m_fixed.h"
+
+
+// Bounding box coordinate storage.
+enum
+{
+    BOXTOP,
+    BOXBOTTOM,
+    BOXLEFT,
+    BOXRIGHT
+};	// bbox coordinates
+
+// Bounding box functions.
+void M_ClearBox (fixed_t*	box);
+
+void
+M_AddToBox
+( fixed_t*	box,
+  fixed_t	x,
+  fixed_t	y );
+
+
+#endif
--- a/src/m_misc.c
+++ b/src/m_misc.c
@@ -43,7 +43,6 @@
 #endif
 
 #include "doomtype.h"
-#include "doomstat.h"
 
 #include "deh_str.h"
 
--- a/src/v_video.c
+++ b/src/v_video.c
@@ -32,12 +32,11 @@
 #include "i_system.h"
 
 #include "doomtype.h"
-#include "doomdata.h"
 
 #include "deh_str.h"
-#include "m_bbox.h"
 #include "i_swap.h"
 #include "i_video.h"
+#include "m_bbox.h"
 #include "m_misc.h"
 #include "v_video.h"
 #include "w_wad.h"