[Scummvm-git-logs] scummvm master -> 588f706503513401091fc602b370fd96f0ccaf5b
sev-
noreply at scummvm.org
Sun Nov 27 23:19:54 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
588f706503 VIDEO: Switch DXA decoder to gzio.
Commit: 588f706503513401091fc602b370fd96f0ccaf5b
https://github.com/scummvm/scummvm/commit/588f706503513401091fc602b370fd96f0ccaf5b
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2022-11-28T00:19:51+01:00
Commit Message:
VIDEO: Switch DXA decoder to gzio.
This reduces reliance on zlib
Changed paths:
engines/sword1/animation.cpp
engines/sword2/animation.cpp
video/dxa_decoder.cpp
diff --git a/engines/sword1/animation.cpp b/engines/sword1/animation.cpp
index c3f93898bd0..dc15c888823 100644
--- a/engines/sword1/animation.cpp
+++ b/engines/sword1/animation.cpp
@@ -40,9 +40,7 @@
#include "video/avi_decoder.h"
#endif
-#ifdef USE_ZLIB
#include "video/dxa_decoder.h"
-#endif
#include "video/psx_decoder.h"
#include "video/smk_decoder.h"
@@ -545,14 +543,8 @@ MoviePlayer *makeMoviePlayer(uint32 id, SwordEngine *vm, Text *textMan, ResMan *
filename = Common::String::format("%s.dxa", sequenceList[id]);
if (Common::File::exists(filename)) {
-#ifdef USE_ZLIB
Video::VideoDecoder *dxaDecoder = new Video::DXADecoder();
return new MoviePlayer(vm, textMan, resMan, system, dxaDecoder, kVideoDecoderDXA);
-#else
- GUI::MessageDialog dialog(_("DXA cutscenes found but ScummVM has been built without zlib"), _("OK"));
- dialog.runModal();
- return 0;
-#endif
}
// Old MPEG2 cutscenes
diff --git a/engines/sword2/animation.cpp b/engines/sword2/animation.cpp
index d99d918fdc3..90c21964e4c 100644
--- a/engines/sword2/animation.cpp
+++ b/engines/sword2/animation.cpp
@@ -45,9 +45,7 @@
#include "video/avi_decoder.h"
#endif
-#ifdef USE_ZLIB
#include "video/dxa_decoder.h"
-#endif
#include "video/smk_decoder.h"
#include "video/psx_decoder.h"
@@ -441,14 +439,8 @@ MoviePlayer *makeMoviePlayer(const char *name, Sword2Engine *vm, OSystem *system
filename = Common::String::format("%s.dxa", name);
if (Common::File::exists(filename)) {
-#ifdef USE_ZLIB
Video::DXADecoder *dxaDecoder = new Video::DXADecoder();
return new MoviePlayer(vm, system, dxaDecoder, kVideoDecoderDXA);
-#else
- GUI::MessageDialog dialog(_("DXA cutscenes found but ScummVM has been built without zlib"), _("OK"));
- dialog.runModal();
- return NULL;
-#endif
}
// Old MPEG2 cutscenes
diff --git a/video/dxa_decoder.cpp b/video/dxa_decoder.cpp
index cbc8bc63012..0ae59b53f61 100644
--- a/video/dxa_decoder.cpp
+++ b/video/dxa_decoder.cpp
@@ -29,9 +29,7 @@
#include "video/dxa_decoder.h"
-#ifdef USE_ZLIB
- #include "common/zlib.h"
-#endif
+#include "common/gzio.h"
namespace Video {
@@ -169,17 +167,13 @@ void DXADecoder::DXAVideoTrack::setFrameStartPos() {
}
void DXADecoder::DXAVideoTrack::decodeZlib(byte *data, int size, int totalSize) {
-#ifdef USE_ZLIB
- unsigned long dstLen = totalSize;
- Common::uncompress(data, &dstLen, _inBuffer, size);
-#endif
+ Common::GzioReadStream::zlibDecompress(data, totalSize, _inBuffer, size);
}
#define BLOCKW 4
#define BLOCKH 4
void DXADecoder::DXAVideoTrack::decode12(int size) {
-#ifdef USE_ZLIB
if (!_decompBuffer) {
_decompBuffer = new byte[_decompBufferSize]();
}
@@ -273,11 +267,9 @@ void DXADecoder::DXAVideoTrack::decode12(int size) {
}
}
}
-#endif
}
void DXADecoder::DXAVideoTrack::decode13(int size) {
-#ifdef USE_ZLIB
uint8 *codeBuf, *dataBuf, *motBuf, *maskBuf;
if (!_decompBuffer) {
@@ -459,7 +451,6 @@ void DXADecoder::DXAVideoTrack::decode13(int size) {
}
}
}
-#endif
}
const Graphics::Surface *DXADecoder::DXAVideoTrack::decodeNextFrame() {
More information about the Scummvm-git-logs
mailing list