MCPcopy Create free account
hub / github.com/AbyssEngine/AbyssEngineOld / drawTile

Method drawTile

src/Abyss/DataTypes/DT1.cpp:187–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187void 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

Callers 1

renderMethod · 0.80

Calls 2

getRendererMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected