diff --git a/CMakeLists.txt b/CMakeLists.txt index dd8631a..853e076 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,34 +1,44 @@ cmake_minimum_required(VERSION 3.5) -project(gameBase) +project(Engine) -set(CMAKE_BUILD_TYPE Debug) -cmake_policy(SET CMP0015 NEW) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) +set(LIB_NAME Engine) -set(states abstractAppState.cpp) -set(core inputManager.cpp mapping.h stateManager.cpp soundManager.cpp) -set(util solUtil.cpp util.cpp) +set(CORE_SRC + Source/Core/Private/util.cpp) -set(LIB_NAME gameBase) -add_library(${LIB_NAME} ${states} ${core} ${util}) +set(SYSTEMS_SRC + Source/Systems/Private/abstractAppState.cpp + Source/Systems/Private/stateManager.cpp + Source/Systems/Private/soundManager.cpp) -set(GLFW_DIR external/glfw) -set(GLFW_LIB_DIR build/external/glfw/src) -target_include_directories(${LIB_NAME} PUBLIC ${GLFW_DIR}/include/GLFW) -target_link_directories(${LIB_NAME} PUBLIC ${GLFW_LIB_DIR}) +set(PLATFORM_SRC + Source/Platform/Private/inputManager.cpp) -set(LUA_DIR external/lua-cmake) -add_subdirectory(${LUA_DIR}) -target_include_directories(${LIB_NAME} PUBLIC ${LUA_DIR}/external/upstream) +set(SCRIPTING_SRC + Source/Scripting/Private/solUtil.cpp) -set(SOL_DIR external/sol2) -add_subdirectory(${SOL_DIR}) -target_include_directories(${LIB_NAME} PUBLIC ${SOL_DIR}/include) +set(ENGINE_SRC ${CORE_SRC} ${SYSTEMS_SRC} ${PLATFORM_SRC} ${SCRIPTING_SRC}) -set(SFML_DIR external/SFML) -add_subdirectory(${SFML_DIR}) -set(SFML_LIB_DIR build/${SFML_DIR}/src) -target_include_directories(${LIB_NAME} PUBLIC ${SFML_DIR}/include) -target_link_directories(${LIB_NAME} PUBLIC ${SFML_LIB_DIR}) +add_library(${LIB_NAME} ${ENGINE_SRC}) -target_link_libraries(${LIB_NAME} sfml-system sfml-audio glfw lua::lib) +target_include_directories(${LIB_NAME} PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/Source/Core/Public + ${CMAKE_CURRENT_SOURCE_DIR}/Source/Systems/Public + ${CMAKE_CURRENT_SOURCE_DIR}/Source/Platform/Public + ${CMAKE_CURRENT_SOURCE_DIR}/Source/Scripting/Public) + +set(THIRDPARTY_DIR ${CMAKE_SOURCE_DIR}/ThirdParty) + +target_include_directories(${LIB_NAME} PUBLIC ${THIRDPARTY_DIR}/GLFW/include) +target_link_libraries(${LIB_NAME} PUBLIC glfw) + +target_include_directories(${LIB_NAME} PUBLIC + ${THIRDPARTY_DIR}/Lua/upstream) +target_link_libraries(${LIB_NAME} PUBLIC lua::lib) + +target_include_directories(${LIB_NAME} PUBLIC + ${THIRDPARTY_DIR}/sol2/include) + +target_include_directories(${LIB_NAME} PUBLIC + ${THIRDPARTY_DIR}/SFML/include) +target_link_libraries(${LIB_NAME} PUBLIC sfml-system sfml-audio) diff --git a/util.cpp b/Source/Core/Private/util.cpp similarity index 99% rename from util.cpp rename to Source/Core/Private/util.cpp index 63425f5..5859dd8 100644 --- a/util.cpp +++ b/Source/Core/Private/util.cpp @@ -1,4 +1,4 @@ -#include +#include #include "util.h" #include "mapping.h" diff --git a/util.h b/Source/Core/Public/util.h similarity index 100% rename from util.h rename to Source/Core/Public/util.h diff --git a/inputManager.cpp b/Source/Platform/Private/inputManager.cpp similarity index 99% rename from inputManager.cpp rename to Source/Platform/Private/inputManager.cpp index 7538142..11cd2b9 100644 --- a/inputManager.cpp +++ b/Source/Platform/Private/inputManager.cpp @@ -2,7 +2,7 @@ #include "stateManager.h" #include "util.h" -#include +#include #include #include diff --git a/inputManager.h b/Source/Platform/Public/inputManager.h similarity index 100% rename from inputManager.h rename to Source/Platform/Public/inputManager.h diff --git a/mapping.h b/Source/Platform/Public/mapping.h old mode 100755 new mode 100644 similarity index 95% rename from mapping.h rename to Source/Platform/Public/mapping.h index b426ac9..d8deba7 --- a/mapping.h +++ b/Source/Platform/Public/mapping.h @@ -1,17 +1,17 @@ -#pragma once -#ifndef KEY_H -#define KEY_H - -namespace gameBase{ - struct Mapping{ - enum BindType{KEYBOARD, MOUSE_KEY, MOUSE_AXIS, JOYSTICK_KEY, JOYSTICK_AXIS}; - enum AuxTriggers{MOUSE_AXIS_LEFT = 310, MOUSE_AXIS_RIGHT = 311, MOUSE_AXIS_UP = 312, MOUSE_AXIS_DOWN = 313}; - - int bind; - BindType type; - int trigger; - bool action, pressed = false; - }; -} - -#endif +#pragma once +#ifndef KEY_H +#define KEY_H + +namespace gameBase{ + struct Mapping{ + enum BindType{KEYBOARD, MOUSE_KEY, MOUSE_AXIS, JOYSTICK_KEY, JOYSTICK_AXIS}; + enum AuxTriggers{MOUSE_AXIS_LEFT = 310, MOUSE_AXIS_RIGHT = 311, MOUSE_AXIS_UP = 312, MOUSE_AXIS_DOWN = 313}; + + int bind; + BindType type; + int trigger; + bool action, pressed = false; + }; +} + +#endif diff --git a/solUtil.cpp b/Source/Scripting/Private/solUtil.cpp similarity index 100% rename from solUtil.cpp rename to Source/Scripting/Private/solUtil.cpp diff --git a/solUtil.h b/Source/Scripting/Public/solUtil.h similarity index 100% rename from solUtil.h rename to Source/Scripting/Public/solUtil.h diff --git a/abstractAppState.cpp b/Source/Systems/Private/abstractAppState.cpp similarity index 100% rename from abstractAppState.cpp rename to Source/Systems/Private/abstractAppState.cpp diff --git a/soundManager.cpp b/Source/Systems/Private/soundManager.cpp similarity index 100% rename from soundManager.cpp rename to Source/Systems/Private/soundManager.cpp diff --git a/stateManager.cpp b/Source/Systems/Private/stateManager.cpp similarity index 100% rename from stateManager.cpp rename to Source/Systems/Private/stateManager.cpp diff --git a/abstractAppState.h b/Source/Systems/Public/abstractAppState.h similarity index 100% rename from abstractAppState.h rename to Source/Systems/Public/abstractAppState.h diff --git a/soundManager.h b/Source/Systems/Public/soundManager.h similarity index 100% rename from soundManager.h rename to Source/Systems/Public/soundManager.h diff --git a/stateManager.h b/Source/Systems/Public/stateManager.h similarity index 100% rename from stateManager.h rename to Source/Systems/Public/stateManager.h diff --git a/external/SFML b/external/SFML deleted file mode 160000 index 3651072..0000000 --- a/external/SFML +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3651072cc0861eb10d67f342d8146b61e3629134 diff --git a/external/glfw b/external/glfw deleted file mode 160000 index 53d86c6..0000000 --- a/external/glfw +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 53d86c64d709ff52886580d338d9b3b2b1f27266 diff --git a/external/lua-cmake b/external/lua-cmake deleted file mode 160000 index ca210c5..0000000 --- a/external/lua-cmake +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ca210c56ae41ff13b20490cca8be5ead47b24196 diff --git a/external/sol2 b/external/sol2 deleted file mode 160000 index c1f95a7..0000000 --- a/external/sol2 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c1f95a773c6f8f4fde8ca3efe872e7286afe4444