mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-17 20:10:23 +03:00
Biome colour and grass side tint options (#98)
* Added biome colour and grass side tint options * Moved GrassColor and FoliageColor to client/renderer/ * * Fix some build issues. * * Add the new files to the CMakeLists.txt --------- Co-authored-by: iProgramInCpp <iprogramincpp@gmail.com>
This commit is contained in:
22
source/client/renderer/GrassColor.cpp
Normal file
22
source/client/renderer/GrassColor.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include "GrassColor.hpp"
|
||||
|
||||
// TODO: This should be inside of an initialized "Minecraft" instance rather than the global namespace
|
||||
bool g_bIsGrassColorAvailable = false;
|
||||
|
||||
Texture GrassColor::texture;
|
||||
|
||||
bool GrassColor::isAvailable()
|
||||
{
|
||||
return g_bIsGrassColorAvailable;
|
||||
}
|
||||
|
||||
void GrassColor::init(Texture texture)
|
||||
{
|
||||
GrassColor::texture = texture;
|
||||
}
|
||||
|
||||
uint32_t GrassColor::get(double x, double y)
|
||||
{
|
||||
y *= x;
|
||||
return GrassColor::texture.m_pixels[(int)((1.0 - y) * 255.0) << 8 | (int)((1.0 - x) * 255.0)];
|
||||
}
|
||||
Reference in New Issue
Block a user