shithub: choc

Download patch

ref: 9429db1a885b7b1c02eefc1ca7342f3e1bbad529
parent: 576f8333909bb491572cb3c5c2e09e023ada44c1
parent: ab2474552a124f3b076a3825714f13e55860a7c3
author: Turo Lamminen <turol@users.noreply.github.com>
date: Fri Nov 4 08:12:07 EDT 2022

Merge pull request #1540 from turol/extern-doom

Clean up extern in Doom, part 1

--- a/src/doom/d_main.c
+++ b/src/doom/d_main.c
@@ -105,7 +105,6 @@
 boolean         fastparm;	// checkparm of -fast
 
 
-extern  boolean	inhelpscreens;
 
 skill_t		startskill;
 int             startepisode;
@@ -162,9 +161,6 @@
 
 // wipegamestate can be set to -1 to force a wipe on the next draw
 gamestate_t     wipegamestate = GS_DEMOSCREEN;
-extern  boolean setsizeneeded;
-extern  int             showMessages;
-void R_ExecuteSetViewSize (void);
 
 boolean D_Display (void)
 {
@@ -1466,8 +1462,6 @@
     if ( (p=M_CheckParm ("-turbo")) )
     {
 	int     scale = 200;
-	extern fixed_t forwardmove[2];
-	extern fixed_t sidemove[2];
 	
 	if (p<myargc-1)
 	    scale = atoi (myargv[p+1]);
--- a/src/doom/d_main.h
+++ b/src/doom/d_main.h
@@ -44,6 +44,9 @@
 //
 
 extern  gameaction_t    gameaction;
+extern boolean advancedemo;
+
+extern const char *pagename;
 
 
 #endif
--- a/src/doom/d_net.c
+++ b/src/doom/d_net.c
@@ -68,7 +68,6 @@
 
 static void RunTic(ticcmd_t *cmds, boolean *ingame)
 {
-    extern boolean advancedemo;
     unsigned int i;
 
     // Check for player quits.
--- a/src/doom/f_finale.c
+++ b/src/doom/f_finale.c
@@ -222,7 +222,6 @@
 //
 
 #include "hu_stuff.h"
-extern	patch_t *hu_font[HU_FONTSIZE];
 
 
 void F_TextWrite (void)
--- a/src/doom/g_game.c
+++ b/src/doom/g_game.c
@@ -941,7 +941,6 @@
              && turbodetected[i])
             {
                 static char turbomessage[80];
-                extern const char *player_names[4];
                 M_snprintf(turbomessage, sizeof(turbomessage),
                            "%s is turbo!", player_names[i]);
                 players[consoleplayer].message = turbomessage;
@@ -1334,7 +1333,6 @@
 // G_DoCompleted 
 //
 boolean		secretexit; 
-extern const char *pagename;
  
 void G_ExitLevel (void) 
 { 
@@ -1569,8 +1567,6 @@
 // G_InitFromSavegame
 // Can be called by the startup code or the menu task. 
 //
-extern boolean setsizeneeded;
-void R_ExecuteSetViewSize (void);
 
 char	savename[256];
 
--- a/src/doom/g_game.h
+++ b/src/doom/g_game.h
@@ -77,5 +77,12 @@
 
 extern int vanilla_savegame_limit;
 extern int vanilla_demo_limit;
+
+extern fixed_t forwardmove[2];
+extern fixed_t sidemove[2];
+
+extern boolean sendpause;
+
+
 #endif
 
--- a/src/doom/hu_stuff.c
+++ b/src/doom/hu_stuff.c
@@ -91,7 +91,6 @@
 static hu_stext_t	w_message;
 static int		message_counter;
 
-extern int		showMessages;
 
 static boolean		headsupactive = false;
 
--- a/src/doom/hu_stuff.h
+++ b/src/doom/hu_stuff.h
@@ -54,7 +54,15 @@
 char HU_dequeueChatChar(void);
 void HU_Erase(void);
 
+extern const char *player_names[4];
 extern char *chat_macros[10];
+
+extern patch_t *hu_font[HU_FONTSIZE];
+
+extern boolean message_dontfuckwithme;
+
+extern boolean chat_on;
+
 
 #endif
 
--- a/src/doom/m_menu.c
+++ b/src/doom/m_menu.c
@@ -61,11 +61,6 @@
 #include "m_menu.h"
 
 
-extern patch_t*		hu_font[HU_FONTSIZE];
-extern boolean		message_dontfuckwithme;
-
-extern boolean		chat_on;		// in heads-up code
-
 //
 // defaulted values
 //
@@ -123,7 +118,6 @@
 #define SKULLXOFF		-32
 #define LINEHEIGHT		16
 
-extern boolean		sendpause;
 char			savegamestrings[10][SAVESTRINGSIZE];
 
 char	endstring[160];
--- a/src/doom/m_menu.h
+++ b/src/doom/m_menu.h
@@ -52,10 +52,11 @@
 void M_StartControlPanel (void);
 
 
-
 extern int detailLevel;
 extern int screenblocks;
 
+extern boolean inhelpscreens;
+extern int showMessages;
 
 
-#endif    
+#endif
--- a/src/doom/p_local.h
+++ b/src/doom/p_local.h
@@ -233,6 +233,10 @@
 
 extern mobj_t*	linetarget;	// who got hit (or NULL)
 
+
+extern fixed_t attackrange;
+
+
 fixed_t
 P_AimLineAttack
 ( mobj_t*	t1,
--- a/src/doom/p_maputl.c
+++ b/src/doom/p_maputl.c
@@ -728,7 +728,6 @@
     return true;		// everything was traversed
 }
 
-extern fixed_t bulletslope;
 
 // Intercepts Overrun emulation, from PrBoom-plus.
 // Thanks to Andrey Budko (entryway) for researching this and his 
--- a/src/doom/p_mobj.c
+++ b/src/doom/p_mobj.c
@@ -865,7 +865,6 @@
 //
 // P_SpawnPuff
 //
-extern fixed_t attackrange;
 
 void
 P_SpawnPuff
--- a/src/doom/p_pspr.h
+++ b/src/doom/p_pspr.h
@@ -68,4 +68,8 @@
 
 } pspdef_t;
 
+
+extern fixed_t bulletslope;
+
+
 #endif
--- a/src/doom/p_spec.c
+++ b/src/doom/p_spec.c
@@ -1192,8 +1192,6 @@
     static int tmp_s3_floorheight;
     static int tmp_s3_floorpic;
 
-    extern int numflats;
-
     if (first)
     {
         int p;
--- a/src/doom/r_data.h
+++ b/src/doom/r_data.h
@@ -48,4 +48,8 @@
 int R_TextureNumForName(const char *name);
 int R_CheckTextureNumForName(const char *name);
 
+
+extern int numflats;
+
+
 #endif
--- a/src/doom/r_main.c
+++ b/src/doom/r_main.c
@@ -51,7 +51,6 @@
 
 
 lighttable_t*		fixedcolormap;
-extern lighttable_t**	walllights;
 
 int			centerx;
 int			centery;
--- a/src/doom/r_main.h
+++ b/src/doom/r_main.h
@@ -49,7 +49,9 @@
 extern int		linecount;
 extern int		loopcount;
 
+extern  boolean setsizeneeded;
 
+
 //
 // Lighting LUT.
 // Used for z-depth cuing per column/row,
@@ -156,5 +158,8 @@
 
 // Called by M_Responder.
 void R_SetViewSize (int blocks, int detail);
+
+void R_ExecuteSetViewSize(void);
+
 
 #endif
--- a/src/doom/r_segs.h
+++ b/src/doom/r_segs.h
@@ -21,6 +21,7 @@
 #define __R_SEGS__
 
 
+extern lighttable_t **walllights;
 
 
 void