Skip to content

Commit

Permalink
Moved Platform to Library
Browse files Browse the repository at this point in the history
  • Loading branch information
captainurist committed Nov 2, 2023
1 parent 0792926 commit fd07a20
Show file tree
Hide file tree
Showing 121 changed files with 277 additions and 205 deletions.
3 changes: 2 additions & 1 deletion src/Application/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@ target_link_libraries(application
library_config
library_lod
media
platform
library_platform_null
library_platform_implementation
utility)
2 changes: 1 addition & 1 deletion src/Application/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
#include "Media/Audio/AudioPlayer.h"
#include "Media/MediaPlayer.h"

#include "Library/Application/PlatformApplication.h"
#include "Library/Platform/Application/PlatformApplication.h"
#include "Library/Random/Random.h"
#include "Library/Logger/Logger.h"

Expand Down
2 changes: 1 addition & 1 deletion src/Application/GameKeyboardController.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "GameKeyboardController.h"

#include "Platform/PlatformEvents.h"
#include "Library/Platform/Interface/PlatformEvents.h"

GameKeyboardController::GameKeyboardController() : PlatformEventFilter({EVENT_KEY_PRESS, EVENT_KEY_RELEASE}) {}

Expand Down
2 changes: 1 addition & 1 deletion src/Application/GameKeyboardController.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "Utility/IndexedArray.h"

#include "Platform/Filters/PlatformEventFilter.h"
#include "Library/Platform/Filters/PlatformEventFilter.h"

#include "Io/IKeyboardController.h"

Expand Down
2 changes: 1 addition & 1 deletion src/Application/GameMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "Engine/Time.h"
#include "Engine/EngineIocContainer.h"

#include "Platform/PlatformEnums.h"
#include "Library/Platform/Interface/PlatformEnums.h"
#include "Io/InputAction.h"
#include "Io/KeyboardInputHandler.h"
#include "Io/Mouse.h"
Expand Down
2 changes: 1 addition & 1 deletion src/Application/GamePathResolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "Application/GamePathResolver.h"

#include "Library/Logger/Logger.h"
#include "Platform/Platform.h"
#include "Library/Platform/Interface/Platform.h"

static std::string _resolvePath(Platform *platform, const char *envVarOverride, const std::vector<const wchar_t *> &registryKeys);

Expand Down
6 changes: 3 additions & 3 deletions src/Application/GameStarter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
#include "Engine/Engine.h"
#include "Engine/EngineGlobals.h"

#include "Library/Application/PlatformApplication.h"
#include "Library/Platform/Application/PlatformApplication.h"
#include "Library/Logger/Logger.h"
#include "Library/Logger/LogSink.h"
#include "Library/Logger/BufferLogSink.h"

#include "Platform/Platform.h"
#include "Platform/Null/NullPlatform.h"
#include "Library/Platform/Interface/Platform.h"
#include "Library/Platform/Null/NullPlatform.h"

#include "GamePathResolver.h"
#include "GameConfig.h"
Expand Down
2 changes: 1 addition & 1 deletion src/Application/GameTraceHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "Engine/Components/Control/EngineControlComponent.h"
#include "Engine/Components/Trace/EngineTraceRecorder.h"

#include "Library/Application/PlatformApplication.h"
#include "Library/Platform/Application/PlatformApplication.h"
#include "Library/Logger/Logger.h"

GameTraceHandler::GameTraceHandler() : PlatformEventFilter({EVENT_KEY_PRESS, EVENT_KEY_RELEASE}) {}
Expand Down
4 changes: 2 additions & 2 deletions src/Application/GameTraceHandler.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "Platform/Filters/PlatformEventFilter.h"
#include "Library/Application/PlatformApplicationAware.h"
#include "Library/Platform/Filters/PlatformEventFilter.h"
#include "Library/Platform/Application/PlatformApplicationAware.h"

// TODO(captainurist): tbh we just need a hotkey system instead of this monstrosity.
/**
Expand Down
4 changes: 2 additions & 2 deletions src/Application/GameWindowHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
#include "Media/MediaPlayer.h"

#include "Library/Logger/Logger.h"
#include "Library/Application/PlatformApplication.h"
#include "Library/Platform/Application/PlatformApplication.h"

#include "Platform/PlatformGamepad.h"
#include "Library/Platform/Interface/PlatformGamepad.h"

using Io::InputAction;

Expand Down
6 changes: 3 additions & 3 deletions src/Application/GameWindowHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#include <memory>
#include <tuple>

#include "Platform/PlatformEnums.h"
#include "Platform/Filters/PlatformEventFilter.h"
#include "Library/Application/PlatformApplicationAware.h"
#include "Library/Platform/Interface/PlatformEnums.h"
#include "Library/Platform/Filters/PlatformEventFilter.h"
#include "Library/Platform/Application/PlatformApplicationAware.h"
#include "Utility/Geometry/Size.h"

namespace Io {
Expand Down
2 changes: 1 addition & 1 deletion src/Arcomage/Arcomage.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "Utility/Geometry/Point.h"
#include "Utility/Geometry/Rect.h"

#include "Platform/PlatformEnums.h"
#include "Library/Platform/Interface/PlatformEnums.h"

class GraphicsImage;

Expand Down
2 changes: 1 addition & 1 deletion src/Bin/CodeGen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ set(BIN_CODEGEN_HEADERS

if(NOT BUILD_PLATFORM STREQUAL "android")
add_executable(CodeGen ${BIN_CODEGEN_SOURCES} ${BIN_CODEGEN_HEADERS})
target_link_libraries(CodeGen PUBLIC platform_main application library_cli)
target_link_libraries(CodeGen PUBLIC application library_cli library_platform_main)
target_check_style(CodeGen)
endif()
4 changes: 2 additions & 2 deletions src/Bin/OpenEnroth/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ if(BUILD_PLATFORM STREQUAL "android")
add_library(main SHARED)
target_sources(main PUBLIC ${BIN_OPENENROTH_HEADERS} ${BIN_OPENENROTH_SOURCES})
target_check_style(main)
target_link_libraries(main PUBLIC platform_main application library_cli)
target_link_libraries(main PUBLIC application library_cli library_platform_main)
target_link_options(main PRIVATE "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libmain.map")
else()
add_executable(OpenEnroth MACOSX_BUNDLE)
target_sources(OpenEnroth PUBLIC ${BIN_OPENENROTH_HEADERS} ${BIN_OPENENROTH_SOURCES})
target_check_style(OpenEnroth)
target_link_libraries(OpenEnroth PUBLIC platform_main application library_cli)
target_link_libraries(OpenEnroth PUBLIC application library_cli library_platform_main)

set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT OpenEnroth)
endif()
2 changes: 1 addition & 1 deletion src/Bin/OpenEnroth/OpenEnroth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "Engine/Engine.h"
#include "Engine/EngineGlobals.h"

#include "Library/Application/PlatformApplication.h"
#include "Library/Platform/Application/PlatformApplication.h"
#include "Library/Trace/EventTrace.h"

#include "Utility/Format.h"
Expand Down
1 change: 0 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ add_subdirectory(GUI)
add_subdirectory(Io)
add_subdirectory(Library)
add_subdirectory(Media)
add_subdirectory(Platform)
add_subdirectory(Utility)
8 changes: 7 additions & 1 deletion src/Engine/Components/Control/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@ set(ENGINE_COMPONENTS_CONTROL_HEADERS
add_library(engine_components_control STATIC ${ENGINE_COMPONENTS_CONTROL_SOURCES} ${ENGINE_COMPONENTS_CONTROL_HEADERS})
target_check_style(engine_components_control)

target_link_libraries(engine_components_control PUBLIC engine gui arcomage platform utility library_application)
target_link_libraries(engine_components_control PUBLIC
utility
engine
gui
arcomage
library_platform_interface
library_platform_application)
2 changes: 1 addition & 1 deletion src/Engine/Components/Control/EngineControlComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <utility>

#include "Platform/PlatformEventHandler.h"
#include "Library/Platform/Interface/PlatformEventHandler.h"

#include "EngineController.h"

Expand Down
6 changes: 3 additions & 3 deletions src/Engine/Components/Control/EngineControlComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#include <functional>
#include <memory>

#include "Platform/Proxy/ProxyOpenGLContext.h"
#include "Platform/Proxy/ProxyEventLoop.h"
#include "Library/Application/PlatformApplicationAware.h"
#include "Library/Platform/Proxy/ProxyOpenGLContext.h"
#include "Library/Platform/Proxy/ProxyEventLoop.h"
#include "Library/Platform/Application/PlatformApplicationAware.h"

#include "EngineControlStateHandle.h"

Expand Down
4 changes: 2 additions & 2 deletions src/Engine/Components/Control/EngineController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
#include "Engine/EngineGlobals.h"
#include "Engine/mm7_data.h"

#include "Library/Application/PlatformApplication.h"
#include "Library/Platform/Application/PlatformApplication.h"

#include "Platform/PlatformEvents.h"
#include "Library/Platform/Interface/PlatformEvents.h"

#include "Utility/Exception.h"
#include "Utility/DataPath.h"
Expand Down
4 changes: 2 additions & 2 deletions src/Engine/Components/Control/EngineController.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#include <string>
#include <memory>

#include "Platform/PlatformEnums.h"
#include "Platform/PlatformEvents.h"
#include "Library/Platform/Interface/PlatformEnums.h"
#include "Library/Platform/Interface/PlatformEvents.h"

#include "EngineControlStateHandle.h"

Expand Down
2 changes: 1 addition & 1 deletion src/Engine/Components/Deterministic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ set(ENGINE_COMPONENTS_DETERMINISTIC_HEADERS
add_library(engine_components_deterministic STATIC ${ENGINE_COMPONENTS_DETERMINISTIC_SOURCES} ${ENGINE_COMPONENTS_DETERMINISTIC_HEADERS})
target_check_style(engine_components_deterministic)

target_link_libraries(engine_components_deterministic PUBLIC platform library_random)
target_link_libraries(engine_components_deterministic PUBLIC library_platform_interface library_random)
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

#include <memory>

#include "Platform/Proxy/ProxyPlatform.h"
#include "Platform/Proxy/ProxyOpenGLContext.h"
#include "Library/Platform/Proxy/ProxyPlatform.h"
#include "Library/Platform/Proxy/ProxyOpenGLContext.h"
#include "Library/Random/RandomEngineEnums.h"
#include "Library/Application/PlatformApplicationAware.h"
#include "Library/Platform/Application/PlatformApplicationAware.h"

class RandomEngine;

Expand Down
4 changes: 2 additions & 2 deletions src/Engine/Components/Trace/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ target_link_libraries(engine_components_trace
engine
engine_components_control
engine_components_deterministic
library_application
library_platform_application
library_platform_interface
library_random
library_trace
platform
utility)
2 changes: 1 addition & 1 deletion src/Engine/Components/Trace/EngineTracePlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#include "Library/Trace/PaintEvent.h"
#include "Library/Trace/EventTrace.h"
#include "Library/Application/PlatformApplication.h"
#include "Library/Platform/Application/PlatformApplication.h"
#include "Library/Random/Random.h"

#include "Utility/ScopeGuard.h"
Expand Down
2 changes: 1 addition & 1 deletion src/Engine/Components/Trace/EngineTracePlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <functional>
#include <memory>

#include "Library/Application/PlatformApplicationAware.h"
#include "Library/Platform/Application/PlatformApplicationAware.h"

#include "EngineTraceEnums.h"

Expand Down
2 changes: 1 addition & 1 deletion src/Engine/Components/Trace/EngineTraceRecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "Engine/Components/Control/EngineController.h"
#include "Engine/Components/Deterministic/EngineDeterministicComponent.h"

#include "Library/Application/PlatformApplication.h"
#include "Library/Platform/Application/PlatformApplication.h"
#include "Library/Trace/EventTrace.h"
#include "Library/Logger/Logger.h"
#include "Library/Random/Random.h"
Expand Down
2 changes: 1 addition & 1 deletion src/Engine/Components/Trace/EngineTraceRecorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <memory>
#include <vector>

#include "Library/Application/PlatformApplicationAware.h"
#include "Library/Platform/Application/PlatformApplicationAware.h"

#include "EngineTraceEnums.h"

Expand Down
2 changes: 1 addition & 1 deletion src/Engine/Components/Trace/EngineTraceSimplePlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "Engine/Components/Control/EngineController.h"

#include "Library/Application/PlatformApplication.h"
#include "Library/Platform/Application/PlatformApplication.h"
#include "Library/Trace/PaintEvent.h"
#include "Library/Random/Random.h"

Expand Down
2 changes: 1 addition & 1 deletion src/Engine/Components/Trace/EngineTraceSimplePlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <memory>
#include <functional>

#include "Library/Application/PlatformApplicationAware.h"
#include "Library/Platform/Application/PlatformApplicationAware.h"

#include "EngineTraceEnums.h"

Expand Down
2 changes: 1 addition & 1 deletion src/Engine/Components/Trace/EngineTraceSimpleRecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <utility>
#include <memory>

#include "Library/Application/PlatformApplication.h"
#include "Library/Platform/Application/PlatformApplication.h"
#include "Library/Random/Random.h"
#include "Library/Trace/PaintEvent.h"
#include "Library/Trace/EventTrace.h"
Expand Down
6 changes: 3 additions & 3 deletions src/Engine/Components/Trace/EngineTraceSimpleRecorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#include <memory>
#include <vector>

#include "Platform/Proxy/ProxyOpenGLContext.h"
#include "Platform/Filters/PlatformEventFilter.h"
#include "Library/Platform/Proxy/ProxyOpenGLContext.h"
#include "Library/Platform/Filters/PlatformEventFilter.h"

#include "Library/Application/PlatformApplicationAware.h"
#include "Library/Platform/Application/PlatformApplicationAware.h"

/**
* Component that can be used to record events.
Expand Down
2 changes: 1 addition & 1 deletion src/Engine/EngineGlobals.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "EngineGlobals.h"

#include "Library/Application/PlatformApplication.h"
#include "Library/Platform/Application/PlatformApplication.h"

Platform *platform = nullptr;
PlatformWindow *window = nullptr;
Expand Down
8 changes: 4 additions & 4 deletions src/Engine/EngineGlobals.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#pragma once

#include "Platform/Platform.h"
#include "Platform/PlatformWindow.h"
#include "Platform/PlatformOpenGLContext.h"
#include "Platform/PlatformEventLoop.h"
#include "Library/Platform/Interface/Platform.h"
#include "Library/Platform/Interface/PlatformWindow.h"
#include "Library/Platform/Interface/PlatformOpenGLContext.h"
#include "Library/Platform/Interface/PlatformEventLoop.h"

class PlatformApplication;

Expand Down
2 changes: 1 addition & 1 deletion src/Engine/Graphics/Nuklear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "Engine/Party.h"

#include "GUI/GUIWindow.h"
#include "Platform/PlatformEnums.h"
#include "Library/Platform/Interface/PlatformEnums.h"

#include "Library/Serialization/Serialization.h"
#include "Library/Logger/Logger.h"
Expand Down
2 changes: 1 addition & 1 deletion src/Engine/Graphics/Nuklear.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <memory>

#include "Platform/PlatformEnums.h"
#include "Library/Platform/Interface/PlatformEnums.h"

#include "GUI/GUIEnums.h"

Expand Down
2 changes: 1 addition & 1 deletion src/Engine/Graphics/NuklearEventHandler.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "Platform/Filters/PlatformEventFilter.h"
#include "Library/Platform/Filters/PlatformEventFilter.h"

class NuklearEventHandler : public PlatformEventFilter {
public:
Expand Down
2 changes: 1 addition & 1 deletion src/Engine/Graphics/OpenGL/RenderOpenGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "Arcomage/Arcomage.h"
#include "Engine/AssetsManager.h"

#include "Library/Application/PlatformApplication.h"
#include "Library/Platform/Application/PlatformApplication.h"
#include "Library/Serialization/EnumSerialization.h"
#include "Library/Image/ImageFunctions.h"
#include "Library/Color/Colorf.h"
Expand Down
2 changes: 1 addition & 1 deletion src/Engine/Graphics/RenderNull.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "Engine/EngineGlobals.h"

#include "Library/Application/PlatformApplication.h"
#include "Library/Platform/Application/PlatformApplication.h"

bool RenderNull::Initialize() {
application->initializeOpenGLContext(PlatformOpenGLOptions());
Expand Down
Loading

0 comments on commit fd07a20

Please sign in to comment.