feat(decals): tiles de decal de sòl compten com a pintats des del load
This commit is contained in:
1 parent
7cd7b4dc4f
commit
7d0aca506a
6 files changed
+74
-12
No files matched your search
@@ -1,5 +1,6 @@
|
||||
#include "game/map/map.hpp"
|
||||
|
||||
#include <cmath>
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
|
||||
@@ -150,6 +151,13 @@ namespace Map {
|
||||
return true;
|
||||
}
|
||||
|
||||
auto pixelToTile(float px, float py) -> std::pair<int, int> {
|
||||
const auto TS = static_cast<float>(tile_size);
|
||||
const int COL = static_cast<int>(std::floor((px - static_cast<float>(tilemap_origin_x)) / TS));
|
||||
const int ROW = static_cast<int>(std::floor((py - static_cast<float>(tilemap_origin_y)) / TS));
|
||||
return {COL, ROW};
|
||||
}
|
||||
|
||||
auto makeInfo() -> Info {
|
||||
return {
|
||||
.playfield_x = playfield_x,
|
||||
|
||||
Reference in new issue
Block a user