MCPcopy Create free account
hub / github.com/Cubitect/cubiomes-viewer / preSearch

Method preSearch

src/searchthread.cpp:397–569  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

395}
396
397void SearchMaster::preSearch()
398{
399 uint64_t sstart = seed;
400
401 if (gen48.mode == GEN48_AUTO)
402 { // resolve automatic mode
403 for (const Condition& c : condtree.condvec)
404 {
405 if (c.type >= F_QH_IDEAL && c.type <= F_QH_BARELY)
406 {
407 gen48.mode = GEN48_QH;
408 break;
409 }
410 else if (c.type >= F_QM_95 && c.type <= F_QM_90)
411 {
412 gen48.mode = GEN48_QM;
413 break;
414 }
415 }
416 }
417
418 if (searchtype != SEARCH_LIST)
419 {
420 if (gen48.mode == GEN48_QH)
421 {
422 uint64_t salt = 0;
423 if (gen48.qual == IDEAL_SALTED)
424 salt = gen48.salt;
425 else
426 {
427 StructureConfig sconf;
428 getStructureConfig_override(Swamp_Hut, mc, &sconf);
429 salt = sconf.salt;
430 }
431 slist.clear();
432 genQHBases(gen48.qual, salt, slist);
433 }
434 else if (gen48.mode == GEN48_QM)
435 {
436 StructureConfig sconf;
437 getStructureConfig_override(Monument, mc, &sconf);
438 slist.clear();
439 for (const uint64_t *s = g_qm_90; *s; s++)
440 if (qmonumentQual(*s) >= gen48.qmarea)
441 slist.push_back((*s - sconf.salt) & MASK48);
442 }
443 else if (gen48.mode == GEN48_LIST)
444 {
445 if (gen48.listsalt)
446 {
447 for (uint64_t& rs : slist)
448 rs += gen48.listsalt;
449 }
450 }
451
452 if (!slist.empty())
453 applyTranspose(slist, gen48, PRECOMPUTE48_BUFSIZ);
454 }

Callers

nothing calls this directly

Calls 5

genQHBasesFunction · 0.85
qmonumentQualFunction · 0.85
applyTransposeFunction · 0.85
clearMethod · 0.80

Tested by

no test coverage detected