39 lines
905 B
C++
39 lines
905 B
C++
|
|
#include "white_brick.hpp"
|
|
#include "tile_base.hpp"
|
|
#include "../../graphics/texture.hpp"
|
|
#include <iterator>
|
|
|
|
using World::Tile::WhiteBrick;
|
|
|
|
void WhiteBrick::update() {
|
|
}
|
|
|
|
unsigned int WhiteBrick::get_texid() const {
|
|
return Graphics::Texture::WHITE_BRICK_FLOOR;
|
|
}
|
|
|
|
std::unique_ptr<World::Tile::TileBase> WhiteBrick::clone() const {
|
|
return std::make_unique<WhiteBrick>(*this);
|
|
}
|
|
|
|
void WhiteBrick::remesh(Graphics::Mesh& mesh, const TileBase* const* neighbours, glm::vec<2, int> offset) const {
|
|
auto p = TileBase::PRIMITIVE_B;
|
|
p.m_texid = Graphics::Texture::WHITE_BRICK_FLOOR;
|
|
p.m_offset = {offset, 0};
|
|
mesh.add_primitive(p);
|
|
|
|
for(int i = 0; i < std::size(TileBase::PRIMITIVE_S); i++) {
|
|
if(!neighbours[i]) {
|
|
p = TileBase::PRIMITIVE_S[i];
|
|
p.m_texid = Graphics::Texture::WHITE_BRICK_WALL;
|
|
p.m_offset = {offset, 0};
|
|
mesh.add_primitive(p);
|
|
}
|
|
}
|
|
}
|
|
|
|
void WhiteBrick::render() const {
|
|
}
|
|
|