[Scummvm-git-logs] scummvm master -> ad20f02070dd324a470bab68f4fd8e09db29dccb
bluegr
noreply at scummvm.org
Wed Jan 8 11:40:37 UTC 2025
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
6824e1057e TWINE: Don't use GIFDecoder when it's not built
ad20f02070 IMAGE: Don't declare GIFDecoder when GIF support is not built
Commit: 6824e1057eddd51c53bd11e97a2ad410441e5f41
https://github.com/scummvm/scummvm/commit/6824e1057eddd51c53bd11e97a2ad410441e5f41
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-01-08T13:40:33+02:00
Commit Message:
TWINE: Don't use GIFDecoder when it's not built
Changed paths:
engines/twine/movies.cpp
engines/twine/movies.h
diff --git a/engines/twine/movies.cpp b/engines/twine/movies.cpp
index ec4253ba596..cbaf5d3169c 100644
--- a/engines/twine/movies.cpp
+++ b/engines/twine/movies.cpp
@@ -296,6 +296,7 @@ void Movies::drawNextFrameFla() {
Movies::Movies(TwinEEngine *engine) : _engine(engine) {}
+#ifdef USE_GIF
void Movies::prepareGIF(int index) {
Image::GIFDecoder decoder;
Common::SeekableReadStream *stream = HQR::makeReadStream(Resources::HQR_FLAGIF_FILE, index);
@@ -318,8 +319,10 @@ void Movies::prepareGIF(int index) {
_engine->delaySkip(5000);
_engine->setPalette(_engine->_screens->_ptrPal);
}
+#endif
void Movies::playGIFMovie(const char *flaName) {
+#ifdef USE_GIF
if (!Common::File::exists(Resources::HQR_FLAGIF_FILE)) {
warning("%s file doesn't exist", Resources::HQR_FLAGIF_FILE);
return;
@@ -365,6 +368,9 @@ void Movies::playGIFMovie(const char *flaName) {
} else {
warning("unknown gif image: %s", name.c_str());
}
+#else
+ warning("No GIF support compiled in");
+#endif
}
bool Movies::playMovie(const char *name) { // PlayAnimFla
diff --git a/engines/twine/movies.h b/engines/twine/movies.h
index 7c8cd8dd0e8..071cbadc77b 100644
--- a/engines/twine/movies.h
+++ b/engines/twine/movies.h
@@ -89,7 +89,9 @@ private:
void scaleFla2x();
void drawNextFrameFla();
+#ifdef USE_GIF
void prepareGIF(int index);
+#endif
void playGIFMovie(const char *flaName);
bool playSmkMovie(const char *name, int index);
Commit: ad20f02070dd324a470bab68f4fd8e09db29dccb
https://github.com/scummvm/scummvm/commit/ad20f02070dd324a470bab68f4fd8e09db29dccb
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-01-08T13:40:33+02:00
Commit Message:
IMAGE: Don't declare GIFDecoder when GIF support is not built
As gif.cpp is not built when GIF support is not enabled, don't declare
it and guard its uses.
Changed paths:
engines/hpl1/engine/graphics/bitmap2D.cpp
image/gif.cpp
image/gif.h
diff --git a/engines/hpl1/engine/graphics/bitmap2D.cpp b/engines/hpl1/engine/graphics/bitmap2D.cpp
index 44324da224e..e22d21e587f 100644
--- a/engines/hpl1/engine/graphics/bitmap2D.cpp
+++ b/engines/hpl1/engine/graphics/bitmap2D.cpp
@@ -59,8 +59,10 @@ Bitmap2D::Bitmap2D(const tString &filepath, const tString &type, const Graphics:
_decoder.reset(loadImage(filepath, new Image::TGADecoder));
else if (type == "jpg" || type == "jpeg")
_decoder.reset(loadImage(filepath, setupJPEGDecoder(new Image::JPEGDecoder)));
+#ifdef USE_GIF
else if (type == "gif")
_decoder.reset(loadImage(filepath, new Image::GIFDecoder));
+#endif
else
error("trying to load unsupported image format %s", type.c_str());
_width = _decoder->getSurface()->w;
diff --git a/image/gif.cpp b/image/gif.cpp
index cf5cf58fdfd..85c20affa91 100644
--- a/image/gif.cpp
+++ b/image/gif.cpp
@@ -28,9 +28,7 @@
#include "graphics/surface.h"
#include "graphics/pixelformat.h"
-#ifdef USE_GIF
#include <gif_lib.h>
-#endif
namespace Image {
@@ -41,17 +39,14 @@ GIFDecoder::~GIFDecoder() {
destroy();
}
-#ifdef USE_GIF
static int gifReadFromStream(GifFileType *gif, GifByteType *bytes, int size) {
Common::SeekableReadStream *stream = (Common::SeekableReadStream *)gif->UserData;
return stream->read(bytes, size);
}
-#endif
bool GIFDecoder::loadStream(Common::SeekableReadStream &stream) {
destroy();
-#ifdef USE_GIF
int error = 0;
GifFileType *gif = DGifOpen(&stream, gifReadFromStream, &error);
if (!gif) {
@@ -125,9 +120,6 @@ bool GIFDecoder::loadStream(Common::SeekableReadStream &stream) {
DGifCloseFile(gif, 0);
return true;
-#else
- return false;
-#endif
}
void GIFDecoder::destroy() {
diff --git a/image/gif.h b/image/gif.h
index 4b5d22e61c8..c27154c18d2 100644
--- a/image/gif.h
+++ b/image/gif.h
@@ -24,6 +24,8 @@
#include "image/image_decoder.h"
+#ifdef USE_GIF
+
namespace Common {
class SeekableReadStream;
}
@@ -69,4 +71,6 @@ private:
/** @} */
} // End of namespace Image
+#endif // USE_GIF
+
#endif
More information about the Scummvm-git-logs
mailing list