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:
parent
1b17c31211
commit
cc3ced6e1c
1 changed files with 5 additions and 7 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue