mirror of
https://github.com/Cubitect/cubiomes.git
synced 2025-09-23 03:33:50 -04:00
Added salt option to scanForQuads for convenience with protobases.
This commit is contained in:
parent
11954031c6
commit
f4c49c8380
@ -715,7 +715,7 @@ int scanForQuadBits(const StructureConfig sconf, int radius, int64_t s48,
|
|||||||
|
|
||||||
int scanForQuads(
|
int scanForQuads(
|
||||||
const StructureConfig sconf, int radius, int64_t s48,
|
const StructureConfig sconf, int radius, int64_t s48,
|
||||||
const int64_t *lowBits, int lowBitCnt, int lowBitN,
|
const int64_t *lowBits, int lowBitCnt, int lowBitN, int64_t salt,
|
||||||
int x, int z, int w, int h, Pos *qplist, int n)
|
int x, int z, int w, int h, Pos *qplist, int n)
|
||||||
{
|
{
|
||||||
int i, cnt = 0;
|
int i, cnt = 0;
|
||||||
@ -729,7 +729,7 @@ int scanForQuads(
|
|||||||
|
|
||||||
for (i = 0; i < lowBitCnt; i++)
|
for (i = 0; i < lowBitCnt; i++)
|
||||||
{
|
{
|
||||||
cnt += scanForQuadBits(sconf, radius, s48, lowBits[i], lowBitN, invB,
|
cnt += scanForQuadBits(sconf, radius, s48, lowBits[i]-salt, lowBitN, invB,
|
||||||
x, z, w, h, qplist+cnt, n-cnt);
|
x, z, w, h, qplist+cnt, n-cnt);
|
||||||
if (cnt >= n)
|
if (cnt >= n)
|
||||||
break;
|
break;
|
||||||
|
@ -425,15 +425,16 @@ Pos getOptimalAfk(Pos p[4], int ax, int ay, int az, int *spcnt);
|
|||||||
* @lowBits : consider transformations that yield one of these lower bits
|
* @lowBits : consider transformations that yield one of these lower bits
|
||||||
* @lowBitCnt : length of lower bit subset
|
* @lowBitCnt : length of lower bit subset
|
||||||
* @lowBitN : number of bits in the subset values (0 < lowBitN <= 48)
|
* @lowBitN : number of bits in the subset values (0 < lowBitN <= 48)
|
||||||
|
* @salt : salt subtracted from subset values (useful for protobases)
|
||||||
* @x,z,w,h : area to scan in region coordinates (inclusive)
|
* @x,z,w,h : area to scan in region coordinates (inclusive)
|
||||||
* @qplist : output region coordinates for the descovered quad-structures
|
* @qplist : output region coordinates for the descovered quad-structures
|
||||||
* @n : maximum number of quad-structures to look for
|
* @n : maximum number of quad-structures to look for
|
||||||
*
|
*<
|
||||||
* Returns the number of quad-structures found (up to 'n').
|
* Returns the number of quad-structures found (up to 'n').
|
||||||
*/
|
*/
|
||||||
int scanForQuads(
|
int scanForQuads(
|
||||||
const StructureConfig sconf, int radius, int64_t s48,
|
const StructureConfig sconf, int radius, int64_t s48,
|
||||||
const int64_t *lowBits, int lowBitCnt, int lowBitN,
|
const int64_t *lowBits, int lowBitCnt, int lowBitN, int64_t salt,
|
||||||
int x, int z, int w, int h, Pos *qplist, int n);
|
int x, int z, int w, int h, Pos *qplist, int n);
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
Loading…
x
Reference in New Issue
Block a user