mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-16 20:41:47 +01:00
Remove Point2f, replace with Vector2f
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
#include "WorldGridManager.h"
|
||||
|
||||
|
||||
WorldTile::WorldTile(const Point2f& position, GroundTileType* groundTileType, TextureManager* pTextureManager, WorldGridManager* pGridManager) : m_Position { position }, m_GroundTileType { groundTileType }, m_pGridManager { pGridManager } {
|
||||
WorldTile::WorldTile(const Vector2f& position, GroundTileType* groundTileType, TextureManager* pTextureManager, WorldGridManager* pGridManager) : m_Position { position }, m_GroundTileType { groundTileType }, m_pGridManager { pGridManager } {
|
||||
// const std::string dirtPath = + "tiles/dirt/dirt" + std::to_string(utils::randRange(1, 5)) + ".png";
|
||||
// m_pTexture = new Texture(dirtPath);
|
||||
m_pTexture = pTextureManager->GetTexture(groundTileType->getPath());
|
||||
@@ -140,12 +140,12 @@ void WorldTile::Draw() {
|
||||
// GroundTileTypes type = tile->GetTileType()->getType();
|
||||
// if(type == Tiles::AIR->getType()) {
|
||||
// utils::SetColor(Colors::BLACK);
|
||||
// utils::FillRect(Rectf{tile->GetPosition(), Point2f{50,50}});
|
||||
// utils::FillRect(Rectf{tile->GetPosition(), Vector2f{50,50}});
|
||||
// continue;
|
||||
// }
|
||||
// if(type != Tiles::AIR->getType()) {
|
||||
// utils::SetColor(Colors::YELLOW);
|
||||
// utils::FillRect(Rectf{tile->GetPosition(), Point2f{50,50}});
|
||||
// utils::FillRect(Rectf{tile->GetPosition(), Vector2f{50,50}});
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
@@ -176,7 +176,7 @@ void WorldTile::Draw() {
|
||||
// if(topLeftType != Tiles::AIR) {
|
||||
// m_pTopLeftTexture->Draw(m_Position);
|
||||
// utils::SetColor(Colors::YELLOW);
|
||||
// utils::FillRect(Rectf{topLeft->GetPosition(), Point2f{50,50}});
|
||||
// utils::FillRect(Rectf{topLeft->GetPosition(), Vector2f{50,50}});
|
||||
// }
|
||||
//
|
||||
// WorldTile* topRight = m_SurroundingTiles.GetTile(TileDirection::TopRight);
|
||||
@@ -187,9 +187,9 @@ void WorldTile::Draw() {
|
||||
//
|
||||
}
|
||||
void WorldTile::Update(Camera* camera) {
|
||||
Point2f CurrentIndex = m_pGridManager->GetIndexFromPosition(m_Position);
|
||||
Vector2f CurrentIndex = m_pGridManager->GetIndexFromPosition(m_Position);
|
||||
m_SurroundingTiles = m_pGridManager->GetSurroundingTiles(this);
|
||||
Point2f mousePos = camera->TransformMouse(Point2f{utils::GetMousePos().x, 500 - utils::GetMousePos().y});
|
||||
Vector2f mousePos = camera->TransformMouse(Vector2f{utils::GetMousePos().x, 500 - utils::GetMousePos().y});
|
||||
m_Hightlight = utils::IsPointInRect(mousePos, Rectf{GetCollisionRect().pos, GetCollisionRect().size});
|
||||
if(CurrentIndex.x == 1 && CurrentIndex.y == 1) {
|
||||
// std::cout << "Hey" << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user