ref: 90056c594d74eb1b938e34d02833435bd23e0bf7
parent: 967d3910e3957417630085237a95cdac546b1bd4
author: Simon Howard <fraggle@gmail.com>
date: Wed Sep 17 16:07:18 EDT 2008
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
--- 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
--- a/src/heretic/d_main.c
+++ b/src/heretic/d_main.c
@@ -66,21 +66,6 @@
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));
-}
-
/*
===============================================================================
--- 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
@@ -665,40 +666,6 @@
===============================================================================
*/
-
-
-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"
--- 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;
--- 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;
--- 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"
--- 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"
--- 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);
--- 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;