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

101 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
#include <cstdint>
#include <map>
#include "compat/GL.hpp"
#include "RenderChunk.hpp"
#define GET_RED(c) (uint8_t(((c) >> 0) & 0xFF))
#define GET_GREEN(c) (uint8_t(((c) >> 8) & 0xFF))
#define GET_BLUE(c) (uint8_t(((c) >> 16) & 0xFF))
#define GET_ALPHA(c) (uint8_t(((c) >> 24) & 0xFF))
class Tesselator
{
public:
static Tesselator instance; // singleton
public:
struct Vertex
{
// position
float m_x;
float m_y;
float m_z;
// texture mapping coords
float m_u;
float m_v;
// RGBA color
uint32_t m_color;
};
public:
Tesselator(int allotedSize = 0x800000);
~Tesselator();
void addOffset(float x, float y, float z);
void begin();
void begin(int accessMode);
void clear();
void color(int c);
void color(int c, int a);
void color(int r, int g, int b);
void color(int r, int g, int b, int a);
void color(char r, char g, char b);
void color(float r, float g, float b);
void color(float r, float g, float b, float a);
void draw();
int getVboCount();
void init();
void noColor();
void normal(float, float, float);
void offset(float, float, float);
void setAccessMode(int mode); // sets m_DrawArraysMode
void tex(float u, float v);
void vertex(float x, float y, float z);
void vertexUV(float x, float y, float z, float u, float v);
void voidBeginAndEndCalls(bool b);
RenderChunk end(int);
public:
Vertex* m_pVertices;
int field_4;
float m_offsetX;
float m_offsetY;
float m_offsetZ;
float m_nextVtxU;
float m_nextVtxV;
uint32_t m_nextVtxColor;
bool m_bHaveColor;
bool m_bHaveTex;
bool field_26;
bool m_bBlockColor;
bool field_28;
int field_2C;
int field_30;
bool field_34;
int m_vboCount;
int field_3C;
GLuint* m_pVBOs;
int field_48;
int m_maxVertices;
GLuint m_drawArraysMode;
int m_accessMode;
std::map<uint32_t, uint32_t> m_VboIdxToRenderChunkID;
};