2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 13:44:56 +00:00

CActorContraption fixes, better CMake dependency handling

This commit is contained in:
Jack Andersen
2019-06-11 16:05:17 -10:00
parent 77d0ef942d
commit e218b8aeb5
295 changed files with 942 additions and 2219 deletions

View File

@@ -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} libjpeg-turbo squish xxhash zeus
kabufuda jbus discord-rpc ${ZLIB_LIBRARIES} lzokay
${BOO_SYS_LIBS} ${URDE_PLAT_LIBS})
RuntimeCommon
${URDE_PLAT_LIBS})
if(COMMAND add_sanitizers)
add_sanitizers(urde)
endif()
if(COMMAND cotire)
set_target_properties(urde PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
cotire(urde)
endif()
set_target_properties(urde PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_BINARY_DIR}/Info.plist"

View File

@@ -1,6 +1,6 @@
#include "ProjectManager.hpp"
#include "ViewManager.hpp"
#include "../DataSpecRegistry.hpp"
#include "DataSpecRegistry.hpp"
#include "hecl/Blender/Connection.hpp"
namespace urde {
@@ -174,7 +174,7 @@ void ProjectManager::mainUpdate() {
if (m_mainMP1) {
if (m_mainMP1->Proc()) {
m_mainMP1->Shutdown();
m_mainMP1 = std::experimental::nullopt;
m_mainMP1 = std::nullopt;
}
}
}

View File

@@ -29,7 +29,7 @@ class ProjectManager {
hecl::ClientProcess m_clientProc;
ProjectResourceFactoryMP1 m_factoryMP1;
ProjectResourcePool m_objStore;
std::experimental::optional<MP1::CMain> m_mainMP1;
std::optional<MP1::CMain> m_mainMP1;
bool m_precooking = false;
public:

View File

@@ -26,7 +26,7 @@ bool ProjectResourceFactoryBase::SyncCook(const hecl::ProjectPath& working) {
CFactoryFnReturn ProjectResourceFactoryBase::BuildSync(const SObjectTag& tag, const hecl::ProjectPath& path,
const CVParamTransfer& paramXfer, CObjectReference* selfRef) {
/* Ensure cooked rep is on the filesystem */
std::experimental::optional<athena::io::FileReader> fr;
std::optional<athena::io::FileReader> fr;
if (!PrepForReadSync(tag, path, fr))
return {};
@@ -166,7 +166,7 @@ ProjectResourceFactoryBase::_RemoveTask(const SObjectTag& tag) {
};
bool ProjectResourceFactoryBase::PrepForReadSync(const SObjectTag& tag, const hecl::ProjectPath& path,
std::experimental::optional<athena::io::FileReader>& fr) {
std::optional<athena::io::FileReader>& fr) {
/* Ensure requested resource is on the filesystem */
if (!path.isFileOrGlob()) {
Log.report(logvisor::Error, _SYS_STR("unable to find resource path '%s'"), path.getAbsolutePath().data());
@@ -288,7 +288,7 @@ u32 ProjectResourceFactoryBase::ResourceSize(const SObjectTag& tag) {
return {};
/* Ensure cooked rep is on the filesystem */
std::experimental::optional<athena::io::FileReader> fr;
std::optional<athena::io::FileReader> fr;
if (!PrepForReadSync(tag, *resPath, fr))
return {};
@@ -325,7 +325,7 @@ std::unique_ptr<u8[]> ProjectResourceFactoryBase::LoadResourceSync(const urde::S
return {};
/* Ensure cooked rep is on the filesystem */
std::experimental::optional<athena::io::FileReader> fr;
std::optional<athena::io::FileReader> fr;
if (!PrepForReadSync(tag, *resPath, fr))
return {};
@@ -343,7 +343,7 @@ std::unique_ptr<u8[]> ProjectResourceFactoryBase::LoadNewResourcePartSync(const
return {};
/* Ensure cooked rep is on the filesystem */
std::experimental::optional<athena::io::FileReader> fr;
std::optional<athena::io::FileReader> fr;
if (!PrepForReadSync(tag, *resPath, fr))
return {};

View File

@@ -6,7 +6,7 @@
#include "Runtime/CFactoryMgr.hpp"
#include "Runtime/CResFactory.hpp"
#include "DataSpec/SpecBase.hpp"
#include "optional.hpp"
#include <optional>
#include <thread>
#include <mutex>
@@ -91,7 +91,7 @@ protected:
}
bool PrepForReadSync(const SObjectTag& tag, const hecl::ProjectPath& path,
std::experimental::optional<athena::io::FileReader>& fr);
std::optional<athena::io::FileReader>& fr);
bool WaitForTagReady(const urde::SObjectTag& tag, const hecl::ProjectPath*& pathOut) {
return static_cast<DataSpec::SpecBase&>(*m_cookSpec).waitForTagReady(tag, pathOut);

View File

@@ -121,7 +121,7 @@ class ViewManager final : public specter::IViewManager {
std::unique_ptr<TestGameView> m_testGameView;
std::unique_ptr<boo::IAudioVoiceEngine> m_voiceEngine;
std::unique_ptr<boo::IAudioVoice> m_videoVoice;
std::experimental::optional<amuse::BooBackendVoiceAllocator> m_amuseAllocWrapper;
std::optional<amuse::BooBackendVoiceAllocator> m_amuseAllocWrapper;
hecl::SystemString m_recentProjectsPath;
std::vector<hecl::SystemString> m_recentProjects;

View File

@@ -1,12 +1,12 @@
if(NOT CMAKE_CROSSCOMPILING)
include_directories(${LIBPNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR})
add_executable(packbadge packbadge.c)
find_library(M_LIB m)
if(NOT M_LIB)
unset(M_LIB CACHE)
endif()
target_link_libraries(packbadge ${PNG_LIB} ${ZLIB_LIBRARIES} ${M_LIB})
target_include_directories(packbadge PRIVATE ${LIBPNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR})
##################
# Package Export #
@@ -40,3 +40,4 @@ bintoc(badge.cpp ${CMAKE_CURRENT_BINARY_DIR}/badge.bin URDE_BADGE)
add_library(UrdeBadging
badge.cpp badge.bin
Badging.hpp Badging.cpp)
target_link_libraries(UrdeBadging PUBLIC specter)

View File

@@ -1,11 +1,11 @@
if(NOT CMAKE_CROSSCOMPILING)
include_directories(${LIBPNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR})
add_executable(packicons packicons.c)
find_library(M_LIB m)
if(NOT M_LIB)
unset(M_LIB CACHE)
endif()
target_link_libraries(packicons ${PNG_LIB} ${ZLIB_LIBRARIES} ${M_LIB})
target_include_directories(packicons PRIVATE ${LIBPNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR})
##################
# Package Export #
@@ -60,3 +60,4 @@ endif()
bintoc(icons_dat.cpp ${CMAKE_CURRENT_BINARY_DIR}/icons.bin URDE_ICONS)
add_library(UrdeIcons icons.cpp icons.hpp icons.bin icons_dat.cpp)
target_link_libraries(UrdeIcons PUBLIC specter)

View File

@@ -1,5 +1,5 @@
include_directories(${LIBPNG_INCLUDE_DIR})
add_executable(mkwmicon mkwmicon.c)
target_include_directories(mkwmicon PRIVATE ${LIBPNG_INCLUDE_DIR})
target_link_libraries(mkwmicon ${PNG_LIB} ${ZLIB_LIBRARIES})
macro(declare_wmicon_target)