shithub: choc

Download patch

ref: a058f719120af93a740d1a9186646f0564d193ca
parent: bd6ef57ac4785f70c58d02feb627407c73a2b909
parent: 20ef3a2ca63140113a41569fa65084e7e03d5fc8
author: Turo Lamminen <turol@users.noreply.github.com>
date: Tue Oct 11 07:51:07 EDT 2022

Merge pull request #1517 from turol/extern-hexen

Clean up extern in Hexen, part 2

--- a/src/hexen/am_map.c
+++ b/src/hexen/am_map.c
@@ -85,8 +85,6 @@
 static boolean ShowKills = 0;
 static unsigned ShowKillsCount = 0;
 
-extern boolean viewactive;
-
 static byte antialias[NUMALIAS][8] = {
     {83, 84, 85, 86, 87, 88, 89, 90},
     {96, 96, 95, 94, 93, 92, 91, 90},
--- a/src/hexen/ct_chat.c
+++ b/src/hexen/ct_chat.c
@@ -89,7 +89,6 @@
 boolean altdown;
 boolean shiftdown;
 
-extern boolean usearti;
 
 //===========================================================================
 //
--- a/src/hexen/d_net.c
+++ b/src/hexen/d_net.c
@@ -36,13 +36,7 @@
 
 ticcmd_t *netcmds;
 
-extern void H2_DoAdvanceDemo(void);
-extern void H2_ProcessEvents(void);
-extern void G_BuildTiccmd(ticcmd_t *cmd, int maketic);
-extern boolean G_CheckDemoStatus(void);
 
-extern boolean demorecording;
-
 // Called when a player leaves the game
 
 static void PlayerQuitGame(player_t *player)
@@ -69,7 +63,6 @@
 
 static void RunTic(ticcmd_t *cmds, boolean *ingame)
 {
-    extern boolean advancedemo;
     unsigned int i;
 
     // Check for player quits.
--- a/src/hexen/f_finale.c
+++ b/src/hexen/f_finale.c
@@ -50,8 +50,6 @@
 
 // EXTERNAL DATA DECLARATIONS ----------------------------------------------
 
-extern boolean viewactive;
-
 // PUBLIC DATA DECLARATIONS ------------------------------------------------
 
 // PRIVATE DATA DEFINITIONS ------------------------------------------------
--- a/src/hexen/g_game.c
+++ b/src/hexen/g_game.c
@@ -37,7 +37,6 @@
 
 // Functions
 
-boolean G_CheckDemoStatus(void);
 void G_ReadDemoTiccmd(ticcmd_t * cmd);
 void G_WriteDemoTiccmd(ticcmd_t * cmd);
 
@@ -57,7 +56,6 @@
 void H2_PageTicker(void);
 void H2_AdvanceDemo(void);
 
-extern boolean mn_SuicideConsole;
 
 gameaction_t gameaction;
 gamestate_t gamestate;
@@ -142,7 +140,6 @@
 
 #define SLOWTURNTICS    6
 
-#define NUMKEYS 256
 boolean gamekeydown[NUMKEYS];
 int turnheld;                   // for accelerative turning
 int lookheld;
@@ -191,7 +188,6 @@
 ====================
 */
 
-extern boolean inventory;
 boolean usearti = true;
 
 void G_BuildTiccmd(ticcmd_t *cmd, int maketic)
@@ -204,8 +200,6 @@
     int flyheight;
     int pClass;
 
-    extern boolean artiskip;
-
     // haleyjd: removed externdriver crap
 
     pClass = players[consoleplayer].class;
@@ -859,7 +853,6 @@
 boolean G_Responder(event_t * ev)
 {
     player_t *plr;
-    extern boolean MenuActive;
 
     plr = &players[consoleplayer];
     if (ev->type == ev_keyup && ev->data1 == key_useartifact)
--- a/src/hexen/h2_main.c
+++ b/src/hexen/h2_main.c
@@ -71,10 +71,7 @@
 
 // PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
 
-void H2_ProcessEvents(void);
-void H2_DoAdvanceDemo(void);
 void H2_AdvanceDemo(void);
-void H2_StartTitle(void);
 void H2_PageTicker(void);
 
 // PRIVATE FUNCTION PROTOTYPES ---------------------------------------------
@@ -89,8 +86,6 @@
 
 // EXTERNAL DATA DECLARATIONS ----------------------------------------------
 
-extern boolean MenuActive;
-extern boolean askforquit;
 
 // PUBLIC DATA DEFINITIONS -------------------------------------------------
 
--- a/src/hexen/h2def.h
+++ b/src/hexen/h2def.h
@@ -612,6 +612,8 @@
 
 extern boolean cdrom;           // true if cd-rom mode active ("-cdrom")
 
+extern boolean viewactive;
+
 extern boolean deathmatch;      // only if started as net death
 
 extern boolean netgame;         // only true if >1 player
@@ -632,6 +634,7 @@
 
 extern boolean DebugSound;      // debug flag for displaying sound info
 
+extern boolean demorecording;
 extern boolean demoplayback;
 extern boolean demoextend;      // allow demos to persist through exit/respawn
 extern int maxzone;             // Maximum chunk allocated for zone heap
@@ -678,6 +681,7 @@
 extern int startepisode;
 extern int startmap;
 extern boolean autostart;
+extern boolean advancedemo;
 
 extern boolean testcontrols;
 extern int testcontrols_mousespeed;
@@ -685,6 +689,9 @@
 extern int vanilla_savegame_limit;
 extern int vanilla_demo_limit;
 
+extern boolean usearti;
+
+
 /*
 ===============================================================================
 
@@ -712,6 +719,12 @@
 // calls all ?_Responder, ?_Ticker, and ?_Drawer functions
 // calls I_GetTime, I_StartFrame, and I_StartTic
 
+void H2_StartTitle(void);
+
+
+extern boolean artiskip;
+
+
 //---------
 //SYSTEM IO
 //---------
@@ -754,6 +767,10 @@
 //GAME
 //----
 
+
+#define NUMKEYS 256
+
+
 void G_DeathMatchSpawnPlayer(int playernum);
 
 void G_InitNew(skill_t skill, int episode, int map);
@@ -774,6 +791,12 @@
 void G_SaveGame(int slot, char *description);
 // called by M_Responder
 
+void H2_ProcessEvents(void);
+
+void H2_DoAdvanceDemo(void);
+
+boolean G_CheckDemoStatus(void);
+
 void G_RecordDemo(skill_t skill, int numplayers, int episode, int map,
                   const char *name);
 // only called by startup code
@@ -792,11 +815,17 @@
 
 void G_WorldDone(void);
 
+void G_BuildTiccmd(ticcmd_t *cmd, int maketic);
 void G_Ticker(void);
 boolean G_Responder(event_t * ev);
 
 void G_ScreenShot(void);
 
+
+extern int LeaveMap;
+extern boolean gamekeydown[NUMKEYS];
+
+
 //-------
 //SV_SAVE
 //-------
@@ -1040,6 +1069,9 @@
 
 extern int inv_ptr;
 extern int curpos;
+extern boolean inventory;
+
+
 void SB_Init(void);
 void SB_SetClassData(void);
 boolean SB_Responder(event_t * event);
@@ -1066,6 +1098,11 @@
 int MN_TextBWidth(const char *text);
 
 extern int messageson;
+extern boolean MenuActive;
+extern boolean askforquit;
+extern boolean mn_SuicideConsole;
+extern int detailLevel;
+
 
 #include "sounds.h"
 
--- a/src/hexen/in_lude.c
+++ b/src/hexen/in_lude.c
@@ -174,8 +174,6 @@
     int msgSize;
     int msgLump;
 
-    extern int LeaveMap;
-
     if (!deathmatch)
     {
         gametype = SINGLE;
--- a/src/hexen/mn_menu.c
+++ b/src/hexen/mn_menu.c
@@ -124,8 +124,6 @@
 
 // EXTERNAL DATA DECLARATIONS ----------------------------------------------
 
-extern int detailLevel;
-extern boolean gamekeydown[256];        // The NUMKEYS macro is local to g_game
 
 // PUBLIC DATA DEFINITIONS -------------------------------------------------
 
@@ -1148,8 +1146,6 @@
     int charTyped;
     int i;
     MenuItem_t *item;
-    extern void H2_StartTitle(void);
-    extern void G_CheckDemoStatus(void);
     char *textBuffer;
 
     // In testcontrols mode, none of the function keys should do anything