RagePhoto: fix inline related issues

This commit is contained in:
Syping 2023-02-20 13:37:40 +01:00
parent d13c22dc05
commit e51d50f77e
2 changed files with 15 additions and 15 deletions

View file

@ -916,7 +916,7 @@ bool RagePhoto::saveFile(const std::string &filename)
return saveFile(filename, m_data->photoFormat);
}
inline size_t RagePhoto::saveSize(RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser, uint32_t photoFormat)
size_t RagePhoto::saveSize(RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser, uint32_t photoFormat)
{
if (photoFormat == PhotoFormat::GTA5)
return (rp_data->jpegBuffer + rp_data->jsonBuffer + rp_data->titlBuffer + rp_data->descBuffer + GTA5_HEADERSIZE + 56UL);
@ -933,27 +933,22 @@ inline size_t RagePhoto::saveSize(RagePhotoData *rp_data, RagePhotoFormatParser
return 0;
}
inline size_t RagePhoto::saveSize(RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser)
size_t RagePhoto::saveSize(RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser)
{
return saveSize(rp_data, rp_parser, rp_data->photoFormat);
}
inline size_t RagePhoto::saveSize(uint32_t photoFormat)
size_t RagePhoto::saveSize(uint32_t photoFormat)
{
return saveSize(m_data, m_parser, photoFormat);
}
inline size_t RagePhoto::saveSize()
size_t RagePhoto::saveSize()
{
return saveSize(m_data->photoFormat);
}
inline void RagePhoto::setBufferDefault()
{
setBufferDefault(m_data);
}
inline void RagePhoto::setBufferDefault(RagePhotoData *rp_data)
void RagePhoto::setBufferDefault(RagePhotoData *rp_data)
{
rp_data->descBuffer = DEFAULT_DESCBUFFER;
rp_data->jsonBuffer = DEFAULT_JSONBUFFER;
@ -961,12 +956,12 @@ inline void RagePhoto::setBufferDefault(RagePhotoData *rp_data)
setBufferOffsets(rp_data);
}
inline void RagePhoto::setBufferOffsets()
void RagePhoto::setBufferDefault()
{
setBufferOffsets(m_data);
setBufferDefault(m_data);
}
inline void RagePhoto::setBufferOffsets(RagePhotoData *rp_data)
void RagePhoto::setBufferOffsets(RagePhotoData *rp_data)
{
rp_data->jsonOffset = rp_data->jpegBuffer + 28;
rp_data->titlOffset = rp_data->jsonOffset + rp_data->jsonBuffer + 8;
@ -974,6 +969,11 @@ inline void RagePhoto::setBufferOffsets(RagePhotoData *rp_data)
rp_data->endOfFile = rp_data->descOffset + rp_data->descBuffer + 12;
}
void RagePhoto::setBufferOffsets()
{
setBufferOffsets(m_data);
}
bool RagePhoto::setData(RagePhotoData *rp_data, bool takeOwnership)
{
if (m_data == rp_data)

View file

@ -146,10 +146,10 @@ public:
static size_t saveSize(RagePhotoData *rp_data, RagePhotoFormatParser *rp_parser); /**< Returns the Photo save file size. */
size_t saveSize(uint32_t photoFormat); /**< Returns the Photo save file size. */
size_t saveSize(); /**< Returns the Photo save file size. */
void setBufferDefault(); /**< Sets all cross-format Buffer to default size. */
static void setBufferDefault(RagePhotoData *rp_data); /**< Sets all cross-format Buffer to default size. */
void setBufferOffsets(); /**< Moves all Buffer offsets to correct position. */
void setBufferDefault(); /**< Sets all cross-format Buffer to default size. */
static void setBufferOffsets(RagePhotoData *rp_data); /**< Moves all Buffer offsets to correct position. */
void setBufferOffsets(); /**< Moves all Buffer offsets to correct position. */
bool setData(RagePhotoData *rp_data, bool takeOwnership = true); /**< Sets the internal RagePhotoData object. */
void setDescription(const char *description, uint32_t bufferSize = 0); /**< Sets the Photo description. */
void setFormat(uint32_t photoFormat); /**< Sets the Photo Format (GTA V or RDR 2). */