Merge branch 'master' into 1_13

This commit is contained in:
Tom Schumm 2018-07-02 14:35:02 -07:00
commit d9c2c8ae07
4 changed files with 14 additions and 1 deletions

View File

@ -534,6 +534,10 @@ static void *baseQuadWitchHutSearchThread(void *data)
sprintf(fnam, "%s.part%d", info.fnam, info.threadID); sprintf(fnam, "%s.part%d", info.fnam, info.threadID);
FILE *fp = fopen(fnam, "a+"); FILE *fp = fopen(fnam, "a+");
if (fp == NULL) {
fprintf(stderr, "Could not open \"%s\" for writing.\n", fnam);
exit(-1);
}
seed = start; seed = start;
@ -620,6 +624,10 @@ void baseQuadWitchHutSearch(const char *fnam, const int threads, const int quali
char fnamThread[256]; char fnamThread[256];
char buffer[4097]; char buffer[4097];
FILE *fp = fopen(fnam, "w"); FILE *fp = fopen(fnam, "w");
if (fp == NULL) {
fprintf(stderr, "Could not open \"%s\" for writing.\n", fnam);
exit(-1);
}
FILE *fpart; FILE *fpart;
int n; int n;
@ -663,6 +671,8 @@ void baseQuadWitchHutSearch(const char *fnam, const int threads, const int quali
/* getBiomeAtPos /* getBiomeAtPos
* ---------------- * ----------------
* Returns the biome for the specified block position. * Returns the biome for the specified block position.
* (Alternatives should be considered in performance critical code.)
* This function is not threadsafe.
*/ */
int getBiomeAtPos(const LayerStack g, const Pos pos) int getBiomeAtPos(const LayerStack g, const Pos pos)
{ {
@ -812,7 +822,7 @@ Pos getMansionPos(long seed, const long area80X, const long area80Z)
pos.z += (seed >> 17) % 60; pos.z += (seed >> 17) % 60;
pos.x = area80X*80 + (pos.x >> 1); pos.x = area80X*80 + (pos.x >> 1);
pos.z = area80X*80 + (pos.z >> 1); pos.z = area80Z*80 + (pos.z >> 1);
pos.x = pos.x*16 + 8; pos.x = pos.x*16 + 8;
pos.z = pos.z*16 + 8; pos.z = pos.z*16 + 8;
return pos; return pos;

View File

@ -129,6 +129,7 @@ void baseQuadWitchHutSearch(const char *fnam, int threads, int quality);
* ---------------- * ----------------
* Returns the biome for the specified block position. * Returns the biome for the specified block position.
* (Alternatives should be considered in performance critical code.) * (Alternatives should be considered in performance critical code.)
* This function is not threadsafe.
*/ */
int getBiomeAtPos(const LayerStack g, const Pos pos); int getBiomeAtPos(const LayerStack g, const Pos pos);

View File

@ -861,6 +861,7 @@ void mapBiomeEdge(Layer *l, int * __restrict out, int areaX, int areaZ, int area
} }
/* This function is not threadsafe. */
void mapHills(Layer *l, int * __restrict out, int areaX, int areaZ, int areaWidth, int areaHeight) void mapHills(Layer *l, int * __restrict out, int areaX, int areaZ, int areaWidth, int areaHeight)
{ {
int pX = areaX - 1; int pX = areaX - 1;

View File

@ -376,6 +376,7 @@ void mapDeepOcean(Layer *l, int * __restrict out, int x, int z, int w, int h);
void mapBiome(Layer *l, int * __restrict out, int x, int z, int w, int h); void mapBiome(Layer *l, int * __restrict out, int x, int z, int w, int h);
void mapRiverInit(Layer *l, int * __restrict out, int x, int z, int w, int h); void mapRiverInit(Layer *l, int * __restrict out, int x, int z, int w, int h);
void mapBiomeEdge(Layer *l, int * __restrict out, int x, int z, int w, int h); void mapBiomeEdge(Layer *l, int * __restrict out, int x, int z, int w, int h);
/* This function is not threadsafe. */
void mapHills(Layer *l, int * __restrict out, int x, int z, int w, int h); void mapHills(Layer *l, int * __restrict out, int x, int z, int w, int h);
void mapRiver(Layer *l, int * __restrict out, int x, int z, int w, int h); void mapRiver(Layer *l, int * __restrict out, int x, int z, int w, int h);
void mapSmooth(Layer *l, int * __restrict out, int x, int z, int w, int h); void mapSmooth(Layer *l, int * __restrict out, int x, int z, int w, int h);