mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-04 19:36:43 +03:00
* 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>
85 lines
1.7 KiB
C++
85 lines
1.7 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
|
|
********************************************************************/
|
|
|
|
#include "PerformanceTestChunkSource.hpp"
|
|
#include "world/level/Level.hpp"
|
|
|
|
PerformanceTestChunkSource::PerformanceTestChunkSource()
|
|
{
|
|
m_pLevel = nullptr;
|
|
}
|
|
|
|
LevelChunk* PerformanceTestChunkSource::create(int x, int z)
|
|
{
|
|
TileID* pData = new TileID[0x8000u];
|
|
memset(pData, 0, 0x8000u * sizeof(TileID));
|
|
|
|
for (int i = 0; i != 65; i++)
|
|
{
|
|
if (i > 59)
|
|
{
|
|
// alternating columns of dirt
|
|
for (int j = 0; j < 16; j += 2)
|
|
{
|
|
for (int k = 0; k < 16; k += 2)
|
|
{
|
|
pData[i | (j << 11) | (k << 7)] = 3; // dirt
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// alternating checkerboard patterns of dirt
|
|
for (int j = (~i) & 1; j < 16; j += 2)
|
|
{
|
|
for (int k = i & 1; k < 16; k += 2)
|
|
{
|
|
pData[i | (j << 11) | (k << 7)] = 3; // dirt
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
LevelChunk* pChunk = new LevelChunk(m_pLevel, pData, x, z);
|
|
pChunk->recalcHeightmap();
|
|
|
|
return pChunk;
|
|
}
|
|
|
|
std::string PerformanceTestChunkSource::gatherStats()
|
|
{
|
|
return "PerformanceTestChunkSource";
|
|
}
|
|
|
|
// this sucks because it creates a new chunk every call to this function...
|
|
LevelChunk* PerformanceTestChunkSource::getChunk(int x, int z)
|
|
{
|
|
return create(x, z);
|
|
}
|
|
|
|
bool PerformanceTestChunkSource::hasChunk(int x, int z)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
void PerformanceTestChunkSource::postProcess(ChunkSource* a, int b, int c)
|
|
{
|
|
|
|
}
|
|
|
|
bool PerformanceTestChunkSource::shouldSave()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
int PerformanceTestChunkSource::tick()
|
|
{
|
|
return 0;
|
|
}
|
|
|