trimming things

This commit is contained in:
ecker 2025-08-01 23:14:52 -05:00
parent 596affe488
commit 4063105847
15 changed files with 37 additions and 35 deletions

View File

@ -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)))

View File

@ -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 )

View File

@ -8,8 +8,8 @@
#include <uf/engine/scene/scene.h>
#if UF_USE_CPPTRACE
#include <cpptrace/cpptrace.hpp>
#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<std::remove_cvref_t<decltype(handle)>>::remove( handle );\
}
#else
#define VK_REGISTER_HANDLE( X ) {};
#define VK_UNREGISTER_HANDLE( X ) {};
#endif
namespace ext {
namespace vulkan {

View File

@ -113,6 +113,7 @@ namespace uf {
}
}
#if UF_USE_CLASS_OF_PODS
namespace uf {
template<typename T = pod::Math::num_t, std::size_t R = 4, std::size_t C = R>
class /*UF_API*/ Matrix {
@ -186,6 +187,7 @@ namespace uf {
typedef Matrix4t<> Matrix4;
typedef Matrix4t<float> Matrix4f;
}
#endif
#include <sstream>
namespace uf {

View File

@ -1,5 +1,7 @@
#include "pod.inl"
#include "class.inl"
#if UF_USE_CLASS_OF_PODS
#include "class.inl"
#endif
template<typename T, size_t R, size_t C>
uf::stl::string /*UF_API*/ uf::string::toString( const pod::Matrix<T,R,C>& m ) {

View File

@ -66,6 +66,7 @@ namespace uf {
}
}
#if UF_USE_CLASS_OF_PODS
namespace uf {
template<typename T = pod::Math::num_t>
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

View File

@ -1,4 +1,6 @@
#pragma once
#include "pod.inl"
#include "class.inl"
#if UF_USE_CLASS_OF_PODS
#include "class.inl"
#endif

View File

@ -185,7 +185,7 @@ namespace uf {
}
}
#if UF_USE_CLASS_OF_PODS
namespace uf {
// Provides operations for POD vector
template<typename T = pod::Math::num_t, size_t N = 3>
@ -320,6 +320,7 @@ namespace uf {
typedef Vector4t<float> Vector4f;
typedef Vector4t<double> Vector4d;
}
#endif
//#include <uf/utils/string/ext.h>
#include <sstream>

View File

@ -618,6 +618,7 @@ pod::Vector<T,4>& pod::Vector<T,4>::operator=( const pod::Vector<U,M>& vector )
return *this = uf::vector::cast<T,4>(vector);
}
//
#if UF_USE_CLASS_OF_PODS
namespace uf {
template<typename T>
struct /*UF_API*/ Vector<T,1> {
@ -1971,4 +1972,5 @@ inline bool uf::Vector<T,4>::operator>( const uf::Vector<T,4>& vector ) const {
template<typename T> // Equality check between two vectors (greater than or equals)
inline bool uf::Vector<T,4>::operator>=( const uf::Vector<T,4>& vector ) const {
return uf::vector::compareTo(this->m_pod, vector.data() ) >= 0;
}
}
#endif

View File

@ -1,5 +1,7 @@
#include "pod.inl"
#include "class.inl"
#if UF_USE_CLASS_OF_PODS
#include "class.inl"
#endif
template<typename T, size_t N>
uf::stl::string /*UF_API*/ uf::string::toString( const pod::Vector<T,N>& v ) {

View File

@ -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;

View File

@ -35,7 +35,6 @@ const uf::stl::string ext::vulkan::DeferredRenderMode::getType() const {
return "Deferred";
}
#include <cpptrace/cpptrace.hpp>
void ext::vulkan::DeferredRenderMode::initialize( Device& device ) {
ext::vulkan::RenderMode::initialize( device );

View File

@ -14,11 +14,15 @@
#include <fstream>
#include <atomic>
#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<std::remove_cvref_t<decltype(handle)>>::add( handle, id ); \
}
#else
#define VK_REGISTER_HANDLE( X ) {};
#endif
namespace {
struct {

View File

@ -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

View File

@ -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