mirror of https://github.com/AxioDL/metaforce.git
CActorContraption fixes, better CMake dependency handling
This commit is contained in:
parent
77d0ef942d
commit
e218b8aeb5
|
@ -25,9 +25,6 @@
|
|||
[submodule "sanitizers-cmake"]
|
||||
path = sanitizers-cmake
|
||||
url = https://github.com/arsenm/sanitizers-cmake.git
|
||||
[submodule "cotire"]
|
||||
path = cotire
|
||||
url = https://github.com/sakra/cotire.git
|
||||
[submodule "discord-rpc"]
|
||||
path = discord-rpc
|
||||
url = https://github.com/discordapp/discord-rpc.git
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
cmake_minimum_required(VERSION 3.10 FATAL_ERROR) # because of c++17
|
||||
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
|
||||
cmake_policy(SET CMP0079 NEW)
|
||||
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Binaries)
|
||||
|
||||
|
@ -33,7 +34,7 @@ if(CMAKE_CROSSCOMPILING)
|
|||
set(HAVE_WORDS_BIGENDIAN_EXITCODE 0 CACHE INTEGER "Makes soxr happy" FORCE)
|
||||
endif()
|
||||
|
||||
project(urde)
|
||||
project(urde VERSION 0.1.0)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
@ -43,11 +44,6 @@ set(BUILD_STATIC_LIBS ON CACHE BOOL "Force static libs on" FORCE)
|
|||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/sanitizers-cmake/cmake" "${CMAKE_SOURCE_DIR}/cotire/CMake" ${CMAKE_MODULE_PATH})
|
||||
find_package(Sanitizers)
|
||||
|
||||
# Don't cotire when using clang-cl
|
||||
if(NOT URDE_MSAN AND (NOT MSVC OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC"))
|
||||
include(cotire)
|
||||
endif()
|
||||
|
||||
if (NX)
|
||||
set(URDE_VECTOR_ISA "neon")
|
||||
else()
|
||||
|
@ -56,16 +52,15 @@ endif()
|
|||
|
||||
if(MSVC)
|
||||
if(${URDE_VECTOR_ISA} STREQUAL "avx2")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:AVX2 -D__SSE4_1__=1")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /arch:AVX2 -D__SSE4_1__=1")
|
||||
add_compile_options(/arch:AVX2)
|
||||
add_definitions(-D__SSE4_1__=1)
|
||||
message(STATUS "Building with AVX2 Vector ISA")
|
||||
elseif(${URDE_VECTOR_ISA} STREQUAL "avx")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:AVX -D__SSE4_1__=1")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /arch:AVX -D__SSE4_1__=1")
|
||||
add_compile_options(/arch:AVX)
|
||||
add_definitions(-D__SSE4_1__=1)
|
||||
message(STATUS "Building with AVX Vector ISA")
|
||||
elseif(${URDE_VECTOR_ISA} STREQUAL "sse41")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__SSE4_1__=1")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__SSE4_1__=1")
|
||||
add_definitions(-D__SSE4_1__=1)
|
||||
message(STATUS "Building with SSE4.1 Vector ISA")
|
||||
else()
|
||||
message(STATUS "Building with SSE2 Vector ISA")
|
||||
|
@ -105,24 +100,19 @@ if(MSVC)
|
|||
|
||||
else()
|
||||
if(${URDE_VECTOR_ISA} STREQUAL "avx2")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx2")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx2")
|
||||
add_compile_options(-mavx2)
|
||||
message(STATUS "Building with AVX2 Vector ISA")
|
||||
elseif(${URDE_VECTOR_ISA} STREQUAL "avx")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx")
|
||||
add_compile_options(-mavx)
|
||||
message(STATUS "Building with AVX Vector ISA")
|
||||
elseif(${URDE_VECTOR_ISA} STREQUAL "sse41")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.1")
|
||||
add_compile_options(-msse4.1)
|
||||
message(STATUS "Building with SSE4.1 Vector ISA")
|
||||
elseif(${URDE_VECTOR_ISA} STREQUAL "sse3")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse3")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse3")
|
||||
add_compile_options(-msse3)
|
||||
message(STATUS "Building with SSE3 Vector ISA")
|
||||
elseif(${URDE_VECTOR_ISA} STREQUAL "sse2")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2")
|
||||
add_compile_options(-msse2)
|
||||
message(STATUS "Building with SSE2 Vector ISA")
|
||||
elseif(${URDE_VECTOR_ISA} STREQUAL "neon")
|
||||
message(STATUS "Building with NEON Vector ISA")
|
||||
|
@ -133,19 +123,17 @@ else()
|
|||
include(CheckCXXCompilerFlag)
|
||||
check_cxx_compiler_flag(-fno-plt HAS_NO_PLT)
|
||||
if (HAS_NO_PLT)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-plt")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-plt")
|
||||
add_compile_options(-fno-plt)
|
||||
endif()
|
||||
|
||||
if(URDE_MSAN)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||
-stdlib=libc++ -fsanitize=memory -fsanitize-memory-track-origins -fsanitize-recover=all")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
|
||||
-fsanitize=memory -fsanitize-memory-track-origins -fsanitize-recover=all")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
||||
add_compile_options(-fsanitize=memory -fsanitize-memory-track-origins -fsanitize-recover=all)
|
||||
endif()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-multichar -Werror=implicit-fallthrough \
|
||||
-Wno-unknown-warning-option -Wno-lto-type-mismatch -Wno-unused-variable -Wno-unused-private-field \
|
||||
-Wno-unused-function -fno-exceptions -fno-rtti -Werror")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
|
||||
add_compile_options(-Wall -Wno-multichar -Werror=implicit-fallthrough -Wno-unknown-warning-option
|
||||
-Wno-lto-type-mismatch -Wno-unused-variable -Wno-unused-private-field
|
||||
-Wno-unused-function -Wno-sign-compare -Wno-unknown-pragmas -fno-exceptions -Werror)
|
||||
|
||||
if(APPLE)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=deprecated-declarations")
|
||||
|
@ -158,8 +146,8 @@ else()
|
|||
endif()
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
||||
include_directories(/usr/local/include)
|
||||
link_directories(/usr/local/lib)
|
||||
include_directories(/usr/local/include)
|
||||
link_directories(/usr/local/lib)
|
||||
endif()
|
||||
|
||||
if(("${CMAKE_BUILD_TYPE}" STREQUAL "Release" OR "${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
|
||||
|
@ -173,8 +161,7 @@ if(USE_LD_GOLD AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_
|
|||
if("${LD_VERSION}" MATCHES "GNU gold")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -flto=thin")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto=thin")
|
||||
add_compile_options(-flto=thin)
|
||||
message(STATUS "GNU gold linker enabled.")
|
||||
else()
|
||||
message(WARNING "GNU gold linker isn't available, using the default system linker.")
|
||||
|
@ -184,27 +171,19 @@ endif()
|
|||
|
||||
# Add discord-rpc here
|
||||
if(NOT GEKKO AND NOT NX)
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/rapidjson/include)
|
||||
set(PROJECT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/discord-rpc)
|
||||
if (NOT CMAKE_INSTALL_LIBDIR)
|
||||
set(CMAKE_INSTALL_LIBDIR ${CMAKE_BINARY_DIR}/fake-prefix)
|
||||
endif()
|
||||
add_subdirectory(discord-rpc/src)
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/discord-rpc/include)
|
||||
target_include_directories(discord-rpc PRIVATE rapidjson/include PUBLIC discord-rpc/include)
|
||||
endif()
|
||||
|
||||
add_subdirectory(nod)
|
||||
set(NOD_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/nod/include)
|
||||
|
||||
set(HECL_DLPACKAGE ${URDE_DLPACKAGE})
|
||||
|
||||
set(BOO_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/hecl/extern/boo/include)
|
||||
set(HECL_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/hecl/include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hecl/blender)
|
||||
set(SPECTER_INCLUDE_DIR specter/include specter/freetype2/include)
|
||||
set(ZEUS_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/specter/zeus/include)
|
||||
|
||||
set(DATA_SPEC_LIBS RetroDataSpec amuse)
|
||||
set(DATA_SPEC_LIBS RetroDataSpec)
|
||||
set(HECL_DATASPEC_DECLS
|
||||
"/* RetroCommon specs */
|
||||
namespace DataSpec
|
||||
|
@ -231,14 +210,16 @@ set(HECL_DATASPEC_PUSHES
|
|||
hecl::Database::DATA_SPEC_REGISTRY.push_back(&DataSpec::SpecEntMP3);
|
||||
hecl::Database::DATA_SPEC_REGISTRY.push_back(&DataSpec::SpecEntMP3PC);
|
||||
hecl::Database::DATA_SPEC_REGISTRY.push_back(&DataSpec::SpecEntMP3ORIG);")
|
||||
add_definitions(-DZE_ATHENA_TYPES=1)
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${SPECTER_INCLUDE_DIR} ${NOD_INCLUDE_DIR}
|
||||
${ZEUS_INCLUDE_DIR})
|
||||
|
||||
add_subdirectory(hecl/shaderc)
|
||||
include(hecl/ApplicationTools.cmake)
|
||||
add_subdirectory(specter/shaders)
|
||||
add_subdirectory(Shaders)
|
||||
add_subdirectory(hecl)
|
||||
target_include_directories(hecl-full PRIVATE ${CMAKE_SOURCE_DIR})
|
||||
target_include_directories(hecl-light PRIVATE ${CMAKE_SOURCE_DIR})
|
||||
target_link_libraries(hecl-full PRIVATE zeus nod)
|
||||
target_link_libraries(hecl-light PRIVATE zeus nod)
|
||||
|
||||
if(NOT TARGET bintoc)
|
||||
# Use native if cross compiling
|
||||
|
@ -258,6 +239,7 @@ add_library(CModelShaders
|
|||
CModelShaders.common.glsl.cpp CModelShaders.vert.glsl.cpp CModelShaders.frag.glsl.cpp
|
||||
CModelShaders.common.hlsl.cpp CModelShaders.vert.hlsl.cpp CModelShaders.frag.hlsl.cpp
|
||||
CModelShaders.common.metal.cpp CModelShaders.vert.metal.cpp CModelShaders.frag.metal.cpp)
|
||||
target_link_libraries(shader_CModelShaders PUBLIC CModelShaders)
|
||||
|
||||
if(NOT TARGET atdna)
|
||||
# Import native atdna if cross-compiling
|
||||
|
@ -267,19 +249,14 @@ if(NOT TARGET atdna)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
add_definitions(${BOO_SYS_DEFINES})
|
||||
include_directories(${BOO_SYS_INCLUDES})
|
||||
add_subdirectory(amuse)
|
||||
add_subdirectory(specter)
|
||||
target_include_directories(specter PRIVATE ${CMAKE_SOURCE_DIR})
|
||||
target_link_libraries(specter PRIVATE nod)
|
||||
add_subdirectory(assetnameparser)
|
||||
include_directories(${ATHENA_INCLUDE_DIR} ${LOGVISOR_INCLUDE_DIR} ${HECL_INCLUDE_DIR}
|
||||
${BOO_INCLUDE_DIR} ${AMUSE_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/NESEmulator
|
||||
${ZLIB_INCLUDE_DIR})
|
||||
add_definitions(-DURDE_ZIP_INPUT_STREAM=1) # Enable CZipInputStream now that zlib header is known
|
||||
add_subdirectory(NESEmulator)
|
||||
add_subdirectory(DataSpec)
|
||||
add_subdirectory(kabufuda)
|
||||
include_directories(${KABUFUDA_INCLUDE_DIR})
|
||||
add_subdirectory(Editor)
|
||||
|
||||
add_subdirectory(jbus)
|
||||
|
@ -290,6 +267,7 @@ set(CLIENT_SOURCES
|
|||
${CMAKE_SOURCE_DIR}/Editor/ProjectResourceFactoryBase.cpp
|
||||
${CMAKE_SOURCE_DIR}/Editor/ProjectResourceFactoryMP1.hpp
|
||||
${CMAKE_SOURCE_DIR}/Editor/ProjectResourceFactoryMP1.cpp)
|
||||
add_subdirectory(NESEmulator)
|
||||
add_subdirectory(Runtime)
|
||||
add_subdirectory(mpcksum)
|
||||
add_subdirectory(gbalink)
|
||||
|
@ -311,7 +289,7 @@ unset(GIT_EXECUTABLE CACHE)
|
|||
find_package(Git)
|
||||
if(GIT_FOUND)
|
||||
# Get the current working branch
|
||||
execute_process(COMMAND "${GIT_EXECUTABLE}" rev-parse --abbrev-ref HEAD WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
execute_process(COMMAND "${GIT_EXECUTABLE}" regiv-parse --abbrev-ref HEAD WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
OUTPUT_VARIABLE GIT_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE )
|
||||
|
||||
# Get the latest abbreviated commit hash of the working branch
|
||||
|
@ -329,4 +307,4 @@ else()
|
|||
set(GIT_COMMIT_DATE "")
|
||||
endif()
|
||||
|
||||
configure_file(${CMAKE_SOURCE_DIR}/version.h.in ${CMAKE_SOURCE_DIR}/version.h)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/version.h.in ${CMAKE_BINARY_DIR}/version.h)
|
||||
|
|
|
@ -1,19 +1,17 @@
|
|||
include_directories(${LIBPNG_INCLUDE_DIR} ${SQUISH_INCLUDE_DIR})
|
||||
|
||||
# Assembles a source/header pair list for use in a DNA library
|
||||
macro(make_dnalist outlist subdir)
|
||||
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${subdir}")
|
||||
macro(make_dnalist)
|
||||
file(RELATIVE_PATH subdir "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_LIST_DIR}")
|
||||
set(CMAKE_CURRENT_LIST_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/${subdir}")
|
||||
file(MAKE_DIRECTORY "${CMAKE_CURRENT_LIST_BINARY_DIR}")
|
||||
foreach(type ${ARGN})
|
||||
get_filename_component(dir ${type} DIRECTORY)
|
||||
if(dir)
|
||||
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${subdir}/${dir}")
|
||||
file(MAKE_DIRECTORY "${CMAKE_CURRENT_LIST_BINARY_DIR}/${dir}")
|
||||
set(dir "${dir}/")
|
||||
endif()
|
||||
get_filename_component(name ${type} NAME)
|
||||
atdna("${subdir}/${dir}atdna_${name}.cpp" "${subdir}/${dir}${name}.hpp")
|
||||
list(APPEND ${outlist}
|
||||
${subdir}/${dir}atdna_${name}.cpp
|
||||
${subdir}/${dir}${name}.hpp)
|
||||
list(APPEND DNA_SOURCES "${subdir}/${dir}atdna_${name}.cpp")
|
||||
list(APPEND DNA_HEADERS "${subdir}/${dir}${name}.hpp")
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
|
@ -30,9 +28,9 @@ macro(dataspec_add_list rel_path a_list)
|
|||
set(${a_list} "${tmp_list}")
|
||||
endmacro(dataspec_add_list)
|
||||
|
||||
include_directories(${ZLIB_INCLUDE_DIR} ${LZOKAY_INCLUDE_DIR})
|
||||
|
||||
# Each game's DNA library
|
||||
unset(DNA_SOURCES)
|
||||
unset(DNA_HEADERS)
|
||||
include(DNACommon/CMakeLists.txt)
|
||||
include(DNAMP1/CMakeLists.txt)
|
||||
include(DNAMP2/CMakeLists.txt)
|
||||
|
@ -70,10 +68,22 @@ add_library(RetroDataSpec
|
|||
AssetNameMap32.bin AssetNameMap32.cpp
|
||||
AssetNameMap64.bin AssetNameMap64.cpp
|
||||
RetroMasterShader.cpp)
|
||||
|
||||
get_target_property(HECL_INCLUDES hecl-full INCLUDE_DIRECTORIES)
|
||||
target_include_directories(RetroDataSpec PUBLIC ${LIBPNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR}
|
||||
${HECL_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR})
|
||||
target_link_libraries(RetroDataSpec PUBLIC amuse zeus nod specter squish ${PNG_LIB} ${ZLIB_LIBRARIES} lzokay logvisor)
|
||||
if(COMMAND add_sanitizers)
|
||||
add_sanitizers(RetroDataSpec)
|
||||
endif()
|
||||
if(COMMAND cotire)
|
||||
set_target_properties(RetroDataSpec PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
|
||||
cotire(RetroDataSpec)
|
||||
endif()
|
||||
|
||||
# Resolve all DNA sources into target
|
||||
list(LENGTH DNA_SOURCES count)
|
||||
math(EXPR count "${count}-1")
|
||||
foreach(i RANGE ${count})
|
||||
list(GET DNA_SOURCES ${i} src)
|
||||
list(GET DNA_HEADERS ${i} header)
|
||||
target_atdna(RetroDataSpec ${src} ${header})
|
||||
endforeach()
|
||||
|
||||
add_custom_target(genexdebug COMMAND ${CMAKE_COMMAND} -E echo "$<TARGET_PROPERTY:RetroDataSpec,INCLUDE_DIRECTORIES>")
|
|
@ -101,8 +101,8 @@ bool ReadANCSToBlender(hecl::blender::Connection& conn, const ANCSDNA& ancs, con
|
|||
"bpy.context.scene.hecl_mesh_obj = bpy.context.scene.name\n"
|
||||
"\n"
|
||||
"# Clear Scene\n"
|
||||
"if 'Collection 1' in bpy.data.collections:\n"
|
||||
" bpy.data.collections.remove(bpy.data.collections['Collection 1'])\n"
|
||||
"if len(bpy.data.collections):\n"
|
||||
" bpy.data.collections.remove(bpy.data.collections[0])\n"
|
||||
"\n"
|
||||
"actor_data = bpy.context.scene.hecl_sact_data\n"
|
||||
"arm_obj = None\n",
|
||||
|
|
|
@ -59,7 +59,7 @@ bool AROTBuilder::Node::compareSets(int a, int b) const {
|
|||
void AROTBuilder::Node::addChild(int level, int minChildren, const std::vector<zeus::CAABox>& triBoxes,
|
||||
const zeus::CAABox& curAABB, BspNodeType& typeOut) {
|
||||
/* Gather intersecting faces */
|
||||
for (int i = 0; i < triBoxes.size(); ++i)
|
||||
for (size_t i = 0; i < triBoxes.size(); ++i)
|
||||
if (triBoxes[i].intersects(curAABB))
|
||||
childIndices.insert(i);
|
||||
|
||||
|
@ -343,7 +343,7 @@ void AROTBuilder::build(std::vector<std::vector<uint8_t>>& secs, const zeus::CAA
|
|||
auto bmpIt = bmp.cbegin();
|
||||
if (bmpIt != bmp.cend()) {
|
||||
int curIdx = 0;
|
||||
for (int w = 0; w < bmpWordCount; ++w) {
|
||||
for (size_t w = 0; w < bmpWordCount; ++w) {
|
||||
for (int b = 0; b < 32; ++b) {
|
||||
if (*bmpIt == curIdx) {
|
||||
bmpWords[w] |= 1 << b;
|
||||
|
|
|
@ -75,7 +75,7 @@ void ReadBabeDeadLightToBlender(hecl::blender::PyOutStream& os, const BabeDeadLi
|
|||
"lamp_obj.location = (%f,%f,%f)\n"
|
||||
"bpy.context.scene.collection.objects.link(lamp_obj)\n"
|
||||
"\n",
|
||||
s, light.lightType, light.q / 8.f, light.color.simd[0], light.color.simd[1], light.color.simd[2],
|
||||
s, unsigned(light.lightType), light.q / 8.f, light.color.simd[0], light.color.simd[1], light.color.simd[2],
|
||||
light.position.simd[0], light.position.simd[1], light.position.simd[2]);
|
||||
|
||||
switch (light.falloff) {
|
||||
|
|
|
@ -377,8 +377,8 @@ void InitGeomBlenderContext(hecl::blender::PyOutStream& os, const hecl::ProjectP
|
|||
"from mathutils import Vector\n"
|
||||
"\n"
|
||||
"# Clear Scene\n"
|
||||
"if 'Collection 1' in bpy.data.collections:\n"
|
||||
" bpy.data.collections.remove(bpy.data.collections['Collection 1'])\n"
|
||||
"if len(bpy.data.collections):\n"
|
||||
" bpy.data.collections.remove(bpy.data.collections[0])\n"
|
||||
"\n"
|
||||
"def loop_from_facevert(bm, face, vert_idx):\n"
|
||||
" for loop in face.loops:\n"
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
make_dnalist(liblist DNACommon
|
||||
CMDL
|
||||
make_dnalist(CMDL
|
||||
FONT
|
||||
DGRP
|
||||
FSM2
|
||||
|
@ -54,4 +53,3 @@ set(DNACOMMON_SOURCES
|
|||
Tweaks/ITweakGuiColors.hpp)
|
||||
|
||||
dataspec_add_list(DNACommon DNACOMMON_SOURCES)
|
||||
list(APPEND DNACOMMON_SOURCES ${liblist})
|
||||
|
|
|
@ -91,7 +91,7 @@ void CRSM<IDType>::_write(athena::io::YAMLDocWriter& w) const {
|
|||
pair.second.write(w);
|
||||
|
||||
for (const auto& pair : x10_sfx)
|
||||
if (pair.second != ~0)
|
||||
if (pair.second != UINT32_MAX)
|
||||
w.writeUint32(pair.first.toString().c_str(), pair.second);
|
||||
|
||||
for (const auto& pair : x20_decals)
|
||||
|
@ -115,7 +115,7 @@ void CRSM<IDType>::_binarySize(size_t& __isz) const {
|
|||
}
|
||||
}
|
||||
for (const auto& pair : x10_sfx) {
|
||||
if (pair.second != ~0)
|
||||
if (pair.second != UINT32_MAX)
|
||||
__isz += 12;
|
||||
}
|
||||
|
||||
|
@ -193,7 +193,7 @@ void CRSM<IDType>::_write(athena::io::IStreamWriter& w) const {
|
|||
|
||||
for (const auto& pair : x10_sfx) {
|
||||
w.writeBytes(pair.first.getChars(), 4);
|
||||
if (pair.second != ~0) {
|
||||
if (pair.second != UINT32_MAX) {
|
||||
w.writeBytes("CNST", 4);
|
||||
w.writeUint32Big(pair.second);
|
||||
} else {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include "ParticleCommon.hpp"
|
||||
#include "PAK.hpp"
|
||||
#include "athena/FileWriter.hpp"
|
||||
#include "optional.hpp"
|
||||
#include <optional>
|
||||
|
||||
namespace DataSpec::DNAParticle {
|
||||
template <class IDType>
|
||||
|
|
|
@ -121,8 +121,8 @@ bool ReadMAPAToBlender(hecl::blender::Connection& conn, const MAPA& mapa, const
|
|||
"name='Retro: Map Object Visibility Mode')\n"
|
||||
"\n"
|
||||
"# Clear Scene\n"
|
||||
"if 'Collection 1' in bpy.data.collections:\n"
|
||||
" bpy.data.collections.remove(bpy.data.collections['Collection 1'])\n"
|
||||
"if len(bpy.data.collections):\n"
|
||||
" bpy.data.collections.remove(bpy.data.collections[0])\n"
|
||||
"\n"
|
||||
"def add_triangle(bm, verts):\n"
|
||||
" verts = [bm.verts[vi] for vi in verts]\n"
|
||||
|
@ -167,8 +167,9 @@ bool ReadMAPAToBlender(hecl::blender::Connection& conn, const MAPA& mapa, const
|
|||
"obj.location = mtxd[0]\n"
|
||||
"obj.rotation_quaternion = mtxd[1]\n"
|
||||
"obj.scale = mtxd[2]\n",
|
||||
moIdx, moMP12->type, RetroMapObjVisModes[moMP12->visMode], moMP12->sclyId, mtxF[0][0], mtxF[0][1], mtxF[0][2],
|
||||
mtxF[0][3], mtxF[1][0], mtxF[1][1], mtxF[1][2], mtxF[1][3], mtxF[2][0], mtxF[2][1], mtxF[2][2], mtxF[2][3]);
|
||||
moIdx, int(moMP12->type), RetroMapObjVisModes[moMP12->visMode], moMP12->sclyId, mtxF[0][0], mtxF[0][1],
|
||||
mtxF[0][2], mtxF[0][3], mtxF[1][0], mtxF[1][1], mtxF[1][2], mtxF[1][3], mtxF[2][0], mtxF[2][1], mtxF[2][2],
|
||||
mtxF[2][3]);
|
||||
++moIdx;
|
||||
continue;
|
||||
} else {
|
||||
|
@ -188,8 +189,9 @@ bool ReadMAPAToBlender(hecl::blender::Connection& conn, const MAPA& mapa, const
|
|||
"obj.location = mtxd[0]\n"
|
||||
"obj.rotation_quaternion = mtxd[1]\n"
|
||||
"obj.scale = mtxd[2]\n",
|
||||
moIdx, moMP3->type, RetroMapObjVisModes[moMP3->visMode], moMP3->sclyId, mtxF[0][0], mtxF[0][1], mtxF[0][2],
|
||||
mtxF[0][3], mtxF[1][0], mtxF[1][1], mtxF[1][2], mtxF[1][3], mtxF[2][0], mtxF[2][1], mtxF[2][2], mtxF[2][3]);
|
||||
moIdx, int(moMP3->type), RetroMapObjVisModes[moMP3->visMode], moMP3->sclyId, mtxF[0][0], mtxF[0][1],
|
||||
mtxF[0][2], mtxF[0][3], mtxF[1][0], mtxF[1][1], mtxF[1][2], mtxF[1][3], mtxF[2][0], mtxF[2][1], mtxF[2][2],
|
||||
mtxF[2][3]);
|
||||
++moIdx;
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -21,8 +21,8 @@ bool ReadMAPUToBlender(hecl::blender::Connection& conn, const MAPU& mapu, const
|
|||
"from mathutils import Matrix\n"
|
||||
"\n"
|
||||
"# Clear Scene\n"
|
||||
"if 'Collection 1' in bpy.data.collections:\n"
|
||||
" bpy.data.collections.remove(bpy.data.collections['Collection 1'])\n"
|
||||
"if len(bpy.data.collections):\n"
|
||||
" bpy.data.collections.remove(bpy.data.collections[0])\n"
|
||||
"\n"
|
||||
"bpy.types.Object.retro_mapworld_color = bpy.props.FloatVectorProperty(name='Retro: MapWorld Color',"
|
||||
" description='Sets map world color', subtype='COLOR', size=4, min=0.0, max=1.0)\n"
|
||||
|
|
|
@ -25,8 +25,8 @@ bool ReadMLVLToBlender(hecl::blender::Connection& conn, const MLVL& mlvl, const
|
|||
"bpy.context.scene.name = 'World'\n"
|
||||
"\n"
|
||||
"# Clear Scene\n"
|
||||
"if 'Collection 1' in bpy.data.collections:\n"
|
||||
" bpy.data.collections.remove(bpy.data.collections['Collection 1'])\n";
|
||||
"if len(bpy.data.collections):\n"
|
||||
" bpy.data.collections.remove(bpy.data.collections[0])\n";
|
||||
|
||||
/* Insert area empties */
|
||||
int areaIdx = 0;
|
||||
|
|
|
@ -17,7 +17,7 @@ struct FittedOBB {
|
|||
static std::vector<int> MakeRootTriangleIndex(const ColMesh& mesh) {
|
||||
std::vector<int> ret;
|
||||
ret.reserve(mesh.trianges.size());
|
||||
for (int i = 0; i < mesh.trianges.size(); ++i)
|
||||
for (size_t i = 0; i < mesh.trianges.size(); ++i)
|
||||
ret.push_back(i);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -370,7 +370,7 @@ hecl::SystemString PAKRouter<BRIDGETYPE>::getResourceRelativePath(const EntryTyp
|
|||
return hecl::SystemString();
|
||||
hecl::ProjectPath aPath = getWorking(&a, BRIDGETYPE::LookupExtractor(*node, *pak, a));
|
||||
hecl::SystemString ret;
|
||||
for (int i = 0; i < aPath.levelCount(); ++i)
|
||||
for (size_t i = 0; i < aPath.levelCount(); ++i)
|
||||
ret += _SYS_STR("../");
|
||||
hecl::ProjectPath bPath = getWorking(be, BRIDGETYPE::LookupExtractor(*node, *pak, *be));
|
||||
ret += bPath.getRelativePath();
|
||||
|
|
|
@ -49,7 +49,7 @@ template <>
|
|||
void VEConstant::Enumerate<BigDNA::ReadYaml>(typename ReadYaml::StreamT& r) {
|
||||
size_t elemCount;
|
||||
if (auto v = r.enterSubVector(nullptr, elemCount)) {
|
||||
for (int i = 0; i < 3 && i < elemCount; ++i) {
|
||||
for (size_t i = 0; i < 3 && i < elemCount; ++i) {
|
||||
if (auto rec = r.enterSubRecord(nullptr))
|
||||
comps[i].read(r);
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ RigInverter<CINFType>::Bone::Bone(const CINFType& cinf, const typename CINFType:
|
|||
atUint32 parentIdx = cinf.getInternalBoneIdxFromId(origBone.parentId);
|
||||
zeus::CVector3f boneOrigin(origBone.origin);
|
||||
zeus::CVector3f naturalTail = boneOrigin + zeus::CVector3f{0.f, 0.5f, 0.f};
|
||||
if (parentIdx != -1) {
|
||||
if (parentIdx != UINT32_MAX) {
|
||||
const typename CINFType::Bone& pBone = cinf.bones[parentIdx];
|
||||
m_parentDelta = boneOrigin - zeus::CVector3f(pBone.origin);
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ RigInverter<CINFType>::Bone::Bone(const CINFType& cinf, const typename CINFType:
|
|||
if (chId == origBone.parentId)
|
||||
continue;
|
||||
atUint32 chIdx = cinf.getInternalBoneIdxFromId(chId);
|
||||
if (chIdx != -1)
|
||||
if (chIdx != UINT32_MAX)
|
||||
++actualChildren;
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ RigInverter<CINFType>::Bone::Bone(const CINFType& cinf, const typename CINFType:
|
|||
if (bName)
|
||||
isLCTR = bName->find("_LCTR") != std::string::npos;
|
||||
|
||||
if (parentIdx == -1) {
|
||||
if (parentIdx == UINT32_MAX) {
|
||||
/* Root will always use +Y tail */
|
||||
m_tail = naturalTail;
|
||||
} else if (actualChildren) {
|
||||
|
@ -40,7 +40,7 @@ RigInverter<CINFType>::Bone::Bone(const CINFType& cinf, const typename CINFType:
|
|||
if (chId == origBone.parentId)
|
||||
continue;
|
||||
atUint32 chIdx = cinf.getInternalBoneIdxFromId(chId);
|
||||
if (chIdx != -1) {
|
||||
if (chIdx != UINT32_MAX) {
|
||||
const typename CINFType::Bone& chBone = cinf.bones[chIdx];
|
||||
m_tail += chBone.origin;
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ RigInverter<CINFType>::Bone::Bone(const CINFType& cinf, const typename CINFType:
|
|||
m_tail = naturalTail;
|
||||
else if (isLCTR)
|
||||
m_tail = boneOrigin + zeus::CVector3f{0.f, 1.0f, 0.f} * (m_tail - boneOrigin).magnitude();
|
||||
} else if (parentIdx != -1) {
|
||||
} else if (parentIdx != UINT32_MAX) {
|
||||
/* Extrapolate by delta with parent */
|
||||
m_tail = boneOrigin + m_parentDelta;
|
||||
float deltaMag = m_parentDelta.magnitude();
|
||||
|
@ -91,8 +91,8 @@ RigInverter<CINFType>::RigInverter(const CINFType& cinf,
|
|||
auto search = matrices.find(*name);
|
||||
if (search != matrices.cend()) {
|
||||
zeus::CMatrix3f boneMtx(search->second[0], search->second[1], search->second[2]);
|
||||
m_bones.back().m_inverter = boneMtx.transposed();
|
||||
m_bones.back().m_restorer = boneMtx;
|
||||
m_bones.back().m_inverter = m_bones.back().m_restorer.inverse();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ template <class CINFType>
|
|||
zeus::CQuaternion RigInverter<CINFType>::invertRotation(atUint32 boneId, const zeus::CQuaternion& origRot) const {
|
||||
for (const Bone& b : m_bones)
|
||||
if (b.m_origBone.id == boneId)
|
||||
return b.m_restorer * zeus::CMatrix3f(origRot) * b.m_inverter;
|
||||
return b.m_restorer * origRot * b.m_inverter;
|
||||
return origRot;
|
||||
}
|
||||
|
||||
|
@ -114,7 +114,7 @@ zeus::CVector3f RigInverter<CINFType>::invertPosition(atUint32 boneId, const zeu
|
|||
zeus::CVector3f localPos = origPos;
|
||||
if (subDelta)
|
||||
localPos -= b.m_parentDelta;
|
||||
return b.m_restorer * localPos;
|
||||
return b.m_restorer.transform(localPos);
|
||||
}
|
||||
return origPos;
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ template <class CINFType>
|
|||
zeus::CQuaternion RigInverter<CINFType>::restoreRotation(atUint32 boneId, const zeus::CQuaternion& origRot) const {
|
||||
for (const Bone& b : m_bones)
|
||||
if (b.m_origBone.id == boneId)
|
||||
return b.m_inverter * zeus::CMatrix3f(origRot) * b.m_restorer;
|
||||
return b.m_inverter * origRot * b.m_restorer;
|
||||
return origRot;
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,7 @@ zeus::CVector3f RigInverter<CINFType>::restorePosition(atUint32 boneId, const ze
|
|||
bool subDelta) const {
|
||||
for (const Bone& b : m_bones)
|
||||
if (b.m_origBone.id == boneId) {
|
||||
zeus::CVector3f localPos = b.m_inverter * origPos;
|
||||
zeus::CVector3f localPos = b.m_inverter.transform(origPos);
|
||||
if (subDelta)
|
||||
localPos += b.m_parentDelta;
|
||||
return localPos;
|
||||
|
|
|
@ -15,8 +15,8 @@ class RigInverter {
|
|||
public:
|
||||
struct Bone {
|
||||
const typename CINFType::Bone& m_origBone;
|
||||
zeus::CMatrix3f m_inverter;
|
||||
zeus::CMatrix3f m_restorer;
|
||||
zeus::CQuaternion m_inverter;
|
||||
zeus::CQuaternion m_restorer;
|
||||
zeus::CVector3f m_tail;
|
||||
zeus::CVector3f m_parentDelta;
|
||||
Bone(const CINFType& cinf, const typename CINFType::Bone& origBone);
|
||||
|
|
|
@ -1148,7 +1148,7 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
|
|||
bool doDXT1 = (colorType == PNG_COLOR_TYPE_RGB || colorType == PNG_COLOR_TYPE_RGB_ALPHA) && width >= 4 && height >= 4;
|
||||
|
||||
/* Read into mip0 image buffer */
|
||||
for (int r = 0; r < height; ++r) {
|
||||
for (png_uint_32 r = 0; r < height; ++r) {
|
||||
if (colorType == PNG_COLOR_TYPE_RGB) {
|
||||
png_read_row(pngRead, rowBuf.get(), nullptr);
|
||||
for (unsigned i = 0; i < width; ++i) {
|
||||
|
@ -1175,7 +1175,7 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
|
|||
fclose(inf);
|
||||
|
||||
/* Reduce mipmaps to minimum allowed dimensions */
|
||||
int minDimX, minDimY;
|
||||
unsigned minDimX, minDimY;
|
||||
if (doDXT1) {
|
||||
minDimX = minDimY = 4;
|
||||
} else {
|
||||
|
@ -1601,7 +1601,7 @@ static const atInt32 RetroToDol[11] {
|
|||
|
||||
std::string TXTR::CalculateDolphinName(DataSpec::PAKEntryReadStream& rs) {
|
||||
atUint32 format = RetroToDol[rs.readUint32Big()];
|
||||
if (format == -1)
|
||||
if (format == UINT32_MAX)
|
||||
return {};
|
||||
|
||||
atUint16 width = rs.readUint16Big();
|
||||
|
|
|
@ -205,7 +205,7 @@ void WPSM<IDType>::_write(athena::io::YAMLDocWriter& w) const {
|
|||
if (!xa6_SWTR)
|
||||
if (auto rec = w.enterSubRecord("SWTR"))
|
||||
xa6_SWTR.write(w);
|
||||
if (xa8_PJFX != ~0)
|
||||
if (xa8_PJFX != UINT32_MAX)
|
||||
w.writeUint32("PJFX", xa8_PJFX);
|
||||
if (xac_RNGE)
|
||||
if (auto rec = w.enterSubRecord("RNGE"))
|
||||
|
@ -339,7 +339,7 @@ void WPSM<IDType>::_binarySize(size_t& __isz) const {
|
|||
__isz += 4;
|
||||
xa6_SWTR.binarySize(__isz);
|
||||
}
|
||||
if (xa8_PJFX != ~0)
|
||||
if (xa8_PJFX != UINT32_MAX)
|
||||
__isz += 12;
|
||||
if (xac_RNGE) {
|
||||
__isz += 4;
|
||||
|
@ -606,7 +606,7 @@ void WPSM<IDType>::_write(athena::io::IStreamWriter& w) const {
|
|||
w.writeBytes("SWTR", 4);
|
||||
xa6_SWTR.write(w);
|
||||
}
|
||||
if (xa8_PJFX != ~0) {
|
||||
if (xa8_PJFX != UINT32_MAX) {
|
||||
w.writeBytes("PJFXCNST", 8);
|
||||
w.writeUint32(xa8_PJFX);
|
||||
}
|
||||
|
|
|
@ -1376,8 +1376,8 @@ bool ANCS::CookANIM(const hecl::ProjectPath& outPath, const hecl::ProjectPath& i
|
|||
|
||||
/* Build bone ID map */
|
||||
std::unordered_map<std::string, atInt32> boneIdMap;
|
||||
std::experimental::optional<CINF> rigCinf;
|
||||
std::experimental::optional<DNAANIM::RigInverter<CINF>> rigInv;
|
||||
std::optional<CINF> rigCinf;
|
||||
std::optional<DNAANIM::RigInverter<CINF>> rigInv;
|
||||
for (const DNAANCS::Armature& arm : actor.armatures) {
|
||||
if (!rigInv) {
|
||||
rigCinf.emplace(arm, boneIdMap);
|
||||
|
|
|
@ -256,7 +256,7 @@ template <class MAT>
|
|||
static uint32_t _HashTextureConfig(const MAT& mat) {
|
||||
XXH32_state_t xxHash;
|
||||
XXH32_reset(&xxHash, 0);
|
||||
for (int i = 0; i < mat.tevStageCount; ++i) {
|
||||
for (uint32_t i = 0; i < mat.tevStageCount; ++i) {
|
||||
const auto& stage = mat.tevStages[i];
|
||||
XXH32_update(&xxHash, &stage.ciFlags, sizeof(stage.ciFlags));
|
||||
XXH32_update(&xxHash, &stage.aiFlags, sizeof(stage.aiFlags));
|
||||
|
@ -352,7 +352,7 @@ static const char* ToString(GX::TevRegID arg) {
|
|||
|
||||
template <class MAT>
|
||||
static void _DescribeTEV(const MAT& mat) {
|
||||
for (int i = 0; i < mat.tevStageCount; ++i) {
|
||||
for (uint32_t i = 0; i < mat.tevStageCount; ++i) {
|
||||
const auto& stage = mat.tevStages[i];
|
||||
fprintf(stderr, "A:%s B:%s C:%s D:%s -> %s | A:%s B:%s C:%s D:%s -> %s\n",
|
||||
ToString(stage.colorInA()), ToString(stage.colorInB()),
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
include(DNAMP1/ScriptObjects/CMakeLists.txt)
|
||||
include(DNAMP1/SFX/CMakeLists.txt)
|
||||
|
||||
make_dnalist(liblist DNAMP1
|
||||
PAK
|
||||
make_dnalist(PAK
|
||||
MLVL
|
||||
AGSC
|
||||
CSNG
|
||||
|
@ -68,4 +67,3 @@ set(DNAMP1_SOURCES
|
|||
Tweaks/CTweakGame.cpp)
|
||||
|
||||
dataspec_add_list(DNAMP1 DNAMP1_SOURCES)
|
||||
list(APPEND DNAMP1_SOURCES ${liblist})
|
||||
|
|
|
@ -39,11 +39,11 @@ bool CSNG::Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath) {
|
|||
hecl::ProjectPath audGrp(outPath.getParentPath().getParentPath(), _SYS_STR("AudioGrp"));
|
||||
audGrp.makeDirChain(true);
|
||||
hecl::ProjectPath songsPath(audGrp, _SYS_STR("!songs.yaml"));
|
||||
std::experimental::optional<athena::io::FileReader> r;
|
||||
std::optional<athena::io::FileReader> r;
|
||||
if (songsPath.isFile())
|
||||
r.emplace(songsPath.getAbsolutePath());
|
||||
athena::io::YAMLDocWriter ydw("amuse::Songs", r ? &*r : nullptr);
|
||||
r = std::experimental::nullopt;
|
||||
r = std::nullopt;
|
||||
char id[16];
|
||||
snprintf(id, 16, "%04X", head.midiSetupId);
|
||||
ydw.writeString(id, hecl::Format("../MidiData/%s", midPath.getLastComponentUTF8().data()));
|
||||
|
|
|
@ -37,8 +37,8 @@ void DCLN::sendToBlender(hecl::blender::Connection& conn, std::string_view entry
|
|||
"\n"
|
||||
"bpy.context.scene.name = '%s'\n"
|
||||
"# Clear Scene\n"
|
||||
"if 'Collection 1' in bpy.data.collections:\n"
|
||||
" bpy.data.collections.remove(bpy.data.collections['Collection 1'])\n",
|
||||
"if len(bpy.data.collections):\n"
|
||||
" bpy.data.collections.remove(bpy.data.collections[0])\n",
|
||||
entryName.data());
|
||||
|
||||
DeafBabe::BlenderInit(os);
|
||||
|
|
|
@ -292,8 +292,8 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
|
|||
os << "import bpy, math, bmesh\n"
|
||||
"from mathutils import Matrix, Quaternion\n"
|
||||
"# Clear Scene\n"
|
||||
"if 'Collection 1' in bpy.data.collections:\n"
|
||||
" bpy.data.collections.remove(bpy.data.collections['Collection 1'])\n"
|
||||
"if len(bpy.data.collections):\n"
|
||||
" bpy.data.collections.remove(bpy.data.collections[0])\n"
|
||||
"\n"
|
||||
"def duplicateObject(copy_obj):\n"
|
||||
" # Create new mesh\n"
|
||||
|
@ -438,7 +438,7 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
|
|||
"verts = []\n",
|
||||
w.header.name.c_str());
|
||||
|
||||
for (int i = 0; i < info->quadCoordCount; ++i) {
|
||||
for (uint32_t i = 0; i < info->quadCoordCount; ++i) {
|
||||
int ti;
|
||||
if (i == 2)
|
||||
ti = 3;
|
||||
|
@ -452,7 +452,7 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
|
|||
os << "bm.faces.new(verts)\n"
|
||||
"bm.loops.layers.uv.new('UV')\n"
|
||||
"bm.verts.ensure_lookup_table()\n";
|
||||
for (int i = 0; i < info->uvCoordCount; ++i) {
|
||||
for (uint32_t i = 0; i < info->uvCoordCount; ++i) {
|
||||
int ti;
|
||||
if (i == 2)
|
||||
ti = 3;
|
||||
|
|
|
@ -202,7 +202,7 @@ bool MLVL::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
|
|||
areaOut.docks.emplace_back();
|
||||
MLVL::Area::Dock& dockOut = areaOut.docks.back();
|
||||
|
||||
if (dock.targetArea != -1 && dock.targetDock != -1) {
|
||||
if (dock.targetArea != UINT32_MAX && dock.targetDock != UINT32_MAX) {
|
||||
dockOut.endpointCount = 1;
|
||||
dockOut.endpoints.emplace_back();
|
||||
MLVL::Area::Dock::Endpoint& ep = dockOut.endpoints.back();
|
||||
|
|
|
@ -207,8 +207,8 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
|
|||
DNACMDL::InitGeomBlenderContext(os, dataSpec.getMasterShaderPath());
|
||||
MaterialSet::RegisterMaterialProps(os);
|
||||
os << "# Clear Scene\n"
|
||||
"if 'Collection 1' in bpy.data.collections:\n"
|
||||
" bpy.data.collections.remove(bpy.data.collections['Collection 1'])\n"
|
||||
"if len(bpy.data.collections):\n"
|
||||
" bpy.data.collections.remove(bpy.data.collections[0])\n"
|
||||
"\n"
|
||||
"bpy.types.Light.retro_layer = bpy.props.IntProperty(name='Retro: Light Layer')\n"
|
||||
"bpy.types.Light.retro_origtype = bpy.props.IntProperty(name='Retro: Original Type')\n"
|
||||
|
@ -296,7 +296,7 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
|
|||
rs.seek(18, athena::Current);
|
||||
uint32_t entityCount = rs.readUint32Big();
|
||||
rs.seek(8, athena::Current);
|
||||
for (int i = 0; i < entityCount; ++i) {
|
||||
for (uint32_t i = 0; i < entityCount; ++i) {
|
||||
uint32_t entityId = rs.readUint32Big();
|
||||
visiWriter.writeUint32(nullptr, entityId);
|
||||
}
|
||||
|
@ -584,7 +584,7 @@ bool MREA::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
|
|||
athena::io::MemoryWriter w(secs.back().data(), secs.back().size());
|
||||
w.writeUint32Big(0xBABEDEAD);
|
||||
|
||||
for (int lay = 0; lay < 2; ++lay) {
|
||||
for (uint32_t lay = 0; lay < 2; ++lay) {
|
||||
int lightCount = 0;
|
||||
for (const Light& l : lights) {
|
||||
if (l.layer == lay)
|
||||
|
|
|
@ -71,8 +71,8 @@ void PATH::sendToBlender(hecl::blender::Connection& conn, std::string_view entry
|
|||
"\n"
|
||||
"bpy.context.scene.name = '%s'\n"
|
||||
"# Clear Scene\n"
|
||||
"if 'Collection 1' in bpy.data.collections:\n"
|
||||
" bpy.data.collections.remove(bpy.data.collections['Collection 1'])\n"
|
||||
"if len(bpy.data.collections):\n"
|
||||
" bpy.data.collections.remove(bpy.data.collections[0])\n"
|
||||
"\n"
|
||||
"bm = bmesh.new()\n"
|
||||
"height_lay = bm.faces.layers.float.new('Height')\n",
|
||||
|
@ -87,7 +87,7 @@ void PATH::sendToBlender(hecl::blender::Connection& conn, std::string_view entry
|
|||
|
||||
for (const Region& r : regions) {
|
||||
os << "tri_verts = []\n";
|
||||
for (int i = 0; i < r.nodeCount; ++i)
|
||||
for (atUint32 i = 0; i < r.nodeCount; ++i)
|
||||
os.format("tri_verts.append(bm.verts[%u])\n", r.nodeStart + i);
|
||||
|
||||
os.format(
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
make_dnalist(liblist DNAMP1/ScriptObjects
|
||||
make_dnalist(
|
||||
IScriptObject
|
||||
Parameters
|
||||
Actor
|
||||
|
@ -141,4 +141,3 @@ set(ScriptObjectsMP1_SOURCES
|
|||
WorldTeleporter.cpp)
|
||||
|
||||
dataspec_add_list(DNAMP1/ScriptObjects ScriptObjectsMP1_SOURCES)
|
||||
list(APPEND ScriptObjectsMP1_SOURCES ${liblist})
|
||||
|
|
|
@ -303,7 +303,7 @@ struct CTweakGui final : ITweakGui {
|
|||
float GetHudLightAttMulQuadratic() const { return x2c0_hudLightAttMulQuadratic; }
|
||||
|
||||
float GetScanSpeed(int idx) const {
|
||||
if (idx < 0 || idx >= x2c4_scanSpeeds.size())
|
||||
if (idx < 0 || size_t(idx) >= x2c4_scanSpeeds.size())
|
||||
return 0.f;
|
||||
return x2c4_scanSpeeds[idx];
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
make_dnalist(liblist DNAMP2
|
||||
MLVL
|
||||
make_dnalist(MLVL
|
||||
ANIM
|
||||
AGSC
|
||||
ANCS
|
||||
|
@ -28,4 +27,3 @@ set(DNAMP2_SOURCES
|
|||
STRG.hpp STRG.cpp)
|
||||
|
||||
dataspec_add_list(DNAMP2 DNAMP2_SOURCES)
|
||||
list(APPEND DNAMP2_SOURCES ${liblist})
|
||||
|
|
|
@ -200,8 +200,8 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
|
|||
DNACMDL::InitGeomBlenderContext(os, dataSpec.getMasterShaderPath());
|
||||
MaterialSet::RegisterMaterialProps(os);
|
||||
os << "# Clear Scene\n"
|
||||
"if 'Collection 1' in bpy.data.collections:\n"
|
||||
" bpy.data.collections.remove(bpy.data.collections['Collection 1'])\n"
|
||||
"if len(bpy.data.collections):\n"
|
||||
" bpy.data.collections.remove(bpy.data.collections[0])\n"
|
||||
"\n"
|
||||
"bpy.types.Light.retro_layer = bpy.props.IntProperty(name='Retro: Light Layer')\n"
|
||||
"bpy.types.Light.retro_origtype = bpy.props.IntProperty(name='Retro: Original Type')\n"
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
make_dnalist(liblist DNAMP3
|
||||
PAK
|
||||
make_dnalist(PAK
|
||||
MLVL
|
||||
ANIM
|
||||
CHAR
|
||||
|
@ -26,4 +25,3 @@ set(DNAMP3_SOURCES
|
|||
MREA.cpp)
|
||||
|
||||
dataspec_add_list(DNAMP3 DNAMP3_SOURCES)
|
||||
list(APPEND DNAMP3_SOURCES ${liblist})
|
||||
|
|
|
@ -103,8 +103,8 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
|
|||
DNACMDL::InitGeomBlenderContext(os, dataSpec.getMasterShaderPath());
|
||||
MaterialSet::RegisterMaterialProps(os);
|
||||
os << "# Clear Scene\n"
|
||||
"if 'Collection 1' in bpy.data.collections:\n"
|
||||
" bpy.data.collections.remove(bpy.data.collections['Collection 1'])\n"
|
||||
"if len(bpy.data.collections):\n"
|
||||
" bpy.data.collections.remove(bpy.data.collections[0])\n"
|
||||
"\n"
|
||||
"bpy.types.Light.retro_layer = bpy.props.IntProperty(name='Retro: Light Layer')\n"
|
||||
"bpy.types.Light.retro_origtype = bpy.props.IntProperty(name='Retro: Original Type')\n"
|
||||
|
|
|
@ -735,7 +735,7 @@ struct SpecMP1 : SpecBase {
|
|||
std::vector<Mesh> meshCompiles;
|
||||
meshCompiles.reserve(meshes.size());
|
||||
|
||||
std::experimental::optional<ColMesh> colMesh;
|
||||
std::optional<ColMesh> colMesh;
|
||||
|
||||
for (const std::string& mesh : meshes) {
|
||||
hecl::SystemStringConv meshSys(mesh);
|
||||
|
@ -1110,7 +1110,7 @@ struct SpecMP1 : SpecBase {
|
|||
Log.report(logvisor::Fatal, _SYS_STR("Corrupt MAPW %s"), mapCookedPath.getRelativePath().data());
|
||||
r.readUint32Big();
|
||||
atUint32 mapaCount = r.readUint32Big();
|
||||
for (int i = 0; i < mapaCount; ++i) {
|
||||
for (atUint32 i = 0; i < mapaCount; ++i) {
|
||||
UniqueID32 id;
|
||||
id.read(r);
|
||||
listOut.push_back({FOURCC('MAPA'), originalToNew(id)});
|
||||
|
|
|
@ -1,15 +1,7 @@
|
|||
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/DataSpec ${CMAKE_SOURCE_DIR}/Runtime)
|
||||
add_subdirectory(locale)
|
||||
add_subdirectory(icons)
|
||||
add_subdirectory(badging)
|
||||
|
||||
atdna(atdna_Space.cpp Space.hpp)
|
||||
atdna(atdna_ResourceBrowser.cpp ResourceBrowser.hpp)
|
||||
atdna(atdna_ModelViewer.cpp ModelViewer.hpp)
|
||||
atdna(atdna_ParticleEditor.cpp ParticleEditor.hpp)
|
||||
atdna(atdna_InformationCenter.cpp InformationCenter.hpp)
|
||||
atdna(atdna_GameMode.cpp GameMode.hpp)
|
||||
|
||||
if(URDE_DLPACKAGE)
|
||||
set(METADATA_VERSION_STRING ${URDE_DLPACKAGE})
|
||||
else()
|
||||
|
@ -82,40 +74,37 @@ endif()
|
|||
|
||||
add_executable(urde WIN32 MACOSX_BUNDLE
|
||||
main.cpp ${PLAT_SRCS}
|
||||
Space.hpp Space.cpp atdna_Space.cpp
|
||||
Space.hpp Space.cpp
|
||||
SplashScreen.hpp SplashScreen.cpp
|
||||
ResourceBrowser.hpp ResourceBrowser.cpp atdna_ResourceBrowser.cpp
|
||||
ModelViewer.hpp ModelViewer.cpp atdna_ModelViewer.cpp
|
||||
ParticleEditor.hpp ParticleEditor.cpp atdna_ParticleEditor.cpp
|
||||
InformationCenter.hpp InformationCenter.hpp atdna_InformationCenter.cpp
|
||||
ResourceBrowser.hpp ResourceBrowser.cpp
|
||||
ModelViewer.hpp ModelViewer.cpp
|
||||
ParticleEditor.hpp ParticleEditor.cpp
|
||||
InformationCenter.hpp InformationCenter.hpp
|
||||
ProjectManager.hpp ProjectManager.cpp
|
||||
ViewManager.hpp ViewManager.cpp
|
||||
Resource.hpp Resource.cpp
|
||||
Camera.hpp Camera.cpp
|
||||
GameMode.hpp GameMode.cpp atdna_GameMode.cpp)
|
||||
GameMode.hpp GameMode.cpp)
|
||||
target_atdna(urde atdna_Space.cpp Space.hpp)
|
||||
target_atdna(urde atdna_ResourceBrowser.cpp ResourceBrowser.hpp)
|
||||
target_atdna(urde atdna_ModelViewer.cpp ModelViewer.hpp)
|
||||
target_atdna(urde atdna_ParticleEditor.cpp ParticleEditor.hpp)
|
||||
target_atdna(urde atdna_InformationCenter.cpp InformationCenter.hpp)
|
||||
target_atdna(urde atdna_GameMode.cpp GameMode.hpp)
|
||||
|
||||
set_target_properties(urde PROPERTIES COMPILE_DEFINITIONS URDE_DLPACKAGE="${URDE_DLPACKAGE}")
|
||||
target_compile_definitions(urde PUBLIC URDE_DLPACKAGE="${URDE_DLPACKAGE}")
|
||||
|
||||
target_include_directories(urde PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_BINARY_DIR})
|
||||
|
||||
target_link_libraries(urde
|
||||
UrdeLocales
|
||||
UrdeIcons
|
||||
UrdeBadging
|
||||
RuntimeCommon NESEmulator
|
||||
specter specter-fonts
|
||||
${HECL_APPLICATION_REPS_TARGETS_LIST}
|
||||
freetype ${DATA_SPEC_LIBS}
|
||||
hecl-full hecl-blender-addon
|
||||
athena-core nod logvisor athena-libyaml amuse boo
|
||||
${PNG_LIB} libjp |