summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-06-26 21:59:27 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-06-26 22:28:22 -0700
commit2f4fc005937e75d931eb6ef87a3fe16364d45113 (patch)
tree2a60ea7b58e9a3045ec0e0754e075ae958e46409 /src/map
parentf5fcb973cfad6221264a2a859f5236c3cef2c470 (diff)
downloadtmwa-2f4fc005937e75d931eb6ef87a3fe16364d45113.tar.gz
tmwa-2f4fc005937e75d931eb6ef87a3fe16364d45113.tar.bz2
tmwa-2f4fc005937e75d931eb6ef87a3fe16364d45113.tar.xz
tmwa-2f4fc005937e75d931eb6ef87a3fe16364d45113.zip
Stick everything in a namespace
Diffstat (limited to 'src/map')
-rw-r--r--src/map/atcommand.cpp3
-rw-r--r--src/map/atcommand.hpp4
-rw-r--r--src/map/battle.cpp3
-rw-r--r--src/map/battle.hpp4
-rw-r--r--src/map/battle.t.hpp4
-rw-r--r--src/map/chrif.cpp3
-rw-r--r--src/map/chrif.hpp4
-rw-r--r--src/map/clif.cpp4
-rw-r--r--src/map/clif.hpp4
-rw-r--r--src/map/clif.t.hpp3
-rw-r--r--src/map/fwd.hpp4
-rw-r--r--src/map/grfio.cpp4
-rw-r--r--src/map/grfio.hpp4
-rw-r--r--src/map/intif.cpp3
-rw-r--r--src/map/intif.hpp4
-rw-r--r--src/map/itemdb.cpp4
-rw-r--r--src/map/itemdb.hpp4
-rw-r--r--src/map/magic-expr-eval.cpp5
-rw-r--r--src/map/magic-expr-eval.hpp4
-rw-r--r--src/map/magic-expr.cpp4
-rw-r--r--src/map/magic-expr.hpp4
-rw-r--r--src/map/magic-interpreter-base.cpp4
-rw-r--r--src/map/magic-interpreter-base.hpp4
-rw-r--r--src/map/magic-interpreter.cpp5
-rw-r--r--src/map/magic-interpreter.hpp4
-rw-r--r--src/map/magic-interpreter.py14
-rw-r--r--src/map/magic-interpreter.t.hpp4
-rw-r--r--src/map/magic-stmt.cpp4
-rw-r--r--src/map/magic-stmt.hpp4
-rw-r--r--src/map/magic-v2.cpp4
-rw-r--r--src/map/magic-v2.hpp4
-rw-r--r--src/map/magic.cpp4
-rw-r--r--src/map/magic.hpp4
-rw-r--r--src/map/main.cpp5
-rw-r--r--src/map/map.cpp4
-rw-r--r--src/map/map.hpp4
-rw-r--r--src/map/map.t.hpp4
-rw-r--r--src/map/mapflag.cpp4
-rw-r--r--src/map/mapflag.hpp4
-rw-r--r--src/map/mapflag.py2
-rw-r--r--src/map/mob.cpp4
-rw-r--r--src/map/mob.hpp4
-rw-r--r--src/map/mob.t.hpp4
-rw-r--r--src/map/npc.cpp4
-rw-r--r--src/map/npc.hpp4
-rw-r--r--src/map/party.cpp4
-rw-r--r--src/map/party.hpp4
-rw-r--r--src/map/path.cpp4
-rw-r--r--src/map/path.hpp4
-rw-r--r--src/map/pc.cpp4
-rw-r--r--src/map/pc.hpp4
-rw-r--r--src/map/pc.t.hpp4
-rw-r--r--src/map/script.cpp4
-rw-r--r--src/map/script.hpp4
-rw-r--r--src/map/script.py4
-rw-r--r--src/map/skill-pools.cpp4
-rw-r--r--src/map/skill-pools.hpp5
-rw-r--r--src/map/skill.cpp4
-rw-r--r--src/map/skill.hpp5
-rw-r--r--src/map/skill.t.hpp4
-rw-r--r--src/map/storage.cpp4
-rw-r--r--src/map/storage.hpp4
-rw-r--r--src/map/tmw.cpp4
-rw-r--r--src/map/tmw.hpp4
-rw-r--r--src/map/trade.cpp4
-rw-r--r--src/map/trade.hpp4
66 files changed, 262 insertions, 10 deletions
diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp
index 1b857f4..e6e321d 100644
--- a/src/map/atcommand.cpp
+++ b/src/map/atcommand.cpp
@@ -72,6 +72,8 @@
#include "../poison.hpp"
+namespace tmwa
+{
enum class ATCE
{
OKAY,
@@ -5345,3 +5347,4 @@ Map<XString, AtCommandInfo> atcommand_info =
0, atcommand_source,
"Legal information about source code (must be a level 0 command!)"_s}},
};
+} // namespace tmwa
diff --git a/src/map/atcommand.hpp b/src/map/atcommand.hpp
index a2aaf5b..16b17a3 100644
--- a/src/map/atcommand.hpp
+++ b/src/map/atcommand.hpp
@@ -31,6 +31,9 @@
# include "../mmo/fwd.hpp"
+
+namespace tmwa
+{
bool is_atcommand(Session *s, dumb_ptr<map_session_data> sd,
ZString message, GmLevel gmlvl);
@@ -42,5 +45,6 @@ void log_atcommand(dumb_ptr<map_session_data> sd, ZString cmd);
extern AString gm_log;
void atcommand_config_write(ZString cfgName);
+} // namespace tmwa
#endif // TMWA_MAP_ATCOMMAND_HPP
diff --git a/src/map/battle.cpp b/src/map/battle.cpp
index 95826bb..5219675 100644
--- a/src/map/battle.cpp
+++ b/src/map/battle.cpp
@@ -47,6 +47,8 @@
#include "../poison.hpp"
+namespace tmwa
+{
static Battle_Config init_battle_config();
#pragma GCC diagnostic push
@@ -2683,3 +2685,4 @@ void battle_config_check()
battle_config.mask_ip_gms = 1;
}
}
+} // namespace tmwa
diff --git a/src/map/battle.hpp b/src/map/battle.hpp
index 5bf7dde..c5e7d95 100644
--- a/src/map/battle.hpp
+++ b/src/map/battle.hpp
@@ -35,6 +35,9 @@
# include "map.t.hpp"
# include "skill.t.hpp"
+
+namespace tmwa
+{
// ダメージ
struct Damage
{
@@ -223,5 +226,6 @@ extern struct Battle_Config
bool battle_config_read(ZString cfgName);
void battle_config_check();
+} // namespace tmwa
#endif // TMWA_MAP_BATTLE_HPP
diff --git a/src/map/battle.t.hpp b/src/map/battle.t.hpp
index 09e2512..fad357d 100644
--- a/src/map/battle.t.hpp
+++ b/src/map/battle.t.hpp
@@ -27,6 +27,9 @@
# include "../generic/enum.hpp"
+
+namespace tmwa
+{
namespace e
{
enum class BF : uint16_t
@@ -239,5 +242,6 @@ earray<Races, Race, Race::COUNT> race_shift //=
Races::boss,
Races::other,
}};
+} // namespace tmwa
#endif // TMWA_MAP_BATTLE_T_HPP
diff --git a/src/map/chrif.cpp b/src/map/chrif.cpp
index 18482f6..7c47ea7 100644
--- a/src/map/chrif.cpp
+++ b/src/map/chrif.cpp
@@ -51,6 +51,8 @@
#include "../poison.hpp"
+namespace tmwa
+{
Session *char_session;
static
IP4Address char_ip;
@@ -1329,3 +1331,4 @@ void do_init_chrif(void)
std::chrono::seconds(5)
).detach();
}
+} // namespace tmwa
diff --git a/src/map/chrif.hpp b/src/map/chrif.hpp
index 321b3bd..27c1b50 100644
--- a/src/map/chrif.hpp
+++ b/src/map/chrif.hpp
@@ -31,6 +31,9 @@
# include "../mmo/fwd.hpp"
+
+namespace tmwa
+{
void chrif_setuserid(AccountName);
void chrif_setpasswd(AccountPass);
AccountPass chrif_getpasswd(void);
@@ -61,5 +64,6 @@ void do_init_chrif(void);
// only used by intif.cpp
// and clif.cpp for the new on_delete stuff ...
extern Session *char_session;
+} // namespace tmwa
#endif // TMWA_MAP_CHRIF_HPP
diff --git a/src/map/clif.cpp b/src/map/clif.cpp
index addfa59..a8a57e6 100644
--- a/src/map/clif.cpp
+++ b/src/map/clif.cpp
@@ -69,6 +69,9 @@
#include "../poison.hpp"
+
+namespace tmwa
+{
constexpr int EMOTE_IGNORED = 0x0e;
// functions list. Rate is how many milliseconds are required between
@@ -5679,3 +5682,4 @@ void do_init_clif(void)
{
make_listen_port(map_port, SessionParsers{.func_parse= clif_parse, .func_delete= clif_delete});
}
+} // namespace tmwa
diff --git a/src/map/clif.hpp b/src/map/clif.hpp
index 0087d78..bf208b8 100644
--- a/src/map/clif.hpp
+++ b/src/map/clif.hpp
@@ -41,6 +41,9 @@
# include "pc.t.hpp"
# include "skill.t.hpp"
+
+namespace tmwa
+{
void clif_setip(IP4Address);
void clif_setport(int);
@@ -187,5 +190,6 @@ int clif_GM_kick(dumb_ptr<map_session_data> sd, dumb_ptr<map_session_data> tsd,
int clif_foreachclient(std::function<void(dumb_ptr<map_session_data>)>);
void do_init_clif(void);
+} // namespace tmwa
#endif // TMWA_MAP_CLIF_HPP
diff --git a/src/map/clif.t.hpp b/src/map/clif.t.hpp
index 0a3737a..9d5df79 100644
--- a/src/map/clif.t.hpp
+++ b/src/map/clif.t.hpp
@@ -35,6 +35,8 @@
# include "../mmo/enums.hpp"
+namespace tmwa
+{
namespace e
{
// [Fate] status.option properties. These are persistent status changes.
@@ -713,5 +715,6 @@ bool network_to_native(SOff1 *native, Little16 network)
{
return network_to_native(&native->index, network);
}
+} // namespace tmwa
#endif // TMWA_MAP_CLIF_T_HPP
diff --git a/src/map/fwd.hpp b/src/map/fwd.hpp
index 13d5f54..d58637e 100644
--- a/src/map/fwd.hpp
+++ b/src/map/fwd.hpp
@@ -21,6 +21,9 @@
# include "../sanity.hpp"
+
+namespace tmwa
+{
// meh, add more when I feel like it
class BlockId;
struct block_list;
@@ -52,5 +55,6 @@ struct env_t;
struct magic_conf_t;
struct component_t;
struct effect_set_t;
+} // namespace tmwa
#endif // TMWA_MAP_FWD_HPP
diff --git a/src/map/grfio.cpp b/src/map/grfio.cpp
index c5ca9a1..4a1656b 100644
--- a/src/map/grfio.cpp
+++ b/src/map/grfio.cpp
@@ -40,6 +40,9 @@
#include "../poison.hpp"
+
+namespace tmwa
+{
static
std::map<MapName, RString> resnametable;
@@ -103,3 +106,4 @@ std::vector<uint8_t> grfio_reads(MapName rname)
close(fd);
return buffer;
}
+} // namespace tmwa
diff --git a/src/map/grfio.hpp b/src/map/grfio.hpp
index d9329d3..002d475 100644
--- a/src/map/grfio.hpp
+++ b/src/map/grfio.hpp
@@ -31,11 +31,15 @@
# include "../mmo/fwd.hpp"
+
+namespace tmwa
+{
bool load_resnametable(ZString filename);
/// Load a resource into memory, subject to data/resnametable.txt.
/// Normally, resourcename is xxx-y.gat and the file is xxx-y.wlk.
/// Currently there is exactly one .wlk per .gat, but multiples are fine.
std::vector<uint8_t> grfio_reads(MapName resourcename);
+} // namespace tmwa
#endif // TMWA_MAP_GRFIO_HPP
diff --git a/src/map/intif.cpp b/src/map/intif.cpp
index 4dbd5f7..314db24 100644
--- a/src/map/intif.cpp
+++ b/src/map/intif.cpp
@@ -47,6 +47,8 @@
#include "../poison.hpp"
+namespace tmwa
+{
//-----------------------------------------------------------------
// inter serverへの送信
@@ -695,3 +697,4 @@ RecvResult intif_parse(Session *s, uint16_t packet_id)
}
return rv;
}
+} // namespace tmwa
diff --git a/src/map/intif.hpp b/src/map/intif.hpp
index 44bd8eb..0e23a94 100644
--- a/src/map/intif.hpp
+++ b/src/map/intif.hpp
@@ -31,6 +31,9 @@
# include "../mmo/fwd.hpp"
+
+namespace tmwa
+{
RecvResult intif_parse(Session *, uint16_t packet_id);
void intif_GMmessage(XString mes);
@@ -53,5 +56,6 @@ void intif_party_leave(PartyId party_id, AccountId accound_id);
void intif_party_changemap(dumb_ptr<map_session_data> sd, int online);
void intif_party_message(PartyId party_id, AccountId account_id, XString mes);
void intif_party_checkconflict(PartyId party_id, AccountId account_id, CharName nick);
+} // namespace tmwa
#endif // TMWA_MAP_INTIF_HPP
diff --git a/src/map/itemdb.cpp b/src/map/itemdb.cpp
index 67b6d21..edc9982 100644
--- a/src/map/itemdb.cpp
+++ b/src/map/itemdb.cpp
@@ -36,6 +36,9 @@
#include "../poison.hpp"
+
+namespace tmwa
+{
static
Map<ItemNameId, struct item_data> item_db;
@@ -261,3 +264,4 @@ void do_final_itemdb(void)
itemdb_final(&pair.second);
item_db.clear();
}
+} // namespace tmwa
diff --git a/src/map/itemdb.hpp b/src/map/itemdb.hpp
index 1d132ad..a6d4104 100644
--- a/src/map/itemdb.hpp
+++ b/src/map/itemdb.hpp
@@ -29,6 +29,9 @@
# include "map.t.hpp"
# include "script.hpp"
+
+namespace tmwa
+{
struct item_data
{
ItemNameId nameid;
@@ -102,5 +105,6 @@ void itemdb_reload(void);
void do_final_itemdb(void);
bool itemdb_readdb(ZString filename);
+} // namespace tmwa
#endif // TMWA_MAP_ITEMDB_HPP
diff --git a/src/map/magic-expr-eval.cpp b/src/map/magic-expr-eval.cpp
index 36b69f5..0283b8d 100644
--- a/src/map/magic-expr-eval.cpp
+++ b/src/map/magic-expr-eval.cpp
@@ -19,3 +19,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "../poison.hpp"
+
+
+namespace tmwa
+{
+} // namespace tmwa
diff --git a/src/map/magic-expr-eval.hpp b/src/map/magic-expr-eval.hpp
index 8500fc0..82cde5c 100644
--- a/src/map/magic-expr-eval.hpp
+++ b/src/map/magic-expr-eval.hpp
@@ -26,6 +26,9 @@
# include "magic-interpreter.t.hpp"
+
+namespace tmwa
+{
// TODO kill this like I killed VAR
# define ARGINT(x) args[x].v.v_int
# define ARGDIR(x) args[x].v.v_dir
@@ -53,5 +56,6 @@
# define ARGMOB(x) (ARGENTITY(x)->is_mob())
# define ARG_MAY_BE_AREA(x) (ARG_TYPE(x) == TYPE::AREA || ARG_TYPE(x) == TYPE::LOCATION)
+} // namespace tmwa
#endif // TMWA_MAP_MAGIC_EXPR_EVAL_HPP
diff --git a/src/map/magic-expr.cpp b/src/map/magic-expr.cpp
index d54bbee..dfb65c5 100644
--- a/src/map/magic-expr.cpp
+++ b/src/map/magic-expr.cpp
@@ -44,6 +44,9 @@
#include "../poison.hpp"
+
+namespace tmwa
+{
template<class T>
bool CHECK_TYPE(T *v, TYPE t)
{
@@ -1768,3 +1771,4 @@ dumb_ptr<expr_t> magic_new_expr(EXPR ty)
expr->ty = ty;
return expr;
}
+} // namespace tmwa
diff --git a/src/map/magic-expr.hpp b/src/map/magic-expr.hpp
index c3e994b..4bf43e8 100644
--- a/src/map/magic-expr.hpp
+++ b/src/map/magic-expr.hpp
@@ -33,6 +33,9 @@
# include "magic-interpreter.t.hpp"
+
+namespace tmwa
+{
/*
* Argument types:
* i : int
@@ -104,5 +107,6 @@ int magic_signature_check(ZString opname, ZString funname, ZString signature,
void magic_area_rect(map_local **m, int *x, int *y, int *width, int *height,
area_t& area);
+} // namespace tmwa
#endif // TMWA_MAP_MAGIC_EXPR_HPP
diff --git a/src/map/magic-interpreter-base.cpp b/src/map/magic-interpreter-base.cpp
index cf14ae0..fa53c51 100644
--- a/src/map/magic-interpreter-base.cpp
+++ b/src/map/magic-interpreter-base.cpp
@@ -35,6 +35,9 @@
#include "../poison.hpp"
+
+namespace tmwa
+{
static
void set_int_p(val_t *v, int i, TYPE t)
{
@@ -555,3 +558,4 @@ int spell_unbind(dumb_ptr<map_session_data> subject, dumb_ptr<invocation> invoca
return 1;
}
+} // namespace tmwa
diff --git a/src/map/magic-interpreter-base.hpp b/src/map/magic-interpreter-base.hpp
index d569434..2f10e72 100644
--- a/src/map/magic-interpreter-base.hpp
+++ b/src/map/magic-interpreter-base.hpp
@@ -28,6 +28,9 @@
# include "../mmo/fwd.hpp"
+
+namespace tmwa
+{
extern magic_conf_t magic_conf; /* Global magic conf */
extern env_t magic_default_env; /* Fake default environment */
@@ -82,5 +85,6 @@ dumb_ptr<invocation> spell_clone_effect(dumb_ptr<invocation> source);
dumb_ptr<spell_t> magic_find_spell(XString invocation);
void spell_update_location(dumb_ptr<invocation> invocation);
+} // namespace tmwa
#endif // TMWA_MAP_MAGIC_INTERPRETER_BASE_HPP
diff --git a/src/map/magic-interpreter.cpp b/src/map/magic-interpreter.cpp
index cca5500..87ac23e 100644
--- a/src/map/magic-interpreter.cpp
+++ b/src/map/magic-interpreter.cpp
@@ -19,3 +19,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "../poison.hpp"
+
+
+namespace tmwa
+{
+} // namespace tmwa
diff --git a/src/map/magic-interpreter.hpp b/src/map/magic-interpreter.hpp
index d8a8d9c..9b6025c 100644
--- a/src/map/magic-interpreter.hpp
+++ b/src/map/magic-interpreter.hpp
@@ -42,6 +42,9 @@
# include "script.hpp"
# include "skill.t.hpp"
+
+namespace tmwa
+{
struct location_t
{
map_local *m;
@@ -424,5 +427,6 @@ struct proc_t
, body()
{}
};
+} // namespace tmwa
#endif // TMWA_MAP_MAGIC_INTERPRETER_HPP
diff --git a/src/map/magic-interpreter.py b/src/map/magic-interpreter.py
index 8170f27..f6fa4c9 100644
--- a/src/map/magic-interpreter.py
+++ b/src/map/magic-interpreter.py
@@ -2,7 +2,7 @@ class area_t(object):
''' print an area_t
'''
__slots__ = ('_value')
- name = 'area_t'
+ name = 'tmwa::area_t'
enabled = True
def __init__(self, value):
@@ -31,7 +31,7 @@ class val_t(object):
''' print a val_t
'''
__slots__ = ('_value')
- name = 'val_t'
+ name = 'tmwa::val_t'
enabled = True
def __init__(self, value):
@@ -69,7 +69,7 @@ class e_area_t(object):
''' print an e_area_t
'''
__slots__ = ('_value')
- name = 'e_area_t'
+ name = 'tmwa::e_area_t'
enabled = True
def __init__(self, value):
@@ -97,7 +97,7 @@ class expr_t(object):
''' print an expr_t
'''
__slots__ = ('_value')
- name = 'expr_t'
+ name = 'tmwa::expr_t'
enabled = True
def __init__(self, value):
@@ -129,7 +129,7 @@ class effect_t(object):
''' print an effect_t
'''
__slots__ = ('_value')
- name = 'effect_t'
+ name = 'tmwa::effect_t'
enabled = True
def __init__(self, value):
@@ -166,7 +166,7 @@ class spellguard_t(object):
''' print a spellguard_t
'''
__slots__ = ('_value')
- name = 'spellguard_t'
+ name = 'tmwa::spellguard_t'
enabled = True
def __init__(self, value):
@@ -201,7 +201,7 @@ class cont_activation_record_t(object):
''' print a cont_activation_record_t
'''
__slots__ = ('_value')
- name = 'cont_activation_record_t'
+ name = 'tmwa::cont_activation_record_t'
enabled = True
def __init__(self, value):
diff --git a/src/map/magic-interpreter.t.hpp b/src/map/magic-interpreter.t.hpp
index 780d011..addaf18 100644
--- a/src/map/magic-interpreter.t.hpp
+++ b/src/map/magic-interpreter.t.hpp
@@ -24,6 +24,9 @@
# include "../generic/enum.hpp"
+
+namespace tmwa
+{
enum class SPELLARG : uint8_t
{
NONE,
@@ -144,5 +147,6 @@ enum class INVOCATION_FLAG : uint8_t
ENUM_BITWISE_OPERATORS(INVOCATION_FLAG)
}
using e::INVOCATION_FLAG;
+} // namespace tmwa
#endif // TMWA_MAP_MAGIC_INTERPRETER_T_HPP
diff --git a/src/map/magic-stmt.cpp b/src/map/magic-stmt.cpp
index 2fbe556..57fbe66 100644
--- a/src/map/magic-stmt.cpp
+++ b/src/map/magic-stmt.cpp
@@ -46,6 +46,9 @@
#include "../poison.hpp"
+
+namespace tmwa
+{
/* used for local spell effects */
constexpr Species INVISIBLE_NPC = wrap<Species>(127);
@@ -1635,3 +1638,4 @@ int spell_attack(BlockId caster_id, BlockId target_id)
return 1;
}
+} // namespace tmwa
diff --git a/src/map/magic-stmt.hpp b/src/map/magic-stmt.hpp
index 745b9b5..3050350 100644
--- a/src/map/magic-stmt.hpp
+++ b/src/map/magic-stmt.hpp
@@ -30,6 +30,9 @@
# include "skill.t.hpp"
+
+namespace tmwa
+{
struct op_t
{
ZString name;
@@ -86,5 +89,6 @@ void magic_stop_completely(dumb_ptr<map_session_data> c);
int spell_attack(BlockId caster, BlockId target);
void spell_free_invocation(dumb_ptr<invocation> invocation);
+} // namespace tmwa
#endif // TMWA_MAP_MAGIC_STMT_HPP
diff --git a/src/map/magic-v2.cpp b/src/map/magic-v2.cpp
index a287519..a671dea 100644
--- a/src/map/magic-v2.cpp
+++ b/src/map/magic-v2.cpp
@@ -42,6 +42,9 @@
#include "../poison.hpp"
+
+namespace tmwa
+{
namespace magic_v2
{
static
@@ -1260,3 +1263,4 @@ bool load_magic_file_v2(ZString filename)
}
return rv;
}
+} // namespace tmwa
diff --git a/src/map/magic-v2.hpp b/src/map/magic-v2.hpp
index 92b6f4e..9c357bc 100644
--- a/src/map/magic-v2.hpp
+++ b/src/map/magic-v2.hpp
@@ -23,8 +23,12 @@
# include "../strings/zstring.hpp"
+
+namespace tmwa
+{
bool magic_init0();
// must be called after itemdb initialization
bool load_magic_file_v2(ZString filename);
+} // namespace tmwa
#endif // TMWA_MAP_MAGIC_V2_HPP
diff --git a/src/map/magic.cpp b/src/map/magic.cpp
index ff4a278..b899a5e 100644
--- a/src/map/magic.cpp
+++ b/src/map/magic.cpp
@@ -37,6 +37,9 @@
#include "../poison.hpp"
+
+namespace tmwa
+{
#undef DEBUG
/// Return a pair of strings, {spellname, parameter}
@@ -124,3 +127,4 @@ int magic_message(dumb_ptr<map_session_data> caster, XString source_invocation)
return 0; /* Not a spell */
}
+} // namespace tmwa
diff --git a/src/map/magic.hpp b/src/map/magic.hpp
index e54661b..4df204f 100644
--- a/src/map/magic.hpp
+++ b/src/map/magic.hpp
@@ -29,6 +29,9 @@
# include "map.t.hpp"
# include "skill.t.hpp"
+
+namespace tmwa
+{
/**
* Try to cast magic.
*
@@ -41,5 +44,6 @@
* message should not be repeated.
*/
int magic_message(dumb_ptr<map_session_data> caster, XString source_invocation);
+} // namespace tmwa
#endif // TMWA_MAP_MAGIC_HPP
diff --git a/src/map/main.cpp b/src/map/main.cpp
index 8354f1c..8e8e9d5 100644
--- a/src/map/main.cpp
+++ b/src/map/main.cpp
@@ -20,3 +20,8 @@
#include "map.hpp"
#include "../poison.hpp"
+
+
+namespace tmwa
+{
+} // namespace tmwa
diff --git a/src/map/map.cpp b/src/map/map.cpp
index 97523b0..033f299 100644
--- a/src/map/map.cpp
+++ b/src/map/map.cpp
@@ -78,6 +78,9 @@
#include "../poison.hpp"
+
+namespace tmwa
+{
DMap<BlockId, dumb_ptr<block_list>> id_db;
UPMap<MapName, map_abstract> maps_db;
@@ -1786,3 +1789,4 @@ int map_scriptcont(dumb_ptr<map_session_data> sd, BlockId id)
return 0;
}
+} // namespace tmwa
diff --git a/src/map/map.hpp b/src/map/map.hpp
index aa2d97a..af08ae4 100644
--- a/src/map/map.hpp
+++ b/src/map/map.hpp
@@ -52,6 +52,9 @@
# include "script.hpp" // change to script.t.hpp
# include "skill.t.hpp"
+
+namespace tmwa
+{
constexpr int MAX_NPC_PER_MAP = 512;
constexpr int BLOCK_SIZE = 8;
# define AREA_SIZE battle_config.area_size
@@ -720,5 +723,6 @@ inline dumb_ptr<npc_data_script> npc_data::is_script() { return npc_subtype == N
inline dumb_ptr<npc_data_shop> npc_data::is_shop() { return npc_subtype == NpcSubtype::SHOP ? as_shop() : nullptr ; }
inline dumb_ptr<npc_data_warp> npc_data::is_warp() { return npc_subtype == NpcSubtype::WARP ? as_warp() : nullptr ; }
inline dumb_ptr<npc_data_message> npc_data::is_message() { return npc_subtype == NpcSubtype::MESSAGE ? as_message() : nullptr ; }
+} // namespace tmwa
#endif // TMWA_MAP_MAP_HPP
diff --git a/src/map/map.t.hpp b/src/map/map.t.hpp
index 4eba867..79e9448 100644
--- a/src/map/map.t.hpp
+++ b/src/map/map.t.hpp
@@ -32,6 +32,9 @@
# include "../mmo/ids.hpp"
# include "../mmo/mmo.hpp"
+
+namespace tmwa
+{
enum class BL : uint8_t
{
NUL,
@@ -198,5 +201,6 @@ inline
BlockId account_to_block(AccountId a) { return wrap<BlockId>(unwrap<AccountId>(a)); }
inline
AccountId block_to_account(BlockId b) { return wrap<AccountId>(unwrap<BlockId>(b)); }
+} // namespace tmwa
#endif // TMWA_MAP_MAP_T_HPP
diff --git a/src/map/mapflag.cpp b/src/map/mapflag.cpp
index 65126d9..f9cf8f6 100644
--- a/src/map/mapflag.cpp
+++ b/src/map/mapflag.cpp
@@ -20,6 +20,9 @@
#include "../poison.hpp"
+
+namespace tmwa
+{
// because bitfields, that's why
bool MapFlags::get(MapFlag mf) const
@@ -89,3 +92,4 @@ MapFlag map_flag_from_int(int shift)
{
return static_cast<MapFlag>(1 << shift);
}
+} // namespace tmwa
diff --git a/src/map/mapflag.hpp b/src/map/mapflag.hpp
index 5e36055..1f42bc9 100644
--- a/src/map/mapflag.hpp
+++ b/src/map/mapflag.hpp
@@ -25,6 +25,9 @@
# include "../mmo/extract.hpp" // TODO remove this (requires specializing the *other* half)
+
+namespace tmwa
+{
// originally from script.cpp
// These are part of the script API, so they can't change ever,
// even though they are silly.
@@ -79,5 +82,6 @@ template<>
bool extract<MapFlag, void, void>(XString str, MapFlag *mf);
MapFlag map_flag_from_int(int shift);
+} // namespace tmwa
#endif // TMWA_MAP_MAPFLAG_HPP
diff --git a/src/map/mapflag.py b/src/map/mapflag.py
index 3bc9f1a..fec8c05 100644
--- a/src/map/mapflag.py
+++ b/src/map/mapflag.py
@@ -2,7 +2,7 @@ class MapFlags(object):
''' print a set of map flags
'''
__slots__ = ('_value')
- name = 'MapFlags'
+ name = 'tmwa::MapFlags'
enabled = True
def __init__(self, value):
diff --git a/src/map/mob.cpp b/src/map/mob.cpp
index 166031f..f9edda9 100644
--- a/src/map/mob.cpp
+++ b/src/map/mob.cpp
@@ -56,6 +56,9 @@
#include "../poison.hpp"
+
+namespace tmwa
+{
constexpr interval_t MIN_MOBTHINKTIME = std::chrono::milliseconds(100);
// Move probability in the negligent mode MOB (rate of 1000 minute)
@@ -3736,3 +3739,4 @@ void do_init_mob2(void)
MIN_MOBTHINKTIME * 10
).detach();
}
+} // namespace tmwa
diff --git a/src/map/mob.hpp b/src/map/mob.hpp
index 8860ab5..87b7d3f 100644
--- a/src/map/mob.hpp
+++ b/src/map/mob.hpp
@@ -36,6 +36,9 @@
# include "map.hpp"
# include "skill.t.hpp"
+
+namespace tmwa
+{
# define ENGLISH_NAME stringish<MobName>("--en--"_s)
# define JAPANESE_NAME stringish<MobName>("--ja--"_s)
# define MOB_THIS_MAP stringish<MapName>("this"_s)
@@ -134,5 +137,6 @@ void mobskill_castend_pos(TimerData *tid, tick_t tick, BlockId id);
int mob_summonslave(dumb_ptr<mob_data> md2, int *value, int amount, int flag);
void mob_reload(void);
+} // namespace tmwa
#endif // TMWA_MAP_MOB_HPP
diff --git a/src/map/mob.t.hpp b/src/map/mob.t.hpp
index 5e056d5..b96fb09 100644
--- a/src/map/mob.t.hpp
+++ b/src/map/mob.t.hpp
@@ -25,6 +25,9 @@
# include <cstdint>
+
+namespace tmwa
+{
enum class MobSkillTarget
{
MST_TARGET = 0,
@@ -59,5 +62,6 @@ enum class MobSkillState : uint8_t
MSS_LOOT,
MSS_CHASE,
};
+} // namespace tmwa
#endif // TMWA_MAP_MOB_T_HPP
diff --git a/src/map/npc.cpp b/src/map/npc.cpp
index 275b41d..16090b2 100644
--- a/src/map/npc.cpp
+++ b/src/map/npc.cpp
@@ -59,6 +59,9 @@
#include "../poison.hpp"
+
+namespace tmwa
+{
static
std::list<AString> npc_srcs;
@@ -1784,3 +1787,4 @@ bool do_init_npc(void)
}
return rv;
}
+} // namespace tmwa
diff --git a/src/map/npc.hpp b/src/map/npc.hpp
index f8ae650..d6d3b62 100644
--- a/src/map/npc.hpp
+++ b/src/map/npc.hpp
@@ -35,6 +35,9 @@
# include "map.hpp"
+
+namespace tmwa
+{
constexpr BlockId START_NPC_NUM = wrap<BlockId>(110000000);
// TODO make these species, see npc_class in npc_data
@@ -96,5 +99,6 @@ void npc_timerevent_stop(dumb_ptr<npc_data_script> nd);
interval_t npc_gettimerevent_tick(dumb_ptr<npc_data_script> nd);
void npc_settimerevent_tick(dumb_ptr<npc_data_script> nd, interval_t newtimer);
int npc_delete(dumb_ptr<npc_data> nd);
+} // namespace tmwa
#endif // TMWA_MAP_NPC_HPP
diff --git a/src/map/party.cpp b/src/map/party.cpp
index 61df355..7784a02 100644
--- a/src/map/party.cpp
+++ b/src/map/party.cpp
@@ -42,6 +42,9 @@
#include "../poison.hpp"
+
+namespace tmwa
+{
// 座標やHP送信の間隔
constexpr interval_t PARTY_SEND_XYHP_INVERVAL = std::chrono::seconds(1);
@@ -804,3 +807,4 @@ void party_foreachsamemap(std::function<void(dumb_ptr<block_list>)> func,
if (list[i]->bl_prev) // 有効かどうかチェック
func(list[i]);
}
+} // namespace tmwa
diff --git a/src/map/party.hpp b/src/map/party.hpp
index d4000f7..b1c1092 100644
--- a/src/map/party.hpp
+++ b/src/map/party.hpp
@@ -31,6 +31,9 @@
# include "../mmo/fwd.hpp"
+
+namespace tmwa
+{
void do_init_party(void);
PartyPair party_search(PartyId party_id);
PartyPair party_searchname(PartyName str);
@@ -67,5 +70,6 @@ int party_exp_share(PartyPair p, map_local *map, int base_exp, int job_exp);
void party_foreachsamemap(std::function<void(dumb_ptr<block_list>)> func,
dumb_ptr<map_session_data> sd, int type);
+} // namespace tmwa
#endif // TMWA_MAP_PARTY_HPP
diff --git a/src/map/path.cpp b/src/map/path.cpp
index 432d9cf..6950797 100644
--- a/src/map/path.cpp
+++ b/src/map/path.cpp
@@ -36,6 +36,9 @@
#include "../poison.hpp"
+
+namespace tmwa
+{
constexpr int MAX_HEAP = 150;
struct tmp_path
{
@@ -358,3 +361,4 @@ int path_search(struct walkpath_data *wpd, map_local *m, int x0, int y0, int x1,
return -1;
}
}
+} // namespace tmwa
diff --git a/src/map/path.hpp b/src/map/path.hpp
index 5f03a90..019a987 100644
--- a/src/map/path.hpp
+++ b/src/map/path.hpp
@@ -23,6 +23,10 @@
# include "fwd.hpp"
+
+namespace tmwa
+{
int path_search(struct walkpath_data *, map_local *, int, int, int, int, int);
+} // namespace tmwa
#endif // TMWA_MAP_PATH_HPP
diff --git a/src/map/pc.cpp b/src/map/pc.cpp
index 48afffc..3b3a6b3 100644
--- a/src/map/pc.cpp
+++ b/src/map/pc.cpp
@@ -63,6 +63,9 @@
#include "../poison.hpp"
+
+namespace tmwa
+{
// PVP順位計算の間隔
constexpr std::chrono::milliseconds PVP_CALCRANK_INTERVAL =
std::chrono::seconds(1);
@@ -5273,3 +5276,4 @@ int pc_logout(dumb_ptr<map_session_data> sd) // [fate] Player logs out
MAP_LOG_STATS(sd, "LOGOUT"_fmt);
return 0;
}
+} // namespace tmwa
diff --git a/src/map/pc.hpp b/src/map/pc.hpp
index 6e07070..d40353b 100644
--- a/src/map/pc.hpp
+++ b/src/map/pc.hpp
@@ -36,6 +36,9 @@
# include "clif.t.hpp"
# include "map.hpp"
+
+namespace tmwa
+{
inline
void pc_setsit(dumb_ptr<map_session_data> sd)
{
@@ -182,5 +185,6 @@ int pc_logout(dumb_ptr<map_session_data> sd); // [fate] Player logs out
void pc_show_motd(dumb_ptr<map_session_data> sd);
void do_init_pc(void);
+} // namespace tmwa
#endif // TMWA_MAP_PC_HPP
diff --git a/src/map/pc.t.hpp b/src/map/pc.t.hpp
index 86817a7..ec882ab 100644
--- a/src/map/pc.t.hpp
+++ b/src/map/pc.t.hpp
@@ -26,6 +26,9 @@
# include <cstdint>
+
+namespace tmwa
+{
enum class PC_GAINEXP_REASON
{
KILLING = 0,
@@ -52,5 +55,6 @@ enum class CalcStatus
NOW,
LATER,
};
+} // namespace tmwa
#endif // TMWA_MAP_PC_T_HPP
diff --git a/src/map/script.cpp b/src/map/script.cpp
index b9d90ea..adc7789 100644
--- a/src/map/script.cpp
+++ b/src/map/script.cpp
@@ -73,6 +73,9 @@
#include "../poison.hpp"
+
+namespace tmwa
+{
constexpr bool DEBUG_DISP = false;
constexpr bool DEBUG_RUN = false;
@@ -5116,3 +5119,4 @@ ZString get_script_var_s(dumb_ptr<map_session_data> sd, VarName var, int e)
PRINTF("Warning: you lied about the type and I can't fix it!"_fmt);
return ZString();
}
+} // namespace tmwa
diff --git a/src/map/script.hpp b/src/map/script.hpp
index 6708bbc..4d6e8df 100644
--- a/src/map/script.hpp
+++ b/src/map/script.hpp
@@ -39,6 +39,9 @@
# include "clif.t.hpp"
# include "map.t.hpp"
+
+namespace tmwa
+{
enum class ByteCode : uint8_t;
struct str_data_t;
@@ -197,5 +200,6 @@ void set_script_var_s(dumb_ptr<map_session_data> sd, VarName var, int e, XString
int get_script_var_i(dumb_ptr<map_session_data> sd, VarName var, int e);
ZString get_script_var_s(dumb_ptr<map_session_data> sd, VarName var, int e);
+} // namespace tmwa
#endif // TMWA_MAP_SCRIPT_HPP
diff --git a/src/map/script.py b/src/map/script.py
index 068307a..dcde08d 100644
--- a/src/map/script.py
+++ b/src/map/script.py
@@ -3,7 +3,7 @@ class ByteCode:
(workaround for gcc bug 58150)
'''
__slots__ = ('_value')
- name = 'ByteCode'
+ name = 'tmwa::ByteCode'
enabled = True
def __init__(self, value):
@@ -34,7 +34,7 @@ class script_data(object):
''' print a script_data
'''
__slots__ = ('_value')
- name = 'script_data'
+ name = 'tmwa::script_data'
enabled = True
def __init__(self, value):
diff --git a/src/map/skill-pools.cpp b/src/map/skill-pools.cpp
index 3e9639a..e37b7e3 100644
--- a/src/map/skill-pools.cpp
+++ b/src/map/skill-pools.cpp
@@ -27,6 +27,9 @@
#include "../poison.hpp"
+
+namespace tmwa
+{
Array<SkillID, MAX_POOL_SKILLS> skill_pool_skills;
int skill_pool_skills_size = 0;
@@ -143,3 +146,4 @@ int skill_power_bl(dumb_ptr<block_list> bl, SkillID skill)
else
return 0;
}
+} // namespace tmwa
diff --git a/src/map/skill-pools.hpp b/src/map/skill-pools.hpp
index 28351b1..d75d344 100644
--- a/src/map/skill-pools.hpp
+++ b/src/map/skill-pools.hpp
@@ -21,4 +21,9 @@
# include "fwd.hpp"
+
+namespace tmwa
+{
+} // namespace tmwa
+
#endif // TMWA_MAP_SKILL_POOLS_HPP
diff --git a/src/map/skill.cpp b/src/map/skill.cpp
index e8ad878..5b5ca63 100644
--- a/src/map/skill.cpp
+++ b/src/map/skill.cpp
@@ -53,6 +53,9 @@
#include "../poison.hpp"
+
+namespace tmwa
+{
struct skill_name_db skill_names[] =
{
{SkillID::AC_OWL, "OWL"_s, "Owl's_Eye"_s},
@@ -1314,3 +1317,4 @@ skill_name_db& skill_lookup_by_name(XString name)
return ner;
return skill_names[num_names - 1];
}
+} // namespace tmwa
diff --git a/src/map/skill.hpp b/src/map/skill.hpp
index 0e566c6..bdaf184 100644
--- a/src/map/skill.hpp
+++ b/src/map/skill.hpp
@@ -35,6 +35,9 @@
# include "map.hpp"
+
+namespace tmwa
+{
constexpr int MAX_SKILL_PRODUCE_DB = 150;
constexpr int MAX_SKILL_ARROW_DB = 150;
constexpr int MAX_SKILL_ABRA_DB = 350;
@@ -164,4 +167,6 @@ int skill_power_bl(dumb_ptr<block_list> bl, SkillID skill);
// [Fate] Remember that a certain skill ID belongs to a pool skill
void skill_pool_register(SkillID id);
+} // namespace tmwa
+
#endif // TMWA_MAP_SKILL_HPP
diff --git a/src/map/skill.t.hpp b/src/map/skill.t.hpp
index b2ef2de..014080b 100644
--- a/src/map/skill.t.hpp
+++ b/src/map/skill.t.hpp
@@ -27,6 +27,9 @@
# include "../generic/enum.hpp"
+
+namespace tmwa
+{
// TODO remove most of these as their corresponding SkillIDs get deleted.
enum class StatusChange : uint16_t
{
@@ -131,5 +134,6 @@ enum class SkillFlags : uint16_t
ENUM_BITWISE_OPERATORS(SkillFlags)
}
using e::SkillFlags;
+} // namespace tmwa
#endif // TMWA_MAP_SKILL_T_HPP
diff --git a/src/map/storage.cpp b/src/map/storage.cpp
index b063250..a6e6a0d 100644
--- a/src/map/storage.cpp
+++ b/src/map/storage.cpp
@@ -36,6 +36,9 @@
#include "../poison.hpp"
+
+namespace tmwa
+{
static
Map<AccountId, Storage> storage_db;
@@ -331,3 +334,4 @@ int storage_storage_saved(AccountId account_id)
}
return 0;
}
+} // namespace tmwa
diff --git a/src/map/storage.hpp b/src/map/storage.hpp
index fe29664..cb9cbc5 100644
--- a/src/map/storage.hpp
+++ b/src/map/storage.hpp
@@ -29,6 +29,9 @@
# include "clif.t.hpp"
+
+namespace tmwa
+{
int storage_storageopen(dumb_ptr<map_session_data> sd);
int storage_storageadd(dumb_ptr<map_session_data> sd, IOff0 index, int amount);
int storage_storageget(dumb_ptr<map_session_data> sd, SOff0 index, int amount);
@@ -39,5 +42,6 @@ Storage *account2storage2(AccountId account_id);
int storage_storage_quit(dumb_ptr<map_session_data> sd);
int storage_storage_save(AccountId account_id, int final);
int storage_storage_saved(AccountId account_id);
+} // namespace tmwa
#endif // TMWA_MAP_STORAGE_HPP
diff --git a/src/map/tmw.cpp b/src/map/tmw.cpp
index 38b96ce..60b5027 100644
--- a/src/map/tmw.cpp
+++ b/src/map/tmw.cpp
@@ -41,6 +41,9 @@
#include "../poison.hpp"
+
+namespace tmwa
+{
static
void tmw_AutoBan(dumb_ptr<map_session_data> sd, ZString reason, int length);
static
@@ -163,3 +166,4 @@ void tmw_GmHackMsg(ZString line)
GmLevel::from(static_cast<uint32_t>(battle_config.hack_info_GM_level)),
line);
}
+} // namespace tmwa
diff --git a/src/map/tmw.hpp b/src/map/tmw.hpp
index dae6e69..610c80c 100644
--- a/src/map/tmw.hpp
+++ b/src/map/tmw.hpp
@@ -26,7 +26,11 @@
# include "../generic/fwd.hpp"
+
+namespace tmwa
+{
int tmw_CheckChatSpam(dumb_ptr<map_session_data> sd, XString message);
void tmw_GmHackMsg(ZString line);
+} // namespace tmwa
#endif // TMWA_MAP_TMW_HPP
diff --git a/src/map/trade.cpp b/src/map/trade.cpp
index c21fd27..c52377d 100644
--- a/src/map/trade.cpp
+++ b/src/map/trade.cpp
@@ -34,6 +34,9 @@
#include "../poison.hpp"
+
+namespace tmwa
+{
/*==========================================
* 取引要請を相手に送る
*------------------------------------------
@@ -462,3 +465,4 @@ void trade_verifyzeny(dumb_ptr<map_session_data> sd)
}
}
}
+} // namespace tmwa
diff --git a/src/map/trade.hpp b/src/map/trade.hpp
index 370fcdf..b9fce57 100644
--- a/src/map/trade.hpp
+++ b/src/map/trade.hpp
@@ -27,6 +27,9 @@
# include "clif.t.hpp"
+
+namespace tmwa
+{
void trade_traderequest(dumb_ptr<map_session_data> sd, BlockId target_id);
void trade_tradeack(dumb_ptr<map_session_data> sd, int type);
void trade_tradeadditem(dumb_ptr<map_session_data> sd, IOff2 index, int amount);
@@ -34,5 +37,6 @@ void trade_tradeok(dumb_ptr<map_session_data> sd);
void trade_tradecancel(dumb_ptr<map_session_data> sd);
void trade_tradecommit(dumb_ptr<map_session_data> sd);
void trade_verifyzeny(dumb_ptr<map_session_data> sd);
+} // namespace tmwa
#endif // TMWA_MAP_TRADE_HPP