| 185 | } |
| 186 | |
| 187 | void DT1::drawTile(const int x, const int y, const int tileIndex) const { |
| 188 | if (tileIndex < 0 || tileIndex >= static_cast<int>(tiles.size())) |
| 189 | return; |
| 190 | const auto &tile = tiles.at(tileIndex); |
| 191 | const auto &renderer = AbyssEngine::getInstance().getRenderer(); |
| 192 | const SDL_Rect destRect = {.x = x, .y = y - tile.drawOffsetY, .w = tile.width, .h = tile.height}; |
| 193 | SDL_RenderCopy(renderer, tile.texture.get(), nullptr, &destRect); |
| 194 | } |
| 195 | |
| 196 | } // namespace Abyss::DataTypes |
no test coverage detected