1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2026-01-08 12:29:04 +00:00

an option to add more projections via plugins

This commit is contained in:
Zeno Rogue
2022-03-27 09:05:47 +02:00
parent 166f076f2d
commit 5a73eccd4c
2 changed files with 10 additions and 2 deletions

View File

@@ -497,6 +497,8 @@ EX void threepoint_projection(const hyperpoint& H, hyperpoint& ret) {
}
#endif
EX vector<hr::function<void(shiftpoint& H_orig, hyperpoint& H, hyperpoint& ret)>> extra_projections;
EX void apply_other_model(shiftpoint H_orig, hyperpoint& ret, eModel md) {
hyperpoint H = H_orig.h;
@@ -1345,6 +1347,11 @@ EX void apply_other_model(shiftpoint H_orig, hyperpoint& ret, eModel md) {
}
case mdGUARD: case mdManual: break;
default:
if(md < isize(extra_projections) && extra_projections[md])
extra_projections[md](H_orig, H, ret);
break;
}
ghcheck(ret,H_orig);