shithub: choc

Download patch

ref: 7ebeefc592a6fb8de0990c350ddf706ca39b2341
parent: a058f719120af93a740d1a9186646f0564d193ca
parent: 535175bc6c785e229bc7ce224d05883ec4614f80
author: Turo Lamminen <turol@users.noreply.github.com>
date: Sat Oct 15 13:54:32 EDT 2022

Merge pull request #1519 from turol/extern-heretic

Clean up extern in heretic, part 1

--- a/src/heretic/am_map.c
+++ b/src/heretic/am_map.c
@@ -30,7 +30,7 @@
 #include "doomkeys.h"
 #include "v_video.h"
 
-vertex_t KeyPoints[NUMKEYS];
+vertex_t KeyPoints[NUM_KEY_TYPES];
 
 #define NUMALIAS 3              // Number of antialiased lines.
 
--- a/src/heretic/am_map.h
+++ b/src/heretic/am_map.h
@@ -16,6 +16,10 @@
 #ifndef __AMMAP_H__
 #define __AMMAP_H__
 
+
+#include "r_local.h"
+
+
 // For use if I do walls with outsides/insides
 #define REDS		12*8
 #define REDRANGE	1       //16
@@ -107,5 +111,14 @@
 } islope_t;
 
 // extern int f_x, f_y, f_w, f_h;
+
+
+extern boolean automapactive;
+extern vertex_t KeyPoints[];
+extern const char *LevelNames[];
+
+
+void AM_Stop(void);
+
 
 #endif
--- a/src/heretic/d_main.c
+++ b/src/heretic/d_main.c
@@ -44,6 +44,7 @@
 #include "s_sound.h"
 #include "w_main.h"
 #include "v_video.h"
+#include "am_map.h"
 
 #include "heretic_icon.c"
 
@@ -73,7 +74,6 @@
 static boolean using_graphical_startup;
 static boolean main_loop_started = false;
 boolean autostart;
-extern boolean automapactive;
 
 boolean advancedemo;
 
@@ -141,7 +141,6 @@
 
 void R_ExecuteSetViewSize(void);
 
-extern boolean finalestage;
 
 void D_Display(void)
 {
@@ -657,7 +656,6 @@
 void D_BindVariables(void)
 {
     extern int screenblocks;
-    extern int snd_Channels;
     int i;
 
     M_ApplyPlatformDefaults();
--- a/src/heretic/deh_htic.c
+++ b/src/heretic/deh_htic.c
@@ -41,8 +41,6 @@
 
 deh_hhe_version_t deh_hhe_version = deh_hhe_1_0;
 
-// deh_htext.c:
-extern deh_section_t deh_section_heretic_text;
 
 //
 // List of section types:
--- a/src/heretic/deh_htic.h
+++ b/src/heretic/deh_htic.h
@@ -48,5 +48,9 @@
 
 extern deh_hhe_version_t deh_hhe_version;
 
+// deh_htext.c:
+extern deh_section_t deh_section_heretic_text;
+
+
 #endif /* #ifndef DEH_HTIC_H */
 
--- a/src/heretic/doomdef.h
+++ b/src/heretic/doomdef.h
@@ -302,7 +302,7 @@
     key_yellow,
     key_green,
     key_blue,
-    NUMKEYS
+    NUM_KEY_TYPES
 } keytype_t;
 
 typedef enum
@@ -439,7 +439,7 @@
     int artifactCount;
     int inventorySlotNum;
     int powers[NUMPOWERS];
-    boolean keys[NUMKEYS];
+    boolean keys[NUM_KEY_TYPES];
     boolean backpack;
     signed int frags[MAXPLAYERS];       // kills of other players
     weapontype_t readyweapon;
--- a/src/heretic/f_finale.c
+++ b/src/heretic/f_finale.c
@@ -23,6 +23,7 @@
 #include "i_video.h"
 #include "s_sound.h"
 #include "v_video.h"
+#include "am_map.h"
 
 static int finalestage;                // 0 = text, 1 = art screen
 static int finalecount;
@@ -35,7 +36,6 @@
 
 static int FontABaseLump;
 
-extern boolean automapactive;
 extern boolean viewactive;
 
 extern void D_StartTitle(void);
@@ -148,8 +148,6 @@
 =======================
 */
 
-//#include "hu_stuff.h"
-//extern        patch_t *hu_font[HU_FONTSIZE];
 
 void F_TextWrite(void)
 {
--- a/src/heretic/in_lude.c
+++ b/src/heretic/in_lude.c
@@ -29,7 +29,9 @@
 #include "i_system.h"
 #include "i_video.h"
 #include "v_video.h"
+#include "am_map.h"
 
+
 typedef enum
 {
     SINGLE,
@@ -97,7 +99,6 @@
 
 static const char *KillersText[] = { "K", "I", "L", "L", "E", "R", "S" };
 
-extern const char *LevelNames[];
 
 typedef struct
 {
@@ -158,7 +159,6 @@
 //
 //========================================================================
 
-extern void AM_Stop(void);
 
 void IN_Start(void)
 {
--- a/src/heretic/mn_menu.c
+++ b/src/heretic/mn_menu.c
@@ -31,6 +31,7 @@
 #include "r_local.h"
 #include "s_sound.h"
 #include "v_video.h"
+#include "am_map.h"
 
 // Macros
 
@@ -1043,7 +1044,6 @@
     int key;
     int i;
     MenuItem_t *item;
-    extern boolean automapactive;
     extern void D_StartTitle(void);
     extern void G_CheckDemoStatus(void);
     char *textBuffer;
--- a/src/heretic/p_inter.c
+++ b/src/heretic/p_inter.c
@@ -23,7 +23,9 @@
 #include "m_random.h"
 #include "p_local.h"
 #include "s_sound.h"
+#include "am_map.h"
 
+
 #define BONUSADD 6
 
 int WeaponValue[] = {
@@ -317,7 +319,6 @@
 void P_GiveKey(player_t * player, keytype_t key)
 {
     extern int playerkeys;
-    extern vertex_t KeyPoints[];
 
     if (player->keys[key])
     {
--- a/src/heretic/p_mobj.c
+++ b/src/heretic/p_mobj.c
@@ -1004,7 +1004,7 @@
     P_SetupPsprites(p);         // setup gun psprite        
     if (deathmatch)
     {                           // Give all keys in death match mode
-        for (i = 0; i < NUMKEYS; i++)
+        for (i = 0; i < NUM_KEY_TYPES; i++)
         {
             p->keys[i] = true;
             if (p == &players[consoleplayer])
@@ -1187,7 +1187,6 @@
 //
 //---------------------------------------------------------------------------
 
-extern fixed_t attackrange;
 
 void P_SpawnPuff(fixed_t x, fixed_t y, fixed_t z)
 {
--- a/src/heretic/p_saveg.c
+++ b/src/heretic/p_saveg.c
@@ -409,8 +409,8 @@
         str->powers[i] = SV_ReadLong();
     }
 
-    // boolean keys[NUMKEYS];
-    for (i=0; i<NUMKEYS; ++i)
+    // boolean keys[NUM_KEY_TYPES];
+    for (i = 0; i < NUM_KEY_TYPES; ++i)
     {
         str->keys[i] = SV_ReadLong();
     }
@@ -579,7 +579,7 @@
     }
 
     // boolean keys[NUMKEYS];
-    for (i=0; i<NUMKEYS; ++i)
+    for (i = 0; i < NUM_KEY_TYPES; ++i)
     {
         SV_WriteLong(str->keys[i]);
     }
--- a/src/heretic/s_sound.h
+++ b/src/heretic/s_sound.h
@@ -21,6 +21,8 @@
 
 extern int snd_MaxVolume;
 extern int snd_MusicVolume;
+extern int snd_Channels;
+
 
 void S_Start(void);
 void S_StartSound(void *origin, int sound_id);
--- a/src/heretic/sb_bar.c
+++ b/src/heretic/sb_bar.c
@@ -26,6 +26,7 @@
 #include "p_local.h"
 #include "s_sound.h"
 #include "v_video.h"
+#include "am_map.h"
 
 // Types
 
@@ -539,7 +540,6 @@
 
 int playerkeys = 0;
 
-extern boolean automapactive;
 
 void SB_Drawer(void)
 {
@@ -1073,7 +1073,6 @@
 static void CheatWeaponsFunc(player_t * player, Cheat_t * cheat)
 {
     int i;
-    //extern boolean *WeaponInShareware;
 
     player->armorpoints = 200;
     player->armortype = 2;