summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/l_crawl.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2012-06-22 13:56:12 +0200
committerAdam Borowski <kilobyte@angband.pl>2012-06-22 13:56:12 +0200
commita87b586b593fe0056dac4d990c03d0befebe505a (patch)
treed9fbf887cdc0d1b18dbb752f7310250850691e91 /crawl-ref/source/l_crawl.cc
parent81fc2edf2e53296c87dffd49865d99f81620ce43 (diff)
downloadcrawl-ref-a87b586b593fe0056dac4d990c03d0befebe505a.tar.gz
crawl-ref-a87b586b593fe0056dac4d990c03d0befebe505a.zip
Make is_tiles() available on the C++ side.
In webtiles, the same binary can run both, so this function returns whether this particular game is controlled from console or tiles (there may be spectators using either, possibly at the same time). Declared constexpr in other build modes, so if we ever turn on C++11ยน mode, they'll be as effective as #ifdefs. Without it, optimized builds may or may not eliminate code that depends on it, debug builds won't. [1]. While there are niceties like sane initialization of arrays, etc, FreeBSD and MacOS use truly ancient compilers, so C++11 is currently not an option.
Diffstat (limited to 'crawl-ref/source/l_crawl.cc')
-rw-r--r--crawl-ref/source/l_crawl.cc8
1 files changed, 1 insertions, 7 deletions
diff --git a/crawl-ref/source/l_crawl.cc b/crawl-ref/source/l_crawl.cc
index 6105a75144..b7ba583b2d 100644
--- a/crawl-ref/source/l_crawl.cc
+++ b/crawl-ref/source/l_crawl.cc
@@ -644,13 +644,7 @@ LUARET1(crawl_div_rand_round, number, div_rand_round(luaL_checkint(ls, 1),
static int crawl_is_tiles(lua_State *ls)
{
-#ifdef USE_TILE_LOCAL
- lua_pushboolean(ls, true);
-#elif defined(USE_TILE_WEB)
- lua_pushboolean(ls, ::tiles.is_controlled_from_web());
-#else
- lua_pushboolean(ls, false);
-#endif
+ lua_pushboolean(ls, is_tiles());
return (1);
}