From 4dd035b84cc22fb014c5e8bd618c822d0459fbc3 Mon Sep 17 00:00:00 2001 From: q66 Date: Mon, 28 Oct 2019 18:15:42 +0100 Subject: [PATCH] opentoonz: add big endian patch --- srcpkgs/opentoonz/patches/big-endian.patch | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 srcpkgs/opentoonz/patches/big-endian.patch diff --git a/srcpkgs/opentoonz/patches/big-endian.patch b/srcpkgs/opentoonz/patches/big-endian.patch new file mode 100644 index 00000000000..fe4573ec08d --- /dev/null +++ b/srcpkgs/opentoonz/patches/big-endian.patch @@ -0,0 +1,38 @@ +Fix up some big endian paths that did not survive refactoring. + +--- toonz/sources/image/tzl/tiio_tzl.cpp ++++ toonz/sources/image/tzl/tiio_tzl.cpp +@@ -945,7 +945,7 @@ void TLevelWriterTzl::saveImage(const TImageP &img, const TFrameId &_fid, + Header *header = (Header *)buff; + + TRasterP ras; +- m_codec->decompress(buff, buffSize, ras); ++ m_codec->decompress(buff, buffSize, ras, false); + delete[] buff; + assert((TRasterCM32P)ras); + assert(ras->getLx() == header->m_lx); +--- toonz/sources/sound/wav/tsio_wav.cpp ++++ toonz/sources/sound/wav/tsio_wav.cpp +@@ -373,17 +373,17 @@ bool TSoundTrackWriterWav::save(const TSoundTrackP &sndtrack) { + #if (!TNZ_LITTLE_ENDIAN) + { + if (fmtChunk.m_bitPerSample == 8) +- memcpy((void *)waveData, (void *)sndtrack->getRawData(), soundDataLength); ++ memcpy((void *)waveData.get(), (void *)sndtrack->getRawData(), soundDataLength); + else if (fmtChunk.m_bitPerSample == 16) { +- swapAndCopySamples((short *)sndtrack->getRawData(), (short *)waveData, ++ swapAndCopySamples((short *)sndtrack->getRawData(), (short *)waveData.get(), + sndtrack->getSampleCount() * fmtChunk.m_chans); + } else if (fmtChunk.m_bitPerSample == 24) { // swap e togliere quarto byte + UCHAR *begin = (UCHAR *)sndtrack->getRawData(); + for (int i = 0; i < (int)sndtrack->getSampleCount() * fmtChunk.m_chans; + ++i) { +- *(waveData + 3 * i) = *(begin + 4 * i + 3); +- *(waveData + 3 * i + 1) = *(begin + 4 * i + 2); +- *(waveData + 3 * i + 2) = *(begin + 4 * i + 1); ++ *(waveData.get() + 3 * i) = *(begin + 4 * i + 3); ++ *(waveData.get() + 3 * i + 1) = *(begin + 4 * i + 2); ++ *(waveData.get() + 3 * i + 2) = *(begin + 4 * i + 1); + } + } + }