Decompile fn_08062 (CSprRes::ReduceSprite)
Batch #12514 by dori: 0 byte-identical, 1 confirmed by peer review. - fn_08062 CSprRes::ReduceSprite: logic confirmed by peer review Peer-reviewed-by: Yommy, gordaoprogramas Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
parent
2e4979574d
commit
0e9cc185be
1 changed files with 3 additions and 1 deletions
|
|
@ -56,12 +56,14 @@ std::uint8_t* CSprRes::ReduceSprite(const std::uint8_t* pixels, int width, int h
|
|||
const int outputWidth = halfWidth != 0 ? width / 2 : width;
|
||||
const int outputHeight = halfHeight != 0 ? height / 2 : height;
|
||||
auto* output = new std::uint8_t[outputWidth * outputHeight];
|
||||
std::uint8_t* destination = output;
|
||||
|
||||
for (int y = 0; y < outputHeight; ++y) {
|
||||
const auto* source = pixels + width * y * (halfHeight + 1);
|
||||
|
||||
for (int x = 0; x < outputWidth; ++x) {
|
||||
output[y * outputWidth + x] = source[x * (halfWidth + 1)];
|
||||
*destination++ = *source;
|
||||
source += halfWidth + 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue