RDR 2 support
This commit is contained in:
parent
7721aab48b
commit
85949e36a1
2 changed files with 21 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
|||
## libragephoto
|
||||
Open Source RAGE Photo Parser for GTA V
|
||||
Open Source RAGE Photo Parser for GTA V and RDR 2
|
||||
|
||||
- Read RAGE Photos error free and correct
|
||||
- Support for metadata stored in RAGE Photos
|
||||
|
|
|
@ -81,7 +81,7 @@ bool RagePhoto::load(const char *data, size_t length)
|
|||
#else
|
||||
uint32_t format = charToUInt32LE(uInt32Buffer);
|
||||
#endif
|
||||
if (format == static_cast<uint32_t>(PhotoFormat::GTA5)) {
|
||||
if (format == static_cast<uint32_t>(PhotoFormat::GTA5) || format == static_cast<uint32_t>(PhotoFormat::RDR2)) {
|
||||
char photoHeader[256];
|
||||
size = readBuffer(data, photoHeader, &pos, 256, length);
|
||||
if (size != 256) {
|
||||
|
@ -123,6 +123,9 @@ bool RagePhoto::load(const char *data, size_t length)
|
|||
p_headerSum = charToUInt32LE(uInt32Buffer);
|
||||
#endif
|
||||
|
||||
if (format == static_cast<uint32_t>(PhotoFormat::RDR2))
|
||||
pos = pos + 8;
|
||||
|
||||
size = readBuffer(data, uInt32Buffer, &pos, 4, length);
|
||||
if (size != 4) {
|
||||
p_error = Error::IncompleteEOF; // 7
|
||||
|
@ -213,6 +216,9 @@ bool RagePhoto::load(const char *data, size_t length)
|
|||
}
|
||||
p_photoLoaded = true;
|
||||
|
||||
if (format == static_cast<uint32_t>(PhotoFormat::RDR2))
|
||||
pos = p_jsonOffset + 272;
|
||||
else
|
||||
pos = p_jsonOffset + 264;
|
||||
size = readBuffer(data, markerBuffer, &pos, 4, length);
|
||||
if (size != 4) {
|
||||
|
@ -249,6 +255,9 @@ bool RagePhoto::load(const char *data, size_t length)
|
|||
p_jsonString = std::string(t_jsonData);
|
||||
free(t_jsonData);
|
||||
|
||||
if (format == static_cast<uint32_t>(PhotoFormat::RDR2))
|
||||
pos = p_titlOffset + 272;
|
||||
else
|
||||
pos = p_titlOffset + 264;
|
||||
size = readBuffer(data, markerBuffer, &pos, 4, length);
|
||||
if (size != 4) {
|
||||
|
@ -285,6 +294,9 @@ bool RagePhoto::load(const char *data, size_t length)
|
|||
p_titleString = std::string(t_titlData);
|
||||
free(t_titlData);
|
||||
|
||||
if (format == static_cast<uint32_t>(PhotoFormat::RDR2))
|
||||
pos = p_descOffset + 272;
|
||||
else
|
||||
pos = p_descOffset + 264;
|
||||
size = readBuffer(data, markerBuffer, &pos, 4, length);
|
||||
if (size != 4) {
|
||||
|
@ -321,6 +333,9 @@ bool RagePhoto::load(const char *data, size_t length)
|
|||
p_descriptionString = std::string(t_descData);
|
||||
free(t_descData);
|
||||
|
||||
if (format == static_cast<uint32_t>(PhotoFormat::RDR2))
|
||||
pos = p_endOfFile + 268;
|
||||
else
|
||||
pos = p_endOfFile + 260;
|
||||
size = readBuffer(data, markerBuffer, &pos, 4, length);
|
||||
if (size != 4) {
|
||||
|
|
Loading…
Reference in a new issue