summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2015-02-23 09:11:59 +0100
committerBardur Arantsson <bardur@scientician.net>2015-02-23 09:11:59 +0100
commit63fae54381d0898503c5dc7f4dcfabc125c04807 (patch)
tree00b743f932c4c3fc7feb7c8a4e87be520e47d2e9 /src
parent71a3bdb100d427ceedce7b2c8fe94de6181341d1 (diff)
Move xtra1.cc function declarations to separate header
Make a couple of functions private to the module while we're at it.
Diffstat (limited to 'src')
-rw-r--r--src/birth.cc1
-rw-r--r--src/bldg.cc1
-rw-r--r--src/cmd1.cc1
-rw-r--r--src/cmd2.cc1
-rw-r--r--src/cmd3.cc1
-rw-r--r--src/cmd4.cc1
-rw-r--r--src/cmd5.cc1
-rw-r--r--src/cmd6.cc1
-rw-r--r--src/cmd7.cc1
-rw-r--r--src/dungeon.cc1
-rw-r--r--src/externs.h23
-rw-r--r--src/files.cc1
-rw-r--r--src/melee1.cc1
-rw-r--r--src/mimic.cc5
-rw-r--r--src/monster2.cc1
-rw-r--r--src/object1.cc1
-rw-r--r--src/object2.cc3
-rw-r--r--src/spells1.cc5
-rw-r--r--src/spells2.cc1
-rw-r--r--src/status.cc1
-rw-r--r--src/store.cc1
-rw-r--r--src/traps.cc1
-rw-r--r--src/util.cc1
-rw-r--r--src/wizard2.cc1
-rw-r--r--src/xtra1.cc56
-rw-r--r--src/xtra1.hpp22
-rw-r--r--src/xtra2.cc1
27 files changed, 80 insertions, 55 deletions
diff --git a/src/birth.cc b/src/birth.cc
index 290e76e2..6336e214 100644
--- a/src/birth.cc
+++ b/src/birth.cc
@@ -22,6 +22,7 @@
#include "skills.hpp"
#include "spells3.hpp"
#include "store.hpp"
+#include "xtra1.hpp"
#include <string>
diff --git a/src/bldg.cc b/src/bldg.cc
index 354ff342..737002f3 100644
--- a/src/bldg.cc
+++ b/src/bldg.cc
@@ -20,6 +20,7 @@
#include "q_fireprof.h"
#include "q_bounty.h"
#include "store.hpp"
+#include "xtra1.hpp"
/* hack as in leave_store in store.c */
static bool_ leave_bldg = FALSE;
diff --git a/src/cmd1.cc b/src/cmd1.cc
index 0a7f56f6..cc57f47d 100644
--- a/src/cmd1.cc
+++ b/src/cmd1.cc
@@ -13,6 +13,7 @@
#include "quark.h"
#include "skills.hpp"
#include "spells3.hpp"
+#include "xtra1.hpp"
#define MAX_VAMPIRIC_DRAIN 100
diff --git a/src/cmd2.cc b/src/cmd2.cc
index 8279747a..9c3a014a 100644
--- a/src/cmd2.cc
+++ b/src/cmd2.cc
@@ -11,6 +11,7 @@
#include "hooks.h"
#include "skills.hpp"
#include "spells3.hpp"
+#include "xtra1.hpp"
#include <chrono>
#include <thread>
diff --git a/src/cmd3.cc b/src/cmd3.cc
index 443dbb15..d6b86bec 100644
--- a/src/cmd3.cc
+++ b/src/cmd3.cc
@@ -17,6 +17,7 @@
#include "quark.h"
#include "squeltch.hpp"
#include "store.hpp"
+#include "xtra1.hpp"
#include <cassert>
#include <algorithm>
diff --git a/src/cmd4.cc b/src/cmd4.cc
index ac4c6e11..abc8a35f 100644
--- a/src/cmd4.cc
+++ b/src/cmd4.cc
@@ -13,6 +13,7 @@
#include "notes.hpp"
#include "skills.hpp"
#include "squeltch.hpp"
+#include "xtra1.hpp"
#include <cassert>
#include <memory>
diff --git a/src/cmd5.cc b/src/cmd5.cc
index e2cdbd95..88939a67 100644
--- a/src/cmd5.cc
+++ b/src/cmd5.cc
@@ -12,6 +12,7 @@
#include "spell_type.hpp"
#include "spells5.hpp"
#include "quark.h"
+#include "xtra1.hpp"
#include <cassert>
diff --git a/src/cmd6.cc b/src/cmd6.cc
index 6de4cb4f..496bc2c8 100644
--- a/src/cmd6.cc
+++ b/src/cmd6.cc
@@ -16,6 +16,7 @@
#include "spell_type.hpp"
#include "spells5.hpp"
#include "store.hpp"
+#include "xtra1.hpp"
#include <cassert>
diff --git a/src/cmd7.cc b/src/cmd7.cc
index b78de144..519716d0 100644
--- a/src/cmd7.cc
+++ b/src/cmd7.cc
@@ -16,6 +16,7 @@
#include "mimic.hpp"
#include "quark.h"
#include "skills.hpp"
+#include "xtra1.hpp"
/*
* Describe class powers of Mindcrafters
diff --git a/src/dungeon.cc b/src/dungeon.cc
index 45e6aca0..e8465d21 100644
--- a/src/dungeon.cc
+++ b/src/dungeon.cc
@@ -23,6 +23,7 @@
#include "spells5.hpp"
#include "squeltch.hpp"
#include "store.hpp"
+#include "xtra1.hpp"
#include <cassert>
diff --git a/src/externs.h b/src/externs.h
index aefcddbe..47abbf04 100644
--- a/src/externs.h
+++ b/src/externs.h
@@ -1366,29 +1366,6 @@ extern int get_keymap_mode();
/* main.c */
extern bool_ private_check_user_directory(cptr dirpath);
-/* xtra1.c */
-extern void fix_message(void);
-extern void apply_flags(u32b f1, u32b f2, u32b f3, u32b f4, u32b f5, u32b esp, s16b pval, s16b tval, s16b to_h, s16b to_d, s16b to_a);
-extern int luck(int min, int max);
-extern int weight_limit(void);
-extern bool_ calc_powers_silent;
-extern void cnv_stat(int i, char *out_val);
-extern s16b modify_stat_value(int value, int amount);
-extern void calc_hitpoints(void);
-extern void notice_stuff(void);
-extern void update_stuff(void);
-extern void redraw_stuff(void);
-extern void window_stuff(void);
-extern void handle_stuff(void);
-extern bool_ monk_empty_hands(void);
-extern bool_ monk_heavy_armor(void);
-extern bool_ beastmaster_whip(void);
-extern void calc_bonuses(bool_ silent);
-extern void calc_sanity(void);
-extern void gain_fate(byte fate);
-extern void fate_desc(char *desc, int fate);
-extern void dump_fates(FILE *OutFile);
-
/* xtra2.c */
extern void do_rebirth(void);
extern void set_subrace_title(player_race_mod *rmp_ptr, cptr name);
diff --git a/src/files.cc b/src/files.cc
index be002830..304b5796 100644
--- a/src/files.cc
+++ b/src/files.cc
@@ -13,6 +13,7 @@
#include "mimic.hpp"
#include "notes.hpp"
#include "skills.hpp"
+#include "xtra1.hpp"
#include <memory>
#include <unordered_set>
diff --git a/src/melee1.cc b/src/melee1.cc
index e25c44c5..a506eb1a 100644
--- a/src/melee1.cc
+++ b/src/melee1.cc
@@ -14,6 +14,7 @@
#include "mimic.hpp"
#include "skills.hpp"
#include "store.hpp"
+#include "xtra1.hpp"
#include <boost/algorithm/string/predicate.hpp>
diff --git a/src/mimic.cc b/src/mimic.cc
index 873ff55a..a55878e5 100644
--- a/src/mimic.cc
+++ b/src/mimic.cc
@@ -1,5 +1,8 @@
#include "mimic.hpp"
-#include <assert.h>
+
+#include "xtra1.hpp"
+
+#include <cassert>
/**
* Mimicry forms
diff --git a/src/monster2.cc b/src/monster2.cc
index b5f92b4a..4c129de9 100644
--- a/src/monster2.cc
+++ b/src/monster2.cc
@@ -14,6 +14,7 @@
#include "hooks.h"
#include "mimic.hpp"
#include "randart.hpp"
+#include "xtra1.hpp"
#include <algorithm>
#include <string>
diff --git a/src/object1.cc b/src/object1.cc
index 90917459..fec6f1b2 100644
--- a/src/object1.cc
+++ b/src/object1.cc
@@ -19,6 +19,7 @@
#include "spell_type.hpp"
#include "spells5.hpp"
#include "squeltch.hpp"
+#include "xtra1.hpp"
#include <cassert>
diff --git a/src/object2.cc b/src/object2.cc
index 4dad14ad..9c08ce93 100644
--- a/src/object2.cc
+++ b/src/object2.cc
@@ -14,11 +14,12 @@
#include "spell_type.hpp"
#include "device_allocation.h"
#include "hooks.h"
+#include "mimic.hpp"
#include "randart.hpp"
#include "skills.hpp"
#include "spells3.hpp"
#include "spells5.hpp"
-#include "mimic.hpp"
+#include "xtra1.hpp"
#include <cassert>
#include <vector>
diff --git a/src/spells1.cc b/src/spells1.cc
index 995c42c5..f0838324 100644
--- a/src/spells1.cc
+++ b/src/spells1.cc
@@ -1,7 +1,3 @@
-/* File: spells1.c */
-
-/* Purpose: Spell code (part 1) */
-
/*
* Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
*
@@ -16,6 +12,7 @@
#include "spell_type.hpp"
#include "spells5.hpp"
#include "squeltch.hpp"
+#include "xtra1.hpp"
#include <chrono>
#include <thread>
diff --git a/src/spells2.cc b/src/spells2.cc
index 241e3c1a..844fd7ec 100644
--- a/src/spells2.cc
+++ b/src/spells2.cc
@@ -11,6 +11,7 @@
#include "notes.hpp"
#include "skills.hpp"
#include "spells3.hpp"
+#include "xtra1.hpp"
#include <cassert>
#include <chrono>
diff --git a/src/status.cc b/src/status.cc
index c5bbf5be..8c21907b 100644
--- a/src/status.cc
+++ b/src/status.cc
@@ -16,6 +16,7 @@
*/
#include "angband.h"
+#include "xtra1.hpp"
static void row_trival(const char*, s16b, u32b, s16b, u32b, int, u32b[INVEN_TOTAL - INVEN_WIELD + 2][7]);
static void row_bival(const char*, s16b, u32b, int, u32b[INVEN_TOTAL - INVEN_WIELD + 2][7]);
diff --git a/src/store.cc b/src/store.cc
index 5b9758b7..4260112d 100644
--- a/src/store.cc
+++ b/src/store.cc
@@ -16,6 +16,7 @@
#include "hooks.h"
#include "skills.hpp"
#include "spells5.hpp"
+#include "xtra1.hpp"
#include <cassert>
diff --git a/src/traps.cc b/src/traps.cc
index 5540576d..0b423ec6 100644
--- a/src/traps.cc
+++ b/src/traps.cc
@@ -9,6 +9,7 @@
#include "angband.h"
#include "gods.hpp"
+#include "xtra1.hpp"
bool_ do_player_trap_call_out(void)
{
diff --git a/src/util.cc b/src/util.cc
index bceb8822..4191bc4c 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -6,6 +6,7 @@
#include "angband.h"
#include "messages.h"
#include "quark.h"
+#include "xtra1.hpp"
#include <boost/algorithm/string/predicate.hpp>
#include <chrono>
diff --git a/src/wizard2.cc b/src/wizard2.cc
index 4559307b..1278ac8c 100644
--- a/src/wizard2.cc
+++ b/src/wizard2.cc
@@ -15,6 +15,7 @@
#include "hooks.h"
#include "randart.hpp"
#include "status.hpp"
+#include "xtra1.hpp"
/*
* Adds a lvl to a monster
diff --git a/src/xtra1.cc b/src/xtra1.cc
index b7998369..daf19bc0 100644
--- a/src/xtra1.cc
+++ b/src/xtra1.cc
@@ -1,7 +1,3 @@
-/* File: misc.c */
-
-/* Purpose: misc code */
-
/*
* Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
*
@@ -10,6 +6,8 @@
* included in all such copies.
*/
+#include "xtra1.hpp"
+
#include "angband.h"
#include "corrupt.hpp"
#include "gods.hpp"
@@ -1573,8 +1571,7 @@ static void calc_powers(void)
/*
* Calculate the player's sanity
*/
-
-void calc_sanity(void)
+static void calc_sanity()
{
int bonus, msane;
@@ -2719,6 +2716,33 @@ void apply_flags(u32b f1, u32b f2, u32b f3, u32b f4, u32b f5, u32b esp, s16b pva
}
}
+
+
+/**
+ * Are barehand fighter's hands empty?
+ */
+static bool_ monk_empty_hands(void)
+{
+ int i;
+ object_type *o_ptr;
+
+ if (p_ptr->melee_style != SKILL_HAND) return FALSE;
+
+ i = 0;
+ while (p_ptr->body_parts[i] == INVEN_WIELD)
+ {
+ o_ptr = &p_ptr->inventory[INVEN_WIELD + i];
+
+ if (o_ptr->k_idx) return FALSE;
+
+ i++;
+ }
+
+ return TRUE;
+}
+
+
+
/*
* Calculate the players current "state", taking into account
* not only race/class intrinsics, but also objects being worn
@@ -4310,26 +4334,6 @@ void handle_stuff(void)
}
-bool_ monk_empty_hands(void)
-{
- int i;
- object_type *o_ptr;
-
- if (p_ptr->melee_style != SKILL_HAND) return FALSE;
-
- i = 0;
- while (p_ptr->body_parts[i] == INVEN_WIELD)
- {
- o_ptr = &p_ptr->inventory[INVEN_WIELD + i];
-
- if (o_ptr->k_idx) return FALSE;
-
- i++;
- }
-
- return TRUE;
-}
-
bool_ monk_heavy_armor(void)
{
u16b monk_arm_wgt = 0;
diff --git a/src/xtra1.hpp b/src/xtra1.hpp
new file mode 100644
index 00000000..f5d193ff
--- /dev/null
+++ b/src/xtra1.hpp
@@ -0,0 +1,22 @@
+#pragma once
+
+#include "angband.h"
+
+extern void fix_message(void);
+extern void apply_flags(u32b f1, u32b f2, u32b f3, u32b f4, u32b f5, u32b esp, s16b pval, s16b tval, s16b to_h, s16b to_d, s16b to_a);
+extern int luck(int min, int max);
+extern int weight_limit(void);
+extern bool_ calc_powers_silent;
+extern void cnv_stat(int i, char *out_val);
+extern s16b modify_stat_value(int value, int amount);
+extern void calc_hitpoints(void);
+extern void notice_stuff(void);
+extern void update_stuff(void);
+extern void redraw_stuff(void);
+extern void window_stuff(void);
+extern void handle_stuff(void);
+extern bool_ monk_heavy_armor(void);
+extern void calc_bonuses(bool_ silent);
+extern void gain_fate(byte fate);
+extern void fate_desc(char *desc, int fate);
+extern void dump_fates(FILE *OutFile);
diff --git a/src/xtra2.cc b/src/xtra2.cc
index cba66982..41888186 100644
--- a/src/xtra2.cc
+++ b/src/xtra2.cc
@@ -20,6 +20,7 @@
#include "quark.h"
#include "randart.hpp"
#include "skills.hpp"
+#include "xtra1.hpp"
#include <type_traits>
#include <cassert>