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

Method draw

src/Abyss/DataTypes/DC6.cpp:125–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123 setBlendMode(_blendMode);
124}
125void DC6::draw(const uint32_t frameIdx, const int x, const int y) const {
126 if (frameIdx >= _frameRects.size())
127 throw std::runtime_error("Invalid frame index");
128
129 const auto &frameRect = _frameRects[frameIdx];
130 const auto &frame = _frames[frameIdx];
131 const SDL_Rect destRect{x + frame.getXOffset(), y + frame.getYOffset() - frameRect.h, frameRect.w, frameRect.h};
132 SDL_RenderCopy(Singletons::getRendererProvider().getRenderer(), _texture.get(), &frameRect, &destRect);
133}
134void DC6::draw(uint32_t frameIdx, const int x, int y, const int framesX, const int framesY) const {
135 for (auto fy = 0; fy < framesY; fy++) {
136 auto orgX = x;

Callers

nothing calls this directly

Calls 4

getXOffsetMethod · 0.80
getYOffsetMethod · 0.80
getRendererMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected