Files
mcpe/source/client/renderer/TileRenderer.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

121 lines
3.2 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
#include "world/level/Region.hpp"
#include "client/renderer/Chunk.hpp"
#include "client/renderer/Tesselator.hpp"
#ifndef ENH_SHADE_HELD_TILES
#define RENDER_TILE_ARG_PATCH
#else
#define RENDER_TILE_ARG_PATCH , float bright
#endif
class TileRenderer
{
private:
void _init();
public:
TileRenderer();
TileRenderer(LevelSource*);
float getWaterHeight(int x, int y, int z, const Material*);
void renderTile(Tile*, int data RENDER_TILE_ARG_PATCH);
// TODO
bool tesselateInWorld(Tile*, int x, int y, int z);
bool tesselateInWorldNoCulling(Tile*, int x, int y, int z);
bool tesselateInWorld(Tile*, int x, int y, int z, int textureOverride);
void renderEast(Tile*, float x, float y, float z, int texture);
void renderWest(Tile*, float x, float y, float z, int texture);
void renderSouth(Tile*, float x, float y, float z, int texture);
void renderNorth(Tile*, float x, float y, float z, int texture);
void renderFaceDown(Tile*, float x, float y, float z, int texture);
void renderFaceUp(Tile*, float x, float y, float z, int texture);
void tesselateCrossTexture(Tile* tile, int data, float x, float y, float z);
void tesselateTorch(Tile*, float x, float y, float z, float a, float b);
bool tesselateBlockInWorldWithAmbienceOcclusion(Tile*, int x, int y, int z, float r, float g, float b);
bool tesselateBlockInWorld(Tile*, int x, int y, int z, float r, float g, float b);
bool tesselateBlockInWorld(Tile*, int x, int y, int z);
bool tesselateCrossInWorld(Tile*, int x, int y, int z);
bool tesselateWaterInWorld(Tile*, int x, int y, int z);
bool tesselateStairsInWorld(Tile*, int x, int y, int z);
bool tesselateLadderInWorld(Tile*, int x, int y, int z);
bool tesselateTorchInWorld(Tile*, int x, int y, int z);
bool tesselateDoorInWorld(Tile*, int x, int y, int z);
#ifndef ORIGINAL_CODE
bool tesselateFireInWorld(Tile*, int x, int y, int z);
#endif
#ifdef ENH_USE_OWN_AO
bool tesselateBlockInWorldWithAmbienceOcclusionV2(Tile*, int x, int y, int z, float r, float g, float b);
#endif
static bool canRender(int renderShape);
private:
LevelSource* m_pLevelSource;
int m_textureOverride;
bool field_8;
bool m_bDisableCulling;
bool m_bAmbientOcclusion;
float field_C;
float field_10;
float field_14;
float field_18;
float field_1C;
float field_20;
float field_24;
float field_28;
float field_2C;
float field_30;
float field_34;
float field_38;
float field_3C;
float field_40;
float field_44;
float field_48;
float field_4C;
float field_50;
float field_54;
float field_58;
float field_5C;
float field_60;
float field_64;
float field_68;
float field_6C;
float field_70;
float field_74;
//...
int field_78;
// for A.O.
//red
float m_vtxRed[4];
//green
float m_vtxGreen[4];
//blue
float m_vtxBlue[4];
bool field_AC;
bool field_AD;
bool field_AE;
bool field_AF;
bool field_B0;
bool field_B1;
bool field_B2;
bool field_B3;
bool field_B4;
bool field_B5;
bool field_B6;
bool field_B7;
};