1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-09-28 22:10:40 +00:00

Merge pull request #74 from Quuxplusone/macros

Rearrange some macros. No functional change intended.
This commit is contained in:
Zeno Rogue 2019-02-09 12:46:32 +01:00 committed by GitHub
commit 6642ebf0c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 40 additions and 32 deletions

View File

@ -39,7 +39,7 @@ eMonster readMonster(const string& ss) {
void initializeCLI() { void initializeCLI() {
printf("HyperRogue by Zeno Rogue <zeno@attnam.com>, version " VER "\n"); printf("HyperRogue by Zeno Rogue <zeno@attnam.com>, version " VER "\n");
#ifndef NOLICENSE #if !NOLICENSE
printf("released under GNU General Public License version 2 and thus\n"); printf("released under GNU General Public License version 2 and thus\n");
printf("comes with absolutely no warranty; see COPYING for details\n"); printf("comes with absolutely no warranty; see COPYING for details\n");
#endif #endif

View File

@ -137,7 +137,7 @@ void buildCredits() {
help += XLAT("game design, programming, texts and graphics by Zeno Rogue <zeno@attnam.com>\n\n"); help += XLAT("game design, programming, texts and graphics by Zeno Rogue <zeno@attnam.com>\n\n");
if(lang() != 0) if(lang() != 0)
help += XLAT("add credits for your translation here"); help += XLAT("add credits for your translation here");
#ifndef NOLICENSE #if !NOLICENSE
help += XLAT( help += XLAT(
"released under GNU General Public License version 2 and thus " "released under GNU General Public License version 2 and thus "
"comes with absolutely no warranty; see COPYING for details\n\n" "comes with absolutely no warranty; see COPYING for details\n\n"

View File

@ -7,9 +7,7 @@
#define VERNUM_HEX 0xA505 #define VERNUM_HEX 0xA505
#include <stdarg.h> #include <stdarg.h>
#if !ISSTEAM
#include "hyper_function.h" #include "hyper_function.h"
#endif
namespace hr { namespace hr {
@ -18,12 +16,6 @@ void ignore(T&&) {
// placate GCC's overzealous -Wunused-result // placate GCC's overzealous -Wunused-result
} }
#if USE_STDFUNCTION
using std::function;
#else
template<class Sig> using function = hyper_function<Sig>;
#endif
// functions and types used from the standard library // functions and types used from the standard library
using std::vector; using std::vector;
using std::map; using std::map;

View File

@ -1,11 +1,25 @@
#pragma once #pragma once
#if USE_STDFUNCTION
#include <functional>
namespace hr {
using std::function;
} // namespace hr
#else
#include <type_traits> #include <type_traits>
#include <utility> #include <utility>
namespace hr {
template<class Sig> template<class Sig>
class hyper_function; class hyper_function;
template<class Sig>
using function = hyper_function<Sig>;
template<class R, class... Args> template<class R, class... Args>
struct hyper_function_state_base { struct hyper_function_state_base {
virtual R call(Args...) const = 0; virtual R call(Args...) const = 0;
@ -59,3 +73,7 @@ public:
return ptr_ != nullptr; return ptr_ != nullptr;
} }
}; };
} // namespace hr
#endif

View File

@ -160,9 +160,7 @@ hint hints[] = {
"Try the Orb Strategy mode!") "Try the Orb Strategy mode!")
); );
dialog::addBreak(50); dialog::addBreak(50);
#ifdef INF
dialog::addItem(XLAT("Orb Strategy mode"), 'z'); dialog::addItem(XLAT("Orb Strategy mode"), 'z');
#endif
}, },
[]() { []() {
#if CAP_INV #if CAP_INV

View File

@ -13,18 +13,6 @@
#define ISWINDOWS 1 #define ISWINDOWS 1
#endif #endif
#if ISSTEAM
#define NOLICENSE
#endif
#ifndef USE_STDFUNCTION
#define USE_STDFUNCTION ISSTEAM
#endif
#ifndef CAP_SHADER
#define CAP_SHADER CAP_GL
#endif
// OS settings // OS settings
#ifndef ISMAC #ifndef ISMAC
@ -51,6 +39,10 @@
#define ISANDROID 0 #define ISANDROID 0
#endif #endif
#ifndef ISSTEAM
#define ISSTEAM 0
#endif
#ifndef ISWEB #ifndef ISWEB
#define ISWEB 0 #define ISWEB 0
#endif #endif
@ -72,18 +64,30 @@
#define CAP_FRAMELIMIT (!ISMOBWEB) #define CAP_FRAMELIMIT (!ISMOBWEB)
#if ISMOBILE==1 #if ISMOBILE
#define EXTERNALFONT #define EXTERNALFONT
#endif #endif
#ifndef CAP_FILES #ifndef NOLICENSE
#define CAP_FILES 1 #define NOLICENSE ISSTEAM
#endif
#ifndef USE_STDFUNCTION
#define USE_STDFUNCTION ISSTEAM
#endif
#ifndef CAP_SHADER
#define CAP_SHADER CAP_GL
#endif #endif
#ifndef CAP_ANIMATIONS #ifndef CAP_ANIMATIONS
#define CAP_ANIMATIONS (!CAP_MINI) #define CAP_ANIMATIONS (!CAP_MINI)
#endif #endif
#ifndef CAP_FILES
#define CAP_FILES 1
#endif
#ifndef CAP_INV #ifndef CAP_INV
#define CAP_INV 1 #define CAP_INV 1
#endif #endif
@ -237,16 +241,12 @@
#define CAP_SHMUP 1 #define CAP_SHMUP 1
#endif #endif
#ifdef ISSTEAM
#define CAP_ACHIEVE 1
#endif
#ifndef CAP_BITFIELD #ifndef CAP_BITFIELD
#define CAP_BITFIELD (!ISWEB) #define CAP_BITFIELD (!ISWEB)
#endif #endif
#ifndef CAP_ACHIEVE #ifndef CAP_ACHIEVE
#define CAP_ACHIEVE 0 #define CAP_ACHIEVE ISSTEAM
#endif #endif
#ifndef CAP_SHMUP_GOOD #ifndef CAP_SHMUP_GOOD