Patched library garbage
All checks were successful
JCS-Prod/RSE-Model/pipeline/pr-master This commit looks good
JCS-Prod/RSE-Model/pipeline/head This commit looks good

This commit is contained in:
JackCarterSmith 2022-09-18 16:01:05 +02:00
parent f21a7cb0a7
commit 433fd210de
Signed by: JackCarterSmith
GPG Key ID: 832E52F4E23F8F24
3 changed files with 53 additions and 46 deletions

View File

@ -33,6 +33,7 @@ set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation d
# Compilation option # Compilation option
option(RSPMODEL_SHARED "Build shared lib" ON) option(RSPMODEL_SHARED "Build shared lib" ON)
option(RSPMODEL_STATIC "Build static lib" ON) option(RSPMODEL_STATIC "Build static lib" ON)
option(BUILD_TOOLS "Build lib tools" ON)
# Push compile infos to source # Push compile infos to source
@ -45,10 +46,12 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_SOURCE_DI
# It is intended to be used by others apps like rendering engine or others. # It is intended to be used by others apps like rendering engine or others.
# - RSEModel is the standalone application of the library, take HOB file in argument and output OBJ/MTL file. # - RSEModel is the standalone application of the library, take HOB file in argument and output OBJ/MTL file.
# Artists or users can directly use this program to retrieve data in common datas format. # Artists or users can directly use this program to retrieve data in common datas format.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
unset(RSE_MODEL_TARGETS_LIST) unset(RSE_MODEL_TARGETS_LIST)
if(BUILD_TOOLS) add_subdirectory(RSPModelLib)
set(RSE_MODEL_TARGETS_LIST rse-model) add_subdirectory(RSEModel)
endif()
if(RSPMODEL_SHARED) if(RSPMODEL_SHARED)
list(APPEND RSE_MODEL_TARGETS_LIST rsp-model-lib) list(APPEND RSE_MODEL_TARGETS_LIST rsp-model-lib)
endif() endif()
@ -61,11 +64,10 @@ if(NOT RSE_MODEL_TARGETS_LIST)
"Please enable at least one of the following options: " "Please enable at least one of the following options: "
"RSPMODEL_STATIC, RSPMODEL_SHARED") "RSPMODEL_STATIC, RSPMODEL_SHARED")
endif() endif()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) if(BUILD_TOOLS)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) list(APPEND RSE_MODEL_TARGETS_LIST rse-model)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) endif()
add_subdirectory(RSPModelLib)
add_subdirectory(RSEModel)
# GPG signature custom command # GPG signature custom command

View File

@ -10,10 +10,9 @@
include(CheckIncludeFile) include(CheckIncludeFile)
include(CheckCSourceCompiles) include(CheckCSourceCompiles)
add_definitions(-DCONF_NO_GL) # Used for obj-lib to not compile GL part if(BUILD_TOOLS)
# Import needed packages and references their include path # Import needed packages and references their include path
find_package(GLEW REQUIRED) # Enable when GL rendering is ready find_package(GLEW REQUIRED)
include_directories(${GLEW_INCLUDE_DIR}) include_directories(${GLEW_INCLUDE_DIR})
@ -48,3 +47,4 @@ if(RSPMODEL_SHARED)
elseif(RSPMODEL_STATIC) elseif(RSPMODEL_STATIC)
target_link_libraries(rse-model PRIVATE rsp-model-libstatic ${GLEW_LIBRARIES} ${AUX_LIBS}) target_link_libraries(rse-model PRIVATE rsp-model-libstatic ${GLEW_LIBRARIES} ${AUX_LIBS})
endif() endif()
endif()

View File

@ -34,24 +34,29 @@ typedef union u_rspmodel_parameters {
// Lib's structure definitions // Lib's structure definitions
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#ifndef MEMFILE #ifndef MEMFILE_DEF
typedef char* MEMFILE; typedef char* MEMFILE;
#define MEMFILE_DEF
#endif #endif
#ifndef T_RGBA #ifndef T_RGBA_DEF
typedef unsigned int T_RGBA; typedef unsigned int T_RGBA;
#define T_RGBA_DEF
#endif #endif
#ifndef T_VECTOR3 #ifndef T_VECTOR3_DEF
typedef struct vector3 { float x,y,z; } T_VECTOR3; typedef struct vector3 { float x,y,z; } T_VECTOR3;
#define T_VECTOR3_DEF
#endif #endif
#ifndef T_VERTEX #ifndef T_VERTEX_DEF
typedef struct vertex { short x,y,z,w; } T_VERTEX; typedef struct vertex { short x,y,z,w; } T_VERTEX;
#define T_VERTEX_DEF
#endif #endif
#ifndef T_TEXCOORD #ifndef T_TEXCOORD_DEF
typedef struct tex_coord { short u,v; } T_TEXCOORD; typedef struct tex_coord { short u,v; } T_TEXCOORD;
#define T_TEXCOORD_DEF
#endif #endif
typedef struct face_flags { typedef struct face_flags {