1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-23 01:47:39 +00:00

the Android version is now able to access honeycomb rules via assets

This commit is contained in:
Zeno Rogue
2021-06-01 14:24:22 +02:00
parent 3c3c95e072
commit 9ebd7d98d5
4 changed files with 36 additions and 2 deletions

View File

@@ -941,12 +941,17 @@ EX namespace reg3 {
vector<int> otherpos;
void load_ruleset(string fname) {
string buf;
#if ISANDROID
buf = get_asset(fname);
#else
FILE *f = fopen(fname.c_str(), "rb");
if(!f) f = fopen((rsrcdir + fname).c_str(), "rb");
string buf;
buf.resize(1000000);
int qty = fread(&buf[0], 1, 1000000, f);
buf.resize(qty);
fclose(f);
#endif
shstream ins(decompress_string(buf));
dynamicval<bool> q(fieldpattern::use_quotient_fp, true);
@@ -955,7 +960,6 @@ EX namespace reg3 {
hread(ins, root);
hread(ins, children);
hread(ins, other);
fclose(f);
}
/** \brief address = (fieldvalue, state) */