SnapmaticPicture: define default PhotoBuffer
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Syping 2021-05-23 05:06:32 +02:00
parent 1770ec23e0
commit b47a0119a5

View file

@ -170,7 +170,11 @@ bool SnapmaticPicture::readingPictureFromFile(const QString &fileName, bool cach
bool SnapmaticPicture::setImage(const QImage &picture, bool eXtendMode) bool SnapmaticPicture::setImage(const QImage &picture, bool eXtendMode)
{ {
#ifdef GTA5SYNC_DYNAMIC_PHOTOBUFFER
quint32 jpegPicStreamLength = p_ragePhoto.photoBuffer(); quint32 jpegPicStreamLength = p_ragePhoto.photoBuffer();
#else
quint32 jpegPicStreamLength = 524288U;
#endif
QByteArray picByteArray; QByteArray picByteArray;
int comLvl = 100; int comLvl = 100;
bool saveSuccess = false; bool saveSuccess = false;
@ -193,6 +197,10 @@ bool SnapmaticPicture::setImage(const QImage &picture, bool eXtendMode)
} }
} }
else { else {
#ifndef GTA5SYNC_DYNAMIC_PHOTOBUFFER
if (p_ragePhoto.photoBuffer() != jpegPicStreamLength)
p_ragePhoto.setPhotoBuffer(jpegPicStreamLength, true);
#endif
picByteArray = picByteArrayT; picByteArray = picByteArrayT;
} }
} }