1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-05 19:31:04 +00:00

Split CIndexBuffer from CMeshBuffer

This commit is contained in:
sfan5 2024-08-27 17:40:29 +02:00
parent 5d6e15bc49
commit 47e4c33a50
13 changed files with 197 additions and 104 deletions

View file

@ -135,8 +135,9 @@ Hud::Hud(Client *client, LocalPlayer *player,
// Prepare mesh for compass drawing
auto &b = m_rotation_mesh_buffer;
auto &vertices = b.Vertices->Data;
auto &indices = b.Indices->Data;
vertices.resize(4);
b.Indices.resize(6);
indices.resize(6);
video::SColor white(255, 255, 255, 255);
v3f normal(0.f, 0.f, 1.f);
@ -146,12 +147,12 @@ Hud::Hud(Client *client, LocalPlayer *player,
vertices[2] = video::S3DVertex(v3f( 1.f, 1.f, 0.f), normal, white, v2f(1.f, 0.f));
vertices[3] = video::S3DVertex(v3f( 1.f, -1.f, 0.f), normal, white, v2f(1.f, 1.f));
b.Indices[0] = 0;
b.Indices[1] = 1;
b.Indices[2] = 2;
b.Indices[3] = 2;
b.Indices[4] = 3;
b.Indices[5] = 0;
indices[0] = 0;
indices[1] = 1;
indices[2] = 2;
indices[3] = 2;
indices[4] = 3;
indices[5] = 0;
b.getMaterial().Lighting = false;
b.getMaterial().MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;