mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-07-19 06:05:17 +02:00
using gif.decoded_frame as a condition is just a bad idea
This commit is contained in:
parent
66d92ca7c7
commit
fd8bd40260
1 changed files with 3 additions and 3 deletions
|
@ -527,7 +527,7 @@ Bitmap::Bitmap(const char *filename)
|
|||
if (fcount > fcount_partial) {
|
||||
Debug() << "Non-fatal error reading" << filename << ": Only decoded" << fcount_partial << "out of" << fcount << "frames";
|
||||
}
|
||||
for (int i = 0; i < fcount_partial; i++) {
|
||||
for (int i = 1; i < fcount_partial; i++) {
|
||||
TEXFBO texfbo;
|
||||
try {
|
||||
texfbo = shState->texPool().request(p->animation.width, p->animation.height);
|
||||
|
@ -548,7 +548,7 @@ Bitmap::Bitmap(const char *filename)
|
|||
TEX::uploadImage(p->animation.width, p->animation.height, handler.gif->frame_image, GL_RGBA);
|
||||
p->animation.frames.push_back(texfbo);
|
||||
|
||||
int status = gif_decode_frame(handler.gif, handler.gif->decoded_frame + 1);
|
||||
int status = gif_decode_frame(handler.gif, i);
|
||||
if (status != GIF_OK && status != GIF_WORKING) {
|
||||
for (TEXFBO &frame : p->animation.frames)
|
||||
shState->texPool().release(frame);
|
||||
|
@ -558,7 +558,7 @@ Bitmap::Bitmap(const char *filename)
|
|||
delete handler.gif_data;
|
||||
|
||||
throw Exception(Exception::MKXPError, "Failed to decode GIF frame %i out of %i (Error %i)",
|
||||
handler.gif->decoded_frame + 1, fcount_partial, status);
|
||||
i + 1, fcount_partial, status);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue