mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-08 21:07:13 +00:00
add some missing nikita patches to TileRenderer
This commit is contained in:
parent
e71af5ef46
commit
e6e8db7ae9
|
|
@ -4068,8 +4068,9 @@ bool TileRenderer::tesselateCrossInWorld(Tile* tt, int x, int y, int z) {
|
|||
float zt = (float)z;
|
||||
|
||||
if (tt == Tile::tallgrass) {
|
||||
int64_t seed = (x * 3129871) ^ (z * 116129781l) ^ (y);
|
||||
seed = seed * seed * 42317861 + seed * 11;
|
||||
// 4jcraft add a bunch of casts to prevent overflow (i pray to god)
|
||||
int64_t seed = ((int64_t)x * 3129871) ^ ((int64_t)z * 116129781L) ^ ((int64_t)y);
|
||||
seed = (int64_t)(((uint64_t)seed * (uint64_t)seed * 42317861ULL) + ((uint64_t)seed * 11ULL));
|
||||
|
||||
xt += ((((seed >> 16) & 0xf) / 15.0f) - 0.5f) * 0.5f;
|
||||
yt += ((((seed >> 20) & 0xf) / 15.0f) - 1.0f) * 0.2f;
|
||||
|
|
@ -4324,8 +4325,9 @@ bool TileRenderer::tesselateLilypadInWorld(Tile* tt, int x, int y, int z) {
|
|||
float u1 = tex->getU1(true);
|
||||
float v1 = tex->getV1(true);
|
||||
|
||||
int64_t seed = (x * 3129871) ^ (z * 116129781l) ^ (y);
|
||||
seed = seed * seed * 42317861 + seed * 11;
|
||||
// 4jcraft add a bunch of casts to prevent overflow (i pray to god)
|
||||
int64_t seed = ((int64_t)x * 3129871) ^ ((int64_t)z * 116129781L) ^ ((int64_t)y);
|
||||
seed = (int64_t)(((uint64_t)seed * (uint64_t)seed * 42317861ULL) + ((uint64_t)seed * 11ULL));
|
||||
|
||||
int dir = (int)((seed >> 16) & 0x3);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue