rendering update
This commit is contained in:
parent
bc97c13a0b
commit
7fdab4f62b
4 changed files with 33 additions and 49 deletions
|
|
@ -115,5 +115,16 @@ export namespace Crafter {
|
|||
redraw[i] = true;
|
||||
}
|
||||
}
|
||||
void CopyNearestNeighbor(Vector<std::uint8_t, 4>* dst, std::uint16_t dstSizeX, std::uint16_t dstScaledSizeX, std::uint16_t dstScaledSizeY, std::uint16_t offsetX, std::uint16_t offsetY) {
|
||||
for (std::uint16_t y = 0; y < dstScaledSizeY; y++) {
|
||||
std::uint16_t srcY = y * scaled.size.y / dstScaledSizeY;
|
||||
std::uint16_t dstY = y + offsetY;
|
||||
for (std::uint16_t x = 0; x < dstScaledSizeX; x++) {
|
||||
std::uint16_t srcX = x * scaled.size.x / dstScaledSizeX;
|
||||
std::uint16_t dstX = x + offsetX;
|
||||
dst[dstY * dstSizeX + dstX] = buffer[srcY * this->scaled.size.x + srcX];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue