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
|
@ -37,12 +37,20 @@ set(RAGEPHOTO_SOURCES
|
||||||
)
|
)
|
||||||
|
|
||||||
# RagePhoto Library Type
|
# RagePhoto Library Type
|
||||||
option(BUILD_SHARED "Build libragephoto as shared library" ON)
|
if (EMSCRIPTEN)
|
||||||
|
option(BUILD_SHARED "Build libragephoto as shared library" OFF)
|
||||||
|
else()
|
||||||
|
option(BUILD_SHARED "Build libragephoto as shared library" ON)
|
||||||
|
endif()
|
||||||
if (BUILD_SHARED)
|
if (BUILD_SHARED)
|
||||||
option(WITH_C_API "Build libragephoto with C API support" ON)
|
option(WITH_C_API "Build libragephoto with C API support" ON)
|
||||||
set(LIBRAGEPHOTO_LIBTYPE LIBRAGEPHOTO_SHARED)
|
set(LIBRAGEPHOTO_LIBTYPE LIBRAGEPHOTO_SHARED)
|
||||||
else()
|
else()
|
||||||
|
if (EMSCRIPTEN)
|
||||||
|
option(WITH_C_API "Build libragephoto with C API support" ON)
|
||||||
|
else()
|
||||||
option(WITH_C_API "Build libragephoto with C API support" OFF)
|
option(WITH_C_API "Build libragephoto with C API support" OFF)
|
||||||
|
endif()
|
||||||
set(LIBRAGEPHOTO_LIBTYPE LIBRAGEPHOTO_STATIC)
|
set(LIBRAGEPHOTO_LIBTYPE LIBRAGEPHOTO_STATIC)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -93,12 +101,40 @@ target_compile_definitions(ragephoto PRIVATE
|
||||||
${LIBRAGEPHOTO_DEFINES}
|
${LIBRAGEPHOTO_DEFINES}
|
||||||
)
|
)
|
||||||
target_include_directories(ragephoto PUBLIC
|
target_include_directories(ragephoto PUBLIC
|
||||||
${PROJECT_BINARY_DIR}/include
|
${ragephoto_BINARY_DIR}/include
|
||||||
${PROJECT_SOURCE_DIR}/src
|
${ragephoto_SOURCE_DIR}/src
|
||||||
)
|
)
|
||||||
install(TARGETS ragephoto DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
install(TARGETS ragephoto DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||||
install(FILES ${RAGEPHOTO_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/RagePhoto)
|
install(FILES ${RAGEPHOTO_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/RagePhoto)
|
||||||
install(FILES ${PROJECT_BINARY_DIR}/pkgconfig/ragephoto.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
install(FILES ${ragephoto_BINARY_DIR}/pkgconfig/ragephoto.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||||
|
|
||||||
|
# RagePhoto WebAssembly Target
|
||||||
|
if (EMSCRIPTEN)
|
||||||
|
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.13.0")
|
||||||
|
add_executable(ragephoto-wasm ${RAGEPHOTO_HEADERS} ${RAGEPHOTO_SOURCES})
|
||||||
|
set_target_properties(ragephoto-wasm PROPERTIES
|
||||||
|
PREFIX "lib"
|
||||||
|
OUTPUT_NAME "ragephoto"
|
||||||
|
)
|
||||||
|
target_compile_definitions(ragephoto-wasm PRIVATE
|
||||||
|
LIBRAGEPHOTO_LIBRARY
|
||||||
|
${LIBRAGEPHOTO_DEFINES}
|
||||||
|
)
|
||||||
|
target_link_options(ragephoto-wasm PRIVATE
|
||||||
|
"SHELL:-O2"
|
||||||
|
"SHELL:--no-entry"
|
||||||
|
"SHELL:-s WASM=1"
|
||||||
|
"SHELL:-s EXPORTED_FUNCTIONS=_free"
|
||||||
|
"SHELL:-s EXPORTED_RUNTIME_METHODS=ccall,cwrap"
|
||||||
|
)
|
||||||
|
target_include_directories(ragephoto-wasm PUBLIC
|
||||||
|
${ragephoto_BINARY_DIR}/include
|
||||||
|
${ragephoto_SOURCE_DIR}/src
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
message(WARNING "A useable WebAssembly build needs at least CMake 3.13.0 or newer")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# RagePhoto Documentation
|
# RagePhoto Documentation
|
||||||
option(WITH_DOCUMENTATION "Build libragephoto with documentation" OFF)
|
option(WITH_DOCUMENTATION "Build libragephoto with documentation" OFF)
|
||||||
|
@ -124,15 +160,25 @@ else()
|
||||||
option(WITH_EXTRACT "Build libragephoto with ragephoto-extract" OFF)
|
option(WITH_EXTRACT "Build libragephoto with ragephoto-extract" OFF)
|
||||||
endif()
|
endif()
|
||||||
if (WITH_EXTRACT)
|
if (WITH_EXTRACT)
|
||||||
|
# RagePhoto-Extract Source files
|
||||||
if (WITH_C_API)
|
if (WITH_C_API)
|
||||||
enable_language(C)
|
enable_language(C)
|
||||||
set(EXTRACT_SOURCES src/RagePhoto-Extract.c)
|
set(EXTRACT_SOURCES src/RagePhoto-Extract.c)
|
||||||
else()
|
else()
|
||||||
set(EXTRACT_SOURCES src/RagePhoto-Extract.cpp)
|
set(EXTRACT_SOURCES src/RagePhoto-Extract.cpp)
|
||||||
endif()
|
endif()
|
||||||
add_executable(ragephoto-extract ${RAGEPHOTO_HEADERS} ${EXTRACT_SOURCES})
|
# RagePhoto-Extract Win32 Shared Resources
|
||||||
|
if (WIN32)
|
||||||
|
string(TIMESTAMP ragephoto_BUILD_YEAR "%Y" UTC)
|
||||||
|
configure_file(src/ragephoto-extract.rc.in resources/ragephoto-extract.rc @ONLY)
|
||||||
|
list(APPEND EXTRACT_RESOURCES
|
||||||
|
${ragephoto_BINARY_DIR}/resources/ragephoto-extract.rc
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
# RagePhoto-Extract Target + Installs
|
||||||
|
add_executable(ragephoto-extract ${RAGEPHOTO_HEADERS} ${EXTRACT_SOURCES} ${EXTRACT_RESOURCES})
|
||||||
set_target_properties(ragephoto-extract PROPERTIES
|
set_target_properties(ragephoto-extract PROPERTIES
|
||||||
INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}
|
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}"
|
||||||
)
|
)
|
||||||
target_link_libraries(ragephoto-extract PRIVATE ragephoto)
|
target_link_libraries(ragephoto-extract PRIVATE ragephoto)
|
||||||
install(TARGETS ragephoto-extract DESTINATION ${CMAKE_INSTALL_BINDIR})
|
install(TARGETS ragephoto-extract DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
PROJECT_NAME = "libragephoto"
|
PROJECT_NAME = "libragephoto"
|
||||||
PROJECT_NUMBER = "Version: @PROJECT_VERSION@"
|
PROJECT_NUMBER = "Version: @ragephoto_VERSION@"
|
||||||
INPUT = "@CMAKE_CURRENT_SOURCE_DIR@/index.doc" \
|
INPUT = "@CMAKE_CURRENT_SOURCE_DIR@/index.doc" \
|
||||||
"src"
|
"src"
|
||||||
OUTPUT_DIRECTORY = "@CMAKE_CURRENT_BINARY_DIR@"
|
OUTPUT_DIRECTORY = "@CMAKE_CURRENT_BINARY_DIR@"
|
||||||
|
|
|
@ -17,8 +17,6 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "RagePhotoC.h"
|
#include "RagePhotoC.h"
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
|
|
||||||
#include "RagePhoto.h"
|
#include "RagePhoto.h"
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
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.
|
* \brief GTA V and RDR 2 Photo Parser.
|
||||||
*/
|
*/
|
||||||
class LIBRAGEPHOTO_EXPORT RagePhoto
|
class LIBRAGEPHOTO_CXX_EXPORT RagePhoto
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/** Default sizes */
|
/** Default sizes */
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#include "RagePhotoC.h"
|
#include "RagePhotoC.h"
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief ABI Stable Wrapper for RagePhoto.
|
* \brief ABI Stable Wrapper for RagePhoto.
|
||||||
|
|
|
@ -35,124 +35,124 @@ extern "C" {
|
||||||
typedef void* ragephoto_t;
|
typedef void* ragephoto_t;
|
||||||
|
|
||||||
/** Opens a \p ragephoto_t instance. */
|
/** 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.
|
/** Resets the \p ragephoto_t instance to default values.
|
||||||
* \param instance \p ragephoto_t instance
|
* \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*.
|
/** Loads a Photo from a const char*.
|
||||||
* \param instance \p ragephoto_t instance
|
* \param instance \p ragephoto_t instance
|
||||||
* \param data Photo data
|
* \param data Photo data
|
||||||
* \param size Photo data size
|
* \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.
|
/** Loads a Photo from a file.
|
||||||
* \param instance \p ragephoto_t instance
|
* \param instance \p ragephoto_t instance
|
||||||
* \param filename File to load
|
* \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.
|
/** Returns the last error occurred.
|
||||||
* \param instance \p ragephoto_t instance
|
* \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. */
|
/** 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. */
|
/** 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. */
|
/** 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. */
|
/** 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.
|
/** Returns the Photo description.
|
||||||
* \param instance \p ragephoto_t instance
|
* \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).
|
/** Returns the Photo Format (GTA V or RDR 2).
|
||||||
* \param instance \p ragephoto_t instance
|
* \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.
|
/** Returns the Photo JPEG data.
|
||||||
* \param instance \p ragephoto_t instance
|
* \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.
|
/** Returns the Photo JSON data.
|
||||||
* \param instance \p ragephoto_t instance
|
* \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.
|
/** Returns the Photo header.
|
||||||
* \param instance \p ragephoto_t instance
|
* \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.
|
/** Returns the Photo JPEG data size.
|
||||||
* \param instance \p ragephoto_t instance
|
* \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.
|
/** Returns the Photo title.
|
||||||
* \param instance \p ragephoto_t instance
|
* \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.
|
/** Returns the Photo save file size.
|
||||||
* \param instance \p ragephoto_t instance
|
* \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.
|
/** Returns the Photo save file size.
|
||||||
* \param instance \p ragephoto_t instance
|
* \param instance \p ragephoto_t instance
|
||||||
* \param photoFormat Photo Format (GTA V or RDR 2)
|
* \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*.
|
/** Saves a Photo to a char*.
|
||||||
* \param instance \p ragephoto_t instance
|
* \param instance \p ragephoto_t instance
|
||||||
* \param data Photo data
|
* \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*.
|
/** Saves a Photo to a char*.
|
||||||
* \param instance \p ragephoto_t instance
|
* \param instance \p ragephoto_t instance
|
||||||
* \param data Photo data
|
* \param data Photo data
|
||||||
* \param photoFormat Photo Format (GTA V or RDR 2)
|
* \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.
|
/** Saves a Photo to a file.
|
||||||
* \param instance \p ragephoto_t instance
|
* \param instance \p ragephoto_t instance
|
||||||
* \param filename File to save
|
* \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.
|
/** Saves a Photo to a file.
|
||||||
* \param instance \p ragephoto_t instance
|
* \param instance \p ragephoto_t instance
|
||||||
* \param filename File to save
|
* \param filename File to save
|
||||||
* \param photoFormat Photo Format (GTA V or RDR 2)
|
* \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.
|
/** Sets all cross-format Buffer to default size.
|
||||||
* \param instance \p ragephoto_t instance
|
* \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.
|
/** Moves all Buffer offsets to correct position.
|
||||||
* \param instance \p ragephoto_t instance
|
* \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.
|
/** Sets the Photo description.
|
||||||
* \param instance \p ragephoto_t instance
|
* \param instance \p ragephoto_t instance
|
||||||
|
@ -161,13 +161,13 @@ LIBRAGEPHOTO_EXPORT void ragephoto_setbufferoffsets(ragephoto_t instance);
|
||||||
*
|
*
|
||||||
* Default bufferSize: 256UL
|
* 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).
|
/** Sets the Photo Format (GTA V or RDR 2).
|
||||||
* \param instance \p ragephoto_t instance
|
* \param instance \p ragephoto_t instance
|
||||||
* \param photoFormat Photo Format (GTA V or RDR 2)
|
* \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.
|
/** Sets the Photo JPEG data.
|
||||||
* \param instance \p ragephoto_t instance
|
* \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()
|
* 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.
|
/** Sets the Photo JSON data.
|
||||||
* \param instance \p ragephoto_t instance
|
* \param instance \p ragephoto_t instance
|
||||||
|
@ -186,10 +186,10 @@ LIBRAGEPHOTO_EXPORT int ragephoto_setphotojpeg(ragephoto_t instance, const char
|
||||||
*
|
*
|
||||||
* Default bufferSize: 3072UL
|
* 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) */
|
/** 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.
|
/** Sets the Photo title.
|
||||||
* \param instance \p ragephoto_t instance
|
* \param instance \p ragephoto_t instance
|
||||||
|
@ -198,15 +198,15 @@ LIBRAGEPHOTO_EXPORT void ragephoto_setphotoheader(ragephoto_t instance, const ch
|
||||||
*
|
*
|
||||||
* Default bufferSize: 256UL
|
* 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.
|
/** Closes a \p ragephoto_t instance.
|
||||||
* \param instance \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. */
|
/** Returns the library version. */
|
||||||
LIBRAGEPHOTO_EXPORT const char* ragephoto_version();
|
LIBRAGEPHOTO_C_EXPORT const char* ragephoto_version();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
struct LIBRAGEPHOTO_EXPORT RagePhotoData
|
struct LIBRAGEPHOTO_CXX_EXPORT RagePhotoData
|
||||||
{
|
{
|
||||||
bool photoLoaded;
|
bool photoLoaded;
|
||||||
char* photoData;
|
char* photoData;
|
||||||
|
|
|
@ -32,15 +32,25 @@
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#ifndef LIBRAGEPHOTO_STATIC
|
#ifndef LIBRAGEPHOTO_STATIC
|
||||||
#ifdef LIBRAGEPHOTO_LIBRARY
|
#ifdef LIBRAGEPHOTO_LIBRARY
|
||||||
#define LIBRAGEPHOTO_EXPORT __declspec(dllexport)
|
#define LIBRAGEPHOTO_C_EXPORT __declspec(dllexport)
|
||||||
|
#define LIBRAGEPHOTO_CXX_EXPORT __declspec(dllexport)
|
||||||
#else
|
#else
|
||||||
#define LIBRAGEPHOTO_EXPORT __declspec(dllimport)
|
#define LIBRAGEPHOTO_C_EXPORT __declspec(dllimport)
|
||||||
|
#define LIBRAGEPHOTO_CXX_EXPORT __declspec(dllimport)
|
||||||
#endif // LIBRAGEPHOTO_LIBRARY
|
#endif // LIBRAGEPHOTO_LIBRARY
|
||||||
#else
|
#else
|
||||||
#define LIBRAGEPHOTO_EXPORT
|
#define LIBRAGEPHOTO_C_EXPORT
|
||||||
|
#define LIBRAGEPHOTO_CXX_EXPORT
|
||||||
#endif // LIBRAGEPHOTO_STATIC
|
#endif // LIBRAGEPHOTO_STATIC
|
||||||
#else
|
#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
|
#endif // _WIN32
|
||||||
/* RAGEPHOTO LIBRARY EXPORT END */
|
/* 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
|
BEGIN
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "Translation", 0x0809, 1200
|
VALUE "Translation", 0x0, 1200
|
||||||
END
|
END
|
||||||
BLOCK "StringFileInfo"
|
BLOCK "StringFileInfo"
|
||||||
BEGIN
|
BEGIN
|
||||||
BLOCK "040904b0"
|
BLOCK "040904b0"
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "Syping"
|
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 "FileVersion", "@ragephoto_VERSION@"
|
||||||
VALUE "InternalName", "libragephoto"
|
VALUE "InternalName", "libragephoto"
|
||||||
VALUE "LegalCopyright", "Copyright © @ragephoto_BUILD_YEAR@ Syping"
|
VALUE "LegalCopyright", "Copyright © @ragephoto_BUILD_YEAR@ Syping"
|
||||||
|
|
Loading…
Reference in a new issue