* Change long to TLong.

This allows a potential linux port to become reality much easier.
This commit is contained in:
iProgramInCpp
2023-07-31 21:08:31 +03:00
parent 47f9b45ac4
commit 5884302836
24 changed files with 82 additions and 48 deletions

View File

@@ -14,7 +14,7 @@ const float RandomLevelSource::SNOW_SCALE = 0.3f;
float g_timeSpentInPostProcessing = 0;
RandomLevelSource::RandomLevelSource(Level* level, long seed, int x) :
RandomLevelSource::RandomLevelSource(Level* level, TLong seed, int x) :
m_random(seed),
m_perlinNoise1(&m_random, 16),
m_perlinNoise2(&m_random, 16),
@@ -334,13 +334,13 @@ void RandomLevelSource::postProcess(ChunkSource* src, int x, int z)
int x16 = x * 16, z16 = z * 16;
Biome* pBiome = m_pLevel->getBiomeSource()->getBiome(x16 + 16, z16 + 16);
long seed = m_pLevel->getSeed();
TLong seed = m_pLevel->getSeed();
int xo, yo, zo;
m_random.setSeed(seed);
long x1 = 1 + 2 * (m_random.nextInt() / 2);
long x2 = 1 + 2 * (m_random.nextInt() / 2);
m_random.setSeed((long(x) * x1 + long(z) * x2) ^ seed);
TLong x1 = 1 + 2 * (m_random.nextInt() / 2);
TLong x2 = 1 + 2 * (m_random.nextInt() / 2);
m_random.setSeed((TLong(x) * x1 + TLong(z) * x2) ^ seed);
// @NOTE: I can't put the random calls _in_ the argument list - args are evaluated right to left I believe