From 40631058476f53b3e2f7dd0486b9f401d5cde176 Mon Sep 17 00:00:00 2001 From: ecker Date: Fri, 1 Aug 2025 23:14:52 -0500 Subject: [PATCH] trimming things --- Makefile | 7 +++++- bin/data/entities/gui/pause/scripts/menu.lua | 24 ------------------- engine/inc/uf/ext/vulkan/vulkan.h | 6 ++++- engine/inc/uf/utils/math/matrix.h | 2 ++ engine/inc/uf/utils/math/matrix/matrix.inl | 4 +++- engine/inc/uf/utils/math/quaternion.h | 3 ++- .../uf/utils/math/quaternion/quaternion.inl | 4 +++- engine/inc/uf/utils/math/vector.h | 3 ++- .../inc/uf/utils/math/vector/redundancy.inl | 4 +++- engine/inc/uf/utils/math/vector/vector.inl | 4 +++- engine/src/ext/gltf/processPrimitives.inl | 2 ++ .../src/ext/vulkan/rendermodes/deferred.cpp | 1 - engine/src/ext/vulkan/vulkan.cpp | 4 ++++ makefiles/dreamcast.gcc.make | 2 +- makefiles/win64.gcc.make | 2 +- 15 files changed, 37 insertions(+), 35 deletions(-) diff --git a/Makefile b/Makefile index 85a40d5d..8d72a6b8 100644 --- a/Makefile +++ b/Makefile @@ -64,8 +64,12 @@ LINKS += $(UF_LIBS) $(EXT_LIBS) $(DEPS) DEPS += FLAGS += +ifneq (,$(findstring -DUF_DEBUG,$(FLAGS))) + REQ_DEPS += meshoptimizer toml xatlas curl ffx:fsr cpptrace # ncurses openvr draco discord bullet ultralight-ux + FLAGS += -g +endif ifneq (,$(findstring win64,$(ARCH))) - REQ_DEPS += $(RENDERER) json:nlohmann toml png zlib luajit reactphysics meshoptimizer xatlas simd ctti gltf imgui fmt curl freetype openal ogg ffx:fsr cpptrace # ncurses openvr draco discord bullet ultralight-ux + REQ_DEPS += $(RENDERER) json:nlohmann png zlib luajit reactphysics simd ctti gltf imgui fmt freetype openal ogg # meshoptimizer toml xatlas curl ffx:fsr cpptrace # ncurses openvr draco discord bullet ultralight-ux FLAGS += -DUF_ENV_WINDOWS -DUF_ENV_WIN64 -DWIN32_LEAN_AND_MEAN DEPS += -lgdi32 -ldwmapi LINKS += #-Wl,-subsystem,windows @@ -122,6 +126,7 @@ ifneq (,$(findstring imgui,$(REQ_DEPS))) INCS += -I./dep/include/imgui/backends endif ifneq (,$(findstring cpptrace,$(REQ_DEPS))) + FLAGS += -DUF_USE_CPPTRACE DEPS += -lcpptrace endif ifneq (,$(findstring json,$(REQ_DEPS))) diff --git a/bin/data/entities/gui/pause/scripts/menu.lua b/bin/data/entities/gui/pause/scripts/menu.lua index f6031884..4c9869ce 100644 --- a/bin/data/entities/gui/pause/scripts/menu.lua +++ b/bin/data/entities/gui/pause/scripts/menu.lua @@ -5,12 +5,10 @@ local metadata = ent:getComponent("Metadata") local masterdata = scene:getComponent("Metadata") local children = { - mainText = ent:loadChild("./main-text.json",true), circleOut = ent:loadChild("./circle-out.json",true), circleIn = ent:loadChild("./circle-in.json",true), coverBar = ent:loadChild("./yellow-box.json",true), commandText = ent:loadChild("./command-text.json",true), - tenkouseiOption = ent:loadChild("./tenkousei.json",true), closeOption = ent:loadChild("./close.json",true), quit = ent:loadChild("./quit.json",true), } @@ -43,7 +41,6 @@ destination(children.circleOut, nil, -2, 0) destination(children.circleIn, nil, 2, 0) destination(children.coverBar, -1.5, nil, 0) destination(children.commandText, -1.5, nil, 0) -destination(children.tenkouseiOption, -1.5, nil, 0) destination(children.closeOption, -1.5, nil, 0) destination(children.quit, -1.5, nil, 0) @@ -122,16 +119,6 @@ if os.arch() == "Dreamcast" then end end - -- main text - local child = children.mainText - if child:uid() > 0 then - local transform = child:getComponent("Transform") - local speed = 0.5 - transform.position.y = transform.position.y + time.delta() * speed - if transform.position.y > 2 then - transform.position.y = -2 - end - end -- circle in if children.circleIn:uid() > 0 then local static = Static.get( children.circleIn ) @@ -237,17 +224,6 @@ else ::continue:: end - -- main text - local child = children.mainText - if child:uid() > 0 then - local transform = child:getComponent("Transform") - local metadata = child:getComponent("Metadata") - local speed = metadata["hovered"] and 0.75 or 0.5 - transform.position.y = transform.position.y + time.delta() * speed - if transform.position.y > 2 then - transform.position.y = -2 - end - end -- circle in if children.circleIn:uid() > 0 then local static = Static.get( children.circleIn ) diff --git a/engine/inc/uf/ext/vulkan/vulkan.h b/engine/inc/uf/ext/vulkan/vulkan.h index 3fba0ce5..305d86b5 100644 --- a/engine/inc/uf/ext/vulkan/vulkan.h +++ b/engine/inc/uf/ext/vulkan/vulkan.h @@ -8,8 +8,8 @@ #include +#if UF_USE_CPPTRACE #include - #define VK_REGISTER_HANDLE( handle ) if ( ext::vulkan::settings::validation::checkpoints ) {\ VK_VALIDATION_MESSAGE("Registered handle: {}: {}", TYPE_NAME(decltype(handle)), (void*) handle);\ uf::stl::string id = ::fmt::format("{}: {}", cpptrace::generate_trace().to_string(), TYPE_NAME(decltype(*this)));\ @@ -19,6 +19,10 @@ VK_VALIDATION_MESSAGE("Unregistered handle: {}: {}", TYPE_NAME(decltype(handle)), (void*) handle);\ ext::vulkan::Resource>::remove( handle );\ } +#else +#define VK_REGISTER_HANDLE( X ) {}; +#define VK_UNREGISTER_HANDLE( X ) {}; +#endif namespace ext { namespace vulkan { diff --git a/engine/inc/uf/utils/math/matrix.h b/engine/inc/uf/utils/math/matrix.h index a574f8f9..b134832b 100644 --- a/engine/inc/uf/utils/math/matrix.h +++ b/engine/inc/uf/utils/math/matrix.h @@ -113,6 +113,7 @@ namespace uf { } } +#if UF_USE_CLASS_OF_PODS namespace uf { template class /*UF_API*/ Matrix { @@ -186,6 +187,7 @@ namespace uf { typedef Matrix4t<> Matrix4; typedef Matrix4t Matrix4f; } +#endif #include namespace uf { diff --git a/engine/inc/uf/utils/math/matrix/matrix.inl b/engine/inc/uf/utils/math/matrix/matrix.inl index 61f2168f..439ec9f0 100644 --- a/engine/inc/uf/utils/math/matrix/matrix.inl +++ b/engine/inc/uf/utils/math/matrix/matrix.inl @@ -1,5 +1,7 @@ #include "pod.inl" -#include "class.inl" +#if UF_USE_CLASS_OF_PODS + #include "class.inl" +#endif template uf::stl::string /*UF_API*/ uf::string::toString( const pod::Matrix& m ) { diff --git a/engine/inc/uf/utils/math/quaternion.h b/engine/inc/uf/utils/math/quaternion.h index dc318057..a0bedf0b 100644 --- a/engine/inc/uf/utils/math/quaternion.h +++ b/engine/inc/uf/utils/math/quaternion.h @@ -66,6 +66,7 @@ namespace uf { } } +#if UF_USE_CLASS_OF_PODS namespace uf { template class /*UF_API*/ Quaternion { @@ -160,7 +161,7 @@ public: inline operator const pod_t&() const { return this->m_pod; } }; } - +#endif #include "quaternion/quaternion.inl" #ifdef UF_USE_GLM_TMP diff --git a/engine/inc/uf/utils/math/quaternion/quaternion.inl b/engine/inc/uf/utils/math/quaternion/quaternion.inl index 90735b93..7334596b 100644 --- a/engine/inc/uf/utils/math/quaternion/quaternion.inl +++ b/engine/inc/uf/utils/math/quaternion/quaternion.inl @@ -1,4 +1,6 @@ #pragma once #include "pod.inl" -#include "class.inl" \ No newline at end of file +#if UF_USE_CLASS_OF_PODS + #include "class.inl" +#endif \ No newline at end of file diff --git a/engine/inc/uf/utils/math/vector.h b/engine/inc/uf/utils/math/vector.h index a68092a1..f46610f2 100644 --- a/engine/inc/uf/utils/math/vector.h +++ b/engine/inc/uf/utils/math/vector.h @@ -185,7 +185,7 @@ namespace uf { } } - +#if UF_USE_CLASS_OF_PODS namespace uf { // Provides operations for POD vector template @@ -320,6 +320,7 @@ namespace uf { typedef Vector4t Vector4f; typedef Vector4t Vector4d; } +#endif //#include #include diff --git a/engine/inc/uf/utils/math/vector/redundancy.inl b/engine/inc/uf/utils/math/vector/redundancy.inl index cf7fa3ed..47c54313 100644 --- a/engine/inc/uf/utils/math/vector/redundancy.inl +++ b/engine/inc/uf/utils/math/vector/redundancy.inl @@ -618,6 +618,7 @@ pod::Vector& pod::Vector::operator=( const pod::Vector& vector ) return *this = uf::vector::cast(vector); } // +#if UF_USE_CLASS_OF_PODS namespace uf { template struct /*UF_API*/ Vector { @@ -1971,4 +1972,5 @@ inline bool uf::Vector::operator>( const uf::Vector& vector ) const { template // Equality check between two vectors (greater than or equals) inline bool uf::Vector::operator>=( const uf::Vector& vector ) const { return uf::vector::compareTo(this->m_pod, vector.data() ) >= 0; -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/engine/inc/uf/utils/math/vector/vector.inl b/engine/inc/uf/utils/math/vector/vector.inl index b5887cc7..d2038492 100644 --- a/engine/inc/uf/utils/math/vector/vector.inl +++ b/engine/inc/uf/utils/math/vector/vector.inl @@ -1,5 +1,7 @@ #include "pod.inl" -#include "class.inl" +#if UF_USE_CLASS_OF_PODS + #include "class.inl" +#endif template uf::stl::string /*UF_API*/ uf::string::toString( const pod::Vector& v ) { diff --git a/engine/src/ext/gltf/processPrimitives.inl b/engine/src/ext/gltf/processPrimitives.inl index 1f5337fd..1cded6d5 100644 --- a/engine/src/ext/gltf/processPrimitives.inl +++ b/engine/src/ext/gltf/processPrimitives.inl @@ -361,6 +361,7 @@ if ( meshgrid.grid.divisions.x > 1 || meshgrid.grid.divisions.y > 1 || meshgrid. } // optimize each meshlet if requested +#if UF_USE_MESHOPT if ( meshopt.should ) { for ( auto& meshlet : meshlets ) { if ( !ext::meshopt::optimize( meshlet, meshopt.simplify, meshopt.level, meshopt.print ) ) { @@ -368,6 +369,7 @@ if ( meshopt.should ) { } } } +#endif { size_t indexID = 0; diff --git a/engine/src/ext/vulkan/rendermodes/deferred.cpp b/engine/src/ext/vulkan/rendermodes/deferred.cpp index 63ce94f1..c43d91b9 100644 --- a/engine/src/ext/vulkan/rendermodes/deferred.cpp +++ b/engine/src/ext/vulkan/rendermodes/deferred.cpp @@ -35,7 +35,6 @@ const uf::stl::string ext::vulkan::DeferredRenderMode::getType() const { return "Deferred"; } -#include void ext::vulkan::DeferredRenderMode::initialize( Device& device ) { ext::vulkan::RenderMode::initialize( device ); diff --git a/engine/src/ext/vulkan/vulkan.cpp b/engine/src/ext/vulkan/vulkan.cpp index 572ae0e6..efdce1cc 100644 --- a/engine/src/ext/vulkan/vulkan.cpp +++ b/engine/src/ext/vulkan/vulkan.cpp @@ -14,11 +14,15 @@ #include #include +#if UF_USE_CPPTRACE #define VK_REGISTER_HANDLE( handle ) if ( ext::vulkan::settings::validation::checkpoints ) {\ VK_VALIDATION_MESSAGE("Registered handle: {}: {}", TYPE_NAME(decltype(handle)), (void*) handle);\ uf::stl::string id = cpptrace::generate_trace().to_string();\ ext::vulkan::Resource>::add( handle, id ); \ } +#else +#define VK_REGISTER_HANDLE( X ) {}; +#endif namespace { struct { diff --git a/makefiles/dreamcast.gcc.make b/makefiles/dreamcast.gcc.make index 82b6ec6e..2e05a6f1 100644 --- a/makefiles/dreamcast.gcc.make +++ b/makefiles/dreamcast.gcc.make @@ -4,7 +4,7 @@ CC = gcc CXX = $(KOS_CCPLUS) RENDERER = opengl TARGET_EXTENSION = elf -OPTIMIZATIONS = -Os -g -ffunction-sections -fdata-sections -Wl,--gc-sections -fstrict-aliasing -ffast-math -fno-unroll-all-loops -fno-optimize-sibling-calls -fschedule-insns2 -fomit-frame-pointer -DUF_NO_EXCEPTIONS -fno-exceptions #-flto +OPTIMIZATIONS = -Os -ffunction-sections -fdata-sections -Wl,--gc-sections -fstrict-aliasing -ffast-math -fno-unroll-all-loops -fno-optimize-sibling-calls -fschedule-insns2 -fomit-frame-pointer -DUF_NO_EXCEPTIONS -fno-exceptions # -g # -flto WARNINGS = -Wno-attributes -Wno-conversion-null FLAGS += $(KOS_CPPFLAGS) -std=c++17 $(OPTIMIZATIONS) $(WARNINGS) -fdiagnostics-color=always INCS += $(KOS_INC_PATHS) -I/opt/dreamcast/sh-elf/sh-elf/include diff --git a/makefiles/win64.gcc.make b/makefiles/win64.gcc.make index a703d054..1c7af333 100644 --- a/makefiles/win64.gcc.make +++ b/makefiles/win64.gcc.make @@ -2,6 +2,6 @@ ARCH = win64 CDIR = CC = gcc CXX = g++ -OPTIMIZATIONS = -O3 -g -fstrict-aliasing -DUF_NO_EXCEPTIONS # -march=native # -flto +OPTIMIZATIONS = -O3 -fstrict-aliasing -DUF_NO_EXCEPTIONS # -g # -march=native # -flto WARNINGS = -Wall -Wno-unknown-pragmas -Wno-unused-function -Wno-unused-variable -Wno-switch -Wno-reorder -Wno-sign-compare -Wno-unused-but-set-variable -Wno-ignored-attributes -Wno-narrowing -Wno-misleading-indentation FLAGS += -std=c++2b $(OPTIMIZATIONS) $(WARNINGS) -fdiagnostics-color=always \ No newline at end of file