Decompile fn_07870 (CGifRes::DecodeGif)
Batch #12438 by Yommy: 0 byte-identical, 1 confirmed by peer review. - fn_07870 CGifRes::DecodeGif: logic confirmed by peer review Peer-reviewed-by: KWDev, SapitoSucio, dori, cremane 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
5671703c66
commit
327967cc1e
3 changed files with 5 additions and 5 deletions
|
|
@ -1,4 +1,4 @@
|
|||
#include "Resource/GifLzw.h"
|
||||
#include "Resource/GifResource.h"
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
#include "Resource/GifResource.h"
|
||||
|
||||
#include "File/File.h"
|
||||
#include "Resource/GifLzw.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
|
|
@ -47,8 +46,8 @@ namespace {
|
|||
|
||||
// INLINED
|
||||
bool IsGifSignature(const void* data) {
|
||||
const auto* bytes = static_cast<const unsigned char*>(data);
|
||||
return bytes[0] == 'G' && bytes[1] == 'I' && bytes[2] == 'F';
|
||||
constexpr char signature[] = {'G', 'I', 'F'};
|
||||
return std::memcmp(data, signature, sizeof(signature)) == 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -295,7 +294,7 @@ bool CGifRes::DecodeGif(const void* data, int bytes, bool iconOnly) {
|
|||
++cursor;
|
||||
|
||||
unsigned char* indices = new unsigned char[descriptor.width * descriptor.height];
|
||||
if (DecodeGifLzw(minimumCodeSize, compressed, compressedBytes, indices) > 0) {
|
||||
if (this->DecodeGifLzw(minimumCodeSize, compressed, compressedBytes, indices) > 0) {
|
||||
const unsigned int pixelCount = screenHeight * screenWidth;
|
||||
std::uint32_t* pixels = new std::uint32_t[pixelCount];
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ public:
|
|||
|
||||
void CreateBlank(int width, int height);
|
||||
bool DecodeGif(const void* data, int bytes, bool iconOnly);
|
||||
int DecodeGifLzw(int minimumCodeSize, const unsigned char* input, int inputBytes, unsigned char* output);
|
||||
|
||||
/* 0124 */ std::vector<Frame> frames;
|
||||
/* 0130 */ std::uint16_t loopCount;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue