X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fblock.cpp;h=50c4a4ffd9040c136f6bfcdebff4704dc8fcdb33;hb=82426ae2997d2b21703d2d5afb631a84736e975f;hp=02e8476c4a2af7cf9ec407fd76040acf8c057dba;hpb=804bde3fc09e4317eef629861638a68bfad3e343;p=blank.git diff --git a/src/block.cpp b/src/block.cpp index 02e8476..50c4a4f 100644 --- a/src/block.cpp +++ b/src/block.cpp @@ -3,31 +3,29 @@ namespace blank { -const BlockType BlockType::DEFAULT; const NullShape BlockType::DEFAULT_SHAPE; -void BlockType::FillVBO( - const glm::vec3 &pos, - std::vector &vertices, - std::vector &colors, - std::vector &normals +void BlockType::FillModel( + Model &model, + const glm::vec3 &pos_offset, + Model::Index idx_offset ) const { - shape->Vertices(vertices, pos); - colors.insert(colors.end(), shape->VertexCount(), color); - shape->Normals(normals); + shape->Vertices(model.vertices, model.normals, model.indices, pos_offset, idx_offset); + model.colors.insert(model.colors.end(), shape->VertexCount(), color); } -void BlockType::FillOutlineVBO( - std::vector &vertices, - std::vector &colors +void BlockType::FillOutlineModel( + OutlineModel &model, + const glm::vec3 &pos_offset, + OutlineModel::Index idx_offset ) const { - shape->Outline(vertices); - colors.insert(colors.end(), shape->OutlineCount(), outline_color); + shape->Outline(model.vertices, model.indices, pos_offset, idx_offset); + model.colors.insert(model.colors.end(), shape->OutlineCount(), outline_color); } BlockTypeRegistry::BlockTypeRegistry() { - Add(BlockType::DEFAULT); + Add(BlockType()); } int BlockTypeRegistry::Add(const BlockType &t) {