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/libgui.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/libgui.h')
-rw-r--r-- | crawl-ref/source/libgui.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crawl-ref/source/libgui.h b/crawl-ref/source/libgui.h index ed49c26b30..2d1f8abc29 100644 --- a/crawl-ref/source/libgui.h +++ b/crawl-ref/source/libgui.h @@ -21,5 +21,10 @@ void gui_init_view_params(crawl_view_geometry &geom); // If mouse on dungeon map, returns true and sets gc. // Otherwise, it just returns false. bool gui_get_mouse_grid_pos(coord_def &gc); + +#ifndef USE_TILE_WEB +static inline constexpr bool is_tiles() { return true; } +#endif + #endif // USE_TILE #endif // LIBGUI_H |