summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2015-03-07 16:55:42 +0100
committerBardur Arantsson <bardur@scientician.net>2015-03-07 16:55:42 +0100
commit6f612c6e6cf9b20c00fd2f515d3694d2b7f7f444 (patch)
tree0c090679f4a130f023c22eaf48f66da31afb2dee
parent50a8089bb44ffeb21b9f8bca2c3b6596b617e0d0 (diff)
Split variables.cc declarations to separate header files
- Can now remove externs.h. Yay! - Put a stray option variable into its rightful place in options.hpp
-rw-r--r--src/angband.h3
-rw-r--r--src/birth.cc2
-rw-r--r--src/bldg.cc1
-rw-r--r--src/cave.cc2
-rw-r--r--src/cmd1.cc2
-rw-r--r--src/cmd2.cc2
-rw-r--r--src/cmd3.cc2
-rw-r--r--src/cmd4.cc2
-rw-r--r--src/cmd5.cc2
-rw-r--r--src/cmd6.cc2
-rw-r--r--src/cmd7.cc2
-rw-r--r--src/corrupt.cc1
-rw-r--r--src/dungeon.cc2
-rw-r--r--src/files.cc2
-rw-r--r--src/gen_evol.cc1
-rw-r--r--src/gen_maze.cc1
-rw-r--r--src/generate.cc1
-rw-r--r--src/gods.cc2
-rw-r--r--src/help.cc1
-rw-r--r--src/init1.cc2
-rw-r--r--src/init2.cc2
-rw-r--r--src/joke.cc1
-rw-r--r--src/levels.cc2
-rw-r--r--src/loadsave.cc2
-rw-r--r--src/lua_bind.cc1
-rw-r--r--src/main-gcu.c1
-rw-r--r--src/main-gtk2.c1
-rw-r--r--src/main-sdl.c1
-rw-r--r--src/main-win.c1
-rw-r--r--src/main-x11.c1
-rw-r--r--src/main.c1
-rw-r--r--src/melee1.cc1
-rw-r--r--src/melee2.cc1
-rw-r--r--src/mimic.cc1
-rw-r--r--src/modules.cc2
-rw-r--r--src/monster1.cc1
-rw-r--r--src/monster2.cc1
-rw-r--r--src/monster3.cc2
-rw-r--r--src/notes.cc2
-rw-r--r--src/object1.cc2
-rw-r--r--src/object2.cc3
-rw-r--r--src/options.cc1
-rw-r--r--src/options.hpp1
-rw-r--r--src/powers.cc2
-rw-r--r--src/q_betwen.cc1
-rw-r--r--src/q_bounty.cc1
-rw-r--r--src/q_dragons.cc1
-rw-r--r--src/q_eol.cc1
-rw-r--r--src/q_evil.cc1
-rw-r--r--src/q_fireprof.cc1
-rw-r--r--src/q_god.cc1
-rw-r--r--src/q_haunted.cc1
-rw-r--r--src/q_hobbit.cc1
-rw-r--r--src/q_invas.cc1
-rw-r--r--src/q_library.cc2
-rw-r--r--src/q_main.cc1
-rw-r--r--src/q_narsil.cc1
-rw-r--r--src/q_nazgul.cc1
-rw-r--r--src/q_nirna.cc1
-rw-r--r--src/q_one.cc1
-rw-r--r--src/q_poison.cc1
-rw-r--r--src/q_rand.cc1
-rw-r--r--src/q_shroom.cc1
-rw-r--r--src/q_spider.cc1
-rw-r--r--src/q_thief.cc1
-rw-r--r--src/q_thrain.cc1
-rw-r--r--src/q_troll.cc1
-rw-r--r--src/q_ultrag.cc1
-rw-r--r--src/q_wight.cc1
-rw-r--r--src/q_wolves.cc1
-rw-r--r--src/randart.cc2
-rw-r--r--src/skills.cc2
-rw-r--r--src/spells1.cc1
-rw-r--r--src/spells2.cc2
-rw-r--r--src/spells3.cc1
-rw-r--r--src/spells4.cc1
-rw-r--r--src/spells5.cc1
-rw-r--r--src/spells6.cc1
-rw-r--r--src/squelch/condition.cc1
-rw-r--r--src/squelch/object_status.cc1
-rw-r--r--src/squelch/rule.cc1
-rw-r--r--src/squeltch.cc2
-rw-r--r--src/status.cc2
-rw-r--r--src/store.cc2
-rw-r--r--src/tables.cc2
-rw-r--r--src/traps.cc1
-rw-r--r--src/util.cc2
-rw-r--r--src/variable.cc12
-rw-r--r--src/variable.h42
-rw-r--r--src/variable.hpp (renamed from src/externs.h)44
-rw-r--r--src/wild.cc1
-rw-r--r--src/wizard1.cc2
-rw-r--r--src/wizard2.cc2
-rw-r--r--src/xtra1.cc2
-rw-r--r--src/xtra2.cc2
95 files changed, 173 insertions, 55 deletions
diff --git a/src/angband.h b/src/angband.h
index 73aad517..a4646d08 100644
--- a/src/angband.h
+++ b/src/angband.h
@@ -38,11 +38,10 @@ extern "C" {
/*
- * Now, include the define's, the type's, and the extern's
+ * Now, include the defines and the types
*/
#include "defines.h"
#include "types.h"
-#include "externs.h"
/***** Some copyright messages follow below *****/
diff --git a/src/birth.cc b/src/birth.cc
index 3d99258e..b6470e59 100644
--- a/src/birth.cc
+++ b/src/birth.cc
@@ -35,6 +35,8 @@
#include "tables.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
#include "xtra1.hpp"
#include "xtra2.hpp"
diff --git a/src/bldg.cc b/src/bldg.cc
index 248a6d4e..bda47667 100644
--- a/src/bldg.cc
+++ b/src/bldg.cc
@@ -28,6 +28,7 @@
#include "tables.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.hpp"
#include "xtra1.hpp"
#include "xtra2.hpp"
diff --git a/src/cave.cc b/src/cave.cc
index 75a5a205..6928abdb 100644
--- a/src/cave.cc
+++ b/src/cave.cc
@@ -8,6 +8,8 @@
#include "tables.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
#include <cassert>
#include <vector>
diff --git a/src/cmd1.cc b/src/cmd1.cc
index 65056cf6..a5c882b9 100644
--- a/src/cmd1.cc
+++ b/src/cmd1.cc
@@ -33,6 +33,8 @@
#include "traps.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
#include "wild.hpp"
#include "xtra1.hpp"
#include "xtra2.hpp"
diff --git a/src/cmd2.cc b/src/cmd2.cc
index 58c2aacc..60a7dc47 100644
--- a/src/cmd2.cc
+++ b/src/cmd2.cc
@@ -29,6 +29,8 @@
#include "traps.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
#include "xtra1.hpp"
#include "xtra2.hpp"
diff --git a/src/cmd3.cc b/src/cmd3.cc
index e878c3dc..dd517bf5 100644
--- a/src/cmd3.cc
+++ b/src/cmd3.cc
@@ -22,6 +22,8 @@
#include "tables.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
#include "xtra1.hpp"
#include "xtra2.hpp"
diff --git a/src/cmd4.cc b/src/cmd4.cc
index f5c3ff57..b2c83b9c 100644
--- a/src/cmd4.cc
+++ b/src/cmd4.cc
@@ -23,6 +23,8 @@
#include "tables.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
#include "xtra1.hpp"
#include <cassert>
diff --git a/src/cmd5.cc b/src/cmd5.cc
index 2725f4ea..81e909f3 100644
--- a/src/cmd5.cc
+++ b/src/cmd5.cc
@@ -25,6 +25,8 @@
#include "tables.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
#include "quark.h"
#include "wizard2.hpp"
#include "xtra1.hpp"
diff --git a/src/cmd6.cc b/src/cmd6.cc
index 705ef14b..58f231f4 100644
--- a/src/cmd6.cc
+++ b/src/cmd6.cc
@@ -30,6 +30,8 @@
#include "store.hpp"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.h"
+#include "variable.hpp"
#include "wild.hpp"
#include "wizard2.hpp"
#include "xtra1.hpp"
diff --git a/src/cmd7.cc b/src/cmd7.cc
index e2e3772d..faa5825c 100644
--- a/src/cmd7.cc
+++ b/src/cmd7.cc
@@ -27,6 +27,8 @@
#include "tables.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
#include "xtra1.hpp"
#include "xtra2.hpp"
diff --git a/src/corrupt.cc b/src/corrupt.cc
index 7dc1bdc6..ec5d69be 100644
--- a/src/corrupt.cc
+++ b/src/corrupt.cc
@@ -1,6 +1,7 @@
#include "angband.h"
#include "init1.hpp"
#include "util.hpp"
+#include "variable.hpp"
#include "xtra2.hpp"
#include <cassert>
diff --git a/src/dungeon.cc b/src/dungeon.cc
index d640795b..9b66d869 100644
--- a/src/dungeon.cc
+++ b/src/dungeon.cc
@@ -55,6 +55,8 @@
#include "tables.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
#include "wild.hpp"
#include "wizard2.hpp"
#include "xtra1.hpp"
diff --git a/src/files.cc b/src/files.cc
index 07d6ed3a..4bc44d6a 100644
--- a/src/files.cc
+++ b/src/files.cc
@@ -31,6 +31,8 @@
#include "tables.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
#include "xtra1.hpp"
#include <memory>
diff --git a/src/gen_evol.cc b/src/gen_evol.cc
index 309b8695..d2676fa1 100644
--- a/src/gen_evol.cc
+++ b/src/gen_evol.cc
@@ -12,6 +12,7 @@
#include "cave.hpp"
#include "generate.hpp"
#include "levels.hpp"
+#include "variable.hpp"
/*
* Generate a game of life level :) and make it evolve
diff --git a/src/gen_maze.cc b/src/gen_maze.cc
index fd9ff153..4c59fb5d 100644
--- a/src/gen_maze.cc
+++ b/src/gen_maze.cc
@@ -13,6 +13,7 @@
#include "cave.hpp"
#include "generate.hpp"
#include "levels.hpp"
+#include "variable.hpp"
#include <memory>
diff --git a/src/generate.cc b/src/generate.cc
index 9a28b2d4..7362b0a2 100644
--- a/src/generate.cc
+++ b/src/generate.cc
@@ -20,6 +20,7 @@
#include "tables.hpp"
#include "traps.hpp"
#include "util.hpp"
+#include "variable.hpp"
#include "wild.hpp"
#include <cassert>
diff --git a/src/gods.cc b/src/gods.cc
index 83fd3aae..be877905 100644
--- a/src/gods.cc
+++ b/src/gods.cc
@@ -11,6 +11,8 @@
#include "skills.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
#include "xtra2.hpp"
#include <cassert>
diff --git a/src/help.cc b/src/help.cc
index f7a8378b..0fb910d8 100644
--- a/src/help.cc
+++ b/src/help.cc
@@ -16,6 +16,7 @@
#include "options.hpp"
#include "skills.hpp"
#include "util.hpp"
+#include "variable.hpp"
#define DESC_MAX 14
#define TRIGGERED_HELP_MAX 19
diff --git a/src/init1.cc b/src/init1.cc
index fe6abb87..93e7d2c0 100644
--- a/src/init1.cc
+++ b/src/init1.cc
@@ -14,6 +14,8 @@
#include "traps.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
#include <boost/algorithm/string/predicate.hpp>
diff --git a/src/init2.cc b/src/init2.cc
index 6a1f7c02..b924c914 100644
--- a/src/init2.cc
+++ b/src/init2.cc
@@ -21,6 +21,8 @@
#include "tome/make_array.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
#include <cassert>
#include <type_traits>
diff --git a/src/joke.cc b/src/joke.cc
index e07a313e..890dbc60 100644
--- a/src/joke.cc
+++ b/src/joke.cc
@@ -4,6 +4,7 @@
#include "monster2.hpp"
#include "options.hpp"
#include "util.hpp"
+#include "variable.hpp"
static void gen_joke_place_monster(int r_idx)
{
diff --git a/src/levels.cc b/src/levels.cc
index 2ecb6e6c..d8820a77 100644
--- a/src/levels.cc
+++ b/src/levels.cc
@@ -12,6 +12,8 @@
#include "init1.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
/*
diff --git a/src/loadsave.cc b/src/loadsave.cc
index b2c9b2ec..10582487 100644
--- a/src/loadsave.cc
+++ b/src/loadsave.cc
@@ -16,6 +16,8 @@
#include "tables.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
#include "xtra2.hpp"
#include <cassert>
diff --git a/src/lua_bind.cc b/src/lua_bind.cc
index 99311804..fcc28bbe 100644
--- a/src/lua_bind.cc
+++ b/src/lua_bind.cc
@@ -20,6 +20,7 @@
#include "spells5.hpp"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.hpp"
#include <cassert>
#include <functional>
diff --git a/src/main-gcu.c b/src/main-gcu.c
index 790f02f8..426345b7 100644
--- a/src/main-gcu.c
+++ b/src/main-gcu.c
@@ -41,6 +41,7 @@
#include "angband.h"
#include "util.h"
+#include "variable.h"
#ifdef USE_GCU
diff --git a/src/main-gtk2.c b/src/main-gtk2.c
index 8f6be607..a7d7b751 100644
--- a/src/main-gtk2.c
+++ b/src/main-gtk2.c
@@ -33,6 +33,7 @@
#include "angband.h"
#include "files.h"
#include "util.h"
+#include "variable.h"
/*
diff --git a/src/main-sdl.c b/src/main-sdl.c
index 736202f3..9126c721 100644
--- a/src/main-sdl.c
+++ b/src/main-sdl.c
@@ -28,6 +28,7 @@
#include "angband.h"
#include "loadsave.h"
#include "util.h"
+#include "variable.h"
#include <SDL.h>
#include <SDL_image.h>
diff --git a/src/main-win.c b/src/main-win.c
index b532c138..05742c86 100644
--- a/src/main-win.c
+++ b/src/main-win.c
@@ -72,6 +72,7 @@
#include "files.h"
#include "init2.h"
#include "util.h"
+#include "variable.h"
#ifdef WINDOWS
diff --git a/src/main-x11.c b/src/main-x11.c
index c19b8d99..2553712e 100644
--- a/src/main-x11.c
+++ b/src/main-x11.c
@@ -95,6 +95,7 @@
#include "angband.h"
#include "loadsave.h"
#include "util.h"
+#include "variable.h"
#ifdef USE_X11
diff --git a/src/main.c b/src/main.c
index cb2f179d..1ffd61ce 100644
--- a/src/main.c
+++ b/src/main.c
@@ -16,6 +16,7 @@
#include "modules.h"
#include "script.h"
#include "util.h"
+#include "variable.h"
diff --git a/src/melee1.cc b/src/melee1.cc
index 43ed3ef1..58f41903 100644
--- a/src/melee1.cc
+++ b/src/melee1.cc
@@ -22,6 +22,7 @@
#include "store.hpp"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.hpp"
#include "xtra1.hpp"
#include "xtra2.hpp"
diff --git a/src/melee2.cc b/src/melee2.cc
index e1c8eaf1..fdd31846 100644
--- a/src/melee2.cc
+++ b/src/melee2.cc
@@ -32,6 +32,7 @@
#include "tables.hpp"
#include "traps.hpp"
#include "util.hpp"
+#include "variable.hpp"
#include "xtra2.hpp"
#include <cassert>
diff --git a/src/mimic.cc b/src/mimic.cc
index a55878e5..6fec9ec3 100644
--- a/src/mimic.cc
+++ b/src/mimic.cc
@@ -1,5 +1,6 @@
#include "mimic.hpp"
+#include "variable.hpp"
#include "xtra1.hpp"
#include <cassert>
diff --git a/src/modules.cc b/src/modules.cc
index 0a2d2a33..98af4032 100644
--- a/src/modules.cc
+++ b/src/modules.cc
@@ -22,6 +22,8 @@
#include "tables.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
#include <cassert>
#include <chrono>
diff --git a/src/monster1.cc b/src/monster1.cc
index c636985e..20f23e59 100644
--- a/src/monster1.cc
+++ b/src/monster1.cc
@@ -11,6 +11,7 @@
#include "angband.h"
#include "monster2.hpp"
#include "util.hpp"
+#include "variable.hpp"
/*
* Pronoun arrays, by gender.
diff --git a/src/monster2.cc b/src/monster2.cc
index 9439c74f..c3429298 100644
--- a/src/monster2.cc
+++ b/src/monster2.cc
@@ -21,6 +21,7 @@
#include "spells2.hpp"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.hpp"
#include "xtra1.hpp"
#include "xtra2.hpp"
diff --git a/src/monster3.cc b/src/monster3.cc
index 12f0fcb6..c4d2295a 100644
--- a/src/monster3.cc
+++ b/src/monster3.cc
@@ -18,6 +18,8 @@
#include "tables.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
#include "xtra2.hpp"
/*
diff --git a/src/notes.cc b/src/notes.cc
index 8869ff2f..0aa632f2 100644
--- a/src/notes.cc
+++ b/src/notes.cc
@@ -13,6 +13,8 @@
#include "files.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
/*
* Show the notes file on the screen
diff --git a/src/object1.cc b/src/object1.cc
index 4280e88a..93021cec 100644
--- a/src/object1.cc
+++ b/src/object1.cc
@@ -29,6 +29,8 @@
#include "tables.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
#include "xtra1.hpp"
#include <cassert>
diff --git a/src/object2.cc b/src/object2.cc
index 9d3ef232..895b0a9b 100644
--- a/src/object2.cc
+++ b/src/object2.cc
@@ -22,8 +22,9 @@
#include "spells3.hpp"
#include "spells5.hpp"
#include "tables.hpp"
-#include "util.hpp"
#include "traps.hpp"
+#include "util.hpp"
+#include "variable.hpp"
#include "xtra1.hpp"
#include <cassert>
diff --git a/src/options.cc b/src/options.cc
index 7acea8ce..490b0245 100644
--- a/src/options.cc
+++ b/src/options.cc
@@ -66,6 +66,7 @@ bool_ view_yellow_lite; /* Use special colors for torch-lit grids */
bool_ view_bright_lite; /* Use special colors for 'viewable' grids */
bool_ view_granite_lite; /* Use special colors for wall grids (slow) */
bool_ view_special_lite; /* Use special colors for floor grids (slow) */
+bool_ center_player; /* Center view on player */
//
// Option Set 5 - ToME options
diff --git a/src/options.hpp b/src/options.hpp
index 13620780..a8a0c9f8 100644
--- a/src/options.hpp
+++ b/src/options.hpp
@@ -68,6 +68,7 @@ extern bool_ view_yellow_lite;
extern bool_ view_bright_lite;
extern bool_ view_granite_lite;
extern bool_ view_special_lite;
+extern bool_ center_player;
//
// Option Set 5 - ToME options
diff --git a/src/powers.cc b/src/powers.cc
index e0305c2d..4c85f2d9 100644
--- a/src/powers.cc
+++ b/src/powers.cc
@@ -28,6 +28,8 @@
#include "traps.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
#include "xtra2.hpp"
/*
diff --git a/src/q_betwen.cc b/src/q_betwen.cc
index 9539b410..498ea9b4 100644
--- a/src/q_betwen.cc
+++ b/src/q_betwen.cc
@@ -7,6 +7,7 @@
#include "object2.hpp"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.hpp"
#define cquest (quest[QUEST_BETWEEN])
diff --git a/src/q_bounty.cc b/src/q_bounty.cc
index 5ac204ca..33a5981d 100644
--- a/src/q_bounty.cc
+++ b/src/q_bounty.cc
@@ -5,6 +5,7 @@
#include "object2.hpp"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.hpp"
#define cquest (quest[QUEST_BOUNTY])
diff --git a/src/q_dragons.cc b/src/q_dragons.cc
index 1ed48086..fbed0821 100644
--- a/src/q_dragons.cc
+++ b/src/q_dragons.cc
@@ -6,6 +6,7 @@
#include "monster2.hpp"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.hpp"
#define cquest (quest[QUEST_DRAGONS])
diff --git a/src/q_eol.cc b/src/q_eol.cc
index f026fc89..fff73299 100644
--- a/src/q_eol.cc
+++ b/src/q_eol.cc
@@ -8,6 +8,7 @@
#include "tables.hpp"
#include "traps.hpp"
#include "util.hpp"
+#include "variable.hpp"
#include <cassert>
diff --git a/src/q_evil.cc b/src/q_evil.cc
index a857a193..b3491d78 100644
--- a/src/q_evil.cc
+++ b/src/q_evil.cc
@@ -6,6 +6,7 @@
#include "monster2.hpp"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.hpp"
#define cquest (quest[QUEST_EVIL])
diff --git a/src/q_fireprof.cc b/src/q_fireprof.cc
index ae13dbe9..9eed970e 100644
--- a/src/q_fireprof.cc
+++ b/src/q_fireprof.cc
@@ -7,6 +7,7 @@
#include "tables.hpp"
#include "traps.hpp"
#include "util.hpp"
+#include "variable.hpp"
#include <cassert>
diff --git a/src/q_god.cc b/src/q_god.cc
index 35f8355c..8186ce96 100644
--- a/src/q_god.cc
+++ b/src/q_god.cc
@@ -4,6 +4,7 @@
#include "object2.hpp"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.hpp"
#include <assert.h>
diff --git a/src/q_haunted.cc b/src/q_haunted.cc
index b4b5f62a..395c6e4a 100644
--- a/src/q_haunted.cc
+++ b/src/q_haunted.cc
@@ -7,6 +7,7 @@
#include "traps.hpp"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.hpp"
#define cquest (quest[QUEST_HAUNTED])
diff --git a/src/q_hobbit.cc b/src/q_hobbit.cc
index 17754e0a..9893e483 100644
--- a/src/q_hobbit.cc
+++ b/src/q_hobbit.cc
@@ -7,6 +7,7 @@
#include "object2.hpp"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.hpp"
#include <cassert>
diff --git a/src/q_invas.cc b/src/q_invas.cc
index d322ff54..739d3c67 100644
--- a/src/q_invas.cc
+++ b/src/q_invas.cc
@@ -6,6 +6,7 @@
#include "monster2.hpp"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.hpp"
#define cquest (quest[QUEST_INVASION])
diff --git a/src/q_library.cc b/src/q_library.cc
index 3037565c..4645150b 100644
--- a/src/q_library.cc
+++ b/src/q_library.cc
@@ -9,6 +9,8 @@
#include "tables.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
#include <cassert>
diff --git a/src/q_main.cc b/src/q_main.cc
index 3c105307..a71ec15f 100644
--- a/src/q_main.cc
+++ b/src/q_main.cc
@@ -3,6 +3,7 @@
#include "hooks.h"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.hpp"
#include <cassert>
diff --git a/src/q_narsil.cc b/src/q_narsil.cc
index d6d9d590..c9f2d365 100644
--- a/src/q_narsil.cc
+++ b/src/q_narsil.cc
@@ -4,6 +4,7 @@
#include "object2.hpp"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.hpp"
#define cquest (quest[QUEST_NARSIL])
diff --git a/src/q_nazgul.cc b/src/q_nazgul.cc
index 9b1b5c06..53f5d430 100644
--- a/src/q_nazgul.cc
+++ b/src/q_nazgul.cc
@@ -6,6 +6,7 @@
#include "object2.hpp"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.hpp"
#include <cassert>
diff --git a/src/q_nirna.cc b/src/q_nirna.cc
index 728b8c03..0bfeb453 100644
--- a/src/q_nirna.cc
+++ b/src/q_nirna.cc
@@ -6,6 +6,7 @@
#include "monster2.hpp"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.hpp"
#define cquest (quest[QUEST_NIRNAETH])
diff --git a/src/q_one.cc b/src/q_one.cc
index 3d8738da..514ed0e0 100644
--- a/src/q_one.cc
+++ b/src/q_one.cc
@@ -7,6 +7,7 @@
#include "object2.hpp"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.hpp"
#define cquest (quest[QUEST_ONE])
diff --git a/src/q_poison.cc b/src/q_poison.cc
index 8681bebe..124894c2 100644
--- a/src/q_poison.cc
+++ b/src/q_poison.cc
@@ -8,6 +8,7 @@
#include "hooks.h"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.hpp"
#define cquest (quest[QUEST_POISON])
diff --git a/src/q_rand.cc b/src/q_rand.cc
index 30fa722b..cfb76ff0 100644
--- a/src/q_rand.cc
+++ b/src/q_rand.cc
@@ -13,6 +13,7 @@
#include "skills.hpp"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.hpp"
#include <cassert>
diff --git a/src/q_shroom.cc b/src/q_shroom.cc
index a8385612..c22cbe56 100644
--- a/src/q_shroom.cc
+++ b/src/q_shroom.cc
@@ -7,6 +7,7 @@
#include "object2.hpp"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.hpp"
#include <cassert>
diff --git a/src/q_spider.cc b/src/q_spider.cc
index 382a4a81..e838414d 100644
--- a/src/q_spider.cc
+++ b/src/q_spider.cc
@@ -8,6 +8,7 @@
#include "object2.hpp"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.hpp"
#define cquest (quest[QUEST_SPIDER])
diff --git a/src/q_thief.cc b/src/q_thief.cc
index 76311c99..452c6739 100644
--- a/src/q_thief.cc
+++ b/src/q_thief.cc
@@ -8,6 +8,7 @@
#include "spells2.hpp"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.hpp"
#define cquest (quest[QUEST_THIEVES])
diff --git a/src/q_thrain.cc b/src/q_thrain.cc
index 9505b5f9..8ddf3d1c 100644
--- a/src/q_thrain.cc
+++ b/src/q_thrain.cc
@@ -12,6 +12,7 @@
#include "object2.hpp"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.hpp"
#include <cassert>
diff --git a/src/q_troll.cc b/src/q_troll.cc
index 6dc57ddc..5c4ddaa2 100644
--- a/src/q_troll.cc
+++ b/src/q_troll.cc
@@ -7,6 +7,7 @@
#include "object2.hpp"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.hpp"
#include <cassert>
diff --git a/src/q_ultrag.cc b/src/q_ultrag.cc
index 4138a8da..632c6bc3 100644
--- a/src/q_ultrag.cc
+++ b/src/q_ultrag.cc
@@ -7,6 +7,7 @@
#include "options.hpp"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.hpp"
#define cquest (quest[QUEST_ULTRA_GOOD])
diff --git a/src/q_wight.cc b/src/q_wight.cc
index 7a9117b0..7ac376eb 100644
--- a/src/q_wight.cc
+++ b/src/q_wight.cc
@@ -8,6 +8,7 @@
#include "quark.h"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.hpp"
#include <cassert>
diff --git a/src/q_wolves.cc b/src/q_wolves.cc
index 5ab28fb0..2585a449 100644
--- a/src/q_wolves.cc
+++ b/src/q_wolves.cc
@@ -6,6 +6,7 @@
#include "monster2.hpp"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.hpp"
#define cquest (quest[QUEST_WOLVES])
diff --git a/src/randart.cc b/src/randart.cc
index 42cdb79b..7d88ada6 100644
--- a/src/randart.cc
+++ b/src/randart.cc
@@ -14,6 +14,8 @@
#include "quark.h"
#include "spells2.hpp"
#include "util.hpp"
+#include "variable.h"
+#include "variable.hpp"
#include <memory>
#include <vector>
diff --git a/src/skills.cc b/src/skills.cc
index b67c8cae..c6d609c0 100644
--- a/src/skills.cc
+++ b/src/skills.cc
@@ -26,6 +26,8 @@
#include "traps.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
#include "xtra2.hpp"
#include <algorithm>
diff --git a/src/spells1.cc b/src/spells1.cc
index b7d73aa8..180fdd75 100644
--- a/src/spells1.cc
+++ b/src/spells1.cc
@@ -30,6 +30,7 @@
#include "traps.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.hpp"
#include "wizard2.hpp"
#include "xtra1.hpp"
#include "xtra2.hpp"
diff --git a/src/spells2.cc b/src/spells2.cc
index 01772d68..f128700d 100644
--- a/src/spells2.cc
+++ b/src/spells2.cc
@@ -27,6 +27,8 @@
#include "tables.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
#include "xtra1.hpp"
#include "xtra2.hpp"
diff --git a/src/spells3.cc b/src/spells3.cc
index ebf2091d..16a016bd 100644
--- a/src/spells3.cc
+++ b/src/spells3.cc
@@ -18,6 +18,7 @@
#include "spells5.hpp"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.hpp"
#include "xtra2.hpp"
#include <algorithm>
diff --git a/src/spells4.cc b/src/spells4.cc
index 4d91e5a1..d4aa7a72 100644
--- a/src/spells4.cc
+++ b/src/spells4.cc
@@ -12,6 +12,7 @@
#include "spells6.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.hpp"
#include <algorithm>
#include <cassert>
diff --git a/src/spells5.cc b/src/spells5.cc
index 32de8771..6dcb8f84 100644
--- a/src/spells5.cc
+++ b/src/spells5.cc
@@ -5,6 +5,7 @@
#include "device_allocation.h"
#include "spells3.hpp"
#include "spells4.hpp"
+#include "variable.hpp"
#include <cassert>
diff --git a/src/spells6.cc b/src/spells6.cc
index 2f2b0493..c0adceb3 100644
--- a/src/spells6.cc
+++ b/src/spells6.cc
@@ -7,6 +7,7 @@
#include "skills.hpp"
#include "spell_type.hpp"
#include "spells4.hpp"
+#include "variable.hpp"
#include <cassert>
#include <vector>
diff --git a/src/squelch/condition.cc b/src/squelch/condition.cc
index 44d3e750..786a1b29 100644
--- a/src/squelch/condition.cc
+++ b/src/squelch/condition.cc
@@ -10,6 +10,7 @@
#include "skills.hpp"
#include "quark.h"
#include "util.hpp"
+#include "variable.hpp"
namespace squelch {
diff --git a/src/squelch/object_status.cc b/src/squelch/object_status.cc
index 09882a9e..2d4f07f9 100644
--- a/src/squelch/object_status.cc
+++ b/src/squelch/object_status.cc
@@ -3,6 +3,7 @@
#include "angband.h"
#include "object1.hpp"
+#include "variable.hpp"
namespace squelch {
diff --git a/src/squelch/rule.cc b/src/squelch/rule.cc
index 3db3dae6..a8bcd19e 100644
--- a/src/squelch/rule.cc
+++ b/src/squelch/rule.cc
@@ -11,6 +11,7 @@
#include "../quark.h"
#include "../tables.hpp"
#include "../util.hpp"
+#include "../variable.hpp"
namespace squelch {
diff --git a/src/squeltch.cc b/src/squeltch.cc
index 594cd67c..4b2fd0b7 100644
--- a/src/squeltch.cc
+++ b/src/squeltch.cc
@@ -23,6 +23,8 @@
#include "tome/squelch/automatizer.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
#include <jansson.h>
#include <algorithm>
diff --git a/src/status.cc b/src/status.cc
index 5cd4241c..0c6dfd10 100644
--- a/src/status.cc
+++ b/src/status.cc
@@ -21,6 +21,8 @@
#include "object1.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
#include "xtra1.hpp"
static void row_trival(const char*, s16b, u32b, s16b, u32b, int, u32b[INVEN_TOTAL - INVEN_WIELD + 2][7]);
diff --git a/src/store.cc b/src/store.cc
index 142c59d8..e61e3685 100644
--- a/src/store.cc
+++ b/src/store.cc
@@ -25,6 +25,8 @@
#include "tables.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
#include "xtra1.hpp"
#include <cassert>
diff --git a/src/tables.cc b/src/tables.cc
index a1b2d698..c11bc60d 100644
--- a/src/tables.cc
+++ b/src/tables.cc
@@ -39,7 +39,7 @@
#include "q_one.h"
#include "q_main.h"
#include "q_rand.h"
-
+#include "variable.hpp"
diff --git a/src/traps.cc b/src/traps.cc
index 9b271167..ad20e0aa 100644
--- a/src/traps.cc
+++ b/src/traps.cc
@@ -20,6 +20,7 @@
#include "spells2.hpp"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.hpp"
#include "xtra1.hpp"
#include "xtra2.hpp"
diff --git a/src/util.cc b/src/util.cc
index bb632066..c35eab78 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -14,6 +14,8 @@
#include "quark.h"
#include "tables.h"
#include "tables.hpp"
+#include "variable.h"
+#include "variable.hpp"
#include "xtra1.hpp"
#include <boost/algorithm/string/predicate.hpp>
diff --git a/src/variable.cc b/src/variable.cc
index 3307dbbe..ca7696dd 100644
--- a/src/variable.cc
+++ b/src/variable.cc
@@ -1,7 +1,3 @@
-/* File: variable.c */
-
-/* Purpose: Angband variables */
-
/*
* Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
*
@@ -10,7 +6,8 @@
* included in all such copies.
*/
-#include "angband.h"
+#include "variable.hpp"
+#include "variable.h"
#include "util.hpp"
@@ -953,11 +950,6 @@ bool_ *k_allow_special;
bool_ *a_allow_special;
/*
- * Center view
- */
-bool_ center_player = FALSE;
-
-/*
* Plots
*/
s16b plots[MAX_PLOTS];
diff --git a/src/variable.h b/src/variable.h
new file mode 100644
index 00000000..3687ec90
--- /dev/null
+++ b/src/variable.h
@@ -0,0 +1,42 @@
+#pragma once
+
+#include "angband.h"
+
+// C linkage required for these functions since main-* code uses them.
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern cptr ANGBAND_SYS;
+extern cptr ANGBAND_KEYBOARD;
+extern char *ANGBAND_DIR_MODULES;
+extern char *ANGBAND_DIR_SAVE;
+extern char *ANGBAND_DIR_CORE;
+extern char *ANGBAND_DIR_DNGN;
+extern char *ANGBAND_DIR_DATA;
+extern char *ANGBAND_DIR_EDIT;
+extern char *ANGBAND_DIR_FILE;
+extern char *ANGBAND_DIR_HELP;
+extern char *ANGBAND_DIR_INFO;
+extern char *ANGBAND_DIR_NOTE;
+extern char *ANGBAND_DIR_PREF;
+extern char *ANGBAND_DIR_USER;
+extern char *ANGBAND_DIR_XTRA;
+extern term *angband_term[ANGBAND_TERM_MAX];
+extern char angband_term_name[ANGBAND_TERM_MAX][80];
+extern byte angband_color_table[256][4];
+extern bool_ arg_wizard;
+extern bool_ arg_force_original;
+extern bool_ arg_force_roguelike;
+extern hist_type *bg;
+extern bool_ character_generated;
+extern bool_ character_icky;
+extern bool_ inkey_flag;
+extern bool_ msg_flag;
+extern char player_name[32];
+extern char player_base[32];
+extern char savefile[1024];
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/src/externs.h b/src/variable.hpp
index b2a85aa3..6ba3cea9 100644
--- a/src/externs.h
+++ b/src/variable.hpp
@@ -1,6 +1,6 @@
-/*
- * Automatically generated "variable" declarations
- */
+#pragma once
+
+#include "angband.h"
extern int max_macrotrigger;
extern char *macro_template;
@@ -8,8 +8,6 @@ extern char *macro_modifier_chr;
extern char *macro_modifier_name[MAX_MACRO_MOD];
extern char *macro_trigger_name[MAX_MACRO_TRIG];
extern char *macro_trigger_keycode[2][MAX_MACRO_TRIG];
-
-/* variable.c */
extern byte version_major;
extern byte version_minor;
extern byte version_patch;
@@ -19,13 +17,8 @@ extern byte sf_patch;
extern u32b sf_when;
extern u16b sf_lives;
extern u16b sf_saves;
-extern bool_ arg_wizard;
-extern bool_ arg_force_original;
-extern bool_ arg_force_roguelike;
-extern bool_ character_generated;
extern bool_ character_dungeon;
extern bool_ character_loaded;
-extern bool_ character_icky;
extern bool_ character_xtra;
extern u32b seed_flavor;
extern s16b command_cmd;
@@ -39,7 +32,6 @@ extern bool_ create_up_stair;
extern bool_ create_down_stair;
extern bool_ create_up_shaft;
extern bool_ create_down_shaft;
-extern bool_ msg_flag;
extern bool_ alive;
extern bool_ death;
extern s16b running;
@@ -58,7 +50,6 @@ extern u16b total_winner;
extern u16b has_won;
extern u16b noscore;
extern bool_ inkey_base;
-extern bool_ inkey_flag;
extern s16b coin_type;
extern bool_ opening_chest;
extern bool_ shimmer_monsters;
@@ -110,11 +101,8 @@ extern s16b health_who;
extern s16b monster_race_idx;
extern s16b monster_ego_idx;
extern object_type *tracked_object;
-extern char player_name[32];
-extern char player_base[32];
extern char died_from[80];
extern char history[4][60];
-extern char savefile[1024];
extern s16b lite_n;
extern s16b lite_y[LITE_MAX];
extern s16b lite_x[LITE_MAX];
@@ -133,9 +121,6 @@ extern u32b option_flag[8];
extern u32b option_mask[8];
extern u32b window_flag[ANGBAND_TERM_MAX];
extern u32b window_mask[ANGBAND_TERM_MAX];
-extern term *angband_term[ANGBAND_TERM_MAX];
-extern char angband_term_name[ANGBAND_TERM_MAX][80];
-extern byte angband_color_table[256][4];
extern cave_type **cave;
extern object_type *o_list;
extern monster_type *m_list;
@@ -164,13 +149,9 @@ extern alchemist_recipe *alchemist_recipes;
extern u32b alchemist_known_artifacts[6];
extern u32b alchemist_gained;
extern s16b player_hp[PY_MAX_LEVEL];
-
extern artifact_select_flag *a_select_flags;
-
extern ability_type *ab_info;
-
extern skill_type *s_info;
-
extern vault_type *v_info;
extern feature_type *f_info;
extern object_kind *k_info;
@@ -192,28 +173,11 @@ extern store_info_type *st_info;
extern store_action_type *ba_info;
extern owner_type *ow_info;
extern set_type *set_info;
-
extern cptr DEFAULT_FEAT_TEXT;
extern cptr DEFAULT_FEAT_TUNNEL;
extern cptr DEFAULT_FEAT_BLOCK;
-
-extern cptr ANGBAND_SYS;
-extern cptr ANGBAND_KEYBOARD;
extern cptr ANGBAND_GRAF;
extern char *ANGBAND_DIR;
-extern char *ANGBAND_DIR_MODULES;
-extern char *ANGBAND_DIR_SAVE;
-extern char *ANGBAND_DIR_CORE;
-extern char *ANGBAND_DIR_DNGN;
-extern char *ANGBAND_DIR_DATA;
-extern char *ANGBAND_DIR_EDIT;
-extern char *ANGBAND_DIR_FILE;
-extern char *ANGBAND_DIR_HELP;
-extern char *ANGBAND_DIR_INFO;
-extern char *ANGBAND_DIR_NOTE;
-extern char *ANGBAND_DIR_PREF;
-extern char *ANGBAND_DIR_USER;
-extern char *ANGBAND_DIR_XTRA;
extern bool_ item_tester_full;
extern byte item_tester_tval;
extern bool_ (*item_tester_hook)(object_type *o_ptr);
@@ -270,7 +234,6 @@ extern bool_ special_lvls;
extern bool_ *m_allow_special;
extern bool_ *k_allow_special;
extern bool_ *a_allow_special;
-extern bool_ center_player;
extern s16b plots[MAX_PLOTS];
extern random_quest random_quests[MAX_RANDOM_QUEST];
extern bool_ *special_lvl[MAX_DUNGEON_DEPTH];
@@ -278,7 +241,6 @@ extern bool_ generate_special_feeling;
extern u32b dungeon_flags1;
extern u32b dungeon_flags2;
extern birther previous_char;
-extern hist_type *bg;
extern int max_bg_idx;
extern s16b schools_count;
extern school_type schools[SCHOOLS_MAX];
diff --git a/src/wild.cc b/src/wild.cc
index 307705bc..5ac9f739 100644
--- a/src/wild.cc
+++ b/src/wild.cc
@@ -16,6 +16,7 @@
#include "options.hpp"
#include "tables.hpp"
#include "util.hpp"
+#include "variable.hpp"
#include <memory>
diff --git a/src/wizard1.cc b/src/wizard1.cc
index ad830625..c8477ba1 100644
--- a/src/wizard1.cc
+++ b/src/wizard1.cc
@@ -7,6 +7,8 @@
#include "tables.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
#include <vector>
diff --git a/src/wizard2.cc b/src/wizard2.cc
index 2c499fce..37f31156 100644
--- a/src/wizard2.cc
+++ b/src/wizard2.cc
@@ -25,6 +25,8 @@
#include "traps.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
#include "wizard1.hpp"
#include "xtra1.hpp"
#include "xtra2.hpp"
diff --git a/src/xtra1.cc b/src/xtra1.cc
index f1805c38..c01f9c24 100644
--- a/src/xtra1.cc
+++ b/src/xtra1.cc
@@ -29,6 +29,8 @@
#include "tables.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
#include "xtra2.hpp"
#include <cassert>
diff --git a/src/xtra2.cc b/src/xtra2.cc
index e6deb848..fcd71db3 100644
--- a/src/xtra2.cc
+++ b/src/xtra2.cc
@@ -31,6 +31,8 @@
#include "tables.hpp"
#include "util.hpp"
#include "util.h"
+#include "variable.h"
+#include "variable.hpp"
#include "wizard2.hpp"
#include "xtra1.hpp"