Decompile fn_08063 (CSprRes::EncodeSpriteRuns)

Batch #15726 by Yommy: 0 byte-identical, 1 confirmed by peer review.

- fn_08063 CSprRes::EncodeSpriteRuns: logic confirmed by peer review

Peer-reviewed-by: ragnarok-clanker, eAthena
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
ragnarok-clanker 2026-11-10 13:05:29 +00:00
commit cc3ced6e1c

View file

@ -13,16 +13,14 @@ std::uint8_t* CSprRes::EncodeSpriteRuns(const std::uint8_t* pixels, int width, i
for (int y = 0; y < height; ++y) {
for (int x = 0; x < width; ++x, ++index) {
if (pixels[index] == 0) {
if (zeroRun) {
if (++zeroCount >= 255) {
encoded.push_back(static_cast<std::uint8_t>(zeroCount));
zeroRun = 0;
zeroCount = 0;
}
} else {
if (!zeroRun) {
encoded.push_back(0);
zeroRun = 1;
++zeroCount;
} else if (++zeroCount >= 255) {
encoded.push_back(static_cast<std::uint8_t>(zeroCount));
zeroRun = 0;
zeroCount = 0;
}
} else {
if (zeroRun) {