diff options
author | Adam Borowski <kilobyte@angband.pl> | 2012-06-22 13:56:12 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2012-06-22 13:56:12 +0200 |
commit | a87b586b593fe0056dac4d990c03d0befebe505a (patch) | |
tree | d9fbf887cdc0d1b18dbb752f7310250850691e91 /crawl-ref/source/libunix.h | |
parent | 81fc2edf2e53296c87dffd49865d99f81620ce43 (diff) | |
download | crawl-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/libunix.h')
-rw-r--r-- | crawl-ref/source/libunix.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crawl-ref/source/libunix.h b/crawl-ref/source/libunix.h index 83f20697d5..80346e72a8 100644 --- a/crawl-ref/source/libunix.h +++ b/crawl-ref/source/libunix.h @@ -11,5 +11,12 @@ #include "libconsole.h" void fakecursorxy(int x, int y); + +#ifdef USE_TILE_WEB +bool is_tiles(); +#else +static inline constexpr bool is_tiles() { return false; } +#endif + #endif #endif |