foxygit / doom Log in
commit 90056c594d74eb1b938e34d02833435bd23e0bf7
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Wed Sep 17 20:07:18 2008 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Wed Sep 17 20:07:18 2008 +0000

    Remove heretic definitions for fixed math arithmetic and endianness
    conversion macros; use the ones from the common code.

    Subversion-branch: /branches/raven-branch
    Subversion-revision: 1242
---
 src/heretic/Makefile.am |  2 +-
 src/heretic/d_main.c    | 15 ---------------
 src/heretic/doomdef.h   | 35 +----------------------------------
 src/heretic/f_finale.c  |  4 +++-
 src/heretic/m_misc.c    |  5 +----
 src/heretic/p_setup.c   |  2 ++
 src/heretic/r_data.c    |  1 +
 src/heretic/r_things.c  |  1 +
 src/heretic/v_video.c   |  2 ++
 9 files changed, 12 insertions(+), 55 deletions(-)

diff --git a/src/heretic/Makefile.am b/src/heretic/Makefile.am
index 179730b2..5f6bc865 100644
--- a/src/heretic/Makefile.am
+++ b/src/heretic/Makefile.am
@@ -1,5 +1,5 @@

-AM_CFLAGS=-I..
+AM_CFLAGS=-I.. @SDL_CFLAGS@ @SDLMIXER_CFLAGS@ @SDLNET_CFLAGS@

 noinst_LIBRARIES=libheretic.a

diff --git a/src/heretic/d_main.c b/src/heretic/d_main.c
index e274044c..bc1b0899 100644
--- a/src/heretic/d_main.c
+++ b/src/heretic/d_main.c
@@ -66,21 +66,6 @@ void D_AdvanceDemo(void);
 void F_Drawer(void);
 boolean F_Responder(event_t * ev);

-//---------------------------------------------------------------------------
-//
-// FUNC FixedDiv
-//
-//---------------------------------------------------------------------------
-
-fixed_t FixedDiv(fixed_t a, fixed_t b)
-{
-    if ((abs(a) >> 14) >= abs(b))
-    {
-        return ((a ^ b) < 0 ? INT_MIN : INT_MAX);
-    }
-    return (FixedDiv2(a, b));
-}
-
 /*
 ===============================================================================

diff --git a/src/heretic/doomdef.h b/src/heretic/doomdef.h
index bdf78a19..654c1bd8 100644
--- a/src/heretic/doomdef.h
+++ b/src/heretic/doomdef.h
@@ -62,6 +62,7 @@
 // events
 #include "d_event.h"

+// gamemode/mission
 #include "d_mode.h"

 extern byte *destview, *destscreen;     // PC direct to screen pointers
@@ -666,40 +667,6 @@ extern boolean autostart;
 ===============================================================================
 */

-
-fixed_t FixedMul(fixed_t a, fixed_t b);
-fixed_t FixedDiv(fixed_t a, fixed_t b);
-fixed_t FixedDiv2(fixed_t a, fixed_t b);
-
-#ifdef __WATCOMC__
-#pragma aux FixedMul =	\
-	"imul ebx",			\
-	"shrd eax,edx,16"	\
-	parm	[eax] [ebx] \
-	value	[eax]		\
-	modify exact [eax edx]
-
-#pragma aux FixedDiv2 =	\
-	"cdq",				\
-	"shld edx,eax,16",	\
-	"sal eax,16",		\
-	"idiv ebx"			\
-	parm	[eax] [ebx] \
-	value	[eax]		\
-	modify exact [eax edx]
-#endif
-
-#ifdef __BIG_ENDIAN__
-short ShortSwap(short);
-long LongSwap(long);
-#define SHORT(x)	ShortSwap(x)
-#define LONG(x)		LongSwap(x)
-#else
-#define SHORT(x)	(x)
-#define LONG(x)		(x)
-#endif
-
-
 #include "z_zone.h"

 //----------
diff --git a/src/heretic/f_finale.c b/src/heretic/f_finale.c
index 10d11d7e..50b28efe 100644
--- a/src/heretic/f_finale.c
+++ b/src/heretic/f_finale.c
@@ -22,9 +22,11 @@
 //-----------------------------------------------------------------------------
 // F_finale.c

+#include <ctype.h>
+
 #include "doomdef.h"
+#include "i_swap.h"
 #include "s_sound.h"
-#include <ctype.h>

 int finalestage;                // 0 = text, 1 = art screen
 int finalecount;
diff --git a/src/heretic/m_misc.c b/src/heretic/m_misc.c
index 4d9f6b5d..91642f02 100644
--- a/src/heretic/m_misc.c
+++ b/src/heretic/m_misc.c
@@ -23,18 +23,15 @@

 // M_misc.c

-#ifdef __NeXT__
-#include <libc.h>
-#else
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <fcntl.h>
 #include <stdlib.h>
-#endif

 #include <ctype.h>

 #include "doomdef.h"
+#include "i_swap.h"
 #include "s_sound.h"

 int myargc;
diff --git a/src/heretic/p_setup.c b/src/heretic/p_setup.c
index 03b1a59c..6d512293 100644
--- a/src/heretic/p_setup.c
+++ b/src/heretic/p_setup.c
@@ -25,7 +25,9 @@

 #include <math.h>
 #include <stdlib.h>
+
 #include "doomdef.h"
+#include "i_swap.h"
 #include "p_local.h"
 #include "s_sound.h"

diff --git a/src/heretic/r_data.c b/src/heretic/r_data.c
index e766becf..7d7df2d1 100644
--- a/src/heretic/r_data.c
+++ b/src/heretic/r_data.c
@@ -24,6 +24,7 @@
 // R_data.c

 #include "doomdef.h"
+#include "i_swap.h"
 #include "r_local.h"
 #include "p_local.h"

diff --git a/src/heretic/r_things.c b/src/heretic/r_things.c
index 1c7f1889..50db34af 100644
--- a/src/heretic/r_things.c
+++ b/src/heretic/r_things.c
@@ -24,6 +24,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include "doomdef.h"
+#include "i_swap.h"
 #include "r_local.h"

 void R_DrawColumn(void);
diff --git a/src/heretic/v_video.c b/src/heretic/v_video.c
index 09812ce0..28d2f476 100644
--- a/src/heretic/v_video.c
+++ b/src/heretic/v_video.c
@@ -25,6 +25,8 @@

 #include "doomdef.h"

+#include "i_swap.h"
+
 #define SC_INDEX 0x3c4

 byte *screen;