Decompile fn_07870 (CGifRes::DecodeGif)

Batch #17295 by SapitoSucio: 0 byte-identical, 1 confirmed by peer review.

- fn_07870 CGifRes::DecodeGif: logic confirmed by peer review

Peer-reviewed-by: eAthena, alisonrag
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-11 20:45:07 +00:00
commit 1e549cb62d

View file

@ -347,8 +347,8 @@ bool CGifRes::DecodeGif(const void* data, int bytes, bool iconOnly) {
memcpy_s(pixels, 4 * pixelCount, this->frames.back().second, 4 * pixelCount);
}
for (std::uint16_t y = 0; y < descriptor.height; ++y) {
for (std::uint16_t x = 0; x < descriptor.width; ++x) {
for (int y = 0; y < descriptor.height; ++y) {
for (int x = 0; x < descriptor.width; ++x) {
const std::uint32_t color = palette[std::min<std::uint16_t>(indices[y * descriptor.width + x], paletteCount)];
if (this->frames.empty() || transparent != 1 || color != palette[std::min<std::uint16_t>(transparentIndex, paletteCount)]) {
const unsigned int position = (descriptor.top + y) * screenWidth + x + descriptor.left;