X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2Fmesh.cpp;h=9cb8c92ae9736a0337a1c7f681e1a2fe1115f5c1;hb=2ad195d00eea2c4d48f3f1a3ccc60a8176e7da20;hp=4a63d99c8f56a2f87612e4dd83748abe90324971;hpb=2da9efc1037fba0461303327151318b8edf4dfc7;p=blank.git diff --git a/src/graphics/mesh.cpp b/src/graphics/mesh.cpp index 4a63d99..9cb8c92 100644 --- a/src/graphics/mesh.cpp +++ b/src/graphics/mesh.cpp @@ -4,7 +4,7 @@ #include "SkyBoxMesh.hpp" #include "SpriteMesh.hpp" -#include "../model/geometry.hpp" +#include "../geometry/primitive.hpp" #include #include @@ -31,8 +31,8 @@ void EntityMesh::Update(const Buffer &buf) noexcept { vao.Bind(); vao.PushAttribute(ATTRIB_VERTEX, buf.vertices); vao.PushAttribute(ATTRIB_TEXCOORD, buf.tex_coords); - vao.PushAttribute(ATTRIB_HSL, buf.hsl_mods); - vao.PushAttribute(ATTRIB_RGB, buf.rgb_mods); + vao.PushAttribute(ATTRIB_HSL, buf.hsl_mods, true); + vao.PushAttribute(ATTRIB_RGB, buf.rgb_mods, true); vao.PushAttribute(ATTRIB_NORMAL, buf.normals); vao.PushIndices(ATTRIB_INDEX, buf.indices); } @@ -62,8 +62,8 @@ void BlockMesh::Update(const Buffer &buf) noexcept { vao.Bind(); vao.PushAttribute(ATTRIB_VERTEX, buf.vertices); vao.PushAttribute(ATTRIB_TEXCOORD, buf.tex_coords); - vao.PushAttribute(ATTRIB_HSL, buf.hsl_mods); - vao.PushAttribute(ATTRIB_RGB, buf.rgb_mods); + vao.PushAttribute(ATTRIB_HSL, buf.hsl_mods, true); + vao.PushAttribute(ATTRIB_RGB, buf.rgb_mods, true); vao.PushAttribute(ATTRIB_LIGHT, buf.lights); vao.PushIndices(ATTRIB_INDEX, buf.indices); } @@ -76,7 +76,7 @@ void BlockMesh::Draw() const noexcept { void PrimitiveMesh::Buffer::FillRect( float w, float h, - const glm::vec4 &color, + const Color &color, const glm::vec2 &pivot ) { Clear(); @@ -92,7 +92,7 @@ void PrimitiveMesh::Buffer::FillRect( indices.assign({ 0, 2, 1, 1, 2, 3 }); } -void PrimitiveMesh::Buffer::OutlineBox(const AABB &box, const glm::vec4 &color) { +void PrimitiveMesh::Buffer::OutlineBox(const AABB &box, const Color &color) { Clear(); Reserve(8, 24); @@ -124,7 +124,7 @@ void PrimitiveMesh::Update(const Buffer &buf) noexcept { vao.Bind(); vao.PushAttribute(ATTRIB_VERTEX, buf.vertices); - vao.PushAttribute(ATTRIB_COLOR, buf.colors); + vao.PushAttribute(ATTRIB_COLOR, buf.colors, true); vao.PushIndices(ATTRIB_INDEX, buf.indices); }