mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-11-14 20:57:10 +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:
@@ -1862,7 +1862,6 @@ EX void normalscreen() {
|
||||
EX vector< function<void()> > screens = { normalscreen };
|
||||
|
||||
#if HDR
|
||||
template<class T> void pushScreen(const T& x) { screens.push_back(x); }
|
||||
inline void popScreen() { if(isize(screens)>1) screens.pop_back(); }
|
||||
inline void popScreenAll() { while(isize(screens)>1) popScreen(); }
|
||||
typedef void (*cfunction)();
|
||||
|
||||
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