1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-12-21 13:28:05 +00:00

geometry specifics in mode code

This commit is contained in:
Zeno Rogue
2018-12-14 19:24:27 +01:00
parent 8a677c28fa
commit db69276264
2 changed files with 28 additions and 3 deletions

View File

@@ -955,6 +955,31 @@ int modecode() {
mct += irr::density_code() << 21; // 8 bits
}
// 32 bits [29..61) for geometry specifics
if(torus) {
mct += ll(torusconfig::dx) << 29;
mct += ll(torusconfig::dy) << 37;
mct += ll(torusconfig::qty) << 45;
mct += ll(torusconfig::torusmode) << 53;
}
if(geometry == gQuotient) {
mct += ll(current_extra) << 29;
mct += ll(fgeomextras[current_extra].current_prime_id) << 37;
}
if(geometry == gCrystal) {
mct += ll(ginf[geometry].sides) << 29;
mct += ll(ginf[geometry].vertices) << 37;
}
if(geometry == gArchimedean) {
unsigned res = 7;
for(char c: arcm::current.symbol) res = res * 157 + c;
mct += ll(res) << 29;
if(PURE) mct ^= (1<<29);
}
return mct;
}