diff options
author | Bardur Arantsson <bardur@scientician.net> | 2013-03-24 19:30:32 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2013-09-27 14:46:41 +0200 |
commit | a9c3fa61b870baab20e4ef2f8a2eaa071f8abb56 (patch) | |
tree | 8b32d45c27b9d5ccab2809ad8829ec5a9be4a95e /src | |
parent | 410376a132361a76e79c2c079e2e0ab6650fec71 (diff) |
Split the main quests from plots.c
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/plots.c | 14 | ||||
-rw-r--r-- | src/plots.h | 5 | ||||
-rw-r--r-- | src/q_main.c | 12 | ||||
-rw-r--r-- | src/q_main.h | 15 | ||||
-rw-r--r-- | src/tables.c | 1 |
6 files changed, 29 insertions, 20 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3e08f7ec..0213a49a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -15,7 +15,7 @@ SET(SRCS q_nirna.c q_eol.c q_god.c q_dragons.c q_poison.c q_spider.c q_wolves.c q_shroom.c q_nazgul.c q_wight.c q_troll.c q_hobbit.c q_thief.c q_ultrae.c q_ultrag.c - q_one.c + q_one.c q_main.c object1.c object2.c randart.c squeltch.cc traps.c monster1.c monster2.c monster3.c xtra1.c xtra2.c skills.c powers.c gods.c diff --git a/src/plots.c b/src/plots.c index ff6610d0..c8fb2506 100644 --- a/src/plots.c +++ b/src/plots.c @@ -343,16 +343,6 @@ bool_ process_hooks_new(int h_idx, void *in, void *out) /******** Plots & Quest stuff ********/ -static void quest_describe(int q_idx) -{ - int i = 0; - - while ((i < 10) && (quest[q_idx].desc[i][0] != '\0')) - { - cmsg_print(TERM_YELLOW, quest[q_idx].desc[i++]); - } -} - /* Catch-all quest hook */ bool_ quest_null_hook(int q) { @@ -362,7 +352,3 @@ bool_ quest_null_hook(int q) /************************** Random Quests *************************/ #include "q_rand.c" - -/**************************** Main plot ***************************/ -#include "q_main.c" - diff --git a/src/plots.h b/src/plots.h index 8143f455..1269df2d 100644 --- a/src/plots.h +++ b/src/plots.h @@ -8,8 +8,3 @@ extern bool_ quest_null_hook(int q); extern bool_ is_randhero(int level); extern bool_ quest_random_init_hook(int q_idx); extern bool_ quest_random_describe(FILE *fff); - -/******* Plot main ********/ -extern bool_ quest_necro_init_hook(int q_idx); -extern bool_ quest_sauron_init_hook(int q_idx); -extern bool_ quest_morgoth_init_hook(int q_idx); diff --git a/src/q_main.c b/src/q_main.c index a13b0790..4eef2298 100644 --- a/src/q_main.c +++ b/src/q_main.c @@ -1,3 +1,15 @@ +#include "q_main.h" + +static void quest_describe(int q_idx) +{ + int i = 0; + + while ((i < 10) && (quest[q_idx].desc[i][0] != '\0')) + { + cmsg_print(TERM_YELLOW, quest[q_idx].desc[i++]); + } +} + bool_ quest_main_monsters_hook(char *fmt) { s32b r_idx; diff --git a/src/q_main.h b/src/q_main.h new file mode 100644 index 00000000..618a2386 --- /dev/null +++ b/src/q_main.h @@ -0,0 +1,15 @@ +#pragma once + +#include "angband.h" + +#ifdef __cplusplus +extern "C" { +#endif + +bool_ quest_necro_init_hook(int q_idx); +bool_ quest_sauron_init_hook(int q_idx); +bool_ quest_morgoth_init_hook(int q_idx); + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/src/tables.c b/src/tables.c index 937ba05d..d6fb29a9 100644 --- a/src/tables.c +++ b/src/tables.c @@ -36,6 +36,7 @@ #include "q_ultrae.h" #include "q_ultrag.h" #include "q_one.h" +#include "q_main.h" |