X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=src%2Fblock.cpp;h=236a61ff62bcb0b2d122f78fc33691f35db2d3d1;hb=a58c4558e7d4934f4d0ee621520acfe1c8258c93;hp=b0de21aff95bf52d1538ec703b4cf55d6fc82f19;hpb=9c1f7b20394808f7ec7a6cadd9e0dd665c6f6bd5;p=blank.git diff --git a/src/block.cpp b/src/block.cpp index b0de21a..236a61f 100644 --- a/src/block.cpp +++ b/src/block.cpp @@ -5,13 +5,23 @@ namespace blank { const NullShape BlockType::DEFAULT_SHAPE; +BlockType::BlockType(bool v, const glm::vec3 &col, const Shape *s) +: shape(s) +, color(col) +, outline_color(-1, -1, -1) +, id(0) +, visible(v) +, fill({ false, false, false, false, false, false }) { + +} + void BlockType::FillModel( - Model &model, + Model::Buffer &buf, const glm::vec3 &pos_offset, Model::Index idx_offset ) const { - shape->Vertices(model.vertices, model.normals, model.indices, pos_offset, idx_offset); - model.colors.insert(model.colors.end(), shape->VertexCount(), color); + shape->Vertices(buf.vertices, buf.normals, buf.indices, pos_offset, idx_offset); + buf.colors.insert(buf.colors.end(), shape->VertexCount(), color); } void BlockType::FillOutlineModel(