1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-01-23 15:36:59 +00:00

static with lambdas apparently does not work in old compilers

This commit is contained in:
Zeno Rogue 2019-01-07 04:50:08 +01:00
parent 645e4fa56c
commit 52f273e3f2

View File

@ -306,10 +306,13 @@ vector<pair<cellwalker,int> > drawbugs;
bool debugmode = false; bool debugmode = false;
// static apparently does not work in old compilers
int bitfield_v;
template<class T> void bitfield_editor(int val, const T& setter, string help = "") { template<class T> void bitfield_editor(int val, const T& setter, string help = "") {
static int v = val; bitfield_v = val;
dialog::editNumber(v, 0, 100, 1, v, help, ""); dialog::editNumber(bitfield_v, 0, 100, 1, bitfield_v, help, "");
dialog::reaction = [&setter] () { setter(v); }; dialog::reaction = [&setter] () { setter(bitfield_v); };
} }
struct debugScreen { struct debugScreen {