1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2026-01-13 06:22:39 +00:00

moved sizeto to hyper.h from floorshapes.cpp

This commit is contained in:
Zeno Rogue
2025-12-04 20:30:06 +01:00
parent 3203231509
commit 85aa299d75
2 changed files with 8 additions and 8 deletions

View File

@@ -277,14 +277,6 @@ void geometry_information::bshape2(hpcshape& sh, PPR prio, int shapeid, matrixli
if(!apeirogonal) hpcpush(starting_point);
}
template<class T> void sizeto(T& t, int n) {
if(isize(t) <= n) t.resize(n+1);
}
template<class T, class U> void sizeto(T& t, int n, const U& val) {
if(isize(t) <= n) t.resize(n+1, val);
}
#if CAP_BT
void geometry_information::bshape_bt(floorshape &fsh, int id, int sides, ld size, cell *c) {

View File

@@ -968,6 +968,14 @@ struct debugflag {
void flip() { enabled = !enabled; }
};
template<class T> void sizeto(T& t, int n) {
if(isize(t) <= n) t.resize(n+1);
}
template<class T, class U> void sizeto(T& t, int n, const U& val) {
if(isize(t) <= n) t.resize(n+1, val);
}
}
/** this macro is used to delay performing the action in case if everything is rolled back */