Files
mcpe/source/world/level/levelgen/chunk/RandomLevelSource.hpp
Brent a0f71c7b27 C++03 Support & Partial Xbox 360 Support (#37)
* WIP C++03 + Xbox 360 Support

* math.h & _USE_MATH_DEFINES on Level.hpp
Updated Xenon vcxproj file for new file structure.

* * Fix bad GUI scale setup.

* * Gui: Use ratios instead of hardcoded sub-1 floating point values, to make the mechanism more clear.

* Add Direct Connect Button and Screen (#30)

* Add Direct Connect Button and Screen

* Remove accidental extra build directories for wasm

* Add DirectConnectScreen.cpp to the CMake

* Use Hungarian coding style notation

* * Fix errors caused by #30

* * Improve the Chat Screen

* * Improve the DirectConnectScreen, among other things.

* * Update the game title once again.

* * Add build-wasm.bat.

* * Add info about compiling for wasm

* * Fix send to specific GUID actually broadcasting to everyone

* * Add command manager.

* * Add writeable configuration.

* * Allow dynamic screen size change on windows

* * Allow the same thing on the emscripten version.

* WIP C++03 + Xbox 360 Support

* Fixed a possible merging issue that broke RakNet?

* Additional Xbox 360 compatability fixes

---------

Co-authored-by: Brent Da Mage <BrentDaMage@users.noreply.github.com>
Co-authored-by: iProgramInCpp <iprogramincpp@gmail.com>
Co-authored-by: ts <124226059+uniformization@users.noreply.github.com>
2023-08-07 15:48:52 +03:00

73 lines
2.1 KiB
C++

/********************************************************************
Minecraft: Pocket Edition - Decompilation Project
Copyright (C) 2023 iProgramInCpp
The following code is licensed under the BSD 1 clause license.
SPDX-License-Identifier: BSD-1-Clause
********************************************************************/
#pragma once
// @NOTE: This class appears to reference a mythical "std::hashtable", but I couldn't find any traces of it.
// I doubt they used C++11 (since it came out in 2011), but this is weird...
// We'll use std::unordered_map instead.
#include <unordered_map>
#include "ChunkSource.hpp"
#include "client/common/PerlinNoise.hpp"
#include "client/common/Utils.hpp"
#include "world/level/levelgen/biome/BiomeSource.hpp"
#include "world/level/levelgen/feature/Feature.hpp"
#include "world/level/levelgen/feature/LargeCaveFeature.hpp"
class RandomLevelSource : public ChunkSource
{
public:
RandomLevelSource(Level*, TLong seed, int);
int tick() override;
bool shouldSave() override;
bool hasChunk(int x, int z) override;
LevelChunk* create(int x, int z) override;
LevelChunk* getChunk(int x, int z) override;
std::string gatherStats() override;
void postProcess(ChunkSource*, int, int) override;
float* getHeights(float*, int, int, int, int, int, int);
void prepareHeights(int x, int z, TileID*, void*, float*);
void buildSurfaces (int x, int z, TileID*, Biome**);
public:
bool field_4;
LargeCaveFeature m_largeCaveFeature;
int field_9D8[1024];
std::unordered_map<int, LevelChunk*> m_chunks;
float field_19F0;
Random m_random;
PerlinNoise m_perlinNoise1;
PerlinNoise m_perlinNoise2;
PerlinNoise m_perlinNoise3;
PerlinNoise m_perlinNoise4;
PerlinNoise m_perlinNoise5;
PerlinNoise m_perlinNoise6;
PerlinNoise m_perlinNoise7;
PerlinNoise m_perlinNoise8;
Level* m_pLevel;
float* field_7280;
float field_7284[256];
float field_7684[256];
float field_7A84[256];
// @TODO
float* field_7E84;
float* field_7E88;
float* field_7E8C;
float* field_7E90;
float* field_7E94;
// @TODO
static const float SNOW_CUTOFF;
static const float SNOW_SCALE;
};