-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
212 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "deps/geecore"] | ||
path = deps/geecore | ||
url = https://github.com/WopsS/GEEcore.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
option(FMT_INSTALL "" OFF) | ||
|
||
# The rest is included by GEEcore. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
option(GEECORE_INSTALL "" OFF) | ||
|
||
add_subdirectory(deps/geecore) | ||
|
||
set_target_properties(fmt PROPERTIES FOLDER "Dependencies") | ||
set_target_properties(GEEcore PROPERTIES FOLDER "Dependencies") | ||
|
||
mark_as_advanced( | ||
GEECORE_INSTALL | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
option(KANGARU_EXPORT "" OFF) | ||
option(KANGARU_INSTALL "" OFF) | ||
|
||
# The rest is included by GEEcore. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include "AppMetadata.hpp" | ||
|
||
#include <utility> | ||
|
||
#include <Windows.h> | ||
#include <wil/win32_helpers.h> | ||
|
||
red3ext::AppMetadata::AppMetadata(const geecore::IHostImage& host_image) | ||
: m_root_directory(compute_root_directory(host_image)) | ||
{ | ||
} | ||
|
||
const std::wstring_view red3ext::AppMetadata::name() const | ||
{ | ||
return L"RED3ext Loader"; | ||
} | ||
|
||
const std::filesystem::path& red3ext::AppMetadata::root_directory() const noexcept | ||
{ | ||
return m_root_directory; | ||
} | ||
|
||
std::filesystem::path red3ext::AppMetadata::module_path() const | ||
{ | ||
return root_directory() / MODULE_NAME; | ||
} | ||
|
||
std::filesystem::path red3ext::AppMetadata::compute_root_directory(const geecore::IHostImage& host_image) | ||
{ | ||
auto game_root = host_image.directory() | ||
.parent_path() // Resolve to "bin" directory. | ||
.parent_path(); // Resolve to game's root directory. | ||
|
||
return game_root / APPLICATION_DIRECTORY; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#pragma once | ||
|
||
#include <filesystem> | ||
#include <string_view> | ||
|
||
#include <kangaru/kangaru.hpp> | ||
|
||
#include <geecore/IHostImage.hpp> | ||
#include <geecore/ILoaderAppMetadata.hpp> | ||
#include <geecore/SpecialMemberFunctions.hpp> | ||
|
||
namespace red3ext | ||
{ | ||
class AppMetadata : public geecore::ILoaderAppMetadata | ||
{ | ||
public: | ||
AppMetadata(const geecore::IHostImage& host_image); | ||
~AppMetadata() final = default; | ||
|
||
GEECORE_NOEXCEPT_COPYABLE_AND_MOVEABLE(AppMetadata); | ||
|
||
const std::wstring_view name() const final; | ||
const std::filesystem::path& root_directory() const noexcept final; | ||
|
||
std::filesystem::path module_path() const final; | ||
|
||
private: | ||
static constexpr std::wstring_view APPLICATION_DIRECTORY = L"red3ext"; | ||
static constexpr std::wstring_view MODULE_NAME = L"RED3ext.dll"; | ||
|
||
static std::filesystem::path compute_root_directory(const geecore::IHostImage& host_image); | ||
|
||
std::filesystem::path m_root_directory; | ||
}; | ||
|
||
struct AppMetadataService | ||
: kgr::single_service<AppMetadata, kgr::dependency<geecore::HostImageService>> | ||
, kgr::overrides<geecore::LoaderAppMetadataService> | ||
{ | ||
}; | ||
} // namespace red3ext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
#pragma once | ||
|
||
#include <exception> | ||
#include <filesystem> | ||
#include <string_view> | ||
#include <utility> | ||
|
||
#include <Windows.h> | ||
|
||
#include <kangaru/kangaru.hpp> | ||
|
||
#include <wil/win32_helpers.h> |