mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-16 21:11:47 +01:00
Temp commit. Textures not working anymor :(
This commit is contained in:
@@ -5,23 +5,18 @@
|
||||
#include "TextureManager.h"
|
||||
#include "utils.h"
|
||||
|
||||
WorldTile::WorldTile() {
|
||||
|
||||
}
|
||||
WorldTile::WorldTile(const Point2f& position, GroundTileTypes groundTileType, TextureManager* pTextureManager) : m_Position { position }, m_GroundTileType { groundTileType } {
|
||||
const std::string dirtPath = + "tiles/dirt/dirt" + std::to_string(utils::randRange(1, 5)) + ".png";
|
||||
|
||||
WorldTile::WorldTile(const Point2f& position, GroundTileType groundTileType, TextureManager* pTextureManager) : m_Position { position }, m_GroundTileType { groundTileType } {
|
||||
// const std::string dirtPath = + "tiles/dirt/dirt" + std::to_string(utils::randRange(1, 5)) + ".png";
|
||||
// m_pTexture = new Texture(dirtPath);
|
||||
m_pTexture = pTextureManager->GetTexture(dirtPath);
|
||||
m_pTexture = pTextureManager->GetTexture(groundTileType.getPath());
|
||||
}
|
||||
WorldTile::~WorldTile() {
|
||||
delete m_pTexture;
|
||||
}
|
||||
void WorldTile::Draw() const {
|
||||
if (m_GroundTileType != GroundTileTypes::Air) {
|
||||
if (m_GroundTileType == Tiles::DIRT) {
|
||||
m_pTexture->Draw(m_Position);
|
||||
//utils::SetColor(Color4f{ 0.5f, 0.5f, 0.5f, 1.0f});
|
||||
//utils::FillRect(m_Position.x, m_Position.y, 50, 50);
|
||||
|
||||
if(m_Hightlight) {
|
||||
utils::SetColor(Colors::GREEN);
|
||||
utils::FillRect(m_Position, 50, 50);
|
||||
|
||||
Reference in New Issue
Block a user