From c8853dc1b89cafb59a5d91df1cb9b4e299620e74 Mon Sep 17 00:00:00 2001 From: mrq Date: Thu, 5 May 2022 01:14:00 -0500 Subject: [PATCH] Commit for 2022.05.05 01-14-35.7z --- Makefile | 35 ++++--- bin/data/config.json | 24 ++--- bin/data/entities/model.json | 2 +- bin/data/entities/playerModel.json | 2 +- bin/data/scenes/sh2_mcdonalds/scene.json | 6 +- .../scenes/sh2_mcdonalds/sh2_mcdonalds.json | 18 +++- bin/data/scenes/ss2/medsci.json | 5 +- bin/data/shaders/display/subpass.h | 28 +++--- .../uf/engine/instantiator/instantiator.inl | 2 +- engine/inc/uf/ext/gltf/gltf.h | 7 +- engine/inc/uf/ext/ncurses/ncurses.h | 5 +- engine/inc/uf/ext/xatlas/xatlas.h | 4 +- engine/inc/uf/spec/window/dreamcast.h | 19 +--- engine/inc/uf/utils/math/collision.h | 5 +- .../inc/uf/utils/math/collision/boundingbox.h | 4 +- engine/inc/uf/utils/math/collision/gjk.h | 4 +- engine/inc/uf/utils/math/collision/mesh.h | 4 +- engine/inc/uf/utils/math/collision/modular.h | 4 +- engine/inc/uf/utils/math/collision/sphere.h | 4 +- engine/inc/uf/utils/octree/octree.h | 1 - engine/inc/uf/utils/thread/thread.h | 2 + engine/inc/uf/utils/type/type.h | 1 - engine/inc/uf/utils/type/type.inl | 0 engine/src/engine/asset/asset.cpp | 3 + engine/src/engine/graph/decode.cpp | 2 + engine/src/engine/graph/encode.cpp | 2 + engine/src/engine/object/object.cpp | 69 ++++++++++++- engine/src/ext/gltf/gltf.cpp | 5 +- engine/src/ext/lua/usertypes/audio.cpp | 2 + engine/src/ext/ncurses/ncurses.cpp | 2 +- engine/src/ext/opengl/graphic.cpp | 62 +++++++----- engine/src/ext/opengl/texture.cpp | 2 +- engine/src/ext/xatlas/xatlas.cpp | 96 +------------------ engine/src/spec/window/dreamcast.cpp | 57 ++--------- engine/src/spec/window/windows.cpp | 1 + engine/src/utils/math/collider.cpp | 4 +- .../src/utils/math/collision/boundingbox.cpp | 4 +- engine/src/utils/math/collision/gjk.cpp | 4 +- engine/src/utils/math/collision/mesh.cpp | 4 +- engine/src/utils/math/collision/modular.cpp | 4 +- engine/src/utils/math/collision/sphere.cpp | 4 +- engine/src/utils/octree/octree.cpp | 2 - ext/behaviors/baking/behavior.cpp | 7 +- ext/behaviors/baking/behavior.h | 1 + ext/behaviors/hands/behavior.cpp | 1 + ext/behaviors/voxelizer/behavior.cpp | 6 +- ext/gui/html/behavior.cpp | 1 + ext/main.cpp | 11 +-- makefiles/dreamcast.gcc.make | 3 +- makefiles/win64.gcc.make | 4 +- makefiles/win64.tdm-gcc.make | 8 ++ 51 files changed, 287 insertions(+), 270 deletions(-) delete mode 100644 engine/inc/uf/utils/octree/octree.h delete mode 100644 engine/inc/uf/utils/type/type.h delete mode 100644 engine/inc/uf/utils/type/type.inl delete mode 100644 engine/src/utils/octree/octree.cpp create mode 100644 makefiles/win64.tdm-gcc.make diff --git a/Makefile b/Makefile index e34b0edf..5e6a5fdc 100644 --- a/Makefile +++ b/Makefile @@ -4,10 +4,13 @@ TARGET_NAME = program TARGET_EXTENSION = exe TARGET_LIB_EXTENSION = dll RENDERER = vulkan +PREFIX = $(ARCH).$(CC) -include makefiles/$(ARCH).$(CC).make +include makefiles/$(PREFIX).make - .PHONY: $(ARCH)-$(CC) +.PHONY: $(ARCH)-$(CC) + +.FORCE: CXX := $(CDIR)$(CXX) BIN_DIR += ./bin @@ -48,11 +51,11 @@ LINKS += $(UF_LIBS) $(EXT_LIBS) $(DEPS) DEPS += ifneq (,$(findstring win64,$(ARCH))) - REQ_DEPS += $(RENDERER) json:nlohmann png zlib openal ogg freetype ncurses curl luajit reactphysics meshoptimizer xatlas simd ctti # openvr draco discord bullet ultralight-ux + REQ_DEPS += $(RENDERER) json:nlohmann png zlib openal ogg freetype curl luajit reactphysics meshoptimizer xatlas simd ctti # ncurses openvr draco discord bullet ultralight-ux FLAGS += DEPS += -lgdi32 else ifneq (,$(findstring dreamcast,$(ARCH))) - REQ_DEPS += simd opengl gldc json:nlohmann lua reactphysics freetype png zlib ctti ogg openal aldc # bullet meshoptimizer draco luajit ultralight-ux ncurses curl openvr discord + REQ_DEPS += simd opengl gldc json:nlohmann lua reactphysics png zlib ctti ogg openal aldc # freetype bullet meshoptimizer draco luajit ultralight-ux ncurses curl openvr discord endif ifneq (,$(findstring vulkan,$(REQ_DEPS))) FLAGS += -DVK_USE_PLATFORM_WIN32_KHR -DUF_USE_VULKAN @@ -116,9 +119,6 @@ endif ifneq (,$(findstring freetype,$(REQ_DEPS))) FLAGS += -DUF_USE_FREETYPE DEPS += -lfreetype -lbz2 - ifneq (,$(findstring dreamcast,$(ARCH))) - DEPS += -lbrotlicommon-static -lbrotlidec-static - endif endif ifneq (,$(findstring ncurses,$(REQ_DEPS))) FLAGS += -DUF_USE_NCURSES @@ -192,7 +192,7 @@ endif # SRCS_DLL += $(wildcard $(ENGINE_SRC_DIR)/*.cpp) $(wildcard $(ENGINE_SRC_DIR)/*/*.cpp) $(wildcard $(ENGINE_SRC_DIR)/*/*/*.cpp) $(wildcard $(ENGINE_SRC_DIR)/*/*/*/*.cpp) $(wildcard $(ENGINE_SRC_DIR)/*/*/*/*/*.cpp) SRCS_DLL += $(wildcard $(ENGINE_SRC_DIR)/*.cpp) $(wildcard $(ENGINE_SRC_DIR)/*/*.cpp) $(wildcard $(ENGINE_SRC_DIR)/*/*/*.cpp) $(wildcard $(ENGINE_SRC_DIR)/*/*/*/*.cpp) $(wildcard $(ENGINE_SRC_DIR)/*/*/*/*/*.cpp) $(wildcard $(EXT_SRC_DIR)/*.cpp) $(wildcard $(EXT_SRC_DIR)/*/*.cpp) $(wildcard $(EXT_SRC_DIR)/*/*/*.cpp) $(wildcard $(EXT_SRC_DIR)/*/*/*/*.cpp) $(wildcard $(EXT_SRC_DIR)/*/*/*/*/*.cpp) -OBJS_DLL += $(patsubst %.cpp,%.$(ARCH).$(CC).o,$(SRCS_DLL)) +OBJS_DLL += $(patsubst %.cpp,%.$(PREFIX).o,$(SRCS_DLL)) BASE_DLL += lib$(LIB_NAME) IM_DLL += $(ENGINE_LIB_DIR)/$(ARCH)/$(CC)/$(BASE_DLL).$(TARGET_LIB_EXTENSION).a EX_DLL += $(BIN_DIR)/exe/lib/$(ARCH)/$(CC)/$(BASE_DLL).$(TARGET_LIB_EXTENSION) @@ -208,13 +208,13 @@ EXT_INCS += -I$(ENGINE_INC_DIR) -I$(EXT_INC_DIR) -I$(VULKAN_SDK_PATH)/includ EXT_LIBS += -L$(ENGINE_LIB_DIR) -L$(EXT_LIB_DIR) -L$(EXT_LIB_DIR)/$(CC) -L$(VULKAN_SDK_PATH)/Lib -L/mingw64/lib SRCS_EXT_DLL += $(wildcard $(EXT_SRC_DIR)/*.cpp) $(wildcard $(EXT_SRC_DIR)/*/*.cpp) $(wildcard $(EXT_SRC_DIR)/*/*/*.cpp) $(wildcard $(EXT_SRC_DIR)/*/*/*/*.cpp) $(wildcard $(EXT_SRC_DIR)/*/*/*/*/*.cpp) -OBJS_EXT_DLL += $(patsubst %.cpp,%.$(ARCH).$(CC).o,$(SRCS_EXT_DLL)) +OBJS_EXT_DLL += $(patsubst %.cpp,%.$(PREFIX).o,$(SRCS_EXT_DLL)) BASE_EXT_DLL += lib$(EXT_LIB_NAME) EXT_IM_DLL += $(ENGINE_LIB_DIR)/$(ARCH)/$(CC)/$(BASE_EXT_DLL).$(TARGET_LIB_EXTENSION).a EXT_EX_DLL += $(BIN_DIR)/exe/lib/$(ARCH)/$(CC)/$(BASE_EXT_DLL).$(TARGET_LIB_EXTENSION) # Client EXE SRCS += $(wildcard $(CLIENT_SRC_DIR)/*.cpp) $(wildcard $(CLIENT_SRC_DIR)/*/*.cpp) -OBJS += $(patsubst %.cpp,%.$(ARCH).$(CC).o,$(SRCS)) +OBJS += $(patsubst %.cpp,%.$(PREFIX).o,$(SRCS)) TARGET += $(BIN_DIR)/exe/$(TARGET_NAME).$(CC).$(TARGET_EXTENSION) # Shaders SRCS_SHADERS += $(wildcard bin/data/shaders/*.glsl) $(wildcard bin/data/shaders/*/*.glsl) $(wildcard bin/data/shaders/*/*/*.glsl) @@ -225,12 +225,12 @@ ifneq (,$(findstring dreamcast,$(ARCH))) $(ARCH): $(TARGET) ./bin/dreamcast/$(TARGET_NAME).cdi SRCS_DLL = $(wildcard $(ENGINE_SRC_DIR)/*.cpp) $(wildcard $(ENGINE_SRC_DIR)/*/*.cpp) $(wildcard $(ENGINE_SRC_DIR)/*/*/*.cpp) $(wildcard $(ENGINE_SRC_DIR)/*/*/*/*.cpp) $(wildcard $(ENGINE_SRC_DIR)/*/*/*/*/*.cpp) -OBJS_DLL = $(patsubst %.cpp,%.$(ARCH).$(CC).o,$(SRCS_DLL)) -OBJS = $(patsubst %.cpp,%.$(ARCH).$(CC).o,$(SRCS_DLL)) $(patsubst %.cpp,%.$(ARCH).$(CC).o,$(SRCS_EXT_DLL)) $(patsubst %.cpp,%.$(ARCH).$(CC).o,$(SRCS)) +OBJS_DLL = $(patsubst %.cpp,%.$(PREFIX).o,$(SRCS_DLL)) +OBJS = $(patsubst %.cpp,%.$(PREFIX).o,$(SRCS_DLL)) $(patsubst %.cpp,%.$(PREFIX).o,$(SRCS_EXT_DLL)) $(patsubst %.cpp,%.$(PREFIX).o,$(SRCS)) DEPS += -lkallisti -lc -lm -lgcc -lstdc++ # -l$(LIB_NAME) -l$(EXT_LIB_NAME) -%.$(ARCH).$(CC).o: %.cpp +%.$(PREFIX).o: %.cpp $(CXX) $(FLAGS) $(INCS) -c $< -o $@ $(EX_DLL): FLAGS += -DUF_EXPORTS -DJSON_DLL_BUILD @@ -253,15 +253,19 @@ $(EXT_EX_DLL): $(OBJS_EXT_DLL) $(TARGET): $(OBJS) #./bin/dreamcast/romdisk.o # $(CXX) -O2 -fomit-frame-pointer -ml -m4-single-only -ffunction-sections -fdata-sections $(KOS_INC_PATHS) $(INCS) -D_arch_dreamcast -D_arch_sub_pristine -Wall -fno-builtin -ml -m4-single-only -Wl,-Ttext=0x8c010000 -Wl,--gc-sections -T/opt/dreamcast/kos/utils/ldscripts/shlelf.xc -nodefaultlibs $(KOS_LIB_PATHS) $(LIBS) -o $(TARGET) $(OBJS) ./bin/dreamcast/romdisk.o -Wl,--start-group $(DEPS) -Wl,--end-group - $(CXX) -O2 -fomit-frame-pointer -ml -m4-single-only -ffunction-sections -fdata-sections $(KOS_INC_PATHS) $(INCS) -D_arch_dreamcast -D_arch_sub_pristine -Wall -fno-builtin -ml -m4-single-only -Wl,-Ttext=0x8c010000 -Wl,--gc-sections -T/opt/dreamcast/kos/utils/ldscripts/shlelf.xc -nodefaultlibs $(KOS_LIB_PATHS) $(LIBS) -o $(TARGET) $(OBJS) -Wl,--start-group $(DEPS) -Wl,--end-group +# $(CXX) -O2 -fomit-frame-pointer -ml -m4-single-only -ffunction-sections -fdata-sections $(KOS_INC_PATHS) $(INCS) -D_arch_dreamcast -D_arch_sub_pristine -Wall -fno-builtin -ml -m4-single-only -Wl,-Ttext=0x8c010000 -Wl,--gc-sections -T/opt/dreamcast/kos/utils/ldscripts/shlelf.xc -nodefaultlibs $(KOS_LIB_PATHS) $(LIBS) -o $(TARGET) $(OBJS) -Wl,--start-group $(DEPS) -Wl,--end-group + $(CXX) -ffunction-sections -fdata-sections $(KOS_INC_PATHS) $(INCS) -D_arch_dreamcast -D_arch_sub_pristine -Wall -fno-builtin -ml -m4-single-only -Wl,-Ttext=0x8c010000 -Wl,--gc-sections -T/opt/dreamcast/kos/utils/ldscripts/shlelf.xc -nodefaultlibs $(KOS_LIB_PATHS) $(LIBS) -o $(TARGET) $(OBJS) -Wl,--start-group $(DEPS) -Wl,--end-group ./bin/dreamcast/$(TARGET_NAME).cdi: $(TARGET) cd ./bin/dreamcast/; ./elf2cdi.sh $(TARGET_NAME) +cdi: + cd ./bin/dreamcast/; ./elf2cdi.sh $(TARGET_NAME) + else $(ARCH): $(EX_DLL) $(TARGET) $(TARGET_SHADERS) -%.$(ARCH).$(CC).o: %.cpp +%.$(PREFIX).o: %.cpp $(CXX) $(FLAGS) $(INCS) -c $< -o $@ $(EX_DLL): FLAGS += -DUF_EXPORTS -DEXT_EXPORTS -DJSON_DLL_BUILD @@ -278,6 +282,7 @@ $(EXT_EX_DLL): $(OBJS_EXT_DLL) $(TARGET): $(OBJS) $(CXX) $(FLAGS) $(OBJS) $(LIBS) $(INCS) $(LINKS) -l$(LIB_NAME) -o $(TARGET) +# $(CXX) $(FLAGS) $(OBJS) $(LIBS) $(INCS) $(LINKS) -l$(LIB_NAME) -o $(TARGET) # $(CXX) $(FLAGS) $(OBJS) $(LIBS) $(INCS) $(LINKS) -l$(LIB_NAME) -l$(EXT_LIB_NAME) -o $(TARGET) endif diff --git a/bin/data/config.json b/bin/data/config.json index a115b6c9..eca8d8f3 100644 --- a/bin/data/config.json +++ b/bin/data/config.json @@ -1,17 +1,17 @@ { "engine": { "scenes": { - "start": "SH2_McDonalds", + "start": "SS2", "meshes": { "interleave": false }, "matrix": { "reverseInfinite": true }, "lights": { - "max": 24, + "max": 12, "enabled": true }, "shadows": { "enabled": true, "update": 4, - "max": 12, + "max": 6, "samples": 2, "experimental mode": 1 }, @@ -26,8 +26,8 @@ "limiter": 2, "size": 96, "dispatch": 8, - "cascades": 4, - "cascadePower": 2, + "cascades": 2, + "cascadePower": 4, "shadows": 0, "granularity": 4, "extents": { @@ -64,7 +64,7 @@ // "size": [ 1280, 720 ], // "size": [ 960, 540 ], // "size": [ 640, 480 ], - "msaa": 0 + "msaa": 1 }, "experimental": { "rebuild on tick begin": false, @@ -75,10 +75,10 @@ "deferred mode": "", "deferred reconstruct position": true, "deferred alias output to swapchain": false, - "vsync": true, - "hdr": true, + "vsync": false, + "hdr": false, "vxgi": true, - "deferred sampling": true, // broken for some scenes + "deferred sampling": true, "culling": true, "bloom": false }, @@ -244,12 +244,12 @@ "cursor" : { "visible" : true, "center" : false, - "sensitivity": [ 1, 1 ] + "sensitivity": [ 0.5, 0.5 ] }, "mode" : "windowed", // fullscreen, borderless, windowed "icon" : "./data/textures/icon.png", - // "size" : [ 1920, 1080 ], - "size" : [ 1280, 720 ], + "size" : [ 1920, 1080 ], + // "size" : [ 1280, 720 ], // "size" : [ 960, 540 ], // "size" : [ 640, 480 ], // "size" : [ 256, 224 ], diff --git a/bin/data/entities/model.json b/bin/data/entities/model.json index bc4af565..ea81cbcc 100644 --- a/bin/data/entities/model.json +++ b/bin/data/entities/model.json @@ -34,7 +34,7 @@ }, "grid": { "/^worldspawn/": { - "size": [3,3,3], + "size": [6,6,6], // "epsilon": 0.01, "cleanup": true, "print": true diff --git a/bin/data/entities/playerModel.json b/bin/data/entities/playerModel.json index ea3a455d..78066453 100644 --- a/bin/data/entities/playerModel.json +++ b/bin/data/entities/playerModel.json @@ -1,7 +1,7 @@ { "type": "Object", "name": "Player: Model", - "ignore": false, + "ignore": true, "assets": [ "/player/bear.glb" // { "filename": "/player/bear/graph.json", "delay": 0, "single threaded": false, "category": "models" } diff --git a/bin/data/scenes/sh2_mcdonalds/scene.json b/bin/data/scenes/sh2_mcdonalds/scene.json index 0423132d..d81c0d9c 100644 --- a/bin/data/scenes/sh2_mcdonalds/scene.json +++ b/bin/data/scenes/sh2_mcdonalds/scene.json @@ -26,9 +26,9 @@ }, "bloom": { "scale": 1.0, - "strength": 0.125, - "sigma": 0.75, - "samples": 8 + "strength": 1.0, + "sigma": 2.0, + "samples": 2 }, "light": { "exposure": 1.0, diff --git a/bin/data/scenes/sh2_mcdonalds/sh2_mcdonalds.json b/bin/data/scenes/sh2_mcdonalds/sh2_mcdonalds.json index bf833b41..b28e64c7 100644 --- a/bin/data/scenes/sh2_mcdonalds/sh2_mcdonalds.json +++ b/bin/data/scenes/sh2_mcdonalds/sh2_mcdonalds.json @@ -3,14 +3,28 @@ "assets": [ // { "filename": "./static.json", "delay": 8 }, - // { "filename": "./models/sh_mcd.glb", "delay": 0, "single threaded": false } + { "filename": "./models/sh_mcd.glb", "delay": 0, "single threaded": false } // { "filename": "./models/sh_mcd/graph.json", "delay": 0, "single threaded": false, "category": "models" } - { "filename": "./models/sh_mcd/graph.json.gz", "delay": 0, "single threaded": false, "category": "models" } + // { "filename": "./models/sh_mcd/graph.json.gz", "delay": 0, "single threaded": false, "category": "models" } ], "metadata": { "model": { "cull mode": "none", "alpha mode": "BLEND", + "grid": { + "/^worldspawn/": { + "size": [4,4,4], + // "epsilon": 0.01, + "cleanup": true, + "print": true + }, + "/^worldspawn_sh2/": { + "size": [32,32,32], + // "epsilon": 0.01, + "cleanup": true, + "print": true + } + }, "tags": { "worldspawn": { "physics": { "type": "mesh", "static": true } }, // "worldspawn_sh2": { "physics": { "type": "mesh", "static": true } }, diff --git a/bin/data/scenes/ss2/medsci.json b/bin/data/scenes/ss2/medsci.json index 43cfa6cd..673261ff 100644 --- a/bin/data/scenes/ss2/medsci.json +++ b/bin/data/scenes/ss2/medsci.json @@ -3,7 +3,7 @@ "assets": [ // { "filename": "./models/tiny_msci.glb", "delay": 0, "single threaded": false, "category": "models" } // { "filename": "./models/tiny_msci/graph.json", "delay": 0, "single threaded": false, "category": "models" } - // { "filename": "./models/tiny_msci/graph.json.gz", "delay": 0, "single threaded": false, "category": "models" } + { "filename": "./models/tiny_msci/graph.json.gz", "delay": 0, "single threaded": false, "category": "models" } // { "filename": "./models/micro_sci.glb", "delay": 0, "single threaded": false, "category": "models" } // { "filename": "./models/micro_sci/graph.json", "delay": 0, "single threaded": false, "category": "models" } @@ -14,7 +14,7 @@ // { "filename": "./models/msci/graph.json", "delay": 0, "single threaded": false, "category": "models" } // { "filename": "./models/msci/graph.json.gz", "delay": 0, "single threaded": false, "category": "models" } - { "filename": "./models/medsci.glb", "delay": 0, "single threaded": false } + // { "filename": "./models/medsci.glb", "delay": 0, "single threaded": false } // { "filename": "./models/medsci/graph.json", "delay": 0, "single threaded": false, "category": "models" } // { "filename": "./models/medsci/graph.json.gz", "delay": 0, "single threaded": false, "category": "models" } ], @@ -30,6 +30,7 @@ "trigger": { "mode": "rendered" }, "output": "./lightmap.png" }, + // "lightmap": "./lightmap.min.png", "filter": "NEAREST", "tags": { "worldspawn": { "physics": { "type": "mesh", "static": true } }, diff --git a/bin/data/shaders/display/subpass.h b/bin/data/shaders/display/subpass.h index 3ccff55b..2fb64708 100644 --- a/bin/data/shaders/display/subpass.h +++ b/bin/data/shaders/display/subpass.h @@ -41,7 +41,7 @@ layout (constant_id = 1) const uint CUBEMAPS = 128; #include "../common/structs.h" -layout (binding = 4) uniform UBO { +layout (binding = 5) uniform UBO { EyeMatrices eyes[2]; Mode mode; @@ -67,30 +67,30 @@ layout (binding = 4) uniform UBO { uint padding3; } ubo; /* -layout (std140, binding = 5) readonly buffer DrawCommands { +layout (std140, binding = 6) readonly buffer DrawCommands { DrawCommand drawCommands[]; }; */ -layout (std140, binding = 5) readonly buffer Instances { +layout (std140, binding = 6) readonly buffer Instances { Instance instances[]; }; -layout (std140, binding = 6) readonly buffer Materials { +layout (std140, binding = 7) readonly buffer Materials { Material materials[]; }; -layout (std140, binding = 7) readonly buffer Textures { +layout (std140, binding = 8) readonly buffer Textures { Texture textures[]; }; -layout (std140, binding = 8) readonly buffer Lights { +layout (std140, binding = 9) readonly buffer Lights { Light lights[]; }; -layout (binding = 9) uniform sampler2D samplerTextures[TEXTURES]; -layout (binding = 10) uniform samplerCube samplerCubemaps[CUBEMAPS]; -layout (binding = 11) uniform sampler3D samplerNoise; +layout (binding = 10) uniform sampler2D samplerTextures[TEXTURES]; +layout (binding = 11) uniform samplerCube samplerCubemaps[CUBEMAPS]; +layout (binding = 12) uniform sampler3D samplerNoise; #if VXGI - layout (binding = 12) uniform usampler3D voxelId[CASCADES]; - layout (binding = 13) uniform sampler3D voxelNormal[CASCADES]; - layout (binding = 14) uniform sampler3D voxelRadiance[CASCADES]; + layout (binding = 13) uniform usampler3D voxelId[CASCADES]; + layout (binding = 14) uniform sampler3D voxelNormal[CASCADES]; + layout (binding = 15) uniform sampler3D voxelRadiance[CASCADES]; #endif layout (location = 0) in vec2 inUv; @@ -210,10 +210,10 @@ void populateSurface() { { #if !MULTISAMPLING const vec4 uv = subpassLoad(samplerUv); - const vec2 mips = vec2(0); // subpassLoad(samplerMips).xy; + const vec2 mips = subpassLoad(samplerMips).xy; #else const vec4 uv = subpassLoad(samplerUv, msaa.currentID); // resolve(samplerUv, ubo.msaa); - const vec2 mips = vec2(0); // subpassLoad(samplerMips, msaa.currentID).xy; // resolve(samplerUv, ubo.msaa); + const vec2 mips = subpassLoad(samplerMips, msaa.currentID).xy; // resolve(samplerUv, ubo.msaa); #endif surface.uv.xy = uv.xy; surface.uv.z = mips.x; diff --git a/engine/inc/uf/engine/instantiator/instantiator.inl b/engine/inc/uf/engine/instantiator/instantiator.inl index a5b8e98d..0fb05178 100644 --- a/engine/inc/uf/engine/instantiator/instantiator.inl +++ b/engine/inc/uf/engine/instantiator/instantiator.inl @@ -1,4 +1,4 @@ -#include +// #include template typename pod::NamedTypes::type_t pod::NamedTypes::getType( const uf::stl::string& name ) { diff --git a/engine/inc/uf/ext/gltf/gltf.h b/engine/inc/uf/ext/gltf/gltf.h index bb7d7301..2d190e9d 100644 --- a/engine/inc/uf/ext/gltf/gltf.h +++ b/engine/inc/uf/ext/gltf/gltf.h @@ -1,5 +1,9 @@ #pragma once +#include + +#if UF_USE_GLTF + #include #include @@ -8,4 +12,5 @@ namespace ext { pod::Graph UF_API load( const uf::stl::string&, const uf::Serializer& = {} ); void UF_API save( const uf::stl::string&, const pod::Graph& ); } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/engine/inc/uf/ext/ncurses/ncurses.h b/engine/inc/uf/ext/ncurses/ncurses.h index 11088cf6..86d210af 100644 --- a/engine/inc/uf/ext/ncurses/ncurses.h +++ b/engine/inc/uf/ext/ncurses/ncurses.h @@ -1,7 +1,7 @@ #pragma once - #include +#if !UF_USE_NCURSES #include namespace ext { @@ -51,4 +51,5 @@ namespace ext { inline void UF_API_CALL attribute(int att, bool on = true) { on ? this->attrOn(att) : this->attrOff(att); } }; extern UF_API ext::Ncurses ncurses; -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/engine/inc/uf/ext/xatlas/xatlas.h b/engine/inc/uf/ext/xatlas/xatlas.h index 6347d18d..f4dc2ab3 100644 --- a/engine/inc/uf/ext/xatlas/xatlas.h +++ b/engine/inc/uf/ext/xatlas/xatlas.h @@ -2,9 +2,11 @@ #include +#if UF_USE_XATLAS namespace ext { namespace xatlas { pod::Vector2ui UF_API unwrap( uf::stl::vector& vertices, uf::stl::vector& indices ); pod::Vector2ui UF_API unwrap( pod::Graph& ); } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/engine/inc/uf/spec/window/dreamcast.h b/engine/inc/uf/spec/window/dreamcast.h index e1a5728d..f28b056f 100644 --- a/engine/inc/uf/spec/window/dreamcast.h +++ b/engine/inc/uf/spec/window/dreamcast.h @@ -8,27 +8,10 @@ namespace spec { namespace dreamcast { class UF_API Window : public spec::uni::Window { - public: - typedef size_t handle_t; - protected: - spec::dreamcast::Window::handle_t m_handle; - // size_t m_cursor; - // size_t m_icon; - - spec::dreamcast::Window::vector_t m_lastSize; - bool m_keyRepeatEnabled; - bool m_resizing; - bool m_mouseInside; - bool m_mouseGrabbed; - uint16_t m_surrogate; - bool m_syncParse; - bool m_asyncParse; public: // C-tors UF_API Window(); - UF_API Window( spec::dreamcast::Window::handle_t ); - UF_API Window( const spec::dreamcast::Window::vector_t& size, const spec::dreamcast::Window::title_t& title = L"Window" ); - /*virtual*/ void UF_API create( const spec::dreamcast::Window::vector_t& size, const spec::dreamcast::Window::title_t& title = L"Window" ); + /*virtual*/ void UF_API create( const spec::dreamcast::Window::vector_t& size, const spec::dreamcast::Window::title_t& title = "" ); // D-tors /*virtual*/ ~Window(); void UF_API terminate(); diff --git a/engine/inc/uf/utils/math/collision.h b/engine/inc/uf/utils/math/collision.h index 40170ffc..fcdc7598 100644 --- a/engine/inc/uf/utils/math/collision.h +++ b/engine/inc/uf/utils/math/collision.h @@ -1,7 +1,7 @@ #pragma once #include - +#if UF_USE_UNUSED #include "./collision/gjk.h" #include "./collision/boundingbox.h" #include "./collision/sphere.h" @@ -27,4 +27,5 @@ namespace uf { uf::stl::vector intersects( const uf::Collider&, bool = false ) const; uf::stl::vector intersects( const pod::Collider&, bool = false ) const; }; -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/engine/inc/uf/utils/math/collision/boundingbox.h b/engine/inc/uf/utils/math/collision/boundingbox.h index 345a1a9d..0028304a 100644 --- a/engine/inc/uf/utils/math/collision/boundingbox.h +++ b/engine/inc/uf/utils/math/collision/boundingbox.h @@ -1,5 +1,6 @@ #pragma once +#if UF_USE_UNUSED #include "gjk.h" namespace uf { @@ -24,4 +25,5 @@ namespace uf { virtual pod::Vector3 support( const pod::Vector3& ) const; pod::Collider::Manifold intersects( const uf::BoundingBox& ) const; }; -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/engine/inc/uf/utils/math/collision/gjk.h b/engine/inc/uf/utils/math/collision/gjk.h index d9af755c..eba30344 100644 --- a/engine/inc/uf/utils/math/collision/gjk.h +++ b/engine/inc/uf/utils/math/collision/gjk.h @@ -2,6 +2,7 @@ #include +#if UF_USE_UNUSED #include #include @@ -85,4 +86,5 @@ namespace pod { const pod::Transform<>& getTransform() const; void setTransform( const pod::Transform<>& ); }; -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/engine/inc/uf/utils/math/collision/mesh.h b/engine/inc/uf/utils/math/collision/mesh.h index 5f036cd8..cf2029bf 100644 --- a/engine/inc/uf/utils/math/collision/mesh.h +++ b/engine/inc/uf/utils/math/collision/mesh.h @@ -1,5 +1,6 @@ #pragma once +#if UF_USE_UNUSED #include "gjk.h" #include @@ -32,4 +33,5 @@ namespace uf { virtual pod::Vector3* expand() const; virtual pod::Vector3 support( const pod::Vector3& ) const; }; -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/engine/inc/uf/utils/math/collision/modular.h b/engine/inc/uf/utils/math/collision/modular.h index 0680c8c4..db854e4f 100644 --- a/engine/inc/uf/utils/math/collision/modular.h +++ b/engine/inc/uf/utils/math/collision/modular.h @@ -1,5 +1,6 @@ #pragma once +#if UF_USE_UNUSED #include "gjk.h" #include @@ -31,4 +32,5 @@ namespace uf { virtual pod::Vector3* expand() const; virtual pod::Vector3 support( const pod::Vector3& ) const; }; -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/engine/inc/uf/utils/math/collision/sphere.h b/engine/inc/uf/utils/math/collision/sphere.h index 02ea475e..a7fcc7b4 100644 --- a/engine/inc/uf/utils/math/collision/sphere.h +++ b/engine/inc/uf/utils/math/collision/sphere.h @@ -1,5 +1,6 @@ #pragma once +#if UF_USE_UNUSED #include "gjk.h" namespace uf { @@ -21,4 +22,5 @@ namespace uf { virtual pod::Vector3 support( const pod::Vector3& ) const; pod::Collider::Manifold intersects( const uf::SphereCollider& ) const; }; -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/engine/inc/uf/utils/octree/octree.h b/engine/inc/uf/utils/octree/octree.h deleted file mode 100644 index 7b9637ef..00000000 --- a/engine/inc/uf/utils/octree/octree.h +++ /dev/null @@ -1 +0,0 @@ -#pragma once \ No newline at end of file diff --git a/engine/inc/uf/utils/thread/thread.h b/engine/inc/uf/utils/thread/thread.h index ff8f7bfd..d45eeab3 100644 --- a/engine/inc/uf/utils/thread/thread.h +++ b/engine/inc/uf/utils/thread/thread.h @@ -9,6 +9,8 @@ #include #include +#include +#include #include #include diff --git a/engine/inc/uf/utils/type/type.h b/engine/inc/uf/utils/type/type.h deleted file mode 100644 index 50e96676..00000000 --- a/engine/inc/uf/utils/type/type.h +++ /dev/null @@ -1 +0,0 @@ -#pragma once diff --git a/engine/inc/uf/utils/type/type.inl b/engine/inc/uf/utils/type/type.inl deleted file mode 100644 index e69de29b..00000000 diff --git a/engine/src/engine/asset/asset.cpp b/engine/src/engine/asset/asset.cpp index 157babae..58c798b9 100644 --- a/engine/src/engine/asset/asset.cpp +++ b/engine/src/engine/asset/asset.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include @@ -284,10 +285,12 @@ uf::stl::string uf::Asset::load(const uf::Asset::Payload& payload ) { UF_ASSET_REGISTER(uf::Serializer) asset.readFromFile(filename); } break; + #if UF_USE_LUA case uf::Asset::Type::LUA: { UF_ASSET_REGISTER(pod::LuaScript) asset = ext::lua::script( filename ); } break; + #endif case uf::Asset::Type::GRAPH: { UF_ASSET_REGISTER(pod::Graph) auto& metadata = this->getComponent(); diff --git a/engine/src/engine/graph/decode.cpp b/engine/src/engine/graph/decode.cpp index 9005e349..6d7b2945 100644 --- a/engine/src/engine/graph/decode.cpp +++ b/engine/src/engine/graph/decode.cpp @@ -271,7 +271,9 @@ pod::Graph uf::graph::load( const uf::stl::string& filename, const uf::Serialize #define UF_DEBUG_TIMER_MULTITRACE_END(...) #endif const uf::stl::string extension = uf::io::extension( filename ); +#if UF_USE_GLTF if ( extension == "glb" || extension == "gltf" ) return ext::gltf::load( filename, metadata ); +#endif const uf::stl::string directory = uf::io::directory( filename ) + "/"; pod::Graph graph; uf::Serializer serializer; diff --git a/engine/src/engine/graph/encode.cpp b/engine/src/engine/graph/encode.cpp index 3b25b165..3cc405d6 100644 --- a/engine/src/engine/graph/encode.cpp +++ b/engine/src/engine/graph/encode.cpp @@ -236,11 +236,13 @@ void uf::graph::save( const pod::Graph& graph, const uf::stl::string& filename ) /*.filename = */directory + "/graph.json", }; if ( !settings.combined ) uf::io::mkdir(directory); +#if UF_USE_XATLAS if ( settings.unwrap ) { pod::Graph& g = const_cast(graph); auto size = ext::xatlas::unwrap( g ); serializer["wrapped"] = uf::vector::encode( size ); } +#endif pod::Thread::container_t jobs; jobs.emplace_back([&]{ diff --git a/engine/src/engine/object/object.cpp b/engine/src/engine/object/object.cpp index fede9e23..c4b3b407 100644 --- a/engine/src/engine/object/object.cpp +++ b/engine/src/engine/object/object.cpp @@ -205,6 +205,12 @@ bool uf::Object::load( const uf::Serializer& _json ) { { if ( ext::json::isObject( json["physics"] ) && !this->hasComponent() ) { auto& physics = this->getComponent(); + physics.linear.velocity = uf::vector::decode( json["physics"]["linear"]["velocity"], physics.linear.velocity ); + physics.linear.acceleration = uf::vector::decode( json["physics"]["linear"]["acceleration"], physics.linear.acceleration ); + physics.rotational.velocity = uf::vector::decode( json["physics"]["rotational"]["velocity"], physics.rotational.velocity ); + physics.rotational.acceleration = uf::vector::decode( json["physics"]["rotational"]["acceleration"], physics.rotational.acceleration ); + + /* if ( ext::json::isArray( json["physics"]["linear"]["velocity"] ) ) for ( size_t j = 0; j < 3; ++j ) physics.linear.velocity[j] = json["physics"]["linear"]["velocity"][j].as(); @@ -218,9 +224,58 @@ bool uf::Object::load( const uf::Serializer& _json ) { if ( ext::json::isArray( json["physics"]["rotational"]["acceleration"] ) ) for ( size_t j = 0; j < 4; ++j ) physics.rotational.acceleration[j] = json["physics"]["rotational"]["acceleration"][j].as(); + */ } } + #define ASSET_ENTRY(type) { uf::string::lowercase(#type), uf::Asset::Type::type } + const uf::stl::unordered_map assets = { + ASSET_ENTRY(AUDIO), + ASSET_ENTRY(IMAGE), + ASSET_ENTRY(GRAPH), + ASSET_ENTRY(LUA), + }; + + for ( auto& pair : assets ) { + auto& assetType = pair.second; + auto& assetTypeString = pair.first; + + uf::Serializer target; + bool override = false; + if ( ext::json::isObject( metadataJson["system"]["assets"] ) ) { + target = metadataJson["system"]["assets"]; + } else if ( ext::json::isArray( json["assets"] ) ) { + target = json["assets"]; + } else if ( ext::json::isObject( json["assets"] ) && !ext::json::isNull( json["assets"][assetTypeString] ) ) { + target = json["assets"][assetTypeString]; + } + + for ( size_t i = 0; i < target.size(); ++i ) { + bool isObject = ext::json::isObject( target[i] ); + uf::stl::string f = isObject ? target[i]["filename"].as() : target[i].as(); + uf::stl::string filename = uf::io::resolveURI( f, metadata.system.root ); + uf::stl::string mime = isObject ? target[i]["mime"].as("") : ""; + uf::Asset::Payload payload = uf::Asset::resolveToPayload( filename, mime ); + if ( !uf::Asset::isExpected( payload, assetType ) ) continue; + payload.hash = isObject ? target[i]["hash"].as("") : ""; + payload.monoThreaded = isObject ? target[i]["single threaded"].as() : false; + this->queueHook( "asset:QueueLoad.%UID%", payload, isObject ? target[i]["delay"].as() : 0 ); + bool bind = isObject && target[i]["bind"].is() ? target[i]["bind"].as() : true; + + switch ( assetType ) { + case uf::Asset::Type::LUA: { + if ( bind ) uf::instantiator::bind("LuaBehavior", *this); + } break; + case uf::Asset::Type::GRAPH: { + auto& aMetadata = assetLoader.getComponent(); + aMetadata[filename] = json["metadata"]["model"]; + aMetadata[filename]["root"] = json["root"]; + if ( bind ) uf::instantiator::bind("GraphBehavior", *this); + } break; + } + } + } +/* #define UF_OBJECT_LOAD_ASSET_HEADER(type)\ uf::Asset::Type assetType = uf::Asset::Type::type;\ uf::stl::string assetTypeString = uf::string::lowercase( #type );\ @@ -276,6 +331,7 @@ bool uf::Object::load( const uf::Serializer& _json ) { if ( bind ) uf::instantiator::bind("LuaBehavior", *this); } } +*/ // Bind behaviors { @@ -307,7 +363,15 @@ bool uf::Object::load( const uf::Serializer& _json ) { // check for children { - UF_OBJECT_LOAD_ASSET_HEADER(JSON) + uf::Serializer target; + bool override = false; + if ( ext::json::isObject( metadataJson["system"]["assets"] ) ) { + target = metadataJson["system"]["assets"]; + } else if ( ext::json::isArray( json["assets"] ) ) { + target = json["assets"]; + } else if ( ext::json::isObject( json["assets"] ) && !ext::json::isNull( json["assets"]["json"] ) ) { + target = json["assets"]["json"]; + } for ( size_t i = 0; i < target.size(); ++i ) { uf::stl::string f = ext::json::isObject( target[i] ) ? target[i]["filename"].as() : target[i].as(); uf::stl::string filename = uf::io::resolveURI( f, metadata.system.root ); @@ -339,6 +403,7 @@ bool uf::Object::load( const uf::Serializer& _json ) { } } // Add lights +#if UF_USE_UNUSED if ( ext::json::isArray( metadataJson["system"]["lights"] ) ) { uf::Serializer target = metadataJson["system"]["lights"]; auto& pTransform = this->getComponent>(); @@ -357,7 +422,7 @@ bool uf::Object::load( const uf::Serializer& _json ) { light->initialize(); } } - +#endif return true; } uf::Object& uf::Object::loadChild( const uf::stl::string& f, bool initialize ) { diff --git a/engine/src/ext/gltf/gltf.cpp b/engine/src/ext/gltf/gltf.cpp index 0726ee0e..b8796c77 100644 --- a/engine/src/ext/gltf/gltf.cpp +++ b/engine/src/ext/gltf/gltf.cpp @@ -1,5 +1,5 @@ #include - +#if UF_USE_GLTF #define TINYGLTF_IMPLEMENTATION #if UF_JSON_USE_NLOHMANN @@ -503,4 +503,5 @@ pod::Graph ext::gltf::load( const uf::stl::string& filename, const uf::Serialize if ( graph.metadata["exporter"]["enabled"].as() ) uf::graph::save( graph, filename ); return graph; -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/engine/src/ext/lua/usertypes/audio.cpp b/engine/src/ext/lua/usertypes/audio.cpp index f09108cd..bac592c6 100644 --- a/engine/src/ext/lua/usertypes/audio.cpp +++ b/engine/src/ext/lua/usertypes/audio.cpp @@ -1,4 +1,5 @@ #include +#if 0 #if UF_USE_LUA #include UF_LUA_REGISTER_USERTYPE(uf::Audio, @@ -30,4 +31,5 @@ UF_LUA_REGISTER_USERTYPE(uf::Audio, UF_LUA_REGISTER_USERTYPE_MEMBER_FUN( uf::Audio::getVolume ), UF_LUA_REGISTER_USERTYPE_MEMBER_FUN( uf::Audio::getFilename ) ) +#endif #endif \ No newline at end of file diff --git a/engine/src/ext/ncurses/ncurses.cpp b/engine/src/ext/ncurses/ncurses.cpp index a2a6e56a..438ed1e9 100644 --- a/engine/src/ext/ncurses/ncurses.cpp +++ b/engine/src/ext/ncurses/ncurses.cpp @@ -2,7 +2,7 @@ ext::Ncurses ext::ncurses; -#if defined(UF_USE_NCURSES) +#if UF_USE_NCURSES #include #include #include diff --git a/engine/src/ext/opengl/graphic.cpp b/engine/src/ext/opengl/graphic.cpp index 6b407692..6cc01af8 100644 --- a/engine/src/ext/opengl/graphic.cpp +++ b/engine/src/ext/opengl/graphic.cpp @@ -356,15 +356,32 @@ void ext::opengl::Graphic::record( CommandBuffer& commandBuffer, const GraphicDe } } + auto uniformBufferIt = uniformBuffers.begin(); + auto uniformBuffer = (*uniformBufferIt++).buffer; + pod::Camera::Viewports* viewports = (pod::Camera::Viewports*) device->getBuffer( uniformBuffer ); + + CommandBuffer::InfoDraw drawCommandInfoBase = {}; + drawCommandInfoBase.type = ext::opengl::enums::Command::DRAW; + drawCommandInfoBase.descriptor = descriptor; + drawCommandInfoBase.attributes.index = descriptor.inputs.index.attributes.front(); + for ( uf::Mesh::Attribute attribute : descriptor.inputs.vertex.attributes ) { + if ( attribute.descriptor.name == "position" ) drawCommandInfoBase.attributes.position = attribute; + else if ( attribute.descriptor.name == "uv" ) drawCommandInfoBase.attributes.uv = attribute; + else if ( attribute.descriptor.name == "st" ) drawCommandInfoBase.attributes.st = attribute; + else if ( attribute.descriptor.name == "normal" ) drawCommandInfoBase.attributes.normal = attribute; + else if ( attribute.descriptor.name == "color" ) drawCommandInfoBase.attributes.color = attribute; + } + + drawCommandInfoBase.attributes.index = descriptor.inputs.index.attributes.front(); + drawCommandInfoBase.matrices.view = &viewports->matrices[0].view; + drawCommandInfoBase.matrices.projection = &viewports->matrices[0].projection; + #if 1 if ( descriptor.inputs.indirect.count ) { auto& indirectAttribute = descriptor.inputs.indirect.attributes.front(); - auto uniformBufferIt = uniformBuffers.begin(); auto storageBufferIt = storageBuffers.begin(); - auto uniformBuffer = (*uniformBufferIt++).buffer; - storageBufferIt++; storageBufferIt++; @@ -372,7 +389,6 @@ void ext::opengl::Graphic::record( CommandBuffer& commandBuffer, const GraphicDe auto materialBuffer = (*storageBufferIt++).buffer; auto textureBuffer = (*storageBufferIt++).buffer; - pod::Camera::Viewports* viewports = (pod::Camera::Viewports*) device->getBuffer( uniformBuffer ); pod::DrawCommand* drawCommands = (pod::DrawCommand*) indirectAttribute.pointer; pod::Instance* instances = (pod::Instance*) device->getBuffer( instanceBuffer ); pod::Material* materials = (pod::Material*) device->getBuffer( materialBuffer ); @@ -389,10 +405,23 @@ void ext::opengl::Graphic::record( CommandBuffer& commandBuffer, const GraphicDe auto textureID = material.indexAlbedo; auto& infos = pool[textureID]; - CommandBuffer::InfoDraw& drawCommandInfo = infos.emplace_back(); + CommandBuffer::InfoDraw& drawCommandInfo = infos.emplace_back( drawCommandInfoBase ); + /* drawCommandInfo.type = ext::opengl::enums::Command::DRAW; drawCommandInfo.descriptor = descriptor; drawCommandInfo.attributes.index = descriptor.inputs.index.attributes.front(); + for ( uf::Mesh::Attribute attribute : descriptor.inputs.vertex.attributes ) { + if ( attribute.descriptor.name == "position" ) drawCommandInfo.attributes.position = attribute; + else if ( attribute.descriptor.name == "uv" ) drawCommandInfo.attributes.uv = attribute; + else if ( attribute.descriptor.name == "st" ) drawCommandInfo.attributes.st = attribute; + else if ( attribute.descriptor.name == "normal" ) drawCommandInfo.attributes.normal = attribute; + else if ( attribute.descriptor.name == "color" ) drawCommandInfo.attributes.color = attribute; + } + + drawCommandInfo.attributes.index = descriptor.inputs.index.attributes.front(); + drawCommandInfo.matrices.view = &viewports->matrices[0].view; + drawCommandInfo.matrices.projection = &viewports->matrices[0].projection; + */ drawCommandInfo.descriptor.inputs.index.first = drawCommand.indexID; drawCommandInfo.descriptor.inputs.index.count = drawCommand.indices; @@ -400,17 +429,6 @@ void ext::opengl::Graphic::record( CommandBuffer& commandBuffer, const GraphicDe drawCommandInfo.descriptor.inputs.vertex.first = drawCommand.vertexID; drawCommandInfo.descriptor.inputs.vertex.count = drawCommand.vertices; - // drawCommandInfo.attributes.index.pointer + drawCommandInfo.attributes.index.stride * drawCommandInfo.descriptor.inputs.index.first; - - for ( uf::Mesh::Attribute attribute : descriptor.inputs.vertex.attributes ) { - // attribute.pointer = attribute.pointer + attribute.stride * drawCommandInfo.descriptor.inputs.vertex.first; - - if ( attribute.descriptor.name == "position" ) drawCommandInfo.attributes.position = attribute; - else if ( attribute.descriptor.name == "uv" ) drawCommandInfo.attributes.uv = attribute; - else if ( attribute.descriptor.name == "st" ) drawCommandInfo.attributes.st = attribute; - else if ( attribute.descriptor.name == "normal" ) drawCommandInfo.attributes.normal = attribute; - else if ( attribute.descriptor.name == "color" ) drawCommandInfo.attributes.color = attribute; - } drawCommandInfo.attributes.instance.pointer = &instance; drawCommandInfo.attributes.instance.length = sizeof(instance); @@ -419,8 +437,6 @@ void ext::opengl::Graphic::record( CommandBuffer& commandBuffer, const GraphicDe drawCommandInfo.attributes.indirect.length = sizeof(drawCommand); drawCommandInfo.matrices.model = &instance.model; - drawCommandInfo.matrices.view = &viewports->matrices[0].view; - drawCommandInfo.matrices.projection = &viewports->matrices[0].projection; if ( 0 <= material.indexAlbedo ) { auto texture2DID = textures[material.indexAlbedo].index; @@ -431,10 +447,12 @@ void ext::opengl::Graphic::record( CommandBuffer& commandBuffer, const GraphicDe auto texture2DID = textures[instance.lightmapID].index; drawCommandInfo.textures.secondary = this->material.textures.at(texture2DID).descriptor; } - if ( !optimize ) commandBuffer.record(drawCommandInfo); + // if ( !optimize ) + commandBuffer.record(drawCommandInfo); } - if ( optimize ) for ( auto pair : pool ) for ( auto& info : pair.second ) commandBuffer.record(info); + // if ( optimize ) for ( auto pair : pool ) for ( auto& info : pair.second ) commandBuffer.record(info); } else { + /* auto uniformBufferIt = uniformBuffers.begin(); auto uniformBuffer = (*uniformBufferIt++).buffer; auto uniformOffset = (size_t) 0; @@ -460,8 +478,8 @@ void ext::opengl::Graphic::record( CommandBuffer& commandBuffer, const GraphicDe drawCommandInfo.matrices.view = &uniforms->modelView; drawCommandInfo.matrices.projection = &uniforms->projection; } - - commandBuffer.record(drawCommandInfo); + */ + commandBuffer.record(drawCommandInfoBase); } #endif } diff --git a/engine/src/ext/opengl/texture.cpp b/engine/src/ext/opengl/texture.cpp index 10781cf4..8a3e11c0 100644 --- a/engine/src/ext/opengl/texture.cpp +++ b/engine/src/ext/opengl/texture.cpp @@ -288,7 +288,7 @@ void ext::opengl::Texture::update( void* data, size_t bufferSize, uint32_t layer format = GL_RGB; break; case enums::Format::R4G4B4A4_UNORM_PACK16: - case enums::Format::R4G4B4A4_UNORM_PSRGB: + // case enums::Format::R4G4B4A4_UNORM_PSRGB: format = GL_RGBA; type = GL_UNSIGNED_SHORT_4_4_4_4; break; diff --git a/engine/src/ext/xatlas/xatlas.cpp b/engine/src/ext/xatlas/xatlas.cpp index 1f807f1d..a9f52454 100644 --- a/engine/src/ext/xatlas/xatlas.cpp +++ b/engine/src/ext/xatlas/xatlas.cpp @@ -1,9 +1,8 @@ #include #if UF_USE_XATLAS - #include -#endif +#include + pod::Vector2ui UF_API ext::xatlas::unwrap( pod::Graph& graph ) { -#if UF_USE_XATLAS struct Pair { size_t index = 0; size_t command = 0; @@ -261,96 +260,9 @@ pod::Vector2ui UF_API ext::xatlas::unwrap( pod::Graph& graph ) { mesh.updateDescriptor(); } -#if 0 - for ( auto i = 0; i < atlas->meshCount; i++ ) { - auto& xmesh = atlas->meshes[i]; - auto& entry = entries[i]; - auto& name = graph.meshes[entry.index]; - auto& mesh = /*graph.storage*/uf::graph::storage.meshes[name]; - auto& source = sources[entry.index]; - - uf::Mesh::Input vertexInput = mesh.vertex; - - uf::Mesh::Attribute positionAttribute; - uf::Mesh::Attribute uvAttribute; - uf::Mesh::Attribute stAttribute; - - for ( auto& attribute : mesh.vertex.attributes ) { - if ( attribute.descriptor.name == "position" ) positionAttribute = attribute; - else if ( attribute.descriptor.name == "uv" ) uvAttribute = attribute; - else if ( attribute.descriptor.name == "st" ) stAttribute = attribute; - } - UF_ASSERT( positionAttribute.descriptor.name == "position" && uvAttribute.descriptor.name == "uv" && stAttribute.descriptor.name == "st" ); - - if ( mesh.index.count ) { - uf::Mesh::Input indexInput = mesh.index; - uf::Mesh::Attribute indexAttribute = mesh.index.attributes.front(); - - ::xatlas::IndexFormat indexType = ::xatlas::IndexFormat::UInt32; - switch ( mesh.index.size ) { - case sizeof(uint16_t): indexType = ::xatlas::IndexFormat::UInt16; break; - case sizeof(uint32_t): indexType = ::xatlas::IndexFormat::UInt32; break; - default: UF_EXCEPTION("unsupported index type"); break; - } - - if ( mesh.indirect.count ) { - for ( auto v = 0; v < xmesh.vertexCount; ++v ) { - auto& vertex = xmesh.vertexArray[v]; - auto ref = vertex.xref; - - vertexInput = mesh.remapVertexInput( entry.command ); - - for ( size_t _ = 0; _ < vertexInput.attributes.size(); ++_ ) { - auto& srcAttribute = source.vertex.attributes[_]; - auto& dstAttribute = mesh.vertex.attributes[_]; - - memcpy( static_cast(dstAttribute.pointer) + dstAttribute.stride * (vertexInput.first + v), static_cast(srcAttribute.pointer) + srcAttribute.stride * (vertexInput.first + ref), srcAttribute.stride ); - } - - pod::Vector2f& st = *(pod::Vector2f*) (static_cast(stAttribute.pointer) + stAttribute.stride * (vertexInput.first + v)); - st = { vertex.uv[0] / atlas->width, vertex.uv[1] / atlas->height }; - } - // indices - - indexInput = mesh.remapIndexInput( entry.command ); - for ( auto index = 0; index < xmesh.indexCount; ++index ) { - switch ( mesh.index.size ) { - case 1: (( uint8_t*) static_cast(indexAttribute.pointer) + indexAttribute.stride * indexInput.first)[index] = xmesh.indexArray[index]; break; - case 2: ((uint16_t*) static_cast(indexAttribute.pointer) + indexAttribute.stride * indexInput.first)[index] = xmesh.indexArray[index]; break; - case 4: ((uint32_t*) static_cast(indexAttribute.pointer) + indexAttribute.stride * indexInput.first)[index] = xmesh.indexArray[index]; break; - } - } - } else { - for ( auto v = 0; v < xmesh.vertexCount; ++v ) { - auto& vertex = xmesh.vertexArray[v]; - auto ref = vertex.xref; - - for ( size_t _ = 0; _ < vertexInput.attributes.size(); ++_ ) { - auto& srcAttribute = source.vertex.attributes[_]; - auto& dstAttribute = mesh.vertex.attributes[_]; - - memcpy( static_cast(dstAttribute.pointer) + dstAttribute.stride * (vertexInput.first + v), static_cast(srcAttribute.pointer) + srcAttribute.stride * (vertexInput.first + ref), srcAttribute.stride ); - } - - pod::Vector2f& st = *(pod::Vector2f*) (static_cast(stAttribute.pointer) + stAttribute.stride * (vertexInput.first + v)); - st = { vertex.uv[0] / atlas->width, vertex.uv[1] / atlas->height }; - } - - for ( auto index = 0; index < xmesh.indexCount; ++index ) { - switch ( mesh.index.size ) { - case 1: (( uint8_t*) static_cast(indexAttribute.pointer) + indexAttribute.stride * indexInput.first)[index] = xmesh.indexArray[index]; break; - case 2: ((uint16_t*) static_cast(indexAttribute.pointer) + indexAttribute.stride * indexInput.first)[index] = xmesh.indexArray[index]; break; - case 4: ((uint32_t*) static_cast(indexAttribute.pointer) + indexAttribute.stride * indexInput.first)[index] = xmesh.indexArray[index]; break; - } - } - } - } else UF_EXCEPTION("to-do: not require indices for meshes"); - } -#endif - pod::Vector2ui size = pod::Vector2ui{ atlas->width, atlas->height }; ::xatlas::Destroy(atlas); return size; -#endif -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/engine/src/spec/window/dreamcast.cpp b/engine/src/spec/window/dreamcast.cpp index ec9b7efe..b060a886 100644 --- a/engine/src/spec/window/dreamcast.cpp +++ b/engine/src/spec/window/dreamcast.cpp @@ -30,6 +30,8 @@ KOS_INIT_FLAGS(INIT_DEFAULT | INIT_MALLOCSTATS); #endif namespace { + bool asyncParse = true; + struct { maple_device_t* device = NULL; kbd_state_t* state = NULL; @@ -267,49 +269,7 @@ namespace { } } -UF_API_CALL spec::dreamcast::Window::Window() : - m_handle (NULL), -// m_callback (0), -// m_cursor (NULL), -// m_icon (NULL), - m_lastSize ({}), - m_keyRepeatEnabled (true), - m_resizing (false), - m_mouseInside (false), - m_mouseGrabbed (false), - m_syncParse (true), - m_asyncParse (false) -{ -} -UF_API_CALL spec::dreamcast::Window::Window( spec::dreamcast::Window::handle_t handle ) : - m_handle (handle), -// m_callback (0), -// m_cursor (NULL), -// m_icon (NULL), - m_lastSize ({}), - m_keyRepeatEnabled (true), - m_resizing (false), - m_mouseInside (false), - m_mouseGrabbed (false), - m_syncParse (true), - m_asyncParse (false) -{ - -} -UF_API_CALL spec::dreamcast::Window::Window( const spec::dreamcast::Window::vector_t& size, const spec::dreamcast::Window::title_t& title ) : - m_handle (NULL), -// m_callback (0), -// m_cursor (NULL), -// m_icon (NULL), - m_keyRepeatEnabled (true), - m_resizing (false), - m_mouseInside (false), - m_mouseGrabbed (false), - m_syncParse (true), - m_asyncParse (false) -{ - this->create(size, title); -} +UF_API_CALL spec::dreamcast::Window::Window() {} void UF_API_CALL spec::dreamcast::Window::create( const spec::dreamcast::Window::vector_t& _size, const spec::dreamcast::Window::title_t& title ) { ::keyboard.device = maple_enum_type(1, MAPLE_FUNC_KEYBOARD); @@ -322,7 +282,7 @@ void UF_API_CALL spec::dreamcast::Window::terminate() { } spec::dreamcast::Window::handle_t UF_API_CALL spec::dreamcast::Window::getHandle() const { - return this->m_handle; + return NULL; // this->m_handle; } spec::dreamcast::Window::vector_t UF_API_CALL spec::dreamcast::Window::getPosition() const { return { 0, 0 }; @@ -373,7 +333,7 @@ void UF_API_CALL spec::dreamcast::Window::setVisible( bool visibility ) { void UF_API_CALL spec::dreamcast::Window::setCursorVisible( bool visibility ) { } void UF_API_CALL spec::dreamcast::Window::setKeyRepeatEnabled( bool state ) { - this->m_keyRepeatEnabled = state; +// this->m_keyRepeatEnabled = state; } void UF_API_CALL spec::dreamcast::Window::requestFocus() { @@ -506,7 +466,7 @@ void UF_API_CALL spec::dreamcast::Window::processEvents() { if ( !::mouse.device ) ::mouse.device = maple_enum_type(0, MAPLE_FUNC_MOUSE); if ( ::mouse.device ) ::mouse.state = (mouse_state_t*) maple_dev_status(::mouse.device); - /* Key inputs */ if ( this->m_asyncParse ) { + /* Key inputs */ if ( ::asyncParse ) { uf::stl::vector keys = GetKeys(); pod::payloads::windowKey event{ "window:Key", @@ -594,7 +554,7 @@ void UF_API_CALL spec::dreamcast::Window::processEvent(/*UINT message, WPARAM wP void UF_API_CALL spec::dreamcast::Window::setTracking(bool state) { } void UF_API_CALL spec::dreamcast::Window::setMouseGrabbed(bool state) { - this->m_mouseGrabbed = state; +// this->m_mouseGrabbed = state; this->grabMouse(state); } void UF_API_CALL spec::dreamcast::Window::grabMouse(bool state) { @@ -602,7 +562,8 @@ void UF_API_CALL spec::dreamcast::Window::grabMouse(bool state) { pod::Vector2ui UF_API_CALL spec::dreamcast::Window::getResolution() { return ::resolution; } -void UF_API_CALL spec::dreamcast::Window::switchToFullscreen( bool borderless ) { + +void UF_API_CALL spec::dreamcast::Window::toggleFullscreen( bool borderless ) { } bool UF_API_CALL spec::dreamcast::Window::isKeyPressed(const uf::stl::string& key) { diff --git a/engine/src/spec/window/windows.cpp b/engine/src/spec/window/windows.cpp index 3c87ce55..608e2a9f 100644 --- a/engine/src/spec/window/windows.cpp +++ b/engine/src/spec/window/windows.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #define UF_HOOK_USE_USERDATA 1 #define UF_HOOK_USE_JSON 0 diff --git a/engine/src/utils/math/collider.cpp b/engine/src/utils/math/collider.cpp index d29ba2b3..d0b14e82 100644 --- a/engine/src/utils/math/collider.cpp +++ b/engine/src/utils/math/collider.cpp @@ -1,3 +1,4 @@ +#if UF_USE_UNUSED #include #include #include @@ -59,4 +60,5 @@ uf::stl::vector UF_API uf::Collider::intersects( const } else manifold = pointer->intersects( body ); } return manifolds; -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/engine/src/utils/math/collision/boundingbox.cpp b/engine/src/utils/math/collision/boundingbox.cpp index d0805843..8220dc33 100644 --- a/engine/src/utils/math/collision/boundingbox.cpp +++ b/engine/src/utils/math/collision/boundingbox.cpp @@ -1,3 +1,4 @@ +#if UF_USE_UNUSED #include UF_API uf::BoundingBox::BoundingBox( const pod::Vector3& origin, const pod::Vector3& corner ) { @@ -154,4 +155,5 @@ pod::Collider::Manifold UF_API uf::BoundingBox::intersects( const uf::BoundingBo manifold.colliding = true; */ return manifold; -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/engine/src/utils/math/collision/gjk.cpp b/engine/src/utils/math/collision/gjk.cpp index 009054c7..df9fe119 100644 --- a/engine/src/utils/math/collision/gjk.cpp +++ b/engine/src/utils/math/collision/gjk.cpp @@ -1,3 +1,4 @@ +#if UF_USE_UNUSED #include /* @@ -244,4 +245,5 @@ const pod::Transform<>& pod::Collider::getTransform() const { } void pod::Collider::setTransform( const pod::Transform<>& transform ) { this->m_transform = transform; -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/engine/src/utils/math/collision/mesh.cpp b/engine/src/utils/math/collision/mesh.cpp index d72db1a3..743bc6c1 100644 --- a/engine/src/utils/math/collision/mesh.cpp +++ b/engine/src/utils/math/collision/mesh.cpp @@ -1,3 +1,4 @@ +#if UF_USE_UNUSED #include uf::MeshCollider::MeshCollider( const pod::Transform<>& transform, const uf::stl::vector& positions ) : m_positions(positions) { @@ -39,4 +40,5 @@ pod::Vector3 uf::MeshCollider::support( const pod::Vector3& direction ) const { } } return points[best.i]; -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/engine/src/utils/math/collision/modular.cpp b/engine/src/utils/math/collision/modular.cpp index 721f90f0..7782d75a 100644 --- a/engine/src/utils/math/collision/modular.cpp +++ b/engine/src/utils/math/collision/modular.cpp @@ -1,3 +1,4 @@ +#if UF_USE_UNUSED #include UF_API uf::ModularCollider::ModularCollider( uint len, pod::Vector3* container, bool should_free, const uf::ModularCollider::function_expand_t& expand, const uf::ModularCollider::function_support_t& support ) { @@ -52,4 +53,5 @@ pod::Vector3 UF_API uf::ModularCollider::support( const pod::Vector3& direction } } return points[best.i]; -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/engine/src/utils/math/collision/sphere.cpp b/engine/src/utils/math/collision/sphere.cpp index 9f0de556..6308c4df 100644 --- a/engine/src/utils/math/collision/sphere.cpp +++ b/engine/src/utils/math/collision/sphere.cpp @@ -1,3 +1,4 @@ +#if UF_USE_UNUSED #include UF_API uf::SphereCollider::SphereCollider( float r, const pod::Vector3& origin ) { @@ -46,4 +47,5 @@ pod::Collider::Manifold uf::SphereCollider::intersects( const uf::SphereCollider manifold.normal = position_b - position_a; manifold.colliding = true; return manifold; -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/engine/src/utils/octree/octree.cpp b/engine/src/utils/octree/octree.cpp deleted file mode 100644 index 85c650a7..00000000 --- a/engine/src/utils/octree/octree.cpp +++ /dev/null @@ -1,2 +0,0 @@ -#include - diff --git a/ext/behaviors/baking/behavior.cpp b/ext/behaviors/baking/behavior.cpp index d45fd5de..c1f2415c 100644 --- a/ext/behaviors/baking/behavior.cpp +++ b/ext/behaviors/baking/behavior.cpp @@ -1,3 +1,5 @@ +#include +#if !UF_ENV_DREAMCAST #include "behavior.h" #include @@ -44,6 +46,7 @@ void ext::BakingBehavior::initialize( uf::Object& self ) { metadata.size = { metadataJson["baking"]["resolution"].as(), metadataJson["baking"]["resolution"].as() }; metadata.max.shadows = metadataJson["baking"]["shadows"].as(metadata.max.shadows); + metadata.max.layers = metadataJson["baking"]["layers"].as(metadata.max.layers); metadata.cull = metadataJson["baking"]["cull"].as(); @@ -54,6 +57,7 @@ void ext::BakingBehavior::initialize( uf::Object& self ) { renderMode.metadata.type = "single"; renderMode.metadata.pipeline = "baking"; renderMode.metadata.samples = 1; + // renderMode.metadata.layers = metadata.max.layers; renderMode.metadata.json["descriptor"]["cull mode"] = "none"; renderMode.width = metadata.size.x; @@ -153,4 +157,5 @@ void ext::BakingBehavior::destroy( uf::Object& self ){ } void ext::BakingBehavior::Metadata::serialize( uf::Object& self, uf::Serializer& serializer ) {} void ext::BakingBehavior::Metadata::deserialize( uf::Object& self, uf::Serializer& serializer ) {} -#undef this \ No newline at end of file +#undef this +#endif \ No newline at end of file diff --git a/ext/behaviors/baking/behavior.h b/ext/behaviors/baking/behavior.h index a0caa278..b4357535 100644 --- a/ext/behaviors/baking/behavior.h +++ b/ext/behaviors/baking/behavior.h @@ -29,6 +29,7 @@ namespace ext { size_t textures3D = 1; size_t lights = 1024; size_t shadows = 1024; + size_t layers = 1; } max; struct { size_t lights = 0; diff --git a/ext/behaviors/hands/behavior.cpp b/ext/behaviors/hands/behavior.cpp index 3266f409..1fae550d 100644 --- a/ext/behaviors/hands/behavior.cpp +++ b/ext/behaviors/hands/behavior.cpp @@ -1,3 +1,4 @@ +#include #if UF_USE_OPENVR #include "behavior.h" diff --git a/ext/behaviors/voxelizer/behavior.cpp b/ext/behaviors/voxelizer/behavior.cpp index 20c60f9a..661eefbf 100644 --- a/ext/behaviors/voxelizer/behavior.cpp +++ b/ext/behaviors/voxelizer/behavior.cpp @@ -1,3 +1,6 @@ +#include +#if !UF_ENV_DREAMCAST + #include "behavior.h" #include @@ -266,4 +269,5 @@ void ext::VoxelizerBehavior::destroy( uf::Object& self ){ } void ext::VoxelizerBehavior::Metadata::serialize( uf::Object& self, uf::Serializer& serializer ){} void ext::VoxelizerBehavior::Metadata::deserialize( uf::Object& self, uf::Serializer& serializer ){} -#undef this \ No newline at end of file +#undef this +#endif \ No newline at end of file diff --git a/ext/gui/html/behavior.cpp b/ext/gui/html/behavior.cpp index de2126e1..dbcb2e23 100644 --- a/ext/gui/html/behavior.cpp +++ b/ext/gui/html/behavior.cpp @@ -1,3 +1,4 @@ +#include #if UF_USE_ULTRALIGHT #include "behavior.h" #include "../gui.h" diff --git a/ext/main.cpp b/ext/main.cpp index 19267968..9a063861 100644 --- a/ext/main.cpp +++ b/ext/main.cpp @@ -201,11 +201,7 @@ void EXT_API ext::initialize() { } { uf::Mesh::defaultInterleaved = ::json["engine"]["scenes"]["meshes"]["interleaved"].as( uf::Mesh::defaultInterleaved ); - #if 0 && UF_USE_OPENGL - uf::matrix::reverseInfiniteProjection = false; - #else uf::matrix::reverseInfiniteProjection = ::json["engine"]["scenes"]["matrix"]["reverseInfinite"].as( uf::matrix::reverseInfiniteProjection ); - #endif } /* Create initial scene (kludge) */ { @@ -357,7 +353,8 @@ void EXT_API ext::initialize() { if ( filter == "nearest" ) uf::renderer::settings::swapchainUpscaleFilter = uf::renderer::enums::Filter::NEAREST; else if ( filter == "linear" ) uf::renderer::settings::swapchainUpscaleFilter = uf::renderer::enums::Filter::LINEAR; } - + + #if UF_USE_VULKAN for ( int i = 0; i < configRenderJson["validation"]["filters"].size(); ++i ) { uf::renderer::settings::validationFilters.emplace_back( configRenderJson["validation"]["filters"][i].as() ); } @@ -385,7 +382,7 @@ void EXT_API ext::initialize() { uf::renderer::settings::experimental::deferredSampling = configRenderExperimentalJson["deferred sampling"].as( uf::renderer::settings::experimental::deferredSampling ); uf::renderer::settings::experimental::culling = configRenderExperimentalJson["culling"].as( uf::renderer::settings::experimental::culling ); uf::renderer::settings::experimental::bloom = configRenderExperimentalJson["bloom"].as( uf::renderer::settings::experimental::bloom ); - + #define JSON_TO_VKFORMAT( key ) if ( configRenderJson["formats"][#key].is() ) {\ uf::stl::string format = configRenderJson["formats"][#key].as();\ format = uf::string::replace( uf::string::uppercase(format), " ", "_" );\ @@ -396,6 +393,7 @@ void EXT_API ext::initialize() { JSON_TO_VKFORMAT(depth); JSON_TO_VKFORMAT(normal); JSON_TO_VKFORMAT(position); + #endif } /* Init controllers */ { @@ -418,6 +416,7 @@ void EXT_API ext::initialize() { /* Physics */ { uf::physics::initialize(); } + #if UF_USE_OPENVR { auto& configVrJson = ::json["engine"]["ext"]["vr"]; diff --git a/makefiles/dreamcast.gcc.make b/makefiles/dreamcast.gcc.make index e113d7ae..f786fd54 100644 --- a/makefiles/dreamcast.gcc.make +++ b/makefiles/dreamcast.gcc.make @@ -3,8 +3,7 @@ CDIR = CC = gcc CXX = $(KOS_CCPLUS) TARGET_EXTENSION = elf -# no flto because it throws an error "undefined reference to `typeinfo for btPolyhedralConvexShape'" -OPTIMIZATIONS = -O3 -fstrict-aliasing -ffast-math -DUF_NO_EXCEPTIONS # -flto +OPTIMIZATIONS = -Os -fstrict-aliasing -ffast-math -flto -DUF_NO_EXCEPTIONS -fno-unroll-all-loops -fno-optimize-sibling-calls -fschedule-insns2 -fomit-frame-pointer 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 60a6d23d..e25a8050 100644 --- a/makefiles/win64.gcc.make +++ b/makefiles/win64.gcc.make @@ -2,6 +2,6 @@ ARCH = win64 CDIR = CC = gcc CXX = g++ -OPTIMIZATIONS = -O3 -fstrict-aliasing # -flto -WARNINGS = -g -Wall -Wno-pointer-arith -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 +OPTIMIZATIONS = -O3 -fstrict-aliasing -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++17 $(OPTIMIZATIONS) $(WARNINGS) -fdiagnostics-color=always \ No newline at end of file diff --git a/makefiles/win64.tdm-gcc.make b/makefiles/win64.tdm-gcc.make new file mode 100644 index 00000000..77420d9d --- /dev/null +++ b/makefiles/win64.tdm-gcc.make @@ -0,0 +1,8 @@ +ARCH = win64 +CDIR = /tdm-gcc/bin/ +CC = gcc +CXX = g++ +OPTIMIZATIONS = -O3 -fstrict-aliasing # -flto +WARNINGS = -Wall -Wno-pointer-arith -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++17 $(OPTIMIZATIONS) $(WARNINGS) -fdiagnostics-color=always +PREFIX = $(ARCH).tdm-gcc \ No newline at end of file