1
0
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:
Zeno Rogue
2025-10-19 12:06:25 +02:00
parent a1b221129a
commit 94024dd5f1
2 changed files with 4 additions and 1 deletions

View File

@@ -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)();

View File

@@ -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] {