| 229 | } |
| 230 | |
| 231 | static std::pair<TileElement*, TileElement*> insertElementPrepareDest(const TilePos2 pos) |
| 232 | { |
| 233 | const auto index = getTileIndex(pos); |
| 234 | if (index >= _tiles.size()) |
| 235 | { |
| 236 | Logging::error("Attempted to get tile out of bounds! ({0}, {1})", pos.x, pos.y); |
| 237 | return std::make_pair(nullptr, nullptr); |
| 238 | } |
| 239 | |
| 240 | auto* source = _tiles[index]; |
| 241 | // _elementsEnd points to the free space at the end of the |
| 242 | // tile elements. You must always check there is space (checkFreeElementsAndReorganise) |
| 243 | // prior to calling this function! |
| 244 | auto* dest = &_elements[_elementsEnd]; |
| 245 | set(pos, dest); |
| 246 | return std::make_pair(source, dest); |
| 247 | } |
| 248 | |
| 249 | static TileElement* insertElementEnd(ElementType type, uint8_t baseZ, uint8_t occupiedQuads, TileElement* source, TileElement* dest, bool lastFound) |
| 250 | { |
no test coverage detected