mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-11-24 09:24:49 +00:00
moved the definition of pushScreen to hyper.h, so that hook_in_subscreen it works with older compilers
This commit is contained in:
4
hyper.h
4
hyper.h
@@ -787,6 +787,10 @@ template<class T, class V, class... U> V callhandlers(V zero, const hookset<T>&
|
||||
|
||||
void popScreen();
|
||||
|
||||
extern vector< function<void()> > screens;
|
||||
|
||||
template<class T> void pushScreen(const T& x) { screens.push_back(x); }
|
||||
|
||||
template<class T, class U> void hook_in_subscreen(hookset<T>& m, int prio, U&& hook) {
|
||||
int v = m.add(prio, static_cast<U&&>(hook));
|
||||
pushScreen([&m, v] {
|
||||
|
||||
Reference in New Issue
Block a user