Skip to content

Commit

Permalink
RagePhoto: fix inline related issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Syping committed Feb 20, 2023
1 parent d13c22d commit e51d50f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
26 changes: 13 additions & 13 deletions src/RagePhoto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -933,47 +933,47 @@ 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;
rp_data->titlBuffer = DEFAULT_TITLBUFFER;
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;
rp_data->descOffset = rp_data->titlOffset + rp_data->titlBuffer + 8;
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)
Expand Down
4 changes: 2 additions & 2 deletions src/RagePhoto.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ class LIBRAGEPHOTO_CXX_BINDING RagePhoto
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). */
Expand Down

0 comments on commit e51d50f

Please sign in to comment.