shithub: choc

Download patch

ref: b3fdd717d3d0a9255a035f99af0cb2e6c1515008
parent: 9bef9730fb26727a9b505a89615b6ef0425fe64a
author: Simon Howard <[email protected]>
date: Sat Sep 20 19:18:12 EDT 2008

Remove definitions from heretic/doomdef.h and use common headers. Merge
heretic ticcmd_t to common type.

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

--- a/src/d_ticcmd.h
+++ b/src/d_ticcmd.h
@@ -35,14 +35,20 @@
 // and transmitted to other peers (multiplayer).
 // Mainly movements/button commands per game tick,
 // plus a checksum for internal state consistency.
+
 typedef struct
 {
     signed char	forwardmove;	// *2048 for move
     signed char	sidemove;	// *2048 for move
-    short	angleturn;	// <<16 for angle delta
-    byte	chatchar;
-    byte	buttons;
-    byte        consistancy;	// checks for net game
+    short angleturn;            // <<16 for angle delta
+    byte chatchar;
+    byte buttons;
+    byte consistancy;           // checks for net game
+   
+    // Heretic/Hexen specific:
+
+    byte lookfly;               // look/fly up/down/centering
+    byte arti;                  // artitype_t to use
 } ticcmd_t;
 
 
--- a/src/heretic/d_main.c
+++ b/src/heretic/d_main.c
@@ -27,6 +27,7 @@
 #include <stdlib.h>
 
 #include "doomdef.h"
+#include "i_video.h"
 #include "m_argv.h"
 #include "p_local.h"
 #include "s_sound.h"
--- a/src/heretic/d_net.c
+++ b/src/heretic/d_net.c
@@ -27,6 +27,10 @@
 #include "doomdef.h"
 #include "doomkeys.h"
 
+#include "i_system.h"
+#include "i_timer.h"
+#include "i_video.h"
+
 #define NCMD_EXIT               0x80000000
 #define NCMD_RETRANSMIT 0x40000000
 #define NCMD_SETUP              0x20000000
--- a/src/heretic/doomdef.h
+++ b/src/heretic/doomdef.h
@@ -65,6 +65,9 @@
 // gamemode/mission
 #include "d_mode.h"
 
+// ticcmd_t
+#include "d_ticcmd.h"
+
 extern byte *destview, *destscreen;     // PC direct to screen pointers
 
 #define	SAVEGAMENAME "hticsav"
@@ -83,18 +86,6 @@
 #define TICRATE		35      // number of tics / second
 #define TICSPERSEC	35
 
-typedef struct
-{
-    char forwardmove;           // *2048 for move
-    char sidemove;              // *2048 for move
-    short angleturn;            // <<16 for angle delta
-    short consistancy;          // checks for net game
-    byte chatchar;
-    byte buttons;
-    byte lookfly;               // look/fly up/down/centering
-    byte arti;                  // artitype_t to use
-} ticcmd_t;
-
 #define	BT_ATTACK		1
 #define	BT_USE			2
 #define	BT_CHANGE		4       // if true, the next 3 bits hold weapon num
@@ -693,34 +684,11 @@
 //---------
 //SYSTEM IO
 //---------
-#if 1
-#define	SCREENWIDTH		320
-#define	SCREENHEIGHT	200
-#else
-#define	SCREENWIDTH		560
-#define	SCREENHEIGHT	375
-#endif
 
 byte *I_ZoneBase(int *size);
 // called by startup code to get the ammount of memory to malloc
 // for the zone management
 
-int I_GetTime(void);
-// called by D_DoomLoop
-// returns current time in tics
-
-void I_StartFrame(void);
-// called by D_DoomLoop
-// called before processing any tics in a frame (just after displaying a frame)
-// time consuming syncronous operations are performed here (joystick reading)
-// can call D_PostEvent
-
-void I_StartTic(void);
-// called by D_DoomLoop
-// called before processing each tic in a frame
-// quick syncronous operations are performed here
-// can call D_PostEvent
-
 // asyncronous interrupt functions should maintain private ques that are
 // read by the syncronous functions to be converted into events
 
@@ -728,38 +696,14 @@
 // called by D_DoomMain
 // determines the hardware configuration and sets up the video mode
 
-void I_InitGraphics(void);
-
 void I_InitNetwork(void);
 void I_NetCmd(void);
 
-void I_Error(char *error, ...);
-// called by anything that can generate a terminal error
-// bad exit with diagnostic message
-
-void I_Quit(void);
-// called by M_Responder when quit is selected
-// clean exit, displays sell blurb
-
-void I_SetPalette(byte * palette);
-// takes full 8 bit values
-
 void I_Update(void);
 // Copy buffer to video
 
-void I_WipeUpdate(wipe_t wipe);
-// Copy buffer to video with wipe effect
-
-void I_WaitVBL(int count);
-// wait for vertical retrace or pause a bit
-
-void I_BeginRead(void);
-void I_EndRead(void);
-
 byte *I_AllocLow(int length);
 // allocates from low memory under dos, just mallocs under unix
-
-void I_Tactile(int on, int off, int total);
 
 #ifdef __WATCOMC__
 extern boolean useexterndriver;
--- a/src/heretic/g_game.c
+++ b/src/heretic/g_game.c
@@ -27,6 +27,8 @@
 #include <string.h>
 #include "doomdef.h"
 #include "doomkeys.h"
+#include "i_timer.h"
+#include "i_system.h"
 #include "m_misc.h"
 #include "m_random.h"
 #include "p_local.h"
--- a/src/heretic/in_lude.c
+++ b/src/heretic/in_lude.c
@@ -30,6 +30,7 @@
 
 #include "doomdef.h"
 #include "s_sound.h"
+#include "i_system.h"
 #include "i_video.h"
 #include "v_video.h"
 
--- a/src/heretic/mn_menu.c
+++ b/src/heretic/mn_menu.c
@@ -26,6 +26,7 @@
 #include <ctype.h>
 #include "doomdef.h"
 #include "doomkeys.h"
+#include "i_system.h"
 #include "p_local.h"
 #include "r_local.h"
 #include "s_sound.h"
--- a/src/heretic/p_enemy.c
+++ b/src/heretic/p_enemy.c
@@ -25,6 +25,7 @@
 
 #include <stdlib.h>
 #include "doomdef.h"
+#include "i_system.h"
 #include "m_random.h"
 #include "p_local.h"
 #include "s_sound.h"
--- a/src/heretic/p_inter.c
+++ b/src/heretic/p_inter.c
@@ -24,6 +24,7 @@
 // P_inter.c
 
 #include "doomdef.h"
+#include "i_system.h"
 #include "m_random.h"
 #include "p_local.h"
 #include "s_sound.h"
--- a/src/heretic/p_map.c
+++ b/src/heretic/p_map.c
@@ -25,6 +25,7 @@
 #include <stdlib.h>
 
 #include "doomdef.h"
+#include "i_system.h"
 #include "m_bbox.h"
 #include "m_random.h"
 #include "p_local.h"
--- a/src/heretic/p_mobj.c
+++ b/src/heretic/p_mobj.c
@@ -24,6 +24,7 @@
 // P_mobj.c
 
 #include "doomdef.h"
+#include "i_system.h"
 #include "m_random.h"
 #include "p_local.h"
 #include "sounds.h"
--- a/src/heretic/p_plats.c
+++ b/src/heretic/p_plats.c
@@ -24,6 +24,7 @@
 // P_plats.c
 
 #include "doomdef.h"
+#include "i_system.h"
 #include "m_random.h"
 #include "p_local.h"
 #include "s_sound.h"
--- a/src/heretic/p_pspr.c
+++ b/src/heretic/p_pspr.c
@@ -24,6 +24,7 @@
 // P_pspr.c
 
 #include "doomdef.h"
+#include "i_system.h"
 #include "m_random.h"
 #include "p_local.h"
 #include "s_sound.h"
--- a/src/heretic/p_setup.c
+++ b/src/heretic/p_setup.c
@@ -28,6 +28,7 @@
 
 #include "doomdef.h"
 #include "i_swap.h"
+#include "i_system.h"
 #include "m_argv.h"
 #include "m_bbox.h"
 #include "p_local.h"
--- a/src/heretic/p_spec.c
+++ b/src/heretic/p_spec.c
@@ -24,6 +24,7 @@
 // P_Spec.c
 
 #include "doomdef.h"
+#include "i_system.h"
 #include "m_random.h"
 #include "p_local.h"
 #include "s_sound.h"
--- a/src/heretic/p_switch.c
+++ b/src/heretic/p_switch.c
@@ -22,6 +22,7 @@
 //-----------------------------------------------------------------------------
 
 #include "doomdef.h"
+#include "i_system.h"
 #include "p_local.h"
 #include "s_sound.h"
 #include "v_video.h"
--- a/src/heretic/p_tick.c
+++ b/src/heretic/p_tick.c
@@ -24,6 +24,7 @@
 // P_tick.c
 
 #include "doomdef.h"
+#include "i_system.h"
 #include "p_local.h"
 #include "v_video.h"
 
--- a/src/heretic/r_data.c
+++ b/src/heretic/r_data.c
@@ -25,6 +25,7 @@
 
 #include "doomdef.h"
 #include "i_swap.h"
+#include "i_system.h"
 #include "r_local.h"
 #include "p_local.h"
 
--- a/src/heretic/r_local.h
+++ b/src/heretic/r_local.h
@@ -25,6 +25,7 @@
 #ifndef __R_LOCAL__
 #define __R_LOCAL__
 
+#include "i_video.h"
 #include "v_patch.h"
 
 #define	ANGLETOSKYSHIFT		22      // sky map is 256*128*4 maps
--- a/src/heretic/r_plane.c
+++ b/src/heretic/r_plane.c
@@ -24,6 +24,7 @@
 
 #include <stdlib.h>
 #include "doomdef.h"
+#include "i_system.h"
 #include "r_local.h"
 
 planefunction_t floorfunc, ceilingfunc;
--- a/src/heretic/r_things.c
+++ b/src/heretic/r_things.c
@@ -25,6 +25,7 @@
 #include <stdlib.h>
 #include "doomdef.h"
 #include "i_swap.h"
+#include "i_system.h"
 #include "r_local.h"
 
 void R_DrawColumn(void);
--- a/src/i_system.h
+++ b/src/i_system.h
@@ -45,23 +45,6 @@
 boolean I_ConsoleStdout(void);
 
 
-// Called by D_DoomLoop,
-// called before processing any tics in a frame
-// (just after displaying a frame).
-// Time consuming syncronous operations
-// are performed here (joystick reading).
-// Can call D_PostEvent.
-//
-void I_StartFrame (void);
-
-
-//
-// Called by D_DoomLoop,
-// called before processing each tic in a frame.
-// Quick syncronous operations are performed here.
-// Can call D_PostEvent.
-void I_StartTic (void);
-
 // Asynchronous interrupt functions should maintain private queues
 // that are read by the synchronous functions
 // to be converted into events.
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -20,7 +20,7 @@
 // 02111-1307, USA.
 //
 // DESCRIPTION:
-//	DOOM graphics stuff for X11, UNIX.
+//     Low level graphics code using SDL.
 //
 //-----------------------------------------------------------------------------
 
--- a/src/i_video.h
+++ b/src/i_video.h
@@ -102,6 +102,16 @@
 void I_DisplayFPSDots(boolean dots_on);
 void I_BindVideoVariables(void);
 
+// Called before processing any tics in a frame (just after displaying a frame).
+// Time consuming syncronous operations are performed here (joystick reading).
+
+void I_StartFrame (void);
+
+// Called before processing each tic in a frame.
+// Quick syncronous operations are performed here.
+
+void I_StartTic (void);
+
 extern char *video_driver;
 extern boolean screenvisible;
 extern float mouse_acceleration;