X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmodel%2Fmodel.cpp;h=cc6e20e788d2ca6e721c943f871b209920dfdac5;hb=1c2994622a6b73f90cbd3ec9c09ffb4d7724cab4;hp=7aaf8f613b931a595e16a89800197260dd6fd044;hpb=8ab4ea13545cccbacbd1ed610968d3f481c1b3c8;p=blank.git diff --git a/src/model/model.cpp b/src/model/model.cpp index 7aaf8f6..cc6e20e 100644 --- a/src/model/model.cpp +++ b/src/model/model.cpp @@ -17,8 +17,11 @@ void EntityModel::Update(const Buffer &buf) noexcept { if (buf.tex_coords.size() < buf.vertices.size()) { std::cerr << "EntityModel: not enough tex coords!" << std::endl; } - if (buf.colors.size() < buf.vertices.size()) { - std::cerr << "EntityModel: not enough colors!" << std::endl; + if (buf.hsl_mods.size() < buf.vertices.size()) { + std::cerr << "BlockModel: not enough HSL modifiers!" << std::endl; + } + if (buf.rgb_mods.size() < buf.vertices.size()) { + std::cerr << "BlockModel: not enough RGB modifiers!" << std::endl; } if (buf.normals.size() < buf.vertices.size()) { std::cerr << "EntityModel: not enough normals!" << std::endl; @@ -28,7 +31,8 @@ void EntityModel::Update(const Buffer &buf) noexcept { vao.Bind(); vao.PushAttribute(ATTRIB_VERTEX, buf.vertices); vao.PushAttribute(ATTRIB_TEXCOORD, buf.tex_coords); - vao.PushAttribute(ATTRIB_COLOR, buf.colors); + vao.PushAttribute(ATTRIB_HSL, buf.hsl_mods); + vao.PushAttribute(ATTRIB_RGB, buf.rgb_mods); vao.PushAttribute(ATTRIB_NORMAL, buf.normals); vao.PushIndices(ATTRIB_INDEX, buf.indices); } @@ -44,8 +48,11 @@ void BlockModel::Update(const Buffer &buf) noexcept { if (buf.tex_coords.size() < buf.vertices.size()) { std::cerr << "BlockModel: not enough tex coords!" << std::endl; } - if (buf.colors.size() < buf.vertices.size()) { - std::cerr << "BlockModel: not enough colors!" << std::endl; + if (buf.hsl_mods.size() < buf.vertices.size()) { + std::cerr << "BlockModel: not enough HSL modifiers!" << std::endl; + } + if (buf.rgb_mods.size() < buf.vertices.size()) { + std::cerr << "BlockModel: not enough RGB modifiers!" << std::endl; } if (buf.lights.size() < buf.vertices.size()) { std::cerr << "BlockModel: not enough lights!" << std::endl; @@ -55,7 +62,8 @@ void BlockModel::Update(const Buffer &buf) noexcept { vao.Bind(); vao.PushAttribute(ATTRIB_VERTEX, buf.vertices); vao.PushAttribute(ATTRIB_TEXCOORD, buf.tex_coords); - vao.PushAttribute(ATTRIB_COLOR, buf.colors); + vao.PushAttribute(ATTRIB_HSL, buf.hsl_mods); + vao.PushAttribute(ATTRIB_RGB, buf.rgb_mods); vao.PushAttribute(ATTRIB_LIGHT, buf.lights); vao.PushIndices(ATTRIB_INDEX, buf.indices); }