Skip to content

Commit 8b58f3a

Browse files
committed
Added glTF exporter
1 parent c9f53c1 commit 8b58f3a

15 files changed

Lines changed: 1912 additions & 53 deletions

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,4 +360,6 @@ MigrationBackup/
360360
.ionide/
361361

362362
# Fody - auto-generated XML schema
363-
FodyWeavers.xsd
363+
FodyWeavers.xsd
364+
365+
build/

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"files.associations": {
3+
"optional": "cpp"
4+
}
5+
}

CMakeLists.txt

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
1+
CMAKE_MINIMUM_REQUIRED(VERSION 3.12)
22
PROJECT(DW1ModelConverter)
33

44
SET(CMAKE_CXX_STANDARD 20)
55

6+
include(cmake/CPM.cmake)
7+
68
# --- Libraries ---
79
# boost
810
#FIND_PACKAGE(Boost 1.75 REQUIRED)
@@ -18,13 +20,26 @@ ADD_SUBDIRECTORY("libs/tinyxml2")
1820
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dcimg_use_png")
1921
INCLUDE_DIRECTORIES( "libs" )
2022

21-
# --- Tools ---
23+
#tinygltf
24+
set(TINYGLTF_HEADER_ONLY ON CACHE INTERNAL "" FORCE)
25+
set(TINYGLTF_INSTALL OFF CACHE INTERNAL "" FORCE)
26+
27+
CPMAddPackage(
28+
NAME tinygltf
29+
VERSION 2.8.9
30+
GITHUB_REPOSITORY "syoyo/tinygltf"
31+
)
2232

33+
# --- Configuration ---
34+
35+
add_compile_definitions(cimg_display=0)
36+
37+
# --- Tools ---
2338
SET(SOURCE_FILES ${SOURCE_FILES} "src/main.cpp" "src/TIM.cpp" "src/Collada.cpp" "src/Animation.cpp" "src/CLUTMap.cpp"
24-
"src/Model.cpp")
39+
"src/Model.cpp" "src/GLTF.cpp")
2540

2641
ADD_EXECUTABLE(DW1ModelConverter ${SOURCE_FILES})
27-
TARGET_LINK_LIBRARIES(DW1ModelConverter PUBLIC tinyxml2 PNG::PNG)
42+
TARGET_LINK_LIBRARIES(DW1ModelConverter PUBLIC tinyxml2 PNG::PNG tinygltf)
2843

2944
# Copy .dll dependencies. Extremely dirty!
3045
if(WIN32)

0 commit comments

Comments
 (0)