WebAssembly CMake support and other changes
RagePhoto-Extract: removed unnecessary includes Windows RagePhoto-Extract: included Windows resource file RagePhotoA: include iostream to fix undefined std:: RagePhoto: seperate C and CXX exports to export only C functions with WebAssembly Windows RagePhoto: changed Windows resource file language to 0x0 Doxyfile: change PROJECT_VERSION variable to ragephoto_VERSION variable
This commit is contained in:
parent
44d67fa78f
commit
c6566c8f17
11 changed files with 134 additions and 51 deletions
|
@ -17,8 +17,6 @@
|
|||
*****************************************************************************/
|
||||
|
||||
#include "RagePhotoC.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
|
||||
#include "RagePhoto.h"
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
|
|
@ -33,7 +33,7 @@ typedef std::function<bool(const char*, size_t, RagePhotoData*)> RagePhotoLoadFu
|
|||
/**
|
||||
* \brief GTA V and RDR 2 Photo Parser.
|
||||
*/
|
||||
class LIBRAGEPHOTO_EXPORT RagePhoto
|
||||
class LIBRAGEPHOTO_CXX_EXPORT RagePhoto
|
||||
{
|
||||
public:
|
||||
/** Default sizes */
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#ifdef __cplusplus
|
||||
#include "RagePhotoC.h"
|
||||
#include <iostream>
|
||||
|
||||
/**
|
||||
* \brief ABI Stable Wrapper for RagePhoto.
|
||||
|
|
|
@ -35,124 +35,124 @@ extern "C" {
|
|||
typedef void* ragephoto_t;
|
||||
|
||||
/** Opens a \p ragephoto_t instance. */
|
||||
LIBRAGEPHOTO_EXPORT ragephoto_t ragephoto_open();
|
||||
LIBRAGEPHOTO_C_EXPORT ragephoto_t ragephoto_open();
|
||||
|
||||
/** Resets the \p ragephoto_t instance to default values.
|
||||
* \param instance \p ragephoto_t instance
|
||||
*/
|
||||
LIBRAGEPHOTO_EXPORT void ragephoto_clear(ragephoto_t instance);
|
||||
LIBRAGEPHOTO_C_EXPORT void ragephoto_clear(ragephoto_t instance);
|
||||
|
||||
/** Loads a Photo from a const char*.
|
||||
* \param instance \p ragephoto_t instance
|
||||
* \param data Photo data
|
||||
* \param size Photo data size
|
||||
*/
|
||||
LIBRAGEPHOTO_EXPORT int ragephoto_load(ragephoto_t instance, const char *data, size_t size);
|
||||
LIBRAGEPHOTO_C_EXPORT int ragephoto_load(ragephoto_t instance, const char *data, size_t size);
|
||||
|
||||
/** Loads a Photo from a file.
|
||||
* \param instance \p ragephoto_t instance
|
||||
* \param filename File to load
|
||||
*/
|
||||
LIBRAGEPHOTO_EXPORT int ragephoto_loadfile(ragephoto_t instance, const char *filename);
|
||||
LIBRAGEPHOTO_C_EXPORT int ragephoto_loadfile(ragephoto_t instance, const char *filename);
|
||||
|
||||
/** Returns the last error occurred.
|
||||
* \param instance \p ragephoto_t instance
|
||||
*/
|
||||
LIBRAGEPHOTO_EXPORT uint8_t ragephoto_error(ragephoto_t instance);
|
||||
LIBRAGEPHOTO_C_EXPORT uint8_t ragephoto_error(ragephoto_t instance);
|
||||
|
||||
/** Returns the GTA V default Photo Buffer Size. */
|
||||
LIBRAGEPHOTO_EXPORT uint32_t ragephoto_defpbuf_gta5();
|
||||
LIBRAGEPHOTO_C_EXPORT uint32_t ragephoto_defpbuf_gta5();
|
||||
|
||||
/** Returns the RDR 2 default Photo Buffer Size. */
|
||||
LIBRAGEPHOTO_EXPORT uint32_t ragephoto_defpbuf_rdr2();
|
||||
LIBRAGEPHOTO_C_EXPORT uint32_t ragephoto_defpbuf_rdr2();
|
||||
|
||||
/** Returns the GTA V Photo Format. */
|
||||
LIBRAGEPHOTO_EXPORT uint32_t ragephoto_format_gta5();
|
||||
LIBRAGEPHOTO_C_EXPORT uint32_t ragephoto_format_gta5();
|
||||
|
||||
/** Returns the RDR 2 Photo Format. */
|
||||
LIBRAGEPHOTO_EXPORT uint32_t ragephoto_format_rdr2();
|
||||
LIBRAGEPHOTO_C_EXPORT uint32_t ragephoto_format_rdr2();
|
||||
|
||||
/** Returns the Photo description.
|
||||
* \param instance \p ragephoto_t instance
|
||||
*/
|
||||
LIBRAGEPHOTO_EXPORT const char* ragephoto_getphotodesc(ragephoto_t instance);
|
||||
LIBRAGEPHOTO_C_EXPORT const char* ragephoto_getphotodesc(ragephoto_t instance);
|
||||
|
||||
/** Returns the Photo Format (GTA V or RDR 2).
|
||||
* \param instance \p ragephoto_t instance
|
||||
*/
|
||||
LIBRAGEPHOTO_EXPORT uint32_t ragephoto_getphotoformat(ragephoto_t instance);
|
||||
LIBRAGEPHOTO_C_EXPORT uint32_t ragephoto_getphotoformat(ragephoto_t instance);
|
||||
|
||||
/** Returns the Photo JPEG data.
|
||||
* \param instance \p ragephoto_t instance
|
||||
*/
|
||||
LIBRAGEPHOTO_EXPORT const char* ragephoto_getphotojpeg(ragephoto_t instance);
|
||||
LIBRAGEPHOTO_C_EXPORT const char* ragephoto_getphotojpeg(ragephoto_t instance);
|
||||
|
||||
/** Returns the Photo JSON data.
|
||||
* \param instance \p ragephoto_t instance
|
||||
*/
|
||||
LIBRAGEPHOTO_EXPORT const char* ragephoto_getphotojson(ragephoto_t instance);
|
||||
LIBRAGEPHOTO_C_EXPORT const char* ragephoto_getphotojson(ragephoto_t instance);
|
||||
|
||||
/** Returns the Photo header.
|
||||
* \param instance \p ragephoto_t instance
|
||||
*/
|
||||
LIBRAGEPHOTO_EXPORT const char* ragephoto_getphotoheader(ragephoto_t instance);
|
||||
LIBRAGEPHOTO_C_EXPORT const char* ragephoto_getphotoheader(ragephoto_t instance);
|
||||
|
||||
/** Returns the Photo JPEG data size.
|
||||
* \param instance \p ragephoto_t instance
|
||||
*/
|
||||
LIBRAGEPHOTO_EXPORT uint32_t ragephoto_getphotosize(ragephoto_t instance);
|
||||
LIBRAGEPHOTO_C_EXPORT uint32_t ragephoto_getphotosize(ragephoto_t instance);
|
||||
|
||||
/** Returns the Photo title.
|
||||
* \param instance \p ragephoto_t instance
|
||||
*/
|
||||
LIBRAGEPHOTO_EXPORT const char* ragephoto_getphototitle(ragephoto_t instance);
|
||||
LIBRAGEPHOTO_C_EXPORT const char* ragephoto_getphototitle(ragephoto_t instance);
|
||||
|
||||
/** Returns the Photo save file size.
|
||||
* \param instance \p ragephoto_t instance
|
||||
*/
|
||||
LIBRAGEPHOTO_EXPORT size_t ragephoto_getsavesize(ragephoto_t instance);
|
||||
LIBRAGEPHOTO_C_EXPORT size_t ragephoto_getsavesize(ragephoto_t instance);
|
||||
|
||||
/** Returns the Photo save file size.
|
||||
* \param instance \p ragephoto_t instance
|
||||
* \param photoFormat Photo Format (GTA V or RDR 2)
|
||||
*/
|
||||
LIBRAGEPHOTO_EXPORT size_t ragephoto_getsavesizef(ragephoto_t instance, uint32_t photoFormat);
|
||||
LIBRAGEPHOTO_C_EXPORT size_t ragephoto_getsavesizef(ragephoto_t instance, uint32_t photoFormat);
|
||||
|
||||
/** Saves a Photo to a char*.
|
||||
* \param instance \p ragephoto_t instance
|
||||
* \param data Photo data
|
||||
*/
|
||||
LIBRAGEPHOTO_EXPORT int ragephoto_save(ragephoto_t instance, char *data);
|
||||
LIBRAGEPHOTO_C_EXPORT int ragephoto_save(ragephoto_t instance, char *data);
|
||||
|
||||
/** Saves a Photo to a char*.
|
||||
* \param instance \p ragephoto_t instance
|
||||
* \param data Photo data
|
||||
* \param photoFormat Photo Format (GTA V or RDR 2)
|
||||
*/
|
||||
LIBRAGEPHOTO_EXPORT int ragephoto_savef(ragephoto_t instance, char *data, uint32_t photoFormat);
|
||||
LIBRAGEPHOTO_C_EXPORT int ragephoto_savef(ragephoto_t instance, char *data, uint32_t photoFormat);
|
||||
|
||||
/** Saves a Photo to a file.
|
||||
* \param instance \p ragephoto_t instance
|
||||
* \param filename File to save
|
||||
*/
|
||||
LIBRAGEPHOTO_EXPORT int ragephoto_savefile(ragephoto_t instance, const char *filename);
|
||||
LIBRAGEPHOTO_C_EXPORT int ragephoto_savefile(ragephoto_t instance, const char *filename);
|
||||
|
||||
/** Saves a Photo to a file.
|
||||
* \param instance \p ragephoto_t instance
|
||||
* \param filename File to save
|
||||
* \param photoFormat Photo Format (GTA V or RDR 2)
|
||||
*/
|
||||
LIBRAGEPHOTO_EXPORT int ragephoto_savefilef(ragephoto_t instance, const char *filename, uint32_t photoFormat);
|
||||
LIBRAGEPHOTO_C_EXPORT int ragephoto_savefilef(ragephoto_t instance, const char *filename, uint32_t photoFormat);
|
||||
|
||||
/** Sets all cross-format Buffer to default size.
|
||||
* \param instance \p ragephoto_t instance
|
||||
*/
|
||||
LIBRAGEPHOTO_EXPORT void ragephoto_setbufferdefault(ragephoto_t instance);
|
||||
LIBRAGEPHOTO_C_EXPORT void ragephoto_setbufferdefault(ragephoto_t instance);
|
||||
|
||||
/** Moves all Buffer offsets to correct position.
|
||||
* \param instance \p ragephoto_t instance
|
||||
*/
|
||||
LIBRAGEPHOTO_EXPORT void ragephoto_setbufferoffsets(ragephoto_t instance);
|
||||
LIBRAGEPHOTO_C_EXPORT void ragephoto_setbufferoffsets(ragephoto_t instance);
|
||||
|
||||
/** Sets the Photo description.
|
||||
* \param instance \p ragephoto_t instance
|
||||
|
@ -161,13 +161,13 @@ LIBRAGEPHOTO_EXPORT void ragephoto_setbufferoffsets(ragephoto_t instance);
|
|||
*
|
||||
* Default bufferSize: 256UL
|
||||
*/
|
||||
LIBRAGEPHOTO_EXPORT void ragephoto_setphotodesc(ragephoto_t instance, const char *description, uint32_t bufferSize);
|
||||
LIBRAGEPHOTO_C_EXPORT void ragephoto_setphotodesc(ragephoto_t instance, const char *description, uint32_t bufferSize);
|
||||
|
||||
/** Sets the Photo Format (GTA V or RDR 2).
|
||||
* \param instance \p ragephoto_t instance
|
||||
* \param photoFormat Photo Format (GTA V or RDR 2)
|
||||
*/
|
||||
LIBRAGEPHOTO_EXPORT void ragephoto_setphotoformat(ragephoto_t instance, uint32_t photoFormat);
|
||||
LIBRAGEPHOTO_C_EXPORT void ragephoto_setphotoformat(ragephoto_t instance, uint32_t photoFormat);
|
||||
|
||||
/** Sets the Photo JPEG data.
|
||||
* \param instance \p ragephoto_t instance
|
||||
|
@ -177,7 +177,7 @@ LIBRAGEPHOTO_EXPORT void ragephoto_setphotoformat(ragephoto_t instance, uint32_t
|
|||
*
|
||||
* Default bufferSize: ragephoto_defpbuf_gta5() or ragephoto_defpbuf_rdr2()
|
||||
*/
|
||||
LIBRAGEPHOTO_EXPORT int ragephoto_setphotojpeg(ragephoto_t instance, const char *data, uint32_t size, uint32_t bufferSize);
|
||||
LIBRAGEPHOTO_C_EXPORT int ragephoto_setphotojpeg(ragephoto_t instance, const char *data, uint32_t size, uint32_t bufferSize);
|
||||
|
||||
/** Sets the Photo JSON data.
|
||||
* \param instance \p ragephoto_t instance
|
||||
|
@ -186,10 +186,10 @@ LIBRAGEPHOTO_EXPORT int ragephoto_setphotojpeg(ragephoto_t instance, const char
|
|||
*
|
||||
* Default bufferSize: 3072UL
|
||||
*/
|
||||
LIBRAGEPHOTO_EXPORT void ragephoto_setphotojson(ragephoto_t instance, const char *json, uint32_t bufferSize);
|
||||
LIBRAGEPHOTO_C_EXPORT void ragephoto_setphotojson(ragephoto_t instance, const char *json, uint32_t bufferSize);
|
||||
|
||||
/** Sets the Photo header. (EXPERT ONLY) */
|
||||
LIBRAGEPHOTO_EXPORT void ragephoto_setphotoheader(ragephoto_t instance, const char *header, uint32_t headerSum);
|
||||
LIBRAGEPHOTO_C_EXPORT void ragephoto_setphotoheader(ragephoto_t instance, const char *header, uint32_t headerSum);
|
||||
|
||||
/** Sets the Photo title.
|
||||
* \param instance \p ragephoto_t instance
|
||||
|
@ -198,15 +198,15 @@ LIBRAGEPHOTO_EXPORT void ragephoto_setphotoheader(ragephoto_t instance, const ch
|
|||
*
|
||||
* Default bufferSize: 256UL
|
||||
*/
|
||||
LIBRAGEPHOTO_EXPORT void ragephoto_setphototitle(ragephoto_t instance, const char *title, uint32_t bufferSize);
|
||||
LIBRAGEPHOTO_C_EXPORT void ragephoto_setphototitle(ragephoto_t instance, const char *title, uint32_t bufferSize);
|
||||
|
||||
/** Closes a \p ragephoto_t instance.
|
||||
* \param instance \p ragephoto_t instance
|
||||
*/
|
||||
LIBRAGEPHOTO_EXPORT void ragephoto_close(ragephoto_t instance);
|
||||
LIBRAGEPHOTO_C_EXPORT void ragephoto_close(ragephoto_t instance);
|
||||
|
||||
/** Returns the library version. */
|
||||
LIBRAGEPHOTO_EXPORT const char* ragephoto_version();
|
||||
LIBRAGEPHOTO_C_EXPORT const char* ragephoto_version();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include <iostream>
|
||||
#include <cstdint>
|
||||
|
||||
struct LIBRAGEPHOTO_EXPORT RagePhotoData
|
||||
struct LIBRAGEPHOTO_CXX_EXPORT RagePhotoData
|
||||
{
|
||||
bool photoLoaded;
|
||||
char* photoData;
|
||||
|
|
|
@ -32,15 +32,25 @@
|
|||
#ifdef _WIN32
|
||||
#ifndef LIBRAGEPHOTO_STATIC
|
||||
#ifdef LIBRAGEPHOTO_LIBRARY
|
||||
#define LIBRAGEPHOTO_EXPORT __declspec(dllexport)
|
||||
#define LIBRAGEPHOTO_C_EXPORT __declspec(dllexport)
|
||||
#define LIBRAGEPHOTO_CXX_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define LIBRAGEPHOTO_EXPORT __declspec(dllimport)
|
||||
#define LIBRAGEPHOTO_C_EXPORT __declspec(dllimport)
|
||||
#define LIBRAGEPHOTO_CXX_EXPORT __declspec(dllimport)
|
||||
#endif // LIBRAGEPHOTO_LIBRARY
|
||||
#else
|
||||
#define LIBRAGEPHOTO_EXPORT
|
||||
#define LIBRAGEPHOTO_C_EXPORT
|
||||
#define LIBRAGEPHOTO_CXX_EXPORT
|
||||
#endif // LIBRAGEPHOTO_STATIC
|
||||
#else
|
||||
#define LIBRAGEPHOTO_EXPORT
|
||||
#ifdef __EMSCRIPTEN__
|
||||
#include <emscripten/emscripten.h>
|
||||
#define LIBRAGEPHOTO_C_EXPORT EMSCRIPTEN_KEEPALIVE
|
||||
#define LIBRAGEPHOTO_CXX_EXPORT
|
||||
#else
|
||||
#define LIBRAGEPHOTO_C_EXPORT
|
||||
#define LIBRAGEPHOTO_CXX_EXPORT
|
||||
#endif // __EMSCRIPTEN__
|
||||
#endif // _WIN32
|
||||
/* RAGEPHOTO LIBRARY EXPORT END */
|
||||
|
||||
|
|
29
src/ragephoto-extract.rc.in
Normal file
29
src/ragephoto-extract.rc.in
Normal file
|
@ -0,0 +1,29 @@
|
|||
#include <windows.h>
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION @ragephoto_VERSION_MAJOR@, @ragephoto_VERSION_MINOR@, @ragephoto_VERSION_PATCH@, 0
|
||||
PRODUCTVERSION @ragephoto_VERSION_MAJOR@, @ragephoto_VERSION_MINOR@, @ragephoto_VERSION_PATCH@, 0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
FILEFLAGS 0
|
||||
FILEOS VOS_NT_WINDOWS32
|
||||
FILETYPE VFT_APP
|
||||
FILESUBTYPE VFT2_UNKNOWN
|
||||
BEGIN
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x0809, 1200
|
||||
END
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Syping"
|
||||
VALUE "FileDescription", "RAGE Photo Extract Tool for GTA V and RDR 2"
|
||||
VALUE "FileVersion", "@ragephoto_VERSION@"
|
||||
VALUE "InternalName", "ragephoto-extract"
|
||||
VALUE "LegalCopyright", "Copyright © @ragephoto_BUILD_YEAR@ Syping"
|
||||
VALUE "OriginalFilename", "ragephoto-extract.exe"
|
||||
VALUE "ProductName", "ragephoto-extract"
|
||||
VALUE "ProductVersion", "@ragephoto_VERSION@"
|
||||
END
|
||||
END
|
||||
END
|
|
@ -10,14 +10,14 @@ FILESUBTYPE VFT2_UNKNOWN
|
|||
BEGIN
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x0809, 1200
|
||||
VALUE "Translation", 0x0, 1200
|
||||
END
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Syping"
|
||||
VALUE "FileDescription", "Open Source RAGE Photo Parser for GTA V and RDR 2"
|
||||
VALUE "FileDescription", "RAGE Photo Parser for GTA V and RDR 2"
|
||||
VALUE "FileVersion", "@ragephoto_VERSION@"
|
||||
VALUE "InternalName", "libragephoto"
|
||||
VALUE "LegalCopyright", "Copyright © @ragephoto_BUILD_YEAR@ Syping"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue