From 0eba4483e6a8cdbe466dcc18f4c2af7aef6690ae Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 16 Nov 2025 16:32:38 +0000 Subject: [PATCH 1/5] Initial plan From 3c6123e2f693bbbde5304cd77d772e68a041436c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 16 Nov 2025 16:37:34 +0000 Subject: [PATCH 2/5] Fix premake5.lua case sensitivity for Linux Co-authored-by: DanielJimenezMorales <64079694+DanielJimenezMorales@users.noreply.github.com> --- Common/Makefile | 149 ++++++++++++++++ DemoGame/ClientGame.make | 289 ++++++++++++++++++++++++++++++ DemoGame/Launcher.make | 141 +++++++++++++++ DemoGame/ServerGame.make | 264 ++++++++++++++++++++++++++++ Engine/Makefile | 369 +++++++++++++++++++++++++++++++++++++++ Makefile | 132 ++++++++++++++ NetworkLibrary/Makefile | 294 +++++++++++++++++++++++++++++++ TestDemoGame/Makefile | 156 +++++++++++++++++ premake5.lua | 4 +- test_common/Makefile | 156 +++++++++++++++++ test_engine/Makefile | 151 ++++++++++++++++ 11 files changed, 2103 insertions(+), 2 deletions(-) create mode 100644 Common/Makefile create mode 100644 DemoGame/ClientGame.make create mode 100644 DemoGame/Launcher.make create mode 100644 DemoGame/ServerGame.make create mode 100644 Engine/Makefile create mode 100644 Makefile create mode 100644 NetworkLibrary/Makefile create mode 100644 TestDemoGame/Makefile create mode 100644 test_common/Makefile create mode 100644 test_engine/Makefile diff --git a/Common/Makefile b/Common/Makefile new file mode 100644 index 0000000..ba282b4 --- /dev/null +++ b/Common/Makefile @@ -0,0 +1,149 @@ +# Alternative GNU Make project makefile autogenerated by Premake + +ifndef config + config=debug +endif + +ifndef verbose + SILENT = @ +endif + +.PHONY: clean prebuild + +SHELLTYPE := posix +ifeq (.exe,$(findstring .exe,$(ComSpec))) + SHELLTYPE := msdos +endif + +# Configurations +# ############################################# + +RESCOMP = windres +INCLUDES += -Isrc +FORCE_INCLUDE += +ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) +ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) +LIBS += +LDDEPS += +LINKCMD = $(AR) -rcs "$@" $(OBJECTS) +define PREBUILDCMDS +endef +define PRELINKCMDS +endef +define POSTBUILDCMDS +endef + +ifeq ($(config),debug) +TARGETDIR = bin +TARGET = $(TARGETDIR)/libCommon_Debug.a +OBJDIR = obj/Debug +DEFINES += -D_HAS_EXCEPTIONS=0 -DDEBUG +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g -std=c++17 +ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 + +else ifeq ($(config),release) +TARGETDIR = bin +TARGET = $(TARGETDIR)/libCommon_Release.a +OBJDIR = obj/Release +DEFINES += -D_HAS_EXCEPTIONS=0 +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 -std=c++17 +ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -s + +endif + +# Per File Configurations +# ############################################# + +PERFILE_FLAGS_0 = $(ALL_CXXFLAGS) -Werror + +# File sets +# ############################################# + +GENERATED := +OBJECTS := + +GENERATED += $(OBJDIR)/AlgorithmUtils.o +GENERATED += $(OBJDIR)/Logger.o +GENERATED += $(OBJDIR)/asserts.o +OBJECTS += $(OBJDIR)/AlgorithmUtils.o +OBJECTS += $(OBJDIR)/Logger.o +OBJECTS += $(OBJDIR)/asserts.o + +# Rules +# ############################################# + +all: $(TARGET) + @: + +$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) + $(PRELINKCMDS) + @echo Linking Common + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) + +$(TARGETDIR): + @echo Creating $(TARGETDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(TARGETDIR) +else + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) +endif + +$(OBJDIR): + @echo Creating $(OBJDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(OBJDIR) +else + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) +endif + +clean: + @echo Cleaning Common +ifeq (posix,$(SHELLTYPE)) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) +else + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) +endif + +prebuild: | $(OBJDIR) + $(PREBUILDCMDS) + +ifneq (,$(PCH)) +$(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) +$(GCH): $(PCH) | prebuild + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" +$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) touch "$@" +else + $(SILENT) echo $null >> "$@" +endif +else +$(OBJECTS): | prebuild +endif + + +# File Rules +# ############################################# + +$(OBJDIR)/AlgorithmUtils.o: src/AlgorithmUtils.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/Logger.o: src/Logger.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/asserts.o: src/asserts.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + +-include $(OBJECTS:%.o=%.d) +ifneq (,$(PCH)) + -include $(PCH_PLACEHOLDER).d +endif \ No newline at end of file diff --git a/DemoGame/ClientGame.make b/DemoGame/ClientGame.make new file mode 100644 index 0000000..f74e66c --- /dev/null +++ b/DemoGame/ClientGame.make @@ -0,0 +1,289 @@ +# Alternative GNU Make project makefile autogenerated by Premake + +ifndef config + config=debug +endif + +ifndef verbose + SILENT = @ +endif + +.PHONY: clean prebuild + +SHELLTYPE := posix +ifeq (.exe,$(findstring .exe,$(ComSpec))) + SHELLTYPE := msdos +endif + +# Configurations +# ############################################# + +RESCOMP = windres +INCLUDES += -Isrc -I../Common/src -I../Engine/src -I../NetworkLibrary/src -I../vendor/entt/include -I../vendor/json/include -I../vendor/sdl2/SDL2-2.30.1/include -I../vendor/sdl2/SDL2_image-2.8.2/include -I../vendor/sdl2/SDL2_mixer-2.8.0/include -I../vendor/sdl2/SDL2_ttf-2.22.0/include +FORCE_INCLUDE += +ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) +ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) +LIBS += +LDDEPS += +LINKCMD = $(AR) -rcs "$@" $(OBJECTS) +define PREBUILDCMDS +endef +define PRELINKCMDS +endef +define POSTBUILDCMDS +endef + +ifeq ($(config),debug) +TARGETDIR = bin +TARGET = $(TARGETDIR)/libClientGame_Debug.a +OBJDIR = obj/Debug/ClientGame +DEFINES += -D_HAS_EXCEPTIONS=0 -DDEBUG +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g -std=c++17 +ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 + +else ifeq ($(config),release) +TARGETDIR = bin +TARGET = $(TARGETDIR)/libClientGame_Release.a +OBJDIR = obj/Release/ClientGame +DEFINES += -D_HAS_EXCEPTIONS=0 +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 -std=c++17 +ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -s + +endif + +# Per File Configurations +# ############################################# + +PERFILE_FLAGS_0 = $(ALL_CXXFLAGS) -Werror + +# File sets +# ############################################# + +GENERATED := +OBJECTS := + +GENERATED += $(OBJDIR)/InputState.o +GENERATED += $(OBJDIR)/InputStateFactory.o +GENERATED += $(OBJDIR)/client_local_player_predictor_system.o +GENERATED += $(OBJDIR)/client_local_player_server_reconciliator_system.o +GENERATED += $(OBJDIR)/client_network_entity_creator.o +GENERATED += $(OBJDIR)/client_player_simulation_events_processor.o +GENERATED += $(OBJDIR)/client_world_initializer.o +GENERATED += $(OBJDIR)/crosshair_follow_mouse_system.o +GENERATED += $(OBJDIR)/health_component.o +GENERATED += $(OBJDIR)/json_configuration_loader.o +GENERATED += $(OBJDIR)/local_player_interpolated_object_state_updater_system.o +GENERATED += $(OBJDIR)/network_peer_global_component.o +GENERATED += $(OBJDIR)/player_aiming_controller.o +GENERATED += $(OBJDIR)/player_controller_component_configuration.o +GENERATED += $(OBJDIR)/player_full_body_animation_applier.o +GENERATED += $(OBJDIR)/player_interpolated_object_state_applier_system.o +GENERATED += $(OBJDIR)/player_interpolated_position_and_rotation_applier.o +GENERATED += $(OBJDIR)/player_movement_controller.o +GENERATED += $(OBJDIR)/player_network_entity_serialization_callbacks.o +GENERATED += $(OBJDIR)/player_rotation_controller.o +GENERATED += $(OBJDIR)/player_shooting_controller.o +GENERATED += $(OBJDIR)/player_state_configuration_utils.o +GENERATED += $(OBJDIR)/player_state_simulator.o +GENERATED += $(OBJDIR)/player_state_utils.o +GENERATED += $(OBJDIR)/player_weapon_flip_applier.o +GENERATED += $(OBJDIR)/player_weapon_visibility_applier.o +GENERATED += $(OBJDIR)/pos_tick_network_system.o +GENERATED += $(OBJDIR)/pre_tick_network_system.o +GENERATED += $(OBJDIR)/simulation_events_handler.o +GENERATED += $(OBJDIR)/temporary_lifetime_objects_system.o +GENERATED += $(OBJDIR)/virtual_mouse_system.o +OBJECTS += $(OBJDIR)/InputState.o +OBJECTS += $(OBJDIR)/InputStateFactory.o +OBJECTS += $(OBJDIR)/client_local_player_predictor_system.o +OBJECTS += $(OBJDIR)/client_local_player_server_reconciliator_system.o +OBJECTS += $(OBJDIR)/client_network_entity_creator.o +OBJECTS += $(OBJDIR)/client_player_simulation_events_processor.o +OBJECTS += $(OBJDIR)/client_world_initializer.o +OBJECTS += $(OBJDIR)/crosshair_follow_mouse_system.o +OBJECTS += $(OBJDIR)/health_component.o +OBJECTS += $(OBJDIR)/json_configuration_loader.o +OBJECTS += $(OBJDIR)/local_player_interpolated_object_state_updater_system.o +OBJECTS += $(OBJDIR)/network_peer_global_component.o +OBJECTS += $(OBJDIR)/player_aiming_controller.o +OBJECTS += $(OBJDIR)/player_controller_component_configuration.o +OBJECTS += $(OBJDIR)/player_full_body_animation_applier.o +OBJECTS += $(OBJDIR)/player_interpolated_object_state_applier_system.o +OBJECTS += $(OBJDIR)/player_interpolated_position_and_rotation_applier.o +OBJECTS += $(OBJDIR)/player_movement_controller.o +OBJECTS += $(OBJDIR)/player_network_entity_serialization_callbacks.o +OBJECTS += $(OBJDIR)/player_rotation_controller.o +OBJECTS += $(OBJDIR)/player_shooting_controller.o +OBJECTS += $(OBJDIR)/player_state_configuration_utils.o +OBJECTS += $(OBJDIR)/player_state_simulator.o +OBJECTS += $(OBJDIR)/player_state_utils.o +OBJECTS += $(OBJDIR)/player_weapon_flip_applier.o +OBJECTS += $(OBJDIR)/player_weapon_visibility_applier.o +OBJECTS += $(OBJDIR)/pos_tick_network_system.o +OBJECTS += $(OBJDIR)/pre_tick_network_system.o +OBJECTS += $(OBJDIR)/simulation_events_handler.o +OBJECTS += $(OBJDIR)/temporary_lifetime_objects_system.o +OBJECTS += $(OBJDIR)/virtual_mouse_system.o + +# Rules +# ############################################# + +all: $(TARGET) + @: + +$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) + $(PRELINKCMDS) + @echo Linking ClientGame + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) + +$(TARGETDIR): + @echo Creating $(TARGETDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(TARGETDIR) +else + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) +endif + +$(OBJDIR): + @echo Creating $(OBJDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(OBJDIR) +else + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) +endif + +clean: + @echo Cleaning ClientGame +ifeq (posix,$(SHELLTYPE)) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) +else + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) +endif + +prebuild: | $(OBJDIR) + $(PREBUILDCMDS) + +ifneq (,$(PCH)) +$(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) +$(GCH): $(PCH) | prebuild + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" +$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) touch "$@" +else + $(SILENT) echo $null >> "$@" +endif +else +$(OBJECTS): | prebuild +endif + + +# File Rules +# ############################################# + +$(OBJDIR)/client_network_entity_creator.o: src/client/client_network_entity_creator.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/client_world_initializer.o: src/client/client_world_initializer.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/local_player_interpolated_object_state_updater_system.o: src/client/player_interpolation/local_player_interpolated_object_state_updater_system.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/player_full_body_animation_applier.o: src/client/player_interpolation/player_full_body_animation_applier.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/player_interpolated_object_state_applier_system.o: src/client/player_interpolation/player_interpolated_object_state_applier_system.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/player_interpolated_position_and_rotation_applier.o: src/client/player_interpolation/player_interpolated_position_and_rotation_applier.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/player_weapon_flip_applier.o: src/client/player_interpolation/player_weapon_flip_applier.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/player_weapon_visibility_applier.o: src/client/player_interpolation/player_weapon_visibility_applier.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/client_player_simulation_events_processor.o: src/client/player_simulation/client_player_simulation_events_processor.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/client_local_player_predictor_system.o: src/client/systems/client_local_player_predictor_system.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/client_local_player_server_reconciliator_system.o: src/client/systems/client_local_player_server_reconciliator_system.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/crosshair_follow_mouse_system.o: src/client/systems/crosshair_follow_mouse_system.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/virtual_mouse_system.o: src/client/systems/virtual_mouse_system.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/InputState.o: src/shared/InputState.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/InputStateFactory.o: src/shared/InputStateFactory.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/player_controller_component_configuration.o: src/shared/component_configurations/player_controller_component_configuration.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/health_component.o: src/shared/components/health_component.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/network_peer_global_component.o: src/shared/global_components/network_peer_global_component.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/json_configuration_loader.o: src/shared/json_configuration_loader.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/player_network_entity_serialization_callbacks.o: src/shared/player_network_entity_serialization_callbacks.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/player_aiming_controller.o: src/shared/player_simulation/player_aiming_controller.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/player_movement_controller.o: src/shared/player_simulation/player_movement_controller.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/player_rotation_controller.o: src/shared/player_simulation/player_rotation_controller.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/player_shooting_controller.o: src/shared/player_simulation/player_shooting_controller.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/player_state_configuration_utils.o: src/shared/player_simulation/player_state_configuration_utils.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/player_state_simulator.o: src/shared/player_simulation/player_state_simulator.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/player_state_utils.o: src/shared/player_simulation/player_state_utils.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/simulation_events_handler.o: src/shared/player_simulation/simulation_events_handler.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/pos_tick_network_system.o: src/shared/systems/pos_tick_network_system.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/pre_tick_network_system.o: src/shared/systems/pre_tick_network_system.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/temporary_lifetime_objects_system.o: src/shared/systems/temporary_lifetime_objects_system.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + +-include $(OBJECTS:%.o=%.d) +ifneq (,$(PCH)) + -include $(PCH_PLACEHOLDER).d +endif \ No newline at end of file diff --git a/DemoGame/Launcher.make b/DemoGame/Launcher.make new file mode 100644 index 0000000..a2bd77c --- /dev/null +++ b/DemoGame/Launcher.make @@ -0,0 +1,141 @@ +# Alternative GNU Make project makefile autogenerated by Premake + +ifndef config + config=debug +endif + +ifndef verbose + SILENT = @ +endif + +.PHONY: clean prebuild + +SHELLTYPE := posix +ifeq (.exe,$(findstring .exe,$(ComSpec))) + SHELLTYPE := msdos +endif + +# Configurations +# ############################################# + +RESCOMP = windres +INCLUDES += -I../Common/src -I../Engine/src -I../NetworkLibrary/src -Isrc -I../vendor/entt/include -I../vendor/json/include -I../vendor/sdl2/SDL2-2.30.1/include -I../vendor/sdl2/SDL2_image-2.8.2/include -I../vendor/sdl2/SDL2_mixer-2.8.0/include -I../vendor/sdl2/SDL2_ttf-2.22.0/include +FORCE_INCLUDE += +ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) +ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) +LINKCMD = $(CXX) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) +define PREBUILDCMDS +endef +define PRELINKCMDS +endef +define POSTBUILDCMDS +endef + +ifeq ($(config),debug) +TARGETDIR = bin +TARGET = $(TARGETDIR)/Launcher_Debug +OBJDIR = obj/Debug/Launcher +DEFINES += -D_HAS_EXCEPTIONS=0 -DDEBUG +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g -std=c++17 +LIBS += -lClientGame_Debug -lServerGame_Debug -lCommon_Debug -lEngine_Debug -lNetworkLibrary_Debug -lSDL2 -lSDL2main -lSDL2_image -lSDL2_mixer -lSDL2_ttf +LDDEPS += bin/libClientGame_Debug.a bin/libServerGame_Debug.a ../Common/bin/libCommon_Debug.a ../Engine/bin/libEngine_Debug.a ../NetworkLibrary/bin/libNetworkLibrary_Debug.a +ALL_LDFLAGS += $(LDFLAGS) -L../vendor/sdl2/SDL2-2.30.1/lib/x64 -L../vendor/sdl2/SDL2_image-2.8.2/lib/x64 -L../vendor/sdl2/SDL2_mixer-2.8.0/lib/x64 -L../vendor/sdl2/SDL2_ttf-2.22.0/lib/x64 -Lbin -L../Common/bin -L../Engine/bin -L../NetworkLibrary/bin -L/usr/lib64 -m64 + +else ifeq ($(config),release) +TARGETDIR = bin +TARGET = $(TARGETDIR)/Launcher_Release +OBJDIR = obj/Release/Launcher +DEFINES += -D_HAS_EXCEPTIONS=0 +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 -std=c++17 +LIBS += -lClientGame_Release -lServerGame_Release -lCommon_Release -lEngine_Release -lNetworkLibrary_Release -lSDL2 -lSDL2main -lSDL2_image -lSDL2_mixer -lSDL2_ttf +LDDEPS += bin/libClientGame_Release.a bin/libServerGame_Release.a ../Common/bin/libCommon_Release.a ../Engine/bin/libEngine_Release.a ../NetworkLibrary/bin/libNetworkLibrary_Release.a +ALL_LDFLAGS += $(LDFLAGS) -L../vendor/sdl2/SDL2-2.30.1/lib/x64 -L../vendor/sdl2/SDL2_image-2.8.2/lib/x64 -L../vendor/sdl2/SDL2_mixer-2.8.0/lib/x64 -L../vendor/sdl2/SDL2_ttf-2.22.0/lib/x64 -Lbin -L../Common/bin -L../Engine/bin -L../NetworkLibrary/bin -L/usr/lib64 -m64 -s + +endif + +# Per File Configurations +# ############################################# + +PERFILE_FLAGS_0 = $(ALL_CXXFLAGS) -Werror + +# File sets +# ############################################# + +GENERATED := +OBJECTS := + +GENERATED += $(OBJDIR)/main.o +OBJECTS += $(OBJDIR)/main.o + +# Rules +# ############################################# + +all: $(TARGET) + @: + +$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) + $(PRELINKCMDS) + @echo Linking Launcher + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) + +$(TARGETDIR): + @echo Creating $(TARGETDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(TARGETDIR) +else + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) +endif + +$(OBJDIR): + @echo Creating $(OBJDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(OBJDIR) +else + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) +endif + +clean: + @echo Cleaning Launcher +ifeq (posix,$(SHELLTYPE)) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) +else + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) +endif + +prebuild: | $(OBJDIR) + $(PREBUILDCMDS) + +ifneq (,$(PCH)) +$(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) +$(GCH): $(PCH) | prebuild + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" +$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) touch "$@" +else + $(SILENT) echo $null >> "$@" +endif +else +$(OBJECTS): | prebuild +endif + + +# File Rules +# ############################################# + +$(OBJDIR)/main.o: src/launcher/main.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + +-include $(OBJECTS:%.o=%.d) +ifneq (,$(PCH)) + -include $(PCH_PLACEHOLDER).d +endif \ No newline at end of file diff --git a/DemoGame/ServerGame.make b/DemoGame/ServerGame.make new file mode 100644 index 0000000..7941216 --- /dev/null +++ b/DemoGame/ServerGame.make @@ -0,0 +1,264 @@ +# Alternative GNU Make project makefile autogenerated by Premake + +ifndef config + config=debug +endif + +ifndef verbose + SILENT = @ +endif + +.PHONY: clean prebuild + +SHELLTYPE := posix +ifeq (.exe,$(findstring .exe,$(ComSpec))) + SHELLTYPE := msdos +endif + +# Configurations +# ############################################# + +RESCOMP = windres +INCLUDES += -Isrc -I../Common/src -I../Engine/src -I../NetworkLibrary/src -I../vendor/entt/include -I../vendor/json/include -I../vendor/sdl2/SDL2-2.30.1/include -I../vendor/sdl2/SDL2_image-2.8.2/include -I../vendor/sdl2/SDL2_mixer-2.8.0/include -I../vendor/sdl2/SDL2_ttf-2.22.0/include +FORCE_INCLUDE += +ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) +ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) +LIBS += +LDDEPS += +LINKCMD = $(AR) -rcs "$@" $(OBJECTS) +define PREBUILDCMDS +endef +define PRELINKCMDS +endef +define POSTBUILDCMDS +endef + +ifeq ($(config),debug) +TARGETDIR = bin +TARGET = $(TARGETDIR)/libServerGame_Debug.a +OBJDIR = obj/Debug/ServerGame +DEFINES += -D_HAS_EXCEPTIONS=0 -DDEBUG +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g -std=c++17 +ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 + +else ifeq ($(config),release) +TARGETDIR = bin +TARGET = $(TARGETDIR)/libServerGame_Release.a +OBJDIR = obj/Release/ServerGame +DEFINES += -D_HAS_EXCEPTIONS=0 +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 -std=c++17 +ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -s + +endif + +# Per File Configurations +# ############################################# + +PERFILE_FLAGS_0 = $(ALL_CXXFLAGS) -Werror + +# File sets +# ############################################# + +GENERATED := +OBJECTS := + +GENERATED += $(OBJDIR)/InputState.o +GENERATED += $(OBJDIR)/InputStateFactory.o +GENERATED += $(OBJDIR)/health_component.o +GENERATED += $(OBJDIR)/json_configuration_loader.o +GENERATED += $(OBJDIR)/network_peer_global_component.o +GENERATED += $(OBJDIR)/player_aiming_controller.o +GENERATED += $(OBJDIR)/player_controller_component_configuration.o +GENERATED += $(OBJDIR)/player_movement_controller.o +GENERATED += $(OBJDIR)/player_network_entity_serialization_callbacks.o +GENERATED += $(OBJDIR)/player_rotation_controller.o +GENERATED += $(OBJDIR)/player_shooting_controller.o +GENERATED += $(OBJDIR)/player_state_configuration_utils.o +GENERATED += $(OBJDIR)/player_state_simulator.o +GENERATED += $(OBJDIR)/player_state_utils.o +GENERATED += $(OBJDIR)/pos_tick_network_system.o +GENERATED += $(OBJDIR)/pre_tick_network_system.o +GENERATED += $(OBJDIR)/server_dummy_input_handler_system.o +GENERATED += $(OBJDIR)/server_hit_registration_system.o +GENERATED += $(OBJDIR)/server_network_entity_creator.o +GENERATED += $(OBJDIR)/server_player_controller_system.o +GENERATED += $(OBJDIR)/server_player_simulation_events_processor.o +GENERATED += $(OBJDIR)/server_remove_death_entities_system.o +GENERATED += $(OBJDIR)/server_revive_death_players_system.o +GENERATED += $(OBJDIR)/server_world_initializer.o +GENERATED += $(OBJDIR)/simulation_events_handler.o +GENERATED += $(OBJDIR)/temporary_lifetime_objects_system.o +OBJECTS += $(OBJDIR)/InputState.o +OBJECTS += $(OBJDIR)/InputStateFactory.o +OBJECTS += $(OBJDIR)/health_component.o +OBJECTS += $(OBJDIR)/json_configuration_loader.o +OBJECTS += $(OBJDIR)/network_peer_global_component.o +OBJECTS += $(OBJDIR)/player_aiming_controller.o +OBJECTS += $(OBJDIR)/player_controller_component_configuration.o +OBJECTS += $(OBJDIR)/player_movement_controller.o +OBJECTS += $(OBJDIR)/player_network_entity_serialization_callbacks.o +OBJECTS += $(OBJDIR)/player_rotation_controller.o +OBJECTS += $(OBJDIR)/player_shooting_controller.o +OBJECTS += $(OBJDIR)/player_state_configuration_utils.o +OBJECTS += $(OBJDIR)/player_state_simulator.o +OBJECTS += $(OBJDIR)/player_state_utils.o +OBJECTS += $(OBJDIR)/pos_tick_network_system.o +OBJECTS += $(OBJDIR)/pre_tick_network_system.o +OBJECTS += $(OBJDIR)/server_dummy_input_handler_system.o +OBJECTS += $(OBJDIR)/server_hit_registration_system.o +OBJECTS += $(OBJDIR)/server_network_entity_creator.o +OBJECTS += $(OBJDIR)/server_player_controller_system.o +OBJECTS += $(OBJDIR)/server_player_simulation_events_processor.o +OBJECTS += $(OBJDIR)/server_remove_death_entities_system.o +OBJECTS += $(OBJDIR)/server_revive_death_players_system.o +OBJECTS += $(OBJDIR)/server_world_initializer.o +OBJECTS += $(OBJDIR)/simulation_events_handler.o +OBJECTS += $(OBJDIR)/temporary_lifetime_objects_system.o + +# Rules +# ############################################# + +all: $(TARGET) + @: + +$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) + $(PRELINKCMDS) + @echo Linking ServerGame + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) + +$(TARGETDIR): + @echo Creating $(TARGETDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(TARGETDIR) +else + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) +endif + +$(OBJDIR): + @echo Creating $(OBJDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(OBJDIR) +else + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) +endif + +clean: + @echo Cleaning ServerGame +ifeq (posix,$(SHELLTYPE)) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) +else + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) +endif + +prebuild: | $(OBJDIR) + $(PREBUILDCMDS) + +ifneq (,$(PCH)) +$(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) +$(GCH): $(PCH) | prebuild + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" +$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) touch "$@" +else + $(SILENT) echo $null >> "$@" +endif +else +$(OBJECTS): | prebuild +endif + + +# File Rules +# ############################################# + +$(OBJDIR)/server_player_simulation_events_processor.o: src/server/player_simulation/server_player_simulation_events_processor.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/server_network_entity_creator.o: src/server/server_network_entity_creator.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/server_world_initializer.o: src/server/server_world_initializer.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/server_dummy_input_handler_system.o: src/server/systems/server_dummy_input_handler_system.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/server_hit_registration_system.o: src/server/systems/server_hit_registration_system.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/server_player_controller_system.o: src/server/systems/server_player_controller_system.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/server_remove_death_entities_system.o: src/server/systems/server_remove_death_entities_system.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/server_revive_death_players_system.o: src/server/systems/server_revive_death_players_system.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/InputState.o: src/shared/InputState.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/InputStateFactory.o: src/shared/InputStateFactory.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/player_controller_component_configuration.o: src/shared/component_configurations/player_controller_component_configuration.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/health_component.o: src/shared/components/health_component.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/network_peer_global_component.o: src/shared/global_components/network_peer_global_component.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/json_configuration_loader.o: src/shared/json_configuration_loader.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/player_network_entity_serialization_callbacks.o: src/shared/player_network_entity_serialization_callbacks.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/player_aiming_controller.o: src/shared/player_simulation/player_aiming_controller.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/player_movement_controller.o: src/shared/player_simulation/player_movement_controller.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/player_rotation_controller.o: src/shared/player_simulation/player_rotation_controller.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/player_shooting_controller.o: src/shared/player_simulation/player_shooting_controller.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/player_state_configuration_utils.o: src/shared/player_simulation/player_state_configuration_utils.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/player_state_simulator.o: src/shared/player_simulation/player_state_simulator.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/player_state_utils.o: src/shared/player_simulation/player_state_utils.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/simulation_events_handler.o: src/shared/player_simulation/simulation_events_handler.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/pos_tick_network_system.o: src/shared/systems/pos_tick_network_system.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/pre_tick_network_system.o: src/shared/systems/pre_tick_network_system.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/temporary_lifetime_objects_system.o: src/shared/systems/temporary_lifetime_objects_system.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + +-include $(OBJECTS:%.o=%.d) +ifneq (,$(PCH)) + -include $(PCH_PLACEHOLDER).d +endif \ No newline at end of file diff --git a/Engine/Makefile b/Engine/Makefile new file mode 100644 index 0000000..1f7df4c --- /dev/null +++ b/Engine/Makefile @@ -0,0 +1,369 @@ +# Alternative GNU Make project makefile autogenerated by Premake + +ifndef config + config=debug +endif + +ifndef verbose + SILENT = @ +endif + +.PHONY: clean prebuild + +SHELLTYPE := posix +ifeq (.exe,$(findstring .exe,$(ComSpec))) + SHELLTYPE := msdos +endif + +# Configurations +# ############################################# + +RESCOMP = windres +INCLUDES += -Isrc -I../Common/src -I../NetworkLibrary/src -I../vendor/entt/include -I../vendor/json/include -I../vendor/sdl2/SDL2-2.30.1/include -I../vendor/sdl2/SDL2_image-2.8.2/include -I../vendor/sdl2/SDL2_mixer-2.8.0/include -I../vendor/sdl2/SDL2_ttf-2.22.0/include +FORCE_INCLUDE += +ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) +ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) +LIBS += +LDDEPS += +LINKCMD = $(AR) -rcs "$@" $(OBJECTS) +define PREBUILDCMDS +endef +define PRELINKCMDS +endef +define POSTBUILDCMDS +endef + +ifeq ($(config),debug) +TARGETDIR = bin +TARGET = $(TARGETDIR)/libEngine_Debug.a +OBJDIR = obj/Debug +DEFINES += -D_HAS_EXCEPTIONS=0 -DDEBUG +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g -std=c++17 +ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 + +else ifeq ($(config),release) +TARGETDIR = bin +TARGET = $(TARGETDIR)/libEngine_Release.a +OBJDIR = obj/Release +DEFINES += -D_HAS_EXCEPTIONS=0 +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 -std=c++17 +ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -s + +endif + +# Per File Configurations +# ############################################# + +PERFILE_FLAGS_0 = $(ALL_CXXFLAGS) -Werror + +# File sets +# ############################################# + +GENERATED := +OBJECTS := + +GENERATED += $(OBJDIR)/Game.o +GENERATED += $(OBJDIR)/Gizmo.o +GENERATED += $(OBJDIR)/animation_asset_loader.o +GENERATED += $(OBJDIR)/animation_component_proxy.o +GENERATED += $(OBJDIR)/animation_initialization_utils.o +GENERATED += $(OBJDIR)/animation_system.o +GENERATED += $(OBJDIR)/archetype_registry.o +GENERATED += $(OBJDIR)/asset_manager.o +GENERATED += $(OBJDIR)/asset_storage.o +GENERATED += $(OBJDIR)/circle_bounds_2d.o +GENERATED += $(OBJDIR)/circle_gizmo.o +GENERATED += $(OBJDIR)/circle_gizmo_renderer.o +GENERATED += $(OBJDIR)/collider_2d_component.o +GENERATED += $(OBJDIR)/collider_2d_component_configuration.o +GENERATED += $(OBJDIR)/collision_detection_system.o +GENERATED += $(OBJDIR)/collision_utils.o +GENERATED += $(OBJDIR)/component_configuration.o +GENERATED += $(OBJDIR)/component_registry.o +GENERATED += $(OBJDIR)/configuration_asset.o +GENERATED += $(OBJDIR)/configuration_asset_loader.o +GENERATED += $(OBJDIR)/configuration_assets_initialization_utils.o +GENERATED += $(OBJDIR)/coordinates_conversion_utils.o +GENERATED += $(OBJDIR)/entity_container.o +GENERATED += $(OBJDIR)/gizmo_pool.o +GENERATED += $(OBJDIR)/gizmo_renderer_system.o +GENERATED += $(OBJDIR)/gizmo_resource_handler.o +GENERATED += $(OBJDIR)/input_handler_global_component.o +GENERATED += $(OBJDIR)/input_handler_system.o +GENERATED += $(OBJDIR)/inputs_initialization_utils.o +GENERATED += $(OBJDIR)/keyboard_controller.o +GENERATED += $(OBJDIR)/math_utils.o +GENERATED += $(OBJDIR)/mouse_controller.o +GENERATED += $(OBJDIR)/prefab.o +GENERATED += $(OBJDIR)/prefab_registry.o +GENERATED += $(OBJDIR)/ray_gizmo.o +GENERATED += $(OBJDIR)/ray_gizmo_renderer.o +GENERATED += $(OBJDIR)/raycaster.o +GENERATED += $(OBJDIR)/render_clear_system.o +GENERATED += $(OBJDIR)/render_present_system.o +GENERATED += $(OBJDIR)/rendering_inicialization_utils.o +GENERATED += $(OBJDIR)/sprite_renderer_component_configuration.o +GENERATED += $(OBJDIR)/sprite_renderer_system.o +GENERATED += $(OBJDIR)/system_coordinator.o +GENERATED += $(OBJDIR)/systems_handler.o +GENERATED += $(OBJDIR)/texture_asset_loader.o +GENERATED += $(OBJDIR)/transform_hierarchy_helper_functions.o +GENERATED += $(OBJDIR)/world.o +OBJECTS += $(OBJDIR)/Game.o +OBJECTS += $(OBJDIR)/Gizmo.o +OBJECTS += $(OBJDIR)/animation_asset_loader.o +OBJECTS += $(OBJDIR)/animation_component_proxy.o +OBJECTS += $(OBJDIR)/animation_initialization_utils.o +OBJECTS += $(OBJDIR)/animation_system.o +OBJECTS += $(OBJDIR)/archetype_registry.o +OBJECTS += $(OBJDIR)/asset_manager.o +OBJECTS += $(OBJDIR)/asset_storage.o +OBJECTS += $(OBJDIR)/circle_bounds_2d.o +OBJECTS += $(OBJDIR)/circle_gizmo.o +OBJECTS += $(OBJDIR)/circle_gizmo_renderer.o +OBJECTS += $(OBJDIR)/collider_2d_component.o +OBJECTS += $(OBJDIR)/collider_2d_component_configuration.o +OBJECTS += $(OBJDIR)/collision_detection_system.o +OBJECTS += $(OBJDIR)/collision_utils.o +OBJECTS += $(OBJDIR)/component_configuration.o +OBJECTS += $(OBJDIR)/component_registry.o +OBJECTS += $(OBJDIR)/configuration_asset.o +OBJECTS += $(OBJDIR)/configuration_asset_loader.o +OBJECTS += $(OBJDIR)/configuration_assets_initialization_utils.o +OBJECTS += $(OBJDIR)/coordinates_conversion_utils.o +OBJECTS += $(OBJDIR)/entity_container.o +OBJECTS += $(OBJDIR)/gizmo_pool.o +OBJECTS += $(OBJDIR)/gizmo_renderer_system.o +OBJECTS += $(OBJDIR)/gizmo_resource_handler.o +OBJECTS += $(OBJDIR)/input_handler_global_component.o +OBJECTS += $(OBJDIR)/input_handler_system.o +OBJECTS += $(OBJDIR)/inputs_initialization_utils.o +OBJECTS += $(OBJDIR)/keyboard_controller.o +OBJECTS += $(OBJDIR)/math_utils.o +OBJECTS += $(OBJDIR)/mouse_controller.o +OBJECTS += $(OBJDIR)/prefab.o +OBJECTS += $(OBJDIR)/prefab_registry.o +OBJECTS += $(OBJDIR)/ray_gizmo.o +OBJECTS += $(OBJDIR)/ray_gizmo_renderer.o +OBJECTS += $(OBJDIR)/raycaster.o +OBJECTS += $(OBJDIR)/render_clear_system.o +OBJECTS += $(OBJDIR)/render_present_system.o +OBJECTS += $(OBJDIR)/rendering_inicialization_utils.o +OBJECTS += $(OBJDIR)/sprite_renderer_component_configuration.o +OBJECTS += $(OBJDIR)/sprite_renderer_system.o +OBJECTS += $(OBJDIR)/system_coordinator.o +OBJECTS += $(OBJDIR)/systems_handler.o +OBJECTS += $(OBJDIR)/texture_asset_loader.o +OBJECTS += $(OBJDIR)/transform_hierarchy_helper_functions.o +OBJECTS += $(OBJDIR)/world.o + +# Rules +# ############################################# + +all: $(TARGET) + @: + +$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) + $(PRELINKCMDS) + @echo Linking Engine + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) + +$(TARGETDIR): + @echo Creating $(TARGETDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(TARGETDIR) +else + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) +endif + +$(OBJDIR): + @echo Creating $(OBJDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(OBJDIR) +else + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) +endif + +clean: + @echo Cleaning Engine +ifeq (posix,$(SHELLTYPE)) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) +else + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) +endif + +prebuild: | $(OBJDIR) + $(PREBUILDCMDS) + +ifneq (,$(PCH)) +$(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) +$(GCH): $(PCH) | prebuild + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" +$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) touch "$@" +else + $(SILENT) echo $null >> "$@" +endif +else +$(OBJECTS): | prebuild +endif + + +# File Rules +# ############################################# + +$(OBJDIR)/Game.o: src/Game.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/animation_asset_loader.o: src/animation/animation_asset_loader.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/animation_component_proxy.o: src/animation/animation_component_proxy.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/animation_initialization_utils.o: src/animation/animation_initialization_utils.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/animation_system.o: src/animation/animation_system.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/asset_manager.o: src/asset_manager/asset_manager.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/asset_storage.o: src/asset_manager/asset_storage.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/configuration_asset.o: src/configuration_assets/configuration_asset.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/configuration_asset_loader.o: src/configuration_assets/configuration_asset_loader.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/configuration_assets_initialization_utils.o: src/configuration_assets/configuration_assets_initialization_utils.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/coordinates_conversion_utils.o: src/coordinates_conversion_utils.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/archetype_registry.o: src/ecs/archetype_registry.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/component_configuration.o: src/ecs/component_configuration.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/component_registry.o: src/ecs/component_registry.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/entity_container.o: src/ecs/entity_container.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/prefab.o: src/ecs/prefab.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/prefab_registry.o: src/ecs/prefab_registry.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/system_coordinator.o: src/ecs/system_coordinator.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/systems_handler.o: src/ecs/systems_handler.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/world.o: src/ecs/world.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/input_handler_global_component.o: src/inputs/input_handler_global_component.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/input_handler_system.o: src/inputs/input_handler_system.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/inputs_initialization_utils.o: src/inputs/inputs_initialization_utils.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/keyboard_controller.o: src/inputs/keyboard_controller.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/mouse_controller.o: src/inputs/mouse_controller.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/math_utils.o: src/math_utils.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/circle_bounds_2d.o: src/physics/circle_bounds_2d.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/collider_2d_component.o: src/physics/collider_2d_component.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/collider_2d_component_configuration.o: src/physics/collider_2d_component_configuration.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/collision_detection_system.o: src/physics/collision_detection_system.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/collision_utils.o: src/physics/collision_utils.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/raycaster.o: src/physics/raycaster.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/Gizmo.o: src/render/Gizmo.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/circle_gizmo.o: src/render/circle_gizmo.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/circle_gizmo_renderer.o: src/render/circle_gizmo_renderer.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/gizmo_pool.o: src/render/gizmo_pool.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/gizmo_renderer_system.o: src/render/gizmo_renderer_system.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/gizmo_resource_handler.o: src/render/gizmo_resource_handler.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/ray_gizmo.o: src/render/ray_gizmo.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/ray_gizmo_renderer.o: src/render/ray_gizmo_renderer.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/render_clear_system.o: src/render/render_clear_system.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/render_present_system.o: src/render/render_present_system.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/rendering_inicialization_utils.o: src/render/rendering_inicialization_utils.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/sprite_renderer_component_configuration.o: src/render/sprite_renderer_component_configuration.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/sprite_renderer_system.o: src/render/sprite_renderer_system.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/texture_asset_loader.o: src/render/texture_asset_loader.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/transform_hierarchy_helper_functions.o: src/transform/transform_hierarchy_helper_functions.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + +-include $(OBJECTS:%.o=%.d) +ifneq (,$(PCH)) + -include $(PCH_PLACEHOLDER).d +endif \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1b49d77 --- /dev/null +++ b/Makefile @@ -0,0 +1,132 @@ +# Alternative GNU Make workspace makefile autogenerated by Premake + +ifndef config + config=debug +endif + +ifndef verbose + SILENT = @ +endif + +ifeq ($(config),debug) + Common_config = debug + Engine_config = debug + NetworkLibrary_config = debug + ClientGame_config = debug + ServerGame_config = debug + Launcher_config = debug + TestDemoGame_config = debug + TestCommon_config = debug + TestEngine_config = debug + +else ifeq ($(config),release) + Common_config = release + Engine_config = release + NetworkLibrary_config = release + ClientGame_config = release + ServerGame_config = release + Launcher_config = release + TestDemoGame_config = release + TestCommon_config = release + TestEngine_config = release + +else + $(error "invalid configuration $(config)") +endif + +PROJECTS := Common Engine NetworkLibrary ClientGame ServerGame Launcher TestDemoGame TestCommon TestEngine + +.PHONY: all clean help $(PROJECTS) DemoGame Tests + +all: $(PROJECTS) + +DemoGame: ClientGame Launcher ServerGame + +Tests: TestCommon TestDemoGame TestEngine + +Common: +ifneq (,$(Common_config)) + @echo "==== Building Common ($(Common_config)) ====" + @${MAKE} --no-print-directory -C Common -f Makefile config=$(Common_config) +endif + +Engine: +ifneq (,$(Engine_config)) + @echo "==== Building Engine ($(Engine_config)) ====" + @${MAKE} --no-print-directory -C Engine -f Makefile config=$(Engine_config) +endif + +NetworkLibrary: +ifneq (,$(NetworkLibrary_config)) + @echo "==== Building NetworkLibrary ($(NetworkLibrary_config)) ====" + @${MAKE} --no-print-directory -C NetworkLibrary -f Makefile config=$(NetworkLibrary_config) +endif + +ClientGame: +ifneq (,$(ClientGame_config)) + @echo "==== Building ClientGame ($(ClientGame_config)) ====" + @${MAKE} --no-print-directory -C DemoGame -f ClientGame.make config=$(ClientGame_config) +endif + +ServerGame: +ifneq (,$(ServerGame_config)) + @echo "==== Building ServerGame ($(ServerGame_config)) ====" + @${MAKE} --no-print-directory -C DemoGame -f ServerGame.make config=$(ServerGame_config) +endif + +Launcher: ClientGame ServerGame Common Engine NetworkLibrary +ifneq (,$(Launcher_config)) + @echo "==== Building Launcher ($(Launcher_config)) ====" + @${MAKE} --no-print-directory -C DemoGame -f Launcher.make config=$(Launcher_config) +endif + +TestDemoGame: ClientGame ServerGame Common Engine NetworkLibrary +ifneq (,$(TestDemoGame_config)) + @echo "==== Building TestDemoGame ($(TestDemoGame_config)) ====" + @${MAKE} --no-print-directory -C TestDemoGame -f Makefile config=$(TestDemoGame_config) +endif + +TestCommon: Common +ifneq (,$(TestCommon_config)) + @echo "==== Building TestCommon ($(TestCommon_config)) ====" + @${MAKE} --no-print-directory -C test_common -f Makefile config=$(TestCommon_config) +endif + +TestEngine: Common Engine +ifneq (,$(TestEngine_config)) + @echo "==== Building TestEngine ($(TestEngine_config)) ====" + @${MAKE} --no-print-directory -C test_engine -f Makefile config=$(TestEngine_config) +endif + +clean: + @${MAKE} --no-print-directory -C Common -f Makefile clean + @${MAKE} --no-print-directory -C Engine -f Makefile clean + @${MAKE} --no-print-directory -C NetworkLibrary -f Makefile clean + @${MAKE} --no-print-directory -C DemoGame -f ClientGame.make clean + @${MAKE} --no-print-directory -C DemoGame -f ServerGame.make clean + @${MAKE} --no-print-directory -C DemoGame -f Launcher.make clean + @${MAKE} --no-print-directory -C TestDemoGame -f Makefile clean + @${MAKE} --no-print-directory -C test_common -f Makefile clean + @${MAKE} --no-print-directory -C test_engine -f Makefile clean + +help: + @echo "Usage: make [config=name] [target]" + @echo "" + @echo "CONFIGURATIONS:" + @echo " debug" + @echo " release" + @echo "" + @echo "TARGETS:" + @echo " all (default)" + @echo " clean" + @echo " Common" + @echo " Engine" + @echo " NetworkLibrary" + @echo " ClientGame" + @echo " ServerGame" + @echo " Launcher" + @echo " TestDemoGame" + @echo " TestCommon" + @echo " TestEngine" + @echo "" + @echo "For more information, see https://github.com/premake/premake-core/wiki" \ No newline at end of file diff --git a/NetworkLibrary/Makefile b/NetworkLibrary/Makefile new file mode 100644 index 0000000..c8b003a --- /dev/null +++ b/NetworkLibrary/Makefile @@ -0,0 +1,294 @@ +# Alternative GNU Make project makefile autogenerated by Premake + +ifndef config + config=debug +endif + +ifndef verbose + SILENT = @ +endif + +.PHONY: clean prebuild + +SHELLTYPE := posix +ifeq (.exe,$(findstring .exe,$(ComSpec))) + SHELLTYPE := msdos +endif + +# Configurations +# ############################################# + +RESCOMP = windres +INCLUDES += -Isrc -I../Common/src +FORCE_INCLUDE += +ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) +ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) +LIBS += +LDDEPS += +LINKCMD = $(AR) -rcs "$@" $(OBJECTS) +define PREBUILDCMDS +endef +define PRELINKCMDS +endef +define POSTBUILDCMDS +endef + +ifeq ($(config),debug) +TARGETDIR = bin +TARGET = $(TARGETDIR)/libNetworkLibrary_Debug.a +OBJDIR = obj/Debug +DEFINES += -D_HAS_EXCEPTIONS=0 -DDEBUG +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g -std=c++17 +ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 + +else ifeq ($(config),release) +TARGETDIR = bin +TARGET = $(TARGETDIR)/libNetworkLibrary_Release.a +OBJDIR = obj/Release +DEFINES += -D_HAS_EXCEPTIONS=0 +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 -std=c++17 +ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -s + +endif + +# Per File Configurations +# ############################################# + +PERFILE_FLAGS_0 = $(ALL_CXXFLAGS) -Werror + +# File sets +# ############################################# + +GENERATED := +OBJECTS := + +GENERATED += $(OBJDIR)/Address.o +GENERATED += $(OBJDIR)/Buffer.o +GENERATED += $(OBJDIR)/Client.o +GENERATED += $(OBJDIR)/Peer.o +GENERATED += $(OBJDIR)/Server.o +GENERATED += $(OBJDIR)/Socket.o +GENERATED += $(OBJDIR)/download_bandwidth_metric.o +GENERATED += $(OBJDIR)/increment_metric.o +GENERATED += $(OBJDIR)/jitter_metric.o +GENERATED += $(OBJDIR)/latency_metric.o +GENERATED += $(OBJDIR)/message.o +GENERATED += $(OBJDIR)/message_factory.o +GENERATED += $(OBJDIR)/message_header.o +GENERATED += $(OBJDIR)/message_utils.o +GENERATED += $(OBJDIR)/metrics_handler.o +GENERATED += $(OBJDIR)/network_entity_storage.o +GENERATED += $(OBJDIR)/network_packet.o +GENERATED += $(OBJDIR)/network_variable_changes_handler.o +GENERATED += $(OBJDIR)/packet_loss_metric.o +GENERATED += $(OBJDIR)/ping_pong_messages_sender.o +GENERATED += $(OBJDIR)/reliable_ordered_channel.o +GENERATED += $(OBJDIR)/remote_peer.o +GENERATED += $(OBJDIR)/remote_peer_inputs_handler.o +GENERATED += $(OBJDIR)/remote_peers_handler.o +GENERATED += $(OBJDIR)/replication_manager.o +GENERATED += $(OBJDIR)/replication_messages_processor.o +GENERATED += $(OBJDIR)/time_clock.o +GENERATED += $(OBJDIR)/time_syncer.o +GENERATED += $(OBJDIR)/transmission_channel.o +GENERATED += $(OBJDIR)/unreliable_ordered_transmission_channel.o +GENERATED += $(OBJDIR)/unreliable_unordered_transmission_channel.o +GENERATED += $(OBJDIR)/upload_bandwidth_metric.o +OBJECTS += $(OBJDIR)/Address.o +OBJECTS += $(OBJDIR)/Buffer.o +OBJECTS += $(OBJDIR)/Client.o +OBJECTS += $(OBJDIR)/Peer.o +OBJECTS += $(OBJDIR)/Server.o +OBJECTS += $(OBJDIR)/Socket.o +OBJECTS += $(OBJDIR)/download_bandwidth_metric.o +OBJECTS += $(OBJDIR)/increment_metric.o +OBJECTS += $(OBJDIR)/jitter_metric.o +OBJECTS += $(OBJDIR)/latency_metric.o +OBJECTS += $(OBJDIR)/message.o +OBJECTS += $(OBJDIR)/message_factory.o +OBJECTS += $(OBJDIR)/message_header.o +OBJECTS += $(OBJDIR)/message_utils.o +OBJECTS += $(OBJDIR)/metrics_handler.o +OBJECTS += $(OBJDIR)/network_entity_storage.o +OBJECTS += $(OBJDIR)/network_packet.o +OBJECTS += $(OBJDIR)/network_variable_changes_handler.o +OBJECTS += $(OBJDIR)/packet_loss_metric.o +OBJECTS += $(OBJDIR)/ping_pong_messages_sender.o +OBJECTS += $(OBJDIR)/reliable_ordered_channel.o +OBJECTS += $(OBJDIR)/remote_peer.o +OBJECTS += $(OBJDIR)/remote_peer_inputs_handler.o +OBJECTS += $(OBJDIR)/remote_peers_handler.o +OBJECTS += $(OBJDIR)/replication_manager.o +OBJECTS += $(OBJDIR)/replication_messages_processor.o +OBJECTS += $(OBJDIR)/time_clock.o +OBJECTS += $(OBJDIR)/time_syncer.o +OBJECTS += $(OBJDIR)/transmission_channel.o +OBJECTS += $(OBJDIR)/unreliable_ordered_transmission_channel.o +OBJECTS += $(OBJDIR)/unreliable_unordered_transmission_channel.o +OBJECTS += $(OBJDIR)/upload_bandwidth_metric.o + +# Rules +# ############################################# + +all: $(TARGET) + @: + +$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) + $(PRELINKCMDS) + @echo Linking NetworkLibrary + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) + +$(TARGETDIR): + @echo Creating $(TARGETDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(TARGETDIR) +else + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) +endif + +$(OBJDIR): + @echo Creating $(OBJDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(OBJDIR) +else + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) +endif + +clean: + @echo Cleaning NetworkLibrary +ifeq (posix,$(SHELLTYPE)) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) +else + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) +endif + +prebuild: | $(OBJDIR) + $(PREBUILDCMDS) + +ifneq (,$(PCH)) +$(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) +$(GCH): $(PCH) | prebuild + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" +$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) touch "$@" +else + $(SILENT) echo $null >> "$@" +endif +else +$(OBJECTS): | prebuild +endif + + +# File Rules +# ############################################# + +$(OBJDIR)/Address.o: src/Core/Address.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/Buffer.o: src/Core/Buffer.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/Client.o: src/Core/Client.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/Peer.o: src/Core/Peer.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/Server.o: src/Core/Server.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/Socket.o: src/Core/Socket.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/ping_pong_messages_sender.o: src/Core/ping_pong_messages_sender.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/remote_peer.o: src/Core/remote_peer.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/remote_peers_handler.o: src/Core/remote_peers_handler.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/time_clock.o: src/Core/time_clock.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/message.o: src/communication/message.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/message_factory.o: src/communication/message_factory.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/message_header.o: src/communication/message_header.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/message_utils.o: src/communication/message_utils.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/network_packet.o: src/communication/network_packet.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/remote_peer_inputs_handler.o: src/inputs/remote_peer_inputs_handler.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/download_bandwidth_metric.o: src/metrics/download_bandwidth_metric.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/increment_metric.o: src/metrics/increment_metric.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/jitter_metric.o: src/metrics/jitter_metric.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/latency_metric.o: src/metrics/latency_metric.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/metrics_handler.o: src/metrics/metrics_handler.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/packet_loss_metric.o: src/metrics/packet_loss_metric.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/upload_bandwidth_metric.o: src/metrics/upload_bandwidth_metric.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/network_entity_storage.o: src/replication/network_entity_storage.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/network_variable_changes_handler.o: src/replication/network_variable_changes_handler.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/replication_manager.o: src/replication/replication_manager.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/replication_messages_processor.o: src/replication/replication_messages_processor.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/time_syncer.o: src/time/time_syncer.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/reliable_ordered_channel.o: src/transmission_channels/reliable_ordered_channel.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/transmission_channel.o: src/transmission_channels/transmission_channel.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/unreliable_ordered_transmission_channel.o: src/transmission_channels/unreliable_ordered_transmission_channel.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/unreliable_unordered_transmission_channel.o: src/transmission_channels/unreliable_unordered_transmission_channel.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + +-include $(OBJECTS:%.o=%.d) +ifneq (,$(PCH)) + -include $(PCH_PLACEHOLDER).d +endif \ No newline at end of file diff --git a/TestDemoGame/Makefile b/TestDemoGame/Makefile new file mode 100644 index 0000000..b17a5a5 --- /dev/null +++ b/TestDemoGame/Makefile @@ -0,0 +1,156 @@ +# Alternative GNU Make project makefile autogenerated by Premake + +ifndef config + config=debug +endif + +ifndef verbose + SILENT = @ +endif + +.PHONY: clean prebuild + +SHELLTYPE := posix +ifeq (.exe,$(findstring .exe,$(ComSpec))) + SHELLTYPE := msdos +endif + +# Configurations +# ############################################# + +RESCOMP = windres +INCLUDES += -Isrc -I../Common/src -I../Engine/src -I../NetworkLibrary/src -I../DemoGame/src -I../vendor/entt/include -I../vendor/json/include -I../vendor/sdl2/SDL2-2.30.1/include -I../vendor/sdl2/SDL2_image-2.8.2/include -I../vendor/sdl2/SDL2_mixer-2.8.0/include -I../vendor/sdl2/SDL2_ttf-2.22.0/include -I../vendor/googletest/googletest/include -I../vendor/googletest/googletest +FORCE_INCLUDE += +ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) +ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) +LINKCMD = $(CXX) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) +define PREBUILDCMDS +endef +define PRELINKCMDS +endef +define POSTBUILDCMDS +endef + +ifeq ($(config),debug) +TARGETDIR = bin +TARGET = $(TARGETDIR)/TestDemoGame_Debug +OBJDIR = obj/Debug +DEFINES += -D_HAS_EXCEPTIONS=0 -DDEBUG +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g -std=c++17 +LIBS += -lClientGame_Debug -lServerGame_Debug -lCommon_Debug -lEngine_Debug -lNetworkLibrary_Debug -lSDL2 -lSDL2main -lSDL2_image -lSDL2_mixer -lSDL2_ttf +LDDEPS += ../DemoGame/bin/libClientGame_Debug.a ../DemoGame/bin/libServerGame_Debug.a ../Common/bin/libCommon_Debug.a ../Engine/bin/libEngine_Debug.a ../NetworkLibrary/bin/libNetworkLibrary_Debug.a +ALL_LDFLAGS += $(LDFLAGS) -L../vendor/sdl2/SDL2-2.30.1/lib/x64 -L../vendor/sdl2/SDL2_image-2.8.2/lib/x64 -L../vendor/sdl2/SDL2_mixer-2.8.0/lib/x64 -L../vendor/sdl2/SDL2_ttf-2.22.0/lib/x64 -L../DemoGame/bin -L../Common/bin -L../Engine/bin -L../NetworkLibrary/bin -L/usr/lib64 -m64 + +else ifeq ($(config),release) +TARGETDIR = bin +TARGET = $(TARGETDIR)/TestDemoGame_Release +OBJDIR = obj/Release +DEFINES += -D_HAS_EXCEPTIONS=0 +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 -std=c++17 +LIBS += -lClientGame_Release -lServerGame_Release -lCommon_Release -lEngine_Release -lNetworkLibrary_Release -lSDL2 -lSDL2main -lSDL2_image -lSDL2_mixer -lSDL2_ttf +LDDEPS += ../DemoGame/bin/libClientGame_Release.a ../DemoGame/bin/libServerGame_Release.a ../Common/bin/libCommon_Release.a ../Engine/bin/libEngine_Release.a ../NetworkLibrary/bin/libNetworkLibrary_Release.a +ALL_LDFLAGS += $(LDFLAGS) -L../vendor/sdl2/SDL2-2.30.1/lib/x64 -L../vendor/sdl2/SDL2_image-2.8.2/lib/x64 -L../vendor/sdl2/SDL2_mixer-2.8.0/lib/x64 -L../vendor/sdl2/SDL2_ttf-2.22.0/lib/x64 -L../DemoGame/bin -L../Common/bin -L../Engine/bin -L../NetworkLibrary/bin -L/usr/lib64 -m64 -s + +endif + +# Per File Configurations +# ############################################# + +PERFILE_FLAGS_0 = $(ALL_CXXFLAGS) -Werror + +# File sets +# ############################################# + +GENERATED := +OBJECTS := + +GENERATED += $(OBJDIR)/gtest-all.o +GENERATED += $(OBJDIR)/main.o +GENERATED += $(OBJDIR)/player_state_serialization_tests.o +GENERATED += $(OBJDIR)/raycast_tests.o +OBJECTS += $(OBJDIR)/gtest-all.o +OBJECTS += $(OBJDIR)/main.o +OBJECTS += $(OBJDIR)/player_state_serialization_tests.o +OBJECTS += $(OBJDIR)/raycast_tests.o + +# Rules +# ############################################# + +all: $(TARGET) + @: + +$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) + $(PRELINKCMDS) + @echo Linking TestDemoGame + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) + +$(TARGETDIR): + @echo Creating $(TARGETDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(TARGETDIR) +else + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) +endif + +$(OBJDIR): + @echo Creating $(OBJDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(OBJDIR) +else + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) +endif + +clean: + @echo Cleaning TestDemoGame +ifeq (posix,$(SHELLTYPE)) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) +else + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) +endif + +prebuild: | $(OBJDIR) + $(PREBUILDCMDS) + +ifneq (,$(PCH)) +$(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) +$(GCH): $(PCH) | prebuild + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" +$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) touch "$@" +else + $(SILENT) echo $null >> "$@" +endif +else +$(OBJECTS): | prebuild +endif + + +# File Rules +# ############################################# + +$(OBJDIR)/gtest-all.o: ../vendor/googletest/googletest/src/gtest-all.cc + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/main.o: src/main.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/player_state_serialization_tests.o: src/player_state_serialization_tests.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/raycast_tests.o: src/raycast_tests.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + +-include $(OBJECTS:%.o=%.d) +ifneq (,$(PCH)) + -include $(PCH_PLACEHOLDER).d +endif \ No newline at end of file diff --git a/premake5.lua b/premake5.lua index f74f997..f92094b 100644 --- a/premake5.lua +++ b/premake5.lua @@ -9,8 +9,8 @@ PROJECT_DATA = COMMON = { NAME = "Common", - PATH = ROOT_PATH "common/", - PREMAKE_PATH = ROOT_PATH "common/common_premake5.lua" + PATH = ROOT_PATH "Common/", + PREMAKE_PATH = ROOT_PATH "Common/common_premake5.lua" }, ENGINE = { diff --git a/test_common/Makefile b/test_common/Makefile new file mode 100644 index 0000000..6f39495 --- /dev/null +++ b/test_common/Makefile @@ -0,0 +1,156 @@ +# Alternative GNU Make project makefile autogenerated by Premake + +ifndef config + config=debug +endif + +ifndef verbose + SILENT = @ +endif + +.PHONY: clean prebuild + +SHELLTYPE := posix +ifeq (.exe,$(findstring .exe,$(ComSpec))) + SHELLTYPE := msdos +endif + +# Configurations +# ############################################# + +RESCOMP = windres +INCLUDES += -Isrc -I../Common/src -I../vendor/googletest/googletest/include -I../vendor/googletest/googletest +FORCE_INCLUDE += +ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) +ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) +LINKCMD = $(CXX) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) +define PREBUILDCMDS +endef +define PRELINKCMDS +endef +define POSTBUILDCMDS +endef + +ifeq ($(config),debug) +TARGETDIR = bin +TARGET = $(TARGETDIR)/TestCommon_Debug +OBJDIR = obj/Debug +DEFINES += -D_HAS_EXCEPTIONS=0 -DDEBUG +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g -std=c++17 +LIBS += -lCommon_Debug +LDDEPS += ../Common/bin/libCommon_Debug.a +ALL_LDFLAGS += $(LDFLAGS) -L../Common/bin -L/usr/lib64 -m64 + +else ifeq ($(config),release) +TARGETDIR = bin +TARGET = $(TARGETDIR)/TestCommon_Release +OBJDIR = obj/Release +DEFINES += -D_HAS_EXCEPTIONS=0 +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 -std=c++17 +LIBS += -lCommon_Release +LDDEPS += ../Common/bin/libCommon_Release.a +ALL_LDFLAGS += $(LDFLAGS) -L../Common/bin -L/usr/lib64 -m64 -s + +endif + +# Per File Configurations +# ############################################# + +PERFILE_FLAGS_0 = $(ALL_CXXFLAGS) -Werror + +# File sets +# ############################################# + +GENERATED := +OBJECTS := + +GENERATED += $(OBJDIR)/delegate_tests.o +GENERATED += $(OBJDIR)/gtest-all.o +GENERATED += $(OBJDIR)/main.o +GENERATED += $(OBJDIR)/push_only_ring_vector_tests.o +OBJECTS += $(OBJDIR)/delegate_tests.o +OBJECTS += $(OBJDIR)/gtest-all.o +OBJECTS += $(OBJDIR)/main.o +OBJECTS += $(OBJDIR)/push_only_ring_vector_tests.o + +# Rules +# ############################################# + +all: $(TARGET) + @: + +$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) + $(PRELINKCMDS) + @echo Linking TestCommon + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) + +$(TARGETDIR): + @echo Creating $(TARGETDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(TARGETDIR) +else + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) +endif + +$(OBJDIR): + @echo Creating $(OBJDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(OBJDIR) +else + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) +endif + +clean: + @echo Cleaning TestCommon +ifeq (posix,$(SHELLTYPE)) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) +else + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) +endif + +prebuild: | $(OBJDIR) + $(PREBUILDCMDS) + +ifneq (,$(PCH)) +$(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) +$(GCH): $(PCH) | prebuild + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" +$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) touch "$@" +else + $(SILENT) echo $null >> "$@" +endif +else +$(OBJECTS): | prebuild +endif + + +# File Rules +# ############################################# + +$(OBJDIR)/gtest-all.o: ../vendor/googletest/googletest/src/gtest-all.cc + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/delegate_tests.o: src/delegate_tests.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/main.o: src/main.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/push_only_ring_vector_tests.o: src/push_only_ring_vector_tests.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + +-include $(OBJECTS:%.o=%.d) +ifneq (,$(PCH)) + -include $(PCH_PLACEHOLDER).d +endif \ No newline at end of file diff --git a/test_engine/Makefile b/test_engine/Makefile new file mode 100644 index 0000000..3e0ebd1 --- /dev/null +++ b/test_engine/Makefile @@ -0,0 +1,151 @@ +# Alternative GNU Make project makefile autogenerated by Premake + +ifndef config + config=debug +endif + +ifndef verbose + SILENT = @ +endif + +.PHONY: clean prebuild + +SHELLTYPE := posix +ifeq (.exe,$(findstring .exe,$(ComSpec))) + SHELLTYPE := msdos +endif + +# Configurations +# ############################################# + +RESCOMP = windres +INCLUDES += -Isrc -I../Common/src -I../Engine/src -I../vendor/googletest/googletest/include -I../vendor/googletest/googletest -I../vendor/entt/include +FORCE_INCLUDE += +ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) +ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) +LINKCMD = $(CXX) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) +define PREBUILDCMDS +endef +define PRELINKCMDS +endef +define POSTBUILDCMDS +endef + +ifeq ($(config),debug) +TARGETDIR = bin +TARGET = $(TARGETDIR)/TestEngine_Debug +OBJDIR = obj/Debug +DEFINES += -D_HAS_EXCEPTIONS=0 -DDEBUG +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g -std=c++17 +LIBS += -lCommon_Debug -lEngine_Debug +LDDEPS += ../Common/bin/libCommon_Debug.a ../Engine/bin/libEngine_Debug.a +ALL_LDFLAGS += $(LDFLAGS) -L../Common/bin -L../Engine/bin -L/usr/lib64 -m64 + +else ifeq ($(config),release) +TARGETDIR = bin +TARGET = $(TARGETDIR)/TestEngine_Release +OBJDIR = obj/Release +DEFINES += -D_HAS_EXCEPTIONS=0 +ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 +ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 -std=c++17 +LIBS += -lCommon_Release -lEngine_Release +LDDEPS += ../Common/bin/libCommon_Release.a ../Engine/bin/libEngine_Release.a +ALL_LDFLAGS += $(LDFLAGS) -L../Common/bin -L../Engine/bin -L/usr/lib64 -m64 -s + +endif + +# Per File Configurations +# ############################################# + +PERFILE_FLAGS_0 = $(ALL_CXXFLAGS) -Werror + +# File sets +# ############################################# + +GENERATED := +OBJECTS := + +GENERATED += $(OBJDIR)/gtest-all.o +GENERATED += $(OBJDIR)/main.o +GENERATED += $(OBJDIR)/transform_tests.o +OBJECTS += $(OBJDIR)/gtest-all.o +OBJECTS += $(OBJDIR)/main.o +OBJECTS += $(OBJDIR)/transform_tests.o + +# Rules +# ############################################# + +all: $(TARGET) + @: + +$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) + $(PRELINKCMDS) + @echo Linking TestEngine + $(SILENT) $(LINKCMD) + $(POSTBUILDCMDS) + +$(TARGETDIR): + @echo Creating $(TARGETDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(TARGETDIR) +else + $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) +endif + +$(OBJDIR): + @echo Creating $(OBJDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) mkdir -p $(OBJDIR) +else + $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) +endif + +clean: + @echo Cleaning TestEngine +ifeq (posix,$(SHELLTYPE)) + $(SILENT) rm -f $(TARGET) + $(SILENT) rm -rf $(GENERATED) + $(SILENT) rm -rf $(OBJDIR) +else + $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) + $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) + $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) +endif + +prebuild: | $(OBJDIR) + $(PREBUILDCMDS) + +ifneq (,$(PCH)) +$(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) +$(GCH): $(PCH) | prebuild + @echo $(notdir $<) + $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" +$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) +ifeq (posix,$(SHELLTYPE)) + $(SILENT) touch "$@" +else + $(SILENT) echo $null >> "$@" +endif +else +$(OBJECTS): | prebuild +endif + + +# File Rules +# ############################################# + +$(OBJDIR)/gtest-all.o: ../vendor/googletest/googletest/src/gtest-all.cc + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/main.o: src/main.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" +$(OBJDIR)/transform_tests.o: src/transform_tests.cpp + @echo "$(notdir $<)" + $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" + +-include $(OBJECTS:%.o=%.d) +ifneq (,$(PCH)) + -include $(PCH_PLACEHOLDER).d +endif \ No newline at end of file From da6a322a010d7e8092ab23fd9aa5f83d679f4e18 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 16 Nov 2025 16:42:05 +0000 Subject: [PATCH 3/5] Refactor duplicated code in transmission channels Move common implementations to base TransmissionChannel class: - AddMessageToSend() - identical in all 3 derived classes - GetReadyToProcessMessage() - identical in all 3 derived classes - ArePendingReadyToProcessMessages() - identical in all 3 derived classes Add pure virtual IsMessageSuitable() to base class to support AddMessageToSend() This eliminates ~60 lines of duplicated code across the transmission channel classes. Co-authored-by: DanielJimenezMorales <64079694+DanielJimenezMorales@users.noreply.github.com> --- .gitignore | 6 +- Common/Makefile | 149 ------- DemoGame/ClientGame.make | 289 -------------- DemoGame/Launcher.make | 141 ------- DemoGame/ServerGame.make | 264 ------------- Engine/Makefile | 369 ------------------ Makefile | 132 ------- NetworkLibrary/Makefile | 294 -------------- .../reliable_ordered_channel.cpp | 30 -- .../reliable_ordered_channel.h | 5 +- .../transmission_channel.cpp | 35 ++ .../transmission_channel.h | 15 +- ...nreliable_ordered_transmission_channel.cpp | 30 -- .../unreliable_ordered_transmission_channel.h | 5 +- ...eliable_unordered_transmission_channel.cpp | 30 -- ...nreliable_unordered_transmission_channel.h | 5 +- TestDemoGame/Makefile | 156 -------- test_common/Makefile | 156 -------- test_engine/Makefile | 151 ------- 19 files changed, 55 insertions(+), 2207 deletions(-) delete mode 100644 Common/Makefile delete mode 100644 DemoGame/ClientGame.make delete mode 100644 DemoGame/Launcher.make delete mode 100644 DemoGame/ServerGame.make delete mode 100644 Engine/Makefile delete mode 100644 Makefile delete mode 100644 NetworkLibrary/Makefile delete mode 100644 TestDemoGame/Makefile delete mode 100644 test_common/Makefile delete mode 100644 test_engine/Makefile diff --git a/.gitignore b/.gitignore index 09c9e31..7144853 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,8 @@ **.vcxproj **.vcxproj.filters **.vcxproj.user -**.csproj \ No newline at end of file +**.csproj + +# Generated build files +Makefile +**.make \ No newline at end of file diff --git a/Common/Makefile b/Common/Makefile deleted file mode 100644 index ba282b4..0000000 --- a/Common/Makefile +++ /dev/null @@ -1,149 +0,0 @@ -# Alternative GNU Make project makefile autogenerated by Premake - -ifndef config - config=debug -endif - -ifndef verbose - SILENT = @ -endif - -.PHONY: clean prebuild - -SHELLTYPE := posix -ifeq (.exe,$(findstring .exe,$(ComSpec))) - SHELLTYPE := msdos -endif - -# Configurations -# ############################################# - -RESCOMP = windres -INCLUDES += -Isrc -FORCE_INCLUDE += -ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) -ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) -LIBS += -LDDEPS += -LINKCMD = $(AR) -rcs "$@" $(OBJECTS) -define PREBUILDCMDS -endef -define PRELINKCMDS -endef -define POSTBUILDCMDS -endef - -ifeq ($(config),debug) -TARGETDIR = bin -TARGET = $(TARGETDIR)/libCommon_Debug.a -OBJDIR = obj/Debug -DEFINES += -D_HAS_EXCEPTIONS=0 -DDEBUG -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g -std=c++17 -ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 - -else ifeq ($(config),release) -TARGETDIR = bin -TARGET = $(TARGETDIR)/libCommon_Release.a -OBJDIR = obj/Release -DEFINES += -D_HAS_EXCEPTIONS=0 -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 -std=c++17 -ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -s - -endif - -# Per File Configurations -# ############################################# - -PERFILE_FLAGS_0 = $(ALL_CXXFLAGS) -Werror - -# File sets -# ############################################# - -GENERATED := -OBJECTS := - -GENERATED += $(OBJDIR)/AlgorithmUtils.o -GENERATED += $(OBJDIR)/Logger.o -GENERATED += $(OBJDIR)/asserts.o -OBJECTS += $(OBJDIR)/AlgorithmUtils.o -OBJECTS += $(OBJDIR)/Logger.o -OBJECTS += $(OBJDIR)/asserts.o - -# Rules -# ############################################# - -all: $(TARGET) - @: - -$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking Common - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) - -$(TARGETDIR): - @echo Creating $(TARGETDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) -else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) -endif - -$(OBJDIR): - @echo Creating $(OBJDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) -else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) -endif - -clean: - @echo Cleaning Common -ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) -else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) -endif - -prebuild: | $(OBJDIR) - $(PREBUILDCMDS) - -ifneq (,$(PCH)) -$(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) -$(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" -$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" -else - $(SILENT) echo $null >> "$@" -endif -else -$(OBJECTS): | prebuild -endif - - -# File Rules -# ############################################# - -$(OBJDIR)/AlgorithmUtils.o: src/AlgorithmUtils.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/Logger.o: src/Logger.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/asserts.o: src/asserts.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" - --include $(OBJECTS:%.o=%.d) -ifneq (,$(PCH)) - -include $(PCH_PLACEHOLDER).d -endif \ No newline at end of file diff --git a/DemoGame/ClientGame.make b/DemoGame/ClientGame.make deleted file mode 100644 index f74e66c..0000000 --- a/DemoGame/ClientGame.make +++ /dev/null @@ -1,289 +0,0 @@ -# Alternative GNU Make project makefile autogenerated by Premake - -ifndef config - config=debug -endif - -ifndef verbose - SILENT = @ -endif - -.PHONY: clean prebuild - -SHELLTYPE := posix -ifeq (.exe,$(findstring .exe,$(ComSpec))) - SHELLTYPE := msdos -endif - -# Configurations -# ############################################# - -RESCOMP = windres -INCLUDES += -Isrc -I../Common/src -I../Engine/src -I../NetworkLibrary/src -I../vendor/entt/include -I../vendor/json/include -I../vendor/sdl2/SDL2-2.30.1/include -I../vendor/sdl2/SDL2_image-2.8.2/include -I../vendor/sdl2/SDL2_mixer-2.8.0/include -I../vendor/sdl2/SDL2_ttf-2.22.0/include -FORCE_INCLUDE += -ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) -ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) -LIBS += -LDDEPS += -LINKCMD = $(AR) -rcs "$@" $(OBJECTS) -define PREBUILDCMDS -endef -define PRELINKCMDS -endef -define POSTBUILDCMDS -endef - -ifeq ($(config),debug) -TARGETDIR = bin -TARGET = $(TARGETDIR)/libClientGame_Debug.a -OBJDIR = obj/Debug/ClientGame -DEFINES += -D_HAS_EXCEPTIONS=0 -DDEBUG -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g -std=c++17 -ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 - -else ifeq ($(config),release) -TARGETDIR = bin -TARGET = $(TARGETDIR)/libClientGame_Release.a -OBJDIR = obj/Release/ClientGame -DEFINES += -D_HAS_EXCEPTIONS=0 -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 -std=c++17 -ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -s - -endif - -# Per File Configurations -# ############################################# - -PERFILE_FLAGS_0 = $(ALL_CXXFLAGS) -Werror - -# File sets -# ############################################# - -GENERATED := -OBJECTS := - -GENERATED += $(OBJDIR)/InputState.o -GENERATED += $(OBJDIR)/InputStateFactory.o -GENERATED += $(OBJDIR)/client_local_player_predictor_system.o -GENERATED += $(OBJDIR)/client_local_player_server_reconciliator_system.o -GENERATED += $(OBJDIR)/client_network_entity_creator.o -GENERATED += $(OBJDIR)/client_player_simulation_events_processor.o -GENERATED += $(OBJDIR)/client_world_initializer.o -GENERATED += $(OBJDIR)/crosshair_follow_mouse_system.o -GENERATED += $(OBJDIR)/health_component.o -GENERATED += $(OBJDIR)/json_configuration_loader.o -GENERATED += $(OBJDIR)/local_player_interpolated_object_state_updater_system.o -GENERATED += $(OBJDIR)/network_peer_global_component.o -GENERATED += $(OBJDIR)/player_aiming_controller.o -GENERATED += $(OBJDIR)/player_controller_component_configuration.o -GENERATED += $(OBJDIR)/player_full_body_animation_applier.o -GENERATED += $(OBJDIR)/player_interpolated_object_state_applier_system.o -GENERATED += $(OBJDIR)/player_interpolated_position_and_rotation_applier.o -GENERATED += $(OBJDIR)/player_movement_controller.o -GENERATED += $(OBJDIR)/player_network_entity_serialization_callbacks.o -GENERATED += $(OBJDIR)/player_rotation_controller.o -GENERATED += $(OBJDIR)/player_shooting_controller.o -GENERATED += $(OBJDIR)/player_state_configuration_utils.o -GENERATED += $(OBJDIR)/player_state_simulator.o -GENERATED += $(OBJDIR)/player_state_utils.o -GENERATED += $(OBJDIR)/player_weapon_flip_applier.o -GENERATED += $(OBJDIR)/player_weapon_visibility_applier.o -GENERATED += $(OBJDIR)/pos_tick_network_system.o -GENERATED += $(OBJDIR)/pre_tick_network_system.o -GENERATED += $(OBJDIR)/simulation_events_handler.o -GENERATED += $(OBJDIR)/temporary_lifetime_objects_system.o -GENERATED += $(OBJDIR)/virtual_mouse_system.o -OBJECTS += $(OBJDIR)/InputState.o -OBJECTS += $(OBJDIR)/InputStateFactory.o -OBJECTS += $(OBJDIR)/client_local_player_predictor_system.o -OBJECTS += $(OBJDIR)/client_local_player_server_reconciliator_system.o -OBJECTS += $(OBJDIR)/client_network_entity_creator.o -OBJECTS += $(OBJDIR)/client_player_simulation_events_processor.o -OBJECTS += $(OBJDIR)/client_world_initializer.o -OBJECTS += $(OBJDIR)/crosshair_follow_mouse_system.o -OBJECTS += $(OBJDIR)/health_component.o -OBJECTS += $(OBJDIR)/json_configuration_loader.o -OBJECTS += $(OBJDIR)/local_player_interpolated_object_state_updater_system.o -OBJECTS += $(OBJDIR)/network_peer_global_component.o -OBJECTS += $(OBJDIR)/player_aiming_controller.o -OBJECTS += $(OBJDIR)/player_controller_component_configuration.o -OBJECTS += $(OBJDIR)/player_full_body_animation_applier.o -OBJECTS += $(OBJDIR)/player_interpolated_object_state_applier_system.o -OBJECTS += $(OBJDIR)/player_interpolated_position_and_rotation_applier.o -OBJECTS += $(OBJDIR)/player_movement_controller.o -OBJECTS += $(OBJDIR)/player_network_entity_serialization_callbacks.o -OBJECTS += $(OBJDIR)/player_rotation_controller.o -OBJECTS += $(OBJDIR)/player_shooting_controller.o -OBJECTS += $(OBJDIR)/player_state_configuration_utils.o -OBJECTS += $(OBJDIR)/player_state_simulator.o -OBJECTS += $(OBJDIR)/player_state_utils.o -OBJECTS += $(OBJDIR)/player_weapon_flip_applier.o -OBJECTS += $(OBJDIR)/player_weapon_visibility_applier.o -OBJECTS += $(OBJDIR)/pos_tick_network_system.o -OBJECTS += $(OBJDIR)/pre_tick_network_system.o -OBJECTS += $(OBJDIR)/simulation_events_handler.o -OBJECTS += $(OBJDIR)/temporary_lifetime_objects_system.o -OBJECTS += $(OBJDIR)/virtual_mouse_system.o - -# Rules -# ############################################# - -all: $(TARGET) - @: - -$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking ClientGame - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) - -$(TARGETDIR): - @echo Creating $(TARGETDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) -else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) -endif - -$(OBJDIR): - @echo Creating $(OBJDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) -else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) -endif - -clean: - @echo Cleaning ClientGame -ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) -else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) -endif - -prebuild: | $(OBJDIR) - $(PREBUILDCMDS) - -ifneq (,$(PCH)) -$(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) -$(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" -$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" -else - $(SILENT) echo $null >> "$@" -endif -else -$(OBJECTS): | prebuild -endif - - -# File Rules -# ############################################# - -$(OBJDIR)/client_network_entity_creator.o: src/client/client_network_entity_creator.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/client_world_initializer.o: src/client/client_world_initializer.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/local_player_interpolated_object_state_updater_system.o: src/client/player_interpolation/local_player_interpolated_object_state_updater_system.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/player_full_body_animation_applier.o: src/client/player_interpolation/player_full_body_animation_applier.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/player_interpolated_object_state_applier_system.o: src/client/player_interpolation/player_interpolated_object_state_applier_system.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/player_interpolated_position_and_rotation_applier.o: src/client/player_interpolation/player_interpolated_position_and_rotation_applier.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/player_weapon_flip_applier.o: src/client/player_interpolation/player_weapon_flip_applier.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/player_weapon_visibility_applier.o: src/client/player_interpolation/player_weapon_visibility_applier.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/client_player_simulation_events_processor.o: src/client/player_simulation/client_player_simulation_events_processor.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/client_local_player_predictor_system.o: src/client/systems/client_local_player_predictor_system.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/client_local_player_server_reconciliator_system.o: src/client/systems/client_local_player_server_reconciliator_system.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/crosshair_follow_mouse_system.o: src/client/systems/crosshair_follow_mouse_system.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/virtual_mouse_system.o: src/client/systems/virtual_mouse_system.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/InputState.o: src/shared/InputState.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/InputStateFactory.o: src/shared/InputStateFactory.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/player_controller_component_configuration.o: src/shared/component_configurations/player_controller_component_configuration.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/health_component.o: src/shared/components/health_component.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/network_peer_global_component.o: src/shared/global_components/network_peer_global_component.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/json_configuration_loader.o: src/shared/json_configuration_loader.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/player_network_entity_serialization_callbacks.o: src/shared/player_network_entity_serialization_callbacks.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/player_aiming_controller.o: src/shared/player_simulation/player_aiming_controller.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/player_movement_controller.o: src/shared/player_simulation/player_movement_controller.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/player_rotation_controller.o: src/shared/player_simulation/player_rotation_controller.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/player_shooting_controller.o: src/shared/player_simulation/player_shooting_controller.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/player_state_configuration_utils.o: src/shared/player_simulation/player_state_configuration_utils.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/player_state_simulator.o: src/shared/player_simulation/player_state_simulator.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/player_state_utils.o: src/shared/player_simulation/player_state_utils.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/simulation_events_handler.o: src/shared/player_simulation/simulation_events_handler.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/pos_tick_network_system.o: src/shared/systems/pos_tick_network_system.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/pre_tick_network_system.o: src/shared/systems/pre_tick_network_system.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/temporary_lifetime_objects_system.o: src/shared/systems/temporary_lifetime_objects_system.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" - --include $(OBJECTS:%.o=%.d) -ifneq (,$(PCH)) - -include $(PCH_PLACEHOLDER).d -endif \ No newline at end of file diff --git a/DemoGame/Launcher.make b/DemoGame/Launcher.make deleted file mode 100644 index a2bd77c..0000000 --- a/DemoGame/Launcher.make +++ /dev/null @@ -1,141 +0,0 @@ -# Alternative GNU Make project makefile autogenerated by Premake - -ifndef config - config=debug -endif - -ifndef verbose - SILENT = @ -endif - -.PHONY: clean prebuild - -SHELLTYPE := posix -ifeq (.exe,$(findstring .exe,$(ComSpec))) - SHELLTYPE := msdos -endif - -# Configurations -# ############################################# - -RESCOMP = windres -INCLUDES += -I../Common/src -I../Engine/src -I../NetworkLibrary/src -Isrc -I../vendor/entt/include -I../vendor/json/include -I../vendor/sdl2/SDL2-2.30.1/include -I../vendor/sdl2/SDL2_image-2.8.2/include -I../vendor/sdl2/SDL2_mixer-2.8.0/include -I../vendor/sdl2/SDL2_ttf-2.22.0/include -FORCE_INCLUDE += -ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) -ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) -LINKCMD = $(CXX) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) -define PREBUILDCMDS -endef -define PRELINKCMDS -endef -define POSTBUILDCMDS -endef - -ifeq ($(config),debug) -TARGETDIR = bin -TARGET = $(TARGETDIR)/Launcher_Debug -OBJDIR = obj/Debug/Launcher -DEFINES += -D_HAS_EXCEPTIONS=0 -DDEBUG -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g -std=c++17 -LIBS += -lClientGame_Debug -lServerGame_Debug -lCommon_Debug -lEngine_Debug -lNetworkLibrary_Debug -lSDL2 -lSDL2main -lSDL2_image -lSDL2_mixer -lSDL2_ttf -LDDEPS += bin/libClientGame_Debug.a bin/libServerGame_Debug.a ../Common/bin/libCommon_Debug.a ../Engine/bin/libEngine_Debug.a ../NetworkLibrary/bin/libNetworkLibrary_Debug.a -ALL_LDFLAGS += $(LDFLAGS) -L../vendor/sdl2/SDL2-2.30.1/lib/x64 -L../vendor/sdl2/SDL2_image-2.8.2/lib/x64 -L../vendor/sdl2/SDL2_mixer-2.8.0/lib/x64 -L../vendor/sdl2/SDL2_ttf-2.22.0/lib/x64 -Lbin -L../Common/bin -L../Engine/bin -L../NetworkLibrary/bin -L/usr/lib64 -m64 - -else ifeq ($(config),release) -TARGETDIR = bin -TARGET = $(TARGETDIR)/Launcher_Release -OBJDIR = obj/Release/Launcher -DEFINES += -D_HAS_EXCEPTIONS=0 -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 -std=c++17 -LIBS += -lClientGame_Release -lServerGame_Release -lCommon_Release -lEngine_Release -lNetworkLibrary_Release -lSDL2 -lSDL2main -lSDL2_image -lSDL2_mixer -lSDL2_ttf -LDDEPS += bin/libClientGame_Release.a bin/libServerGame_Release.a ../Common/bin/libCommon_Release.a ../Engine/bin/libEngine_Release.a ../NetworkLibrary/bin/libNetworkLibrary_Release.a -ALL_LDFLAGS += $(LDFLAGS) -L../vendor/sdl2/SDL2-2.30.1/lib/x64 -L../vendor/sdl2/SDL2_image-2.8.2/lib/x64 -L../vendor/sdl2/SDL2_mixer-2.8.0/lib/x64 -L../vendor/sdl2/SDL2_ttf-2.22.0/lib/x64 -Lbin -L../Common/bin -L../Engine/bin -L../NetworkLibrary/bin -L/usr/lib64 -m64 -s - -endif - -# Per File Configurations -# ############################################# - -PERFILE_FLAGS_0 = $(ALL_CXXFLAGS) -Werror - -# File sets -# ############################################# - -GENERATED := -OBJECTS := - -GENERATED += $(OBJDIR)/main.o -OBJECTS += $(OBJDIR)/main.o - -# Rules -# ############################################# - -all: $(TARGET) - @: - -$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking Launcher - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) - -$(TARGETDIR): - @echo Creating $(TARGETDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) -else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) -endif - -$(OBJDIR): - @echo Creating $(OBJDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) -else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) -endif - -clean: - @echo Cleaning Launcher -ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) -else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) -endif - -prebuild: | $(OBJDIR) - $(PREBUILDCMDS) - -ifneq (,$(PCH)) -$(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) -$(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" -$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" -else - $(SILENT) echo $null >> "$@" -endif -else -$(OBJECTS): | prebuild -endif - - -# File Rules -# ############################################# - -$(OBJDIR)/main.o: src/launcher/main.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" - --include $(OBJECTS:%.o=%.d) -ifneq (,$(PCH)) - -include $(PCH_PLACEHOLDER).d -endif \ No newline at end of file diff --git a/DemoGame/ServerGame.make b/DemoGame/ServerGame.make deleted file mode 100644 index 7941216..0000000 --- a/DemoGame/ServerGame.make +++ /dev/null @@ -1,264 +0,0 @@ -# Alternative GNU Make project makefile autogenerated by Premake - -ifndef config - config=debug -endif - -ifndef verbose - SILENT = @ -endif - -.PHONY: clean prebuild - -SHELLTYPE := posix -ifeq (.exe,$(findstring .exe,$(ComSpec))) - SHELLTYPE := msdos -endif - -# Configurations -# ############################################# - -RESCOMP = windres -INCLUDES += -Isrc -I../Common/src -I../Engine/src -I../NetworkLibrary/src -I../vendor/entt/include -I../vendor/json/include -I../vendor/sdl2/SDL2-2.30.1/include -I../vendor/sdl2/SDL2_image-2.8.2/include -I../vendor/sdl2/SDL2_mixer-2.8.0/include -I../vendor/sdl2/SDL2_ttf-2.22.0/include -FORCE_INCLUDE += -ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) -ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) -LIBS += -LDDEPS += -LINKCMD = $(AR) -rcs "$@" $(OBJECTS) -define PREBUILDCMDS -endef -define PRELINKCMDS -endef -define POSTBUILDCMDS -endef - -ifeq ($(config),debug) -TARGETDIR = bin -TARGET = $(TARGETDIR)/libServerGame_Debug.a -OBJDIR = obj/Debug/ServerGame -DEFINES += -D_HAS_EXCEPTIONS=0 -DDEBUG -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g -std=c++17 -ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 - -else ifeq ($(config),release) -TARGETDIR = bin -TARGET = $(TARGETDIR)/libServerGame_Release.a -OBJDIR = obj/Release/ServerGame -DEFINES += -D_HAS_EXCEPTIONS=0 -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 -std=c++17 -ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -s - -endif - -# Per File Configurations -# ############################################# - -PERFILE_FLAGS_0 = $(ALL_CXXFLAGS) -Werror - -# File sets -# ############################################# - -GENERATED := -OBJECTS := - -GENERATED += $(OBJDIR)/InputState.o -GENERATED += $(OBJDIR)/InputStateFactory.o -GENERATED += $(OBJDIR)/health_component.o -GENERATED += $(OBJDIR)/json_configuration_loader.o -GENERATED += $(OBJDIR)/network_peer_global_component.o -GENERATED += $(OBJDIR)/player_aiming_controller.o -GENERATED += $(OBJDIR)/player_controller_component_configuration.o -GENERATED += $(OBJDIR)/player_movement_controller.o -GENERATED += $(OBJDIR)/player_network_entity_serialization_callbacks.o -GENERATED += $(OBJDIR)/player_rotation_controller.o -GENERATED += $(OBJDIR)/player_shooting_controller.o -GENERATED += $(OBJDIR)/player_state_configuration_utils.o -GENERATED += $(OBJDIR)/player_state_simulator.o -GENERATED += $(OBJDIR)/player_state_utils.o -GENERATED += $(OBJDIR)/pos_tick_network_system.o -GENERATED += $(OBJDIR)/pre_tick_network_system.o -GENERATED += $(OBJDIR)/server_dummy_input_handler_system.o -GENERATED += $(OBJDIR)/server_hit_registration_system.o -GENERATED += $(OBJDIR)/server_network_entity_creator.o -GENERATED += $(OBJDIR)/server_player_controller_system.o -GENERATED += $(OBJDIR)/server_player_simulation_events_processor.o -GENERATED += $(OBJDIR)/server_remove_death_entities_system.o -GENERATED += $(OBJDIR)/server_revive_death_players_system.o -GENERATED += $(OBJDIR)/server_world_initializer.o -GENERATED += $(OBJDIR)/simulation_events_handler.o -GENERATED += $(OBJDIR)/temporary_lifetime_objects_system.o -OBJECTS += $(OBJDIR)/InputState.o -OBJECTS += $(OBJDIR)/InputStateFactory.o -OBJECTS += $(OBJDIR)/health_component.o -OBJECTS += $(OBJDIR)/json_configuration_loader.o -OBJECTS += $(OBJDIR)/network_peer_global_component.o -OBJECTS += $(OBJDIR)/player_aiming_controller.o -OBJECTS += $(OBJDIR)/player_controller_component_configuration.o -OBJECTS += $(OBJDIR)/player_movement_controller.o -OBJECTS += $(OBJDIR)/player_network_entity_serialization_callbacks.o -OBJECTS += $(OBJDIR)/player_rotation_controller.o -OBJECTS += $(OBJDIR)/player_shooting_controller.o -OBJECTS += $(OBJDIR)/player_state_configuration_utils.o -OBJECTS += $(OBJDIR)/player_state_simulator.o -OBJECTS += $(OBJDIR)/player_state_utils.o -OBJECTS += $(OBJDIR)/pos_tick_network_system.o -OBJECTS += $(OBJDIR)/pre_tick_network_system.o -OBJECTS += $(OBJDIR)/server_dummy_input_handler_system.o -OBJECTS += $(OBJDIR)/server_hit_registration_system.o -OBJECTS += $(OBJDIR)/server_network_entity_creator.o -OBJECTS += $(OBJDIR)/server_player_controller_system.o -OBJECTS += $(OBJDIR)/server_player_simulation_events_processor.o -OBJECTS += $(OBJDIR)/server_remove_death_entities_system.o -OBJECTS += $(OBJDIR)/server_revive_death_players_system.o -OBJECTS += $(OBJDIR)/server_world_initializer.o -OBJECTS += $(OBJDIR)/simulation_events_handler.o -OBJECTS += $(OBJDIR)/temporary_lifetime_objects_system.o - -# Rules -# ############################################# - -all: $(TARGET) - @: - -$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking ServerGame - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) - -$(TARGETDIR): - @echo Creating $(TARGETDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) -else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) -endif - -$(OBJDIR): - @echo Creating $(OBJDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) -else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) -endif - -clean: - @echo Cleaning ServerGame -ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) -else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) -endif - -prebuild: | $(OBJDIR) - $(PREBUILDCMDS) - -ifneq (,$(PCH)) -$(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) -$(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" -$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" -else - $(SILENT) echo $null >> "$@" -endif -else -$(OBJECTS): | prebuild -endif - - -# File Rules -# ############################################# - -$(OBJDIR)/server_player_simulation_events_processor.o: src/server/player_simulation/server_player_simulation_events_processor.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/server_network_entity_creator.o: src/server/server_network_entity_creator.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/server_world_initializer.o: src/server/server_world_initializer.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/server_dummy_input_handler_system.o: src/server/systems/server_dummy_input_handler_system.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/server_hit_registration_system.o: src/server/systems/server_hit_registration_system.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/server_player_controller_system.o: src/server/systems/server_player_controller_system.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/server_remove_death_entities_system.o: src/server/systems/server_remove_death_entities_system.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/server_revive_death_players_system.o: src/server/systems/server_revive_death_players_system.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/InputState.o: src/shared/InputState.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/InputStateFactory.o: src/shared/InputStateFactory.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/player_controller_component_configuration.o: src/shared/component_configurations/player_controller_component_configuration.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/health_component.o: src/shared/components/health_component.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/network_peer_global_component.o: src/shared/global_components/network_peer_global_component.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/json_configuration_loader.o: src/shared/json_configuration_loader.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/player_network_entity_serialization_callbacks.o: src/shared/player_network_entity_serialization_callbacks.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/player_aiming_controller.o: src/shared/player_simulation/player_aiming_controller.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/player_movement_controller.o: src/shared/player_simulation/player_movement_controller.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/player_rotation_controller.o: src/shared/player_simulation/player_rotation_controller.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/player_shooting_controller.o: src/shared/player_simulation/player_shooting_controller.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/player_state_configuration_utils.o: src/shared/player_simulation/player_state_configuration_utils.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/player_state_simulator.o: src/shared/player_simulation/player_state_simulator.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/player_state_utils.o: src/shared/player_simulation/player_state_utils.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/simulation_events_handler.o: src/shared/player_simulation/simulation_events_handler.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/pos_tick_network_system.o: src/shared/systems/pos_tick_network_system.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/pre_tick_network_system.o: src/shared/systems/pre_tick_network_system.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/temporary_lifetime_objects_system.o: src/shared/systems/temporary_lifetime_objects_system.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" - --include $(OBJECTS:%.o=%.d) -ifneq (,$(PCH)) - -include $(PCH_PLACEHOLDER).d -endif \ No newline at end of file diff --git a/Engine/Makefile b/Engine/Makefile deleted file mode 100644 index 1f7df4c..0000000 --- a/Engine/Makefile +++ /dev/null @@ -1,369 +0,0 @@ -# Alternative GNU Make project makefile autogenerated by Premake - -ifndef config - config=debug -endif - -ifndef verbose - SILENT = @ -endif - -.PHONY: clean prebuild - -SHELLTYPE := posix -ifeq (.exe,$(findstring .exe,$(ComSpec))) - SHELLTYPE := msdos -endif - -# Configurations -# ############################################# - -RESCOMP = windres -INCLUDES += -Isrc -I../Common/src -I../NetworkLibrary/src -I../vendor/entt/include -I../vendor/json/include -I../vendor/sdl2/SDL2-2.30.1/include -I../vendor/sdl2/SDL2_image-2.8.2/include -I../vendor/sdl2/SDL2_mixer-2.8.0/include -I../vendor/sdl2/SDL2_ttf-2.22.0/include -FORCE_INCLUDE += -ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) -ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) -LIBS += -LDDEPS += -LINKCMD = $(AR) -rcs "$@" $(OBJECTS) -define PREBUILDCMDS -endef -define PRELINKCMDS -endef -define POSTBUILDCMDS -endef - -ifeq ($(config),debug) -TARGETDIR = bin -TARGET = $(TARGETDIR)/libEngine_Debug.a -OBJDIR = obj/Debug -DEFINES += -D_HAS_EXCEPTIONS=0 -DDEBUG -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g -std=c++17 -ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 - -else ifeq ($(config),release) -TARGETDIR = bin -TARGET = $(TARGETDIR)/libEngine_Release.a -OBJDIR = obj/Release -DEFINES += -D_HAS_EXCEPTIONS=0 -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 -std=c++17 -ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -s - -endif - -# Per File Configurations -# ############################################# - -PERFILE_FLAGS_0 = $(ALL_CXXFLAGS) -Werror - -# File sets -# ############################################# - -GENERATED := -OBJECTS := - -GENERATED += $(OBJDIR)/Game.o -GENERATED += $(OBJDIR)/Gizmo.o -GENERATED += $(OBJDIR)/animation_asset_loader.o -GENERATED += $(OBJDIR)/animation_component_proxy.o -GENERATED += $(OBJDIR)/animation_initialization_utils.o -GENERATED += $(OBJDIR)/animation_system.o -GENERATED += $(OBJDIR)/archetype_registry.o -GENERATED += $(OBJDIR)/asset_manager.o -GENERATED += $(OBJDIR)/asset_storage.o -GENERATED += $(OBJDIR)/circle_bounds_2d.o -GENERATED += $(OBJDIR)/circle_gizmo.o -GENERATED += $(OBJDIR)/circle_gizmo_renderer.o -GENERATED += $(OBJDIR)/collider_2d_component.o -GENERATED += $(OBJDIR)/collider_2d_component_configuration.o -GENERATED += $(OBJDIR)/collision_detection_system.o -GENERATED += $(OBJDIR)/collision_utils.o -GENERATED += $(OBJDIR)/component_configuration.o -GENERATED += $(OBJDIR)/component_registry.o -GENERATED += $(OBJDIR)/configuration_asset.o -GENERATED += $(OBJDIR)/configuration_asset_loader.o -GENERATED += $(OBJDIR)/configuration_assets_initialization_utils.o -GENERATED += $(OBJDIR)/coordinates_conversion_utils.o -GENERATED += $(OBJDIR)/entity_container.o -GENERATED += $(OBJDIR)/gizmo_pool.o -GENERATED += $(OBJDIR)/gizmo_renderer_system.o -GENERATED += $(OBJDIR)/gizmo_resource_handler.o -GENERATED += $(OBJDIR)/input_handler_global_component.o -GENERATED += $(OBJDIR)/input_handler_system.o -GENERATED += $(OBJDIR)/inputs_initialization_utils.o -GENERATED += $(OBJDIR)/keyboard_controller.o -GENERATED += $(OBJDIR)/math_utils.o -GENERATED += $(OBJDIR)/mouse_controller.o -GENERATED += $(OBJDIR)/prefab.o -GENERATED += $(OBJDIR)/prefab_registry.o -GENERATED += $(OBJDIR)/ray_gizmo.o -GENERATED += $(OBJDIR)/ray_gizmo_renderer.o -GENERATED += $(OBJDIR)/raycaster.o -GENERATED += $(OBJDIR)/render_clear_system.o -GENERATED += $(OBJDIR)/render_present_system.o -GENERATED += $(OBJDIR)/rendering_inicialization_utils.o -GENERATED += $(OBJDIR)/sprite_renderer_component_configuration.o -GENERATED += $(OBJDIR)/sprite_renderer_system.o -GENERATED += $(OBJDIR)/system_coordinator.o -GENERATED += $(OBJDIR)/systems_handler.o -GENERATED += $(OBJDIR)/texture_asset_loader.o -GENERATED += $(OBJDIR)/transform_hierarchy_helper_functions.o -GENERATED += $(OBJDIR)/world.o -OBJECTS += $(OBJDIR)/Game.o -OBJECTS += $(OBJDIR)/Gizmo.o -OBJECTS += $(OBJDIR)/animation_asset_loader.o -OBJECTS += $(OBJDIR)/animation_component_proxy.o -OBJECTS += $(OBJDIR)/animation_initialization_utils.o -OBJECTS += $(OBJDIR)/animation_system.o -OBJECTS += $(OBJDIR)/archetype_registry.o -OBJECTS += $(OBJDIR)/asset_manager.o -OBJECTS += $(OBJDIR)/asset_storage.o -OBJECTS += $(OBJDIR)/circle_bounds_2d.o -OBJECTS += $(OBJDIR)/circle_gizmo.o -OBJECTS += $(OBJDIR)/circle_gizmo_renderer.o -OBJECTS += $(OBJDIR)/collider_2d_component.o -OBJECTS += $(OBJDIR)/collider_2d_component_configuration.o -OBJECTS += $(OBJDIR)/collision_detection_system.o -OBJECTS += $(OBJDIR)/collision_utils.o -OBJECTS += $(OBJDIR)/component_configuration.o -OBJECTS += $(OBJDIR)/component_registry.o -OBJECTS += $(OBJDIR)/configuration_asset.o -OBJECTS += $(OBJDIR)/configuration_asset_loader.o -OBJECTS += $(OBJDIR)/configuration_assets_initialization_utils.o -OBJECTS += $(OBJDIR)/coordinates_conversion_utils.o -OBJECTS += $(OBJDIR)/entity_container.o -OBJECTS += $(OBJDIR)/gizmo_pool.o -OBJECTS += $(OBJDIR)/gizmo_renderer_system.o -OBJECTS += $(OBJDIR)/gizmo_resource_handler.o -OBJECTS += $(OBJDIR)/input_handler_global_component.o -OBJECTS += $(OBJDIR)/input_handler_system.o -OBJECTS += $(OBJDIR)/inputs_initialization_utils.o -OBJECTS += $(OBJDIR)/keyboard_controller.o -OBJECTS += $(OBJDIR)/math_utils.o -OBJECTS += $(OBJDIR)/mouse_controller.o -OBJECTS += $(OBJDIR)/prefab.o -OBJECTS += $(OBJDIR)/prefab_registry.o -OBJECTS += $(OBJDIR)/ray_gizmo.o -OBJECTS += $(OBJDIR)/ray_gizmo_renderer.o -OBJECTS += $(OBJDIR)/raycaster.o -OBJECTS += $(OBJDIR)/render_clear_system.o -OBJECTS += $(OBJDIR)/render_present_system.o -OBJECTS += $(OBJDIR)/rendering_inicialization_utils.o -OBJECTS += $(OBJDIR)/sprite_renderer_component_configuration.o -OBJECTS += $(OBJDIR)/sprite_renderer_system.o -OBJECTS += $(OBJDIR)/system_coordinator.o -OBJECTS += $(OBJDIR)/systems_handler.o -OBJECTS += $(OBJDIR)/texture_asset_loader.o -OBJECTS += $(OBJDIR)/transform_hierarchy_helper_functions.o -OBJECTS += $(OBJDIR)/world.o - -# Rules -# ############################################# - -all: $(TARGET) - @: - -$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking Engine - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) - -$(TARGETDIR): - @echo Creating $(TARGETDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) -else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) -endif - -$(OBJDIR): - @echo Creating $(OBJDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) -else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) -endif - -clean: - @echo Cleaning Engine -ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) -else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) -endif - -prebuild: | $(OBJDIR) - $(PREBUILDCMDS) - -ifneq (,$(PCH)) -$(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) -$(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" -$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" -else - $(SILENT) echo $null >> "$@" -endif -else -$(OBJECTS): | prebuild -endif - - -# File Rules -# ############################################# - -$(OBJDIR)/Game.o: src/Game.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/animation_asset_loader.o: src/animation/animation_asset_loader.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/animation_component_proxy.o: src/animation/animation_component_proxy.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/animation_initialization_utils.o: src/animation/animation_initialization_utils.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/animation_system.o: src/animation/animation_system.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/asset_manager.o: src/asset_manager/asset_manager.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/asset_storage.o: src/asset_manager/asset_storage.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/configuration_asset.o: src/configuration_assets/configuration_asset.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/configuration_asset_loader.o: src/configuration_assets/configuration_asset_loader.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/configuration_assets_initialization_utils.o: src/configuration_assets/configuration_assets_initialization_utils.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/coordinates_conversion_utils.o: src/coordinates_conversion_utils.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/archetype_registry.o: src/ecs/archetype_registry.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/component_configuration.o: src/ecs/component_configuration.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/component_registry.o: src/ecs/component_registry.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/entity_container.o: src/ecs/entity_container.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/prefab.o: src/ecs/prefab.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/prefab_registry.o: src/ecs/prefab_registry.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/system_coordinator.o: src/ecs/system_coordinator.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/systems_handler.o: src/ecs/systems_handler.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/world.o: src/ecs/world.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/input_handler_global_component.o: src/inputs/input_handler_global_component.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/input_handler_system.o: src/inputs/input_handler_system.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/inputs_initialization_utils.o: src/inputs/inputs_initialization_utils.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/keyboard_controller.o: src/inputs/keyboard_controller.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/mouse_controller.o: src/inputs/mouse_controller.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/math_utils.o: src/math_utils.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/circle_bounds_2d.o: src/physics/circle_bounds_2d.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/collider_2d_component.o: src/physics/collider_2d_component.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/collider_2d_component_configuration.o: src/physics/collider_2d_component_configuration.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/collision_detection_system.o: src/physics/collision_detection_system.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/collision_utils.o: src/physics/collision_utils.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/raycaster.o: src/physics/raycaster.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/Gizmo.o: src/render/Gizmo.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/circle_gizmo.o: src/render/circle_gizmo.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/circle_gizmo_renderer.o: src/render/circle_gizmo_renderer.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/gizmo_pool.o: src/render/gizmo_pool.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/gizmo_renderer_system.o: src/render/gizmo_renderer_system.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/gizmo_resource_handler.o: src/render/gizmo_resource_handler.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/ray_gizmo.o: src/render/ray_gizmo.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/ray_gizmo_renderer.o: src/render/ray_gizmo_renderer.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/render_clear_system.o: src/render/render_clear_system.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/render_present_system.o: src/render/render_present_system.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/rendering_inicialization_utils.o: src/render/rendering_inicialization_utils.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/sprite_renderer_component_configuration.o: src/render/sprite_renderer_component_configuration.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/sprite_renderer_system.o: src/render/sprite_renderer_system.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/texture_asset_loader.o: src/render/texture_asset_loader.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/transform_hierarchy_helper_functions.o: src/transform/transform_hierarchy_helper_functions.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" - --include $(OBJECTS:%.o=%.d) -ifneq (,$(PCH)) - -include $(PCH_PLACEHOLDER).d -endif \ No newline at end of file diff --git a/Makefile b/Makefile deleted file mode 100644 index 1b49d77..0000000 --- a/Makefile +++ /dev/null @@ -1,132 +0,0 @@ -# Alternative GNU Make workspace makefile autogenerated by Premake - -ifndef config - config=debug -endif - -ifndef verbose - SILENT = @ -endif - -ifeq ($(config),debug) - Common_config = debug - Engine_config = debug - NetworkLibrary_config = debug - ClientGame_config = debug - ServerGame_config = debug - Launcher_config = debug - TestDemoGame_config = debug - TestCommon_config = debug - TestEngine_config = debug - -else ifeq ($(config),release) - Common_config = release - Engine_config = release - NetworkLibrary_config = release - ClientGame_config = release - ServerGame_config = release - Launcher_config = release - TestDemoGame_config = release - TestCommon_config = release - TestEngine_config = release - -else - $(error "invalid configuration $(config)") -endif - -PROJECTS := Common Engine NetworkLibrary ClientGame ServerGame Launcher TestDemoGame TestCommon TestEngine - -.PHONY: all clean help $(PROJECTS) DemoGame Tests - -all: $(PROJECTS) - -DemoGame: ClientGame Launcher ServerGame - -Tests: TestCommon TestDemoGame TestEngine - -Common: -ifneq (,$(Common_config)) - @echo "==== Building Common ($(Common_config)) ====" - @${MAKE} --no-print-directory -C Common -f Makefile config=$(Common_config) -endif - -Engine: -ifneq (,$(Engine_config)) - @echo "==== Building Engine ($(Engine_config)) ====" - @${MAKE} --no-print-directory -C Engine -f Makefile config=$(Engine_config) -endif - -NetworkLibrary: -ifneq (,$(NetworkLibrary_config)) - @echo "==== Building NetworkLibrary ($(NetworkLibrary_config)) ====" - @${MAKE} --no-print-directory -C NetworkLibrary -f Makefile config=$(NetworkLibrary_config) -endif - -ClientGame: -ifneq (,$(ClientGame_config)) - @echo "==== Building ClientGame ($(ClientGame_config)) ====" - @${MAKE} --no-print-directory -C DemoGame -f ClientGame.make config=$(ClientGame_config) -endif - -ServerGame: -ifneq (,$(ServerGame_config)) - @echo "==== Building ServerGame ($(ServerGame_config)) ====" - @${MAKE} --no-print-directory -C DemoGame -f ServerGame.make config=$(ServerGame_config) -endif - -Launcher: ClientGame ServerGame Common Engine NetworkLibrary -ifneq (,$(Launcher_config)) - @echo "==== Building Launcher ($(Launcher_config)) ====" - @${MAKE} --no-print-directory -C DemoGame -f Launcher.make config=$(Launcher_config) -endif - -TestDemoGame: ClientGame ServerGame Common Engine NetworkLibrary -ifneq (,$(TestDemoGame_config)) - @echo "==== Building TestDemoGame ($(TestDemoGame_config)) ====" - @${MAKE} --no-print-directory -C TestDemoGame -f Makefile config=$(TestDemoGame_config) -endif - -TestCommon: Common -ifneq (,$(TestCommon_config)) - @echo "==== Building TestCommon ($(TestCommon_config)) ====" - @${MAKE} --no-print-directory -C test_common -f Makefile config=$(TestCommon_config) -endif - -TestEngine: Common Engine -ifneq (,$(TestEngine_config)) - @echo "==== Building TestEngine ($(TestEngine_config)) ====" - @${MAKE} --no-print-directory -C test_engine -f Makefile config=$(TestEngine_config) -endif - -clean: - @${MAKE} --no-print-directory -C Common -f Makefile clean - @${MAKE} --no-print-directory -C Engine -f Makefile clean - @${MAKE} --no-print-directory -C NetworkLibrary -f Makefile clean - @${MAKE} --no-print-directory -C DemoGame -f ClientGame.make clean - @${MAKE} --no-print-directory -C DemoGame -f ServerGame.make clean - @${MAKE} --no-print-directory -C DemoGame -f Launcher.make clean - @${MAKE} --no-print-directory -C TestDemoGame -f Makefile clean - @${MAKE} --no-print-directory -C test_common -f Makefile clean - @${MAKE} --no-print-directory -C test_engine -f Makefile clean - -help: - @echo "Usage: make [config=name] [target]" - @echo "" - @echo "CONFIGURATIONS:" - @echo " debug" - @echo " release" - @echo "" - @echo "TARGETS:" - @echo " all (default)" - @echo " clean" - @echo " Common" - @echo " Engine" - @echo " NetworkLibrary" - @echo " ClientGame" - @echo " ServerGame" - @echo " Launcher" - @echo " TestDemoGame" - @echo " TestCommon" - @echo " TestEngine" - @echo "" - @echo "For more information, see https://github.com/premake/premake-core/wiki" \ No newline at end of file diff --git a/NetworkLibrary/Makefile b/NetworkLibrary/Makefile deleted file mode 100644 index c8b003a..0000000 --- a/NetworkLibrary/Makefile +++ /dev/null @@ -1,294 +0,0 @@ -# Alternative GNU Make project makefile autogenerated by Premake - -ifndef config - config=debug -endif - -ifndef verbose - SILENT = @ -endif - -.PHONY: clean prebuild - -SHELLTYPE := posix -ifeq (.exe,$(findstring .exe,$(ComSpec))) - SHELLTYPE := msdos -endif - -# Configurations -# ############################################# - -RESCOMP = windres -INCLUDES += -Isrc -I../Common/src -FORCE_INCLUDE += -ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) -ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) -LIBS += -LDDEPS += -LINKCMD = $(AR) -rcs "$@" $(OBJECTS) -define PREBUILDCMDS -endef -define PRELINKCMDS -endef -define POSTBUILDCMDS -endef - -ifeq ($(config),debug) -TARGETDIR = bin -TARGET = $(TARGETDIR)/libNetworkLibrary_Debug.a -OBJDIR = obj/Debug -DEFINES += -D_HAS_EXCEPTIONS=0 -DDEBUG -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g -std=c++17 -ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 - -else ifeq ($(config),release) -TARGETDIR = bin -TARGET = $(TARGETDIR)/libNetworkLibrary_Release.a -OBJDIR = obj/Release -DEFINES += -D_HAS_EXCEPTIONS=0 -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 -std=c++17 -ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -s - -endif - -# Per File Configurations -# ############################################# - -PERFILE_FLAGS_0 = $(ALL_CXXFLAGS) -Werror - -# File sets -# ############################################# - -GENERATED := -OBJECTS := - -GENERATED += $(OBJDIR)/Address.o -GENERATED += $(OBJDIR)/Buffer.o -GENERATED += $(OBJDIR)/Client.o -GENERATED += $(OBJDIR)/Peer.o -GENERATED += $(OBJDIR)/Server.o -GENERATED += $(OBJDIR)/Socket.o -GENERATED += $(OBJDIR)/download_bandwidth_metric.o -GENERATED += $(OBJDIR)/increment_metric.o -GENERATED += $(OBJDIR)/jitter_metric.o -GENERATED += $(OBJDIR)/latency_metric.o -GENERATED += $(OBJDIR)/message.o -GENERATED += $(OBJDIR)/message_factory.o -GENERATED += $(OBJDIR)/message_header.o -GENERATED += $(OBJDIR)/message_utils.o -GENERATED += $(OBJDIR)/metrics_handler.o -GENERATED += $(OBJDIR)/network_entity_storage.o -GENERATED += $(OBJDIR)/network_packet.o -GENERATED += $(OBJDIR)/network_variable_changes_handler.o -GENERATED += $(OBJDIR)/packet_loss_metric.o -GENERATED += $(OBJDIR)/ping_pong_messages_sender.o -GENERATED += $(OBJDIR)/reliable_ordered_channel.o -GENERATED += $(OBJDIR)/remote_peer.o -GENERATED += $(OBJDIR)/remote_peer_inputs_handler.o -GENERATED += $(OBJDIR)/remote_peers_handler.o -GENERATED += $(OBJDIR)/replication_manager.o -GENERATED += $(OBJDIR)/replication_messages_processor.o -GENERATED += $(OBJDIR)/time_clock.o -GENERATED += $(OBJDIR)/time_syncer.o -GENERATED += $(OBJDIR)/transmission_channel.o -GENERATED += $(OBJDIR)/unreliable_ordered_transmission_channel.o -GENERATED += $(OBJDIR)/unreliable_unordered_transmission_channel.o -GENERATED += $(OBJDIR)/upload_bandwidth_metric.o -OBJECTS += $(OBJDIR)/Address.o -OBJECTS += $(OBJDIR)/Buffer.o -OBJECTS += $(OBJDIR)/Client.o -OBJECTS += $(OBJDIR)/Peer.o -OBJECTS += $(OBJDIR)/Server.o -OBJECTS += $(OBJDIR)/Socket.o -OBJECTS += $(OBJDIR)/download_bandwidth_metric.o -OBJECTS += $(OBJDIR)/increment_metric.o -OBJECTS += $(OBJDIR)/jitter_metric.o -OBJECTS += $(OBJDIR)/latency_metric.o -OBJECTS += $(OBJDIR)/message.o -OBJECTS += $(OBJDIR)/message_factory.o -OBJECTS += $(OBJDIR)/message_header.o -OBJECTS += $(OBJDIR)/message_utils.o -OBJECTS += $(OBJDIR)/metrics_handler.o -OBJECTS += $(OBJDIR)/network_entity_storage.o -OBJECTS += $(OBJDIR)/network_packet.o -OBJECTS += $(OBJDIR)/network_variable_changes_handler.o -OBJECTS += $(OBJDIR)/packet_loss_metric.o -OBJECTS += $(OBJDIR)/ping_pong_messages_sender.o -OBJECTS += $(OBJDIR)/reliable_ordered_channel.o -OBJECTS += $(OBJDIR)/remote_peer.o -OBJECTS += $(OBJDIR)/remote_peer_inputs_handler.o -OBJECTS += $(OBJDIR)/remote_peers_handler.o -OBJECTS += $(OBJDIR)/replication_manager.o -OBJECTS += $(OBJDIR)/replication_messages_processor.o -OBJECTS += $(OBJDIR)/time_clock.o -OBJECTS += $(OBJDIR)/time_syncer.o -OBJECTS += $(OBJDIR)/transmission_channel.o -OBJECTS += $(OBJDIR)/unreliable_ordered_transmission_channel.o -OBJECTS += $(OBJDIR)/unreliable_unordered_transmission_channel.o -OBJECTS += $(OBJDIR)/upload_bandwidth_metric.o - -# Rules -# ############################################# - -all: $(TARGET) - @: - -$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking NetworkLibrary - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) - -$(TARGETDIR): - @echo Creating $(TARGETDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) -else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) -endif - -$(OBJDIR): - @echo Creating $(OBJDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) -else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) -endif - -clean: - @echo Cleaning NetworkLibrary -ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) -else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) -endif - -prebuild: | $(OBJDIR) - $(PREBUILDCMDS) - -ifneq (,$(PCH)) -$(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) -$(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" -$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" -else - $(SILENT) echo $null >> "$@" -endif -else -$(OBJECTS): | prebuild -endif - - -# File Rules -# ############################################# - -$(OBJDIR)/Address.o: src/Core/Address.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/Buffer.o: src/Core/Buffer.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/Client.o: src/Core/Client.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/Peer.o: src/Core/Peer.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/Server.o: src/Core/Server.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/Socket.o: src/Core/Socket.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/ping_pong_messages_sender.o: src/Core/ping_pong_messages_sender.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/remote_peer.o: src/Core/remote_peer.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/remote_peers_handler.o: src/Core/remote_peers_handler.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/time_clock.o: src/Core/time_clock.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/message.o: src/communication/message.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/message_factory.o: src/communication/message_factory.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/message_header.o: src/communication/message_header.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/message_utils.o: src/communication/message_utils.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/network_packet.o: src/communication/network_packet.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/remote_peer_inputs_handler.o: src/inputs/remote_peer_inputs_handler.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/download_bandwidth_metric.o: src/metrics/download_bandwidth_metric.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/increment_metric.o: src/metrics/increment_metric.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/jitter_metric.o: src/metrics/jitter_metric.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/latency_metric.o: src/metrics/latency_metric.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/metrics_handler.o: src/metrics/metrics_handler.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/packet_loss_metric.o: src/metrics/packet_loss_metric.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/upload_bandwidth_metric.o: src/metrics/upload_bandwidth_metric.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/network_entity_storage.o: src/replication/network_entity_storage.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/network_variable_changes_handler.o: src/replication/network_variable_changes_handler.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/replication_manager.o: src/replication/replication_manager.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/replication_messages_processor.o: src/replication/replication_messages_processor.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/time_syncer.o: src/time/time_syncer.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/reliable_ordered_channel.o: src/transmission_channels/reliable_ordered_channel.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/transmission_channel.o: src/transmission_channels/transmission_channel.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/unreliable_ordered_transmission_channel.o: src/transmission_channels/unreliable_ordered_transmission_channel.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/unreliable_unordered_transmission_channel.o: src/transmission_channels/unreliable_unordered_transmission_channel.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" - --include $(OBJECTS:%.o=%.d) -ifneq (,$(PCH)) - -include $(PCH_PLACEHOLDER).d -endif \ No newline at end of file diff --git a/NetworkLibrary/src/transmission_channels/reliable_ordered_channel.cpp b/NetworkLibrary/src/transmission_channels/reliable_ordered_channel.cpp index 3a21f64..5e06e38 100644 --- a/NetworkLibrary/src/transmission_channels/reliable_ordered_channel.cpp +++ b/NetworkLibrary/src/transmission_channels/reliable_ordered_channel.cpp @@ -159,18 +159,7 @@ namespace NetLib return result; } - bool ReliableOrderedChannel::AddMessageToSend( std::unique_ptr< Message > message ) - { - assert( message != nullptr ); - - if ( !IsMessageSuitable( message->GetHeader() ) ) - { - return false; - } - _unsentMessages.push_back( std::move( message ) ); - return true; - } bool ReliableOrderedChannel::ArePendingMessagesToSend() const { @@ -285,26 +274,7 @@ namespace NetLib return true; } - bool ReliableOrderedChannel::ArePendingReadyToProcessMessages() const - { - return !_readyToProcessMessages.empty(); - } - const Message* ReliableOrderedChannel::GetReadyToProcessMessage() - { - if ( !ArePendingReadyToProcessMessages() ) - { - return nullptr; - } - - std::unique_ptr< Message > message( std::move( _readyToProcessMessages.front() ) ); - _readyToProcessMessages.pop(); - - Message* messageToReturn = message.get(); - _processedMessages.push( std::move( message ) ); - - return messageToReturn; - } bool ReliableOrderedChannel::AreUnackedMessagesToResend() const { diff --git a/NetworkLibrary/src/transmission_channels/reliable_ordered_channel.h b/NetworkLibrary/src/transmission_channels/reliable_ordered_channel.h index 65b1577..1576cd9 100644 --- a/NetworkLibrary/src/transmission_channels/reliable_ordered_channel.h +++ b/NetworkLibrary/src/transmission_channels/reliable_ordered_channel.h @@ -39,14 +39,11 @@ namespace NetLib bool CreateAndSendPacket( Socket& socket, const Address& address, Metrics::MetricsHandler* metrics_handler ) override; - bool AddMessageToSend( std::unique_ptr< Message > message ) override; bool ArePendingMessagesToSend() const override; std::unique_ptr< Message > GetMessageToSend( Metrics::MetricsHandler* metrics_handler ); bool AddReceivedMessage( std::unique_ptr< Message > message, Metrics::MetricsHandler* metrics_handler ) override; - bool ArePendingReadyToProcessMessages() const override; - const Message* GetReadyToProcessMessage() override; void ProcessACKs( uint32 acks, uint16 lastAckedMessageSequenceNumber, Metrics::MetricsHandler* metrics_handler ) override; @@ -79,7 +76,7 @@ namespace NetLib /// /// The header of the message to check. /// True if it is suitable, False otherwise. - bool IsMessageSuitable( const MessageHeader& header ) const; + bool IsMessageSuitable( const MessageHeader& header ) const override; ////////// // ACKS diff --git a/NetworkLibrary/src/transmission_channels/transmission_channel.cpp b/NetworkLibrary/src/transmission_channels/transmission_channel.cpp index ad81963..0212ca7 100644 --- a/NetworkLibrary/src/transmission_channels/transmission_channel.cpp +++ b/NetworkLibrary/src/transmission_channels/transmission_channel.cpp @@ -2,6 +2,7 @@ #include +#include "communication/message.h" #include "communication/message_factory.h" namespace NetLib @@ -39,6 +40,40 @@ namespace NetLib return *this; } + bool TransmissionChannel::AddMessageToSend( std::unique_ptr< Message > message ) + { + assert( message != nullptr ); + + if ( !IsMessageSuitable( message->GetHeader() ) ) + { + return false; + } + + _unsentMessages.push_back( std::move( message ) ); + return true; + } + + bool TransmissionChannel::ArePendingReadyToProcessMessages() const + { + return !_readyToProcessMessages.empty(); + } + + const Message* TransmissionChannel::GetReadyToProcessMessage() + { + if ( !ArePendingReadyToProcessMessages() ) + { + return nullptr; + } + + std::unique_ptr< Message > message( std::move( _readyToProcessMessages.front() ) ); + _readyToProcessMessages.pop(); + + Message* messageToReturn = message.get(); + _processedMessages.push( std::move( message ) ); + + return messageToReturn; + } + void TransmissionChannel::FreeProcessedMessages() { MessageFactory& messageFactory = MessageFactory::GetInstance(); diff --git a/NetworkLibrary/src/transmission_channels/transmission_channel.h b/NetworkLibrary/src/transmission_channels/transmission_channel.h index 7775a12..7e5bab7 100644 --- a/NetworkLibrary/src/transmission_channels/transmission_channel.h +++ b/NetworkLibrary/src/transmission_channels/transmission_channel.h @@ -8,6 +8,7 @@ namespace NetLib { class Message; + struct MessageHeader; class MessageFactory; class Socket; class Address; @@ -53,7 +54,7 @@ namespace NetLib /// /// The message pending to be sent. /// True if the message was stored correclt, False otherwise. - virtual bool AddMessageToSend( std::unique_ptr< Message > message ) = 0; + bool AddMessageToSend( std::unique_ptr< Message > message ); /// /// Checks if there are any messages pending to be sent through the network. @@ -69,8 +70,8 @@ namespace NetLib /// True if the message was stored correclt, False otherwise. virtual bool AddReceivedMessage( std::unique_ptr< Message > message, Metrics::MetricsHandler* metrics_handler ) = 0; - virtual bool ArePendingReadyToProcessMessages() const = 0; - virtual const Message* GetReadyToProcessMessage() = 0; + bool ArePendingReadyToProcessMessages() const; + const Message* GetReadyToProcessMessage(); void FreeProcessedMessages(); virtual void ProcessACKs( uint32 acks, uint16 lastAckedMessageSequenceNumber, @@ -94,6 +95,14 @@ namespace NetLib uint16 GetNextMessageSequenceNumber() const { return _nextMessageSequenceNumber; } void IncreaseMessageSequenceNumber() { ++_nextMessageSequenceNumber; }; + /// + /// Checks if a message is suitable for this transmission channel type. + /// Must be implemented by derived classes to validate message properties. + /// + /// The message header to validate. + /// True if the message is suitable for this channel, False otherwise. + virtual bool IsMessageSuitable( const MessageHeader& header ) const = 0; + private: TransmissionChannelType _type; uint16 _nextMessageSequenceNumber; diff --git a/NetworkLibrary/src/transmission_channels/unreliable_ordered_transmission_channel.cpp b/NetworkLibrary/src/transmission_channels/unreliable_ordered_transmission_channel.cpp index 981b6b6..7ac39d4 100644 --- a/NetworkLibrary/src/transmission_channels/unreliable_ordered_transmission_channel.cpp +++ b/NetworkLibrary/src/transmission_channels/unreliable_ordered_transmission_channel.cpp @@ -104,18 +104,7 @@ namespace NetLib return result; } - bool UnreliableOrderedTransmissionChannel::AddMessageToSend( std::unique_ptr< Message > message ) - { - assert( message != nullptr ); - - if ( !IsMessageSuitable( message->GetHeader() ) ) - { - return false; - } - _unsentMessages.push_back( std::move( message ) ); - return true; - } bool UnreliableOrderedTransmissionChannel::ArePendingMessagesToSend() const { @@ -175,26 +164,7 @@ namespace NetLib return true; } - bool UnreliableOrderedTransmissionChannel::ArePendingReadyToProcessMessages() const - { - return ( !_readyToProcessMessages.empty() ); - } - const Message* UnreliableOrderedTransmissionChannel::GetReadyToProcessMessage() - { - if ( !ArePendingReadyToProcessMessages() ) - { - return nullptr; - } - - std::unique_ptr< Message > message( std::move( _readyToProcessMessages.front() ) ); - _readyToProcessMessages.pop(); - - Message* messageToReturn = message.get(); - _processedMessages.push( std::move( message ) ); - - return messageToReturn; - } void UnreliableOrderedTransmissionChannel::ProcessACKs( uint32 acks, uint16 lastAckedMessageSequenceNumber, Metrics::MetricsHandler* metrics_handler ) diff --git a/NetworkLibrary/src/transmission_channels/unreliable_ordered_transmission_channel.h b/NetworkLibrary/src/transmission_channels/unreliable_ordered_transmission_channel.h index 6d81b05..21a6145 100644 --- a/NetworkLibrary/src/transmission_channels/unreliable_ordered_transmission_channel.h +++ b/NetworkLibrary/src/transmission_channels/unreliable_ordered_transmission_channel.h @@ -18,15 +18,12 @@ namespace NetLib bool CreateAndSendPacket( Socket& socket, const Address& address, Metrics::MetricsHandler* metrics_handler ) override; - bool AddMessageToSend( std::unique_ptr< Message > message ) override; bool ArePendingMessagesToSend() const override; std::unique_ptr< Message > GetMessageToSend( Metrics::MetricsHandler* metrics_handler ); uint32 GetSizeOfNextUnsentMessage() const; bool AddReceivedMessage( std::unique_ptr< Message > message, Metrics::MetricsHandler* metrics_handler ) override; - bool ArePendingReadyToProcessMessages() const override; - const Message* GetReadyToProcessMessage() override; void ProcessACKs( uint32 acks, uint16 lastAckedMessageSequenceNumber, Metrics::MetricsHandler* metrics_handler ) override; @@ -46,6 +43,6 @@ namespace NetLib /// /// The header of the message to check. /// True if it is suitable, False otherwise. - bool IsMessageSuitable( const MessageHeader& header ) const; + bool IsMessageSuitable( const MessageHeader& header ) const override; }; } // namespace NetLib diff --git a/NetworkLibrary/src/transmission_channels/unreliable_unordered_transmission_channel.cpp b/NetworkLibrary/src/transmission_channels/unreliable_unordered_transmission_channel.cpp index c8bbd65..a2017e3 100644 --- a/NetworkLibrary/src/transmission_channels/unreliable_unordered_transmission_channel.cpp +++ b/NetworkLibrary/src/transmission_channels/unreliable_unordered_transmission_channel.cpp @@ -96,18 +96,7 @@ namespace NetLib return result; } - bool UnreliableUnorderedTransmissionChannel::AddMessageToSend( std::unique_ptr< Message > message ) - { - assert( message != nullptr ); - - if ( !IsMessageSuitable( message->GetHeader() ) ) - { - return false; - } - _unsentMessages.push_back( std::move( message ) ); - return true; - } bool UnreliableUnorderedTransmissionChannel::ArePendingMessagesToSend() const { @@ -156,26 +145,7 @@ namespace NetLib return true; } - bool UnreliableUnorderedTransmissionChannel::ArePendingReadyToProcessMessages() const - { - return ( !_readyToProcessMessages.empty() ); - } - const Message* UnreliableUnorderedTransmissionChannel::GetReadyToProcessMessage() - { - if ( !ArePendingReadyToProcessMessages() ) - { - return nullptr; - } - - std::unique_ptr< Message > message( std::move( _readyToProcessMessages.front() ) ); - _readyToProcessMessages.pop(); - - Message* messageToReturn = message.get(); - _processedMessages.push( std::move( message ) ); - - return messageToReturn; - } void UnreliableUnorderedTransmissionChannel::ProcessACKs( uint32 acks, uint16 lastAckedMessageSequenceNumber, Metrics::MetricsHandler* metrics_handler ) diff --git a/NetworkLibrary/src/transmission_channels/unreliable_unordered_transmission_channel.h b/NetworkLibrary/src/transmission_channels/unreliable_unordered_transmission_channel.h index f15ca20..db881de 100644 --- a/NetworkLibrary/src/transmission_channels/unreliable_unordered_transmission_channel.h +++ b/NetworkLibrary/src/transmission_channels/unreliable_unordered_transmission_channel.h @@ -23,15 +23,12 @@ namespace NetLib bool CreateAndSendPacket( Socket& socket, const Address& address, Metrics::MetricsHandler* metrics_handler ) override; - bool AddMessageToSend( std::unique_ptr< Message > message ) override; bool ArePendingMessagesToSend() const override; std::unique_ptr< Message > GetMessageToSend( Metrics::MetricsHandler* metrics_handler ); uint32 GetSizeOfNextUnsentMessage() const; bool AddReceivedMessage( std::unique_ptr< Message > message, Metrics::MetricsHandler* metrics_handler ) override; - bool ArePendingReadyToProcessMessages() const override; - const Message* GetReadyToProcessMessage() override; void ProcessACKs( uint32 acks, uint16 lastAckedMessageSequenceNumber, Metrics::MetricsHandler* metrics_handler ) override; @@ -45,6 +42,6 @@ namespace NetLib /// /// The header of the message to check. /// True if it is suitable, False otherwise. - bool IsMessageSuitable( const MessageHeader& header ) const; + bool IsMessageSuitable( const MessageHeader& header ) const override; }; } // namespace NetLib diff --git a/TestDemoGame/Makefile b/TestDemoGame/Makefile deleted file mode 100644 index b17a5a5..0000000 --- a/TestDemoGame/Makefile +++ /dev/null @@ -1,156 +0,0 @@ -# Alternative GNU Make project makefile autogenerated by Premake - -ifndef config - config=debug -endif - -ifndef verbose - SILENT = @ -endif - -.PHONY: clean prebuild - -SHELLTYPE := posix -ifeq (.exe,$(findstring .exe,$(ComSpec))) - SHELLTYPE := msdos -endif - -# Configurations -# ############################################# - -RESCOMP = windres -INCLUDES += -Isrc -I../Common/src -I../Engine/src -I../NetworkLibrary/src -I../DemoGame/src -I../vendor/entt/include -I../vendor/json/include -I../vendor/sdl2/SDL2-2.30.1/include -I../vendor/sdl2/SDL2_image-2.8.2/include -I../vendor/sdl2/SDL2_mixer-2.8.0/include -I../vendor/sdl2/SDL2_ttf-2.22.0/include -I../vendor/googletest/googletest/include -I../vendor/googletest/googletest -FORCE_INCLUDE += -ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) -ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) -LINKCMD = $(CXX) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) -define PREBUILDCMDS -endef -define PRELINKCMDS -endef -define POSTBUILDCMDS -endef - -ifeq ($(config),debug) -TARGETDIR = bin -TARGET = $(TARGETDIR)/TestDemoGame_Debug -OBJDIR = obj/Debug -DEFINES += -D_HAS_EXCEPTIONS=0 -DDEBUG -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g -std=c++17 -LIBS += -lClientGame_Debug -lServerGame_Debug -lCommon_Debug -lEngine_Debug -lNetworkLibrary_Debug -lSDL2 -lSDL2main -lSDL2_image -lSDL2_mixer -lSDL2_ttf -LDDEPS += ../DemoGame/bin/libClientGame_Debug.a ../DemoGame/bin/libServerGame_Debug.a ../Common/bin/libCommon_Debug.a ../Engine/bin/libEngine_Debug.a ../NetworkLibrary/bin/libNetworkLibrary_Debug.a -ALL_LDFLAGS += $(LDFLAGS) -L../vendor/sdl2/SDL2-2.30.1/lib/x64 -L../vendor/sdl2/SDL2_image-2.8.2/lib/x64 -L../vendor/sdl2/SDL2_mixer-2.8.0/lib/x64 -L../vendor/sdl2/SDL2_ttf-2.22.0/lib/x64 -L../DemoGame/bin -L../Common/bin -L../Engine/bin -L../NetworkLibrary/bin -L/usr/lib64 -m64 - -else ifeq ($(config),release) -TARGETDIR = bin -TARGET = $(TARGETDIR)/TestDemoGame_Release -OBJDIR = obj/Release -DEFINES += -D_HAS_EXCEPTIONS=0 -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 -std=c++17 -LIBS += -lClientGame_Release -lServerGame_Release -lCommon_Release -lEngine_Release -lNetworkLibrary_Release -lSDL2 -lSDL2main -lSDL2_image -lSDL2_mixer -lSDL2_ttf -LDDEPS += ../DemoGame/bin/libClientGame_Release.a ../DemoGame/bin/libServerGame_Release.a ../Common/bin/libCommon_Release.a ../Engine/bin/libEngine_Release.a ../NetworkLibrary/bin/libNetworkLibrary_Release.a -ALL_LDFLAGS += $(LDFLAGS) -L../vendor/sdl2/SDL2-2.30.1/lib/x64 -L../vendor/sdl2/SDL2_image-2.8.2/lib/x64 -L../vendor/sdl2/SDL2_mixer-2.8.0/lib/x64 -L../vendor/sdl2/SDL2_ttf-2.22.0/lib/x64 -L../DemoGame/bin -L../Common/bin -L../Engine/bin -L../NetworkLibrary/bin -L/usr/lib64 -m64 -s - -endif - -# Per File Configurations -# ############################################# - -PERFILE_FLAGS_0 = $(ALL_CXXFLAGS) -Werror - -# File sets -# ############################################# - -GENERATED := -OBJECTS := - -GENERATED += $(OBJDIR)/gtest-all.o -GENERATED += $(OBJDIR)/main.o -GENERATED += $(OBJDIR)/player_state_serialization_tests.o -GENERATED += $(OBJDIR)/raycast_tests.o -OBJECTS += $(OBJDIR)/gtest-all.o -OBJECTS += $(OBJDIR)/main.o -OBJECTS += $(OBJDIR)/player_state_serialization_tests.o -OBJECTS += $(OBJDIR)/raycast_tests.o - -# Rules -# ############################################# - -all: $(TARGET) - @: - -$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking TestDemoGame - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) - -$(TARGETDIR): - @echo Creating $(TARGETDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) -else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) -endif - -$(OBJDIR): - @echo Creating $(OBJDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) -else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) -endif - -clean: - @echo Cleaning TestDemoGame -ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) -else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) -endif - -prebuild: | $(OBJDIR) - $(PREBUILDCMDS) - -ifneq (,$(PCH)) -$(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) -$(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" -$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" -else - $(SILENT) echo $null >> "$@" -endif -else -$(OBJECTS): | prebuild -endif - - -# File Rules -# ############################################# - -$(OBJDIR)/gtest-all.o: ../vendor/googletest/googletest/src/gtest-all.cc - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/main.o: src/main.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/player_state_serialization_tests.o: src/player_state_serialization_tests.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/raycast_tests.o: src/raycast_tests.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" - --include $(OBJECTS:%.o=%.d) -ifneq (,$(PCH)) - -include $(PCH_PLACEHOLDER).d -endif \ No newline at end of file diff --git a/test_common/Makefile b/test_common/Makefile deleted file mode 100644 index 6f39495..0000000 --- a/test_common/Makefile +++ /dev/null @@ -1,156 +0,0 @@ -# Alternative GNU Make project makefile autogenerated by Premake - -ifndef config - config=debug -endif - -ifndef verbose - SILENT = @ -endif - -.PHONY: clean prebuild - -SHELLTYPE := posix -ifeq (.exe,$(findstring .exe,$(ComSpec))) - SHELLTYPE := msdos -endif - -# Configurations -# ############################################# - -RESCOMP = windres -INCLUDES += -Isrc -I../Common/src -I../vendor/googletest/googletest/include -I../vendor/googletest/googletest -FORCE_INCLUDE += -ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) -ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) -LINKCMD = $(CXX) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) -define PREBUILDCMDS -endef -define PRELINKCMDS -endef -define POSTBUILDCMDS -endef - -ifeq ($(config),debug) -TARGETDIR = bin -TARGET = $(TARGETDIR)/TestCommon_Debug -OBJDIR = obj/Debug -DEFINES += -D_HAS_EXCEPTIONS=0 -DDEBUG -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g -std=c++17 -LIBS += -lCommon_Debug -LDDEPS += ../Common/bin/libCommon_Debug.a -ALL_LDFLAGS += $(LDFLAGS) -L../Common/bin -L/usr/lib64 -m64 - -else ifeq ($(config),release) -TARGETDIR = bin -TARGET = $(TARGETDIR)/TestCommon_Release -OBJDIR = obj/Release -DEFINES += -D_HAS_EXCEPTIONS=0 -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 -std=c++17 -LIBS += -lCommon_Release -LDDEPS += ../Common/bin/libCommon_Release.a -ALL_LDFLAGS += $(LDFLAGS) -L../Common/bin -L/usr/lib64 -m64 -s - -endif - -# Per File Configurations -# ############################################# - -PERFILE_FLAGS_0 = $(ALL_CXXFLAGS) -Werror - -# File sets -# ############################################# - -GENERATED := -OBJECTS := - -GENERATED += $(OBJDIR)/delegate_tests.o -GENERATED += $(OBJDIR)/gtest-all.o -GENERATED += $(OBJDIR)/main.o -GENERATED += $(OBJDIR)/push_only_ring_vector_tests.o -OBJECTS += $(OBJDIR)/delegate_tests.o -OBJECTS += $(OBJDIR)/gtest-all.o -OBJECTS += $(OBJDIR)/main.o -OBJECTS += $(OBJDIR)/push_only_ring_vector_tests.o - -# Rules -# ############################################# - -all: $(TARGET) - @: - -$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking TestCommon - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) - -$(TARGETDIR): - @echo Creating $(TARGETDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) -else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) -endif - -$(OBJDIR): - @echo Creating $(OBJDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) -else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) -endif - -clean: - @echo Cleaning TestCommon -ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) -else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) -endif - -prebuild: | $(OBJDIR) - $(PREBUILDCMDS) - -ifneq (,$(PCH)) -$(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) -$(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" -$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" -else - $(SILENT) echo $null >> "$@" -endif -else -$(OBJECTS): | prebuild -endif - - -# File Rules -# ############################################# - -$(OBJDIR)/gtest-all.o: ../vendor/googletest/googletest/src/gtest-all.cc - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/delegate_tests.o: src/delegate_tests.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/main.o: src/main.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/push_only_ring_vector_tests.o: src/push_only_ring_vector_tests.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" - --include $(OBJECTS:%.o=%.d) -ifneq (,$(PCH)) - -include $(PCH_PLACEHOLDER).d -endif \ No newline at end of file diff --git a/test_engine/Makefile b/test_engine/Makefile deleted file mode 100644 index 3e0ebd1..0000000 --- a/test_engine/Makefile +++ /dev/null @@ -1,151 +0,0 @@ -# Alternative GNU Make project makefile autogenerated by Premake - -ifndef config - config=debug -endif - -ifndef verbose - SILENT = @ -endif - -.PHONY: clean prebuild - -SHELLTYPE := posix -ifeq (.exe,$(findstring .exe,$(ComSpec))) - SHELLTYPE := msdos -endif - -# Configurations -# ############################################# - -RESCOMP = windres -INCLUDES += -Isrc -I../Common/src -I../Engine/src -I../vendor/googletest/googletest/include -I../vendor/googletest/googletest -I../vendor/entt/include -FORCE_INCLUDE += -ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES) -ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) -LINKCMD = $(CXX) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) -define PREBUILDCMDS -endef -define PRELINKCMDS -endef -define POSTBUILDCMDS -endef - -ifeq ($(config),debug) -TARGETDIR = bin -TARGET = $(TARGETDIR)/TestEngine_Debug -OBJDIR = obj/Debug -DEFINES += -D_HAS_EXCEPTIONS=0 -DDEBUG -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -g -std=c++17 -LIBS += -lCommon_Debug -lEngine_Debug -LDDEPS += ../Common/bin/libCommon_Debug.a ../Engine/bin/libEngine_Debug.a -ALL_LDFLAGS += $(LDFLAGS) -L../Common/bin -L../Engine/bin -L/usr/lib64 -m64 - -else ifeq ($(config),release) -TARGETDIR = bin -TARGET = $(TARGETDIR)/TestEngine_Release -OBJDIR = obj/Release -DEFINES += -D_HAS_EXCEPTIONS=0 -ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 -ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -Wundef -O2 -std=c++17 -LIBS += -lCommon_Release -lEngine_Release -LDDEPS += ../Common/bin/libCommon_Release.a ../Engine/bin/libEngine_Release.a -ALL_LDFLAGS += $(LDFLAGS) -L../Common/bin -L../Engine/bin -L/usr/lib64 -m64 -s - -endif - -# Per File Configurations -# ############################################# - -PERFILE_FLAGS_0 = $(ALL_CXXFLAGS) -Werror - -# File sets -# ############################################# - -GENERATED := -OBJECTS := - -GENERATED += $(OBJDIR)/gtest-all.o -GENERATED += $(OBJDIR)/main.o -GENERATED += $(OBJDIR)/transform_tests.o -OBJECTS += $(OBJDIR)/gtest-all.o -OBJECTS += $(OBJDIR)/main.o -OBJECTS += $(OBJDIR)/transform_tests.o - -# Rules -# ############################################# - -all: $(TARGET) - @: - -$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR) - $(PRELINKCMDS) - @echo Linking TestEngine - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) - -$(TARGETDIR): - @echo Creating $(TARGETDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) -else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) -endif - -$(OBJDIR): - @echo Creating $(OBJDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) -else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) -endif - -clean: - @echo Cleaning TestEngine -ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(GENERATED) - $(SILENT) rm -rf $(OBJDIR) -else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) -endif - -prebuild: | $(OBJDIR) - $(PREBUILDCMDS) - -ifneq (,$(PCH)) -$(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER) -$(GCH): $(PCH) | prebuild - @echo $(notdir $<) - $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" -$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) touch "$@" -else - $(SILENT) echo $null >> "$@" -endif -else -$(OBJECTS): | prebuild -endif - - -# File Rules -# ############################################# - -$(OBJDIR)/gtest-all.o: ../vendor/googletest/googletest/src/gtest-all.cc - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/main.o: src/main.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" -$(OBJDIR)/transform_tests.o: src/transform_tests.cpp - @echo "$(notdir $<)" - $(SILENT) $(CXX) $(PERFILE_FLAGS_0) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" - --include $(OBJECTS:%.o=%.d) -ifneq (,$(PCH)) - -include $(PCH_PLACEHOLDER).d -endif \ No newline at end of file From a0a2992cc91301c6acb5c3d1e079722be1f296f2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 16 Nov 2025 16:45:18 +0000 Subject: [PATCH 4/5] Refactor bandwidth metrics to eliminate duplication Create BandwidthMetric base class to consolidate duplicate code from: - UploadBandwidthMetric (86 lines -> 12 lines) - DownloadBandwidthMetric (86 lines -> 12 lines) The two metrics were identical except for the metric name. This refactoring: - Eliminates ~150 lines of duplicated code - Makes it easier to add new bandwidth metrics in the future - Improves maintainability by keeping common logic in one place Co-authored-by: DanielJimenezMorales <64079694+DanielJimenezMorales@users.noreply.github.com> --- .../src/metrics/bandwidth_metric.cpp | 79 +++++++++++++++++++ NetworkLibrary/src/metrics/bandwidth_metric.h | 32 ++++++++ .../src/metrics/download_bandwidth_metric.cpp | 72 ----------------- .../src/metrics/download_bandwidth_metric.h | 19 +---- .../src/metrics/upload_bandwidth_metric.cpp | 72 ----------------- .../src/metrics/upload_bandwidth_metric.h | 19 +---- 6 files changed, 115 insertions(+), 178 deletions(-) create mode 100644 NetworkLibrary/src/metrics/bandwidth_metric.cpp create mode 100644 NetworkLibrary/src/metrics/bandwidth_metric.h diff --git a/NetworkLibrary/src/metrics/bandwidth_metric.cpp b/NetworkLibrary/src/metrics/bandwidth_metric.cpp new file mode 100644 index 0000000..ce94613 --- /dev/null +++ b/NetworkLibrary/src/metrics/bandwidth_metric.cpp @@ -0,0 +1,79 @@ +#include "bandwidth_metric.h" + +#include "logger.h" + +namespace NetLib +{ + namespace Metrics + { + BandwidthMetric::BandwidthMetric() + : _updateRate( 1.0f ) + , _timeUntilNextUpdate( 1.0f ) + , _inProgressValue( 0 ) + , _currentValue( 0 ) + , _maxValue( 0 ) + { + } + + uint32 BandwidthMetric::GetValue( const std::string& value_type ) const + { + uint32 result = 0; + + if ( value_type == "MAX" ) + { + result = _maxValue; + } + else if ( value_type == "CURRENT" ) + { + result = _currentValue; + } + else + { + LOG_WARNING( "Unknown value type '%s' for BandwidthMetric", value_type.c_str() ); + } + + return result; + } + + void BandwidthMetric::SetUpdateRate( float32 update_rate ) + { + _updateRate = update_rate; + _timeUntilNextUpdate = _updateRate; + } + + void BandwidthMetric::Update( float32 elapsed_time ) + { + if ( _timeUntilNextUpdate <= elapsed_time ) + { + // Update current + _currentValue = _inProgressValue; + _inProgressValue = 0; + + // Update max + if ( _currentValue > _maxValue ) + { + _maxValue = _currentValue; + } + + _timeUntilNextUpdate = _updateRate; + } + else + { + _timeUntilNextUpdate -= elapsed_time; + } + } + + void BandwidthMetric::AddValueSample( uint32 value, const std::string& sample_type ) + { + _inProgressValue += value; + } + + void BandwidthMetric::Reset() + { + _inProgressValue = 0; + _currentValue = 0; + _maxValue = 0; + _timeUntilNextUpdate = _updateRate; + } + } // namespace Metrics +} // namespace NetLib diff --git a/NetworkLibrary/src/metrics/bandwidth_metric.h b/NetworkLibrary/src/metrics/bandwidth_metric.h new file mode 100644 index 0000000..c9b732c --- /dev/null +++ b/NetworkLibrary/src/metrics/bandwidth_metric.h @@ -0,0 +1,32 @@ +#pragma once +#include "metrics/i_metric.h" + +namespace NetLib +{ + namespace Metrics + { + /// + /// Base class for bandwidth metrics (upload and download). + /// Tracks current bandwidth usage and maximum bandwidth over time. + /// + class BandwidthMetric : public IMetric + { + public: + BandwidthMetric(); + + uint32 GetValue( const std::string& value_type ) const override; + void SetUpdateRate( float32 update_rate ) override; + void Update( float32 elapsed_time ) override; + void AddValueSample( uint32 value, const std::string& sample_type = "NONE" ) override; + void Reset() override; + + protected: + float32 _timeUntilNextUpdate; + float32 _updateRate; + + uint32 _inProgressValue; + uint32 _currentValue; + uint32 _maxValue; + }; + } +} diff --git a/NetworkLibrary/src/metrics/download_bandwidth_metric.cpp b/NetworkLibrary/src/metrics/download_bandwidth_metric.cpp index c581345..e3ee2c5 100644 --- a/NetworkLibrary/src/metrics/download_bandwidth_metric.cpp +++ b/NetworkLibrary/src/metrics/download_bandwidth_metric.cpp @@ -1,86 +1,14 @@ #include "download_bandwidth_metric.h" -#include "logger.h" - #include "metrics/metric_names.h" namespace NetLib { namespace Metrics { - DownloadBandwidthMetric::DownloadBandwidthMetric() - : _updateRate( 1.0f ) - , _timeUntilNextUpdate( 1.0f ) - , _inProgressValue( 0 ) - , _currentValue( 0 ) - , _maxValue( 0 ) - { - } - void DownloadBandwidthMetric::GetName( std::string& out_name_buffer ) const { out_name_buffer.assign( DOWNLOAD_BANDWIDTH_METRIC ); } - - uint32 DownloadBandwidthMetric::GetValue( const std::string& value_type ) const - { - uint32 result = 0; - - if ( value_type == "MAX" ) - { - result = _maxValue; - } - else if ( value_type == "CURRENT" ) - { - result = _currentValue; - } - else - { - LOG_WARNING( "Unknown value type '%s' for UploadBandwidthMetric", value_type.c_str() ); - } - - return result; - } - - void DownloadBandwidthMetric::SetUpdateRate( float32 update_rate ) - { - _updateRate = update_rate; - _timeUntilNextUpdate = _updateRate; - } - - void DownloadBandwidthMetric::Update( float32 elapsed_time ) - { - if ( _timeUntilNextUpdate <= elapsed_time ) - { - // Update current - _currentValue = _inProgressValue; - _inProgressValue = 0; - - // Update max - if ( _currentValue > _maxValue ) - { - _maxValue = _currentValue; - } - - _timeUntilNextUpdate = _updateRate; - } - else - { - _timeUntilNextUpdate -= elapsed_time; - } - } - - void DownloadBandwidthMetric::AddValueSample( uint32 value, const std::string& sample_type ) - { - _inProgressValue += value; - } - - void DownloadBandwidthMetric::Reset() - { - _inProgressValue = 0; - _currentValue = 0; - _maxValue = 0; - _timeUntilNextUpdate = _updateRate; - } } // namespace Metrics } // namespace NetLib diff --git a/NetworkLibrary/src/metrics/download_bandwidth_metric.h b/NetworkLibrary/src/metrics/download_bandwidth_metric.h index 24820ca..0049f0f 100644 --- a/NetworkLibrary/src/metrics/download_bandwidth_metric.h +++ b/NetworkLibrary/src/metrics/download_bandwidth_metric.h @@ -1,29 +1,14 @@ #pragma once -#include "metrics/i_metric.h" +#include "metrics/bandwidth_metric.h" namespace NetLib { namespace Metrics { - class DownloadBandwidthMetric : public IMetric + class DownloadBandwidthMetric : public BandwidthMetric { public: - DownloadBandwidthMetric(); - void GetName( std::string& out_name_buffer ) const override; - uint32 GetValue( const std::string& value_type ) const override; - void SetUpdateRate( float32 update_rate ) override; - void Update( float32 elapsed_time ) override; - void AddValueSample( uint32 value, const std::string& sample_type = "NONE" ) override; - void Reset() override; - - private: - float32 _timeUntilNextUpdate; - float32 _updateRate; - - uint32 _inProgressValue; - uint32 _currentValue; - uint32 _maxValue; }; } } diff --git a/NetworkLibrary/src/metrics/upload_bandwidth_metric.cpp b/NetworkLibrary/src/metrics/upload_bandwidth_metric.cpp index 65b9289..a4cb1e0 100644 --- a/NetworkLibrary/src/metrics/upload_bandwidth_metric.cpp +++ b/NetworkLibrary/src/metrics/upload_bandwidth_metric.cpp @@ -1,86 +1,14 @@ #include "upload_bandwidth_metric.h" -#include "logger.h" - #include "metrics/metric_names.h" namespace NetLib { namespace Metrics { - UploadBandwidthMetric::UploadBandwidthMetric() - : _updateRate( 1.0f ) - , _timeUntilNextUpdate( 1.0f ) - , _inProgressValue( 0 ) - , _currentValue( 0 ) - , _maxValue( 0 ) - { - } - void UploadBandwidthMetric::GetName( std::string& out_name_buffer ) const { out_name_buffer.assign( UPLOAD_BANDWIDTH_METRIC ); } - - uint32 UploadBandwidthMetric::GetValue( const std::string& value_type ) const - { - uint32 result = 0; - - if ( value_type == "MAX" ) - { - result = _maxValue; - } - else if ( value_type == "CURRENT" ) - { - result = _currentValue; - } - else - { - LOG_WARNING( "Unknown value type '%s' for UploadBandwidthMetric", value_type.c_str() ); - } - - return result; - } - - void UploadBandwidthMetric::SetUpdateRate( float32 update_rate ) - { - _updateRate = update_rate; - _timeUntilNextUpdate = _updateRate; - } - - void UploadBandwidthMetric::Update( float32 elapsed_time ) - { - if ( _timeUntilNextUpdate <= elapsed_time ) - { - // Update current - _currentValue = _inProgressValue; - _inProgressValue = 0; - - // Update max - if ( _currentValue > _maxValue ) - { - _maxValue = _currentValue; - } - - _timeUntilNextUpdate = _updateRate; - } - else - { - _timeUntilNextUpdate -= elapsed_time; - } - } - - void UploadBandwidthMetric::AddValueSample( uint32 value, const std::string& sample_type ) - { - _inProgressValue += value; - } - - void UploadBandwidthMetric::Reset() - { - _inProgressValue = 0; - _currentValue = 0; - _maxValue = 0; - _timeUntilNextUpdate = _updateRate; - } } // namespace Metrics } // namespace NetLib diff --git a/NetworkLibrary/src/metrics/upload_bandwidth_metric.h b/NetworkLibrary/src/metrics/upload_bandwidth_metric.h index c0e9d90..df3a35d 100644 --- a/NetworkLibrary/src/metrics/upload_bandwidth_metric.h +++ b/NetworkLibrary/src/metrics/upload_bandwidth_metric.h @@ -1,29 +1,14 @@ #pragma once -#include "metrics/i_metric.h" +#include "metrics/bandwidth_metric.h" namespace NetLib { namespace Metrics { - class UploadBandwidthMetric : public IMetric + class UploadBandwidthMetric : public BandwidthMetric { public: - UploadBandwidthMetric(); - void GetName( std::string& out_name_buffer ) const override; - uint32 GetValue( const std::string& value_type ) const override; - void SetUpdateRate( float32 update_rate ) override; - void Update( float32 elapsed_time ) override; - void AddValueSample( uint32 value, const std::string& sample_type = "NONE" ) override; - void Reset() override; - - private: - float32 _timeUntilNextUpdate; - float32 _updateRate; - - uint32 _inProgressValue; - uint32 _currentValue; - uint32 _maxValue; }; } } From f3232e7f4ad1d503b574807e3cce5483b328017d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 16 Nov 2025 16:47:02 +0000 Subject: [PATCH 5/5] Update progress - refactoring complete Co-authored-by: DanielJimenezMorales <64079694+DanielJimenezMorales@users.noreply.github.com> --- _codeql_detected_source_root | 1 + 1 file changed, 1 insertion(+) create mode 120000 _codeql_detected_source_root diff --git a/_codeql_detected_source_root b/_codeql_detected_source_root new file mode 120000 index 0000000..945c9b4 --- /dev/null +++ b/_codeql_detected_source_root @@ -0,0 +1 @@ +. \ No newline at end of file