forked from OpenEnroth/OpenEnroth
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
7731d38
commit 8a0dcd1
Showing
52 changed files
with
613 additions
and
215 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
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
#include <string> | ||
|
||
class Platform; | ||
class Environment; | ||
|
||
constexpr char mm6PathOverrideKey[] = "OPENENROTH_MM6_PATH"; | ||
constexpr char mm7PathOverrideKey[] = "OPENENROTH_MM7_PATH"; | ||
constexpr char mm8PathOverrideKey[] = "OPENENROTH_MM8_PATH"; | ||
|
||
std::string resolveMm6Path(Platform *platform); | ||
std::string resolveMm7Path(Platform *platform); | ||
std::string resolveMm8Path(Platform *platform); | ||
std::string resolveMm6Path(Environment *environment); | ||
std::string resolveMm7Path(Environment *environment); | ||
std::string resolveMm8Path(Environment *environment); |
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
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,33 @@ | ||
#include "AndroidEnvironment.h" | ||
|
||
#include <SDL.h> | ||
|
||
std::string AndroidEnvironment::queryRegistry(const std::string &path) const { | ||
return {} | ||
} | ||
|
||
std::string AndroidEnvironment::path(EnvironmentPath path) const { | ||
const char *result = nullptr; | ||
if (path == PATH_ANDROID_STORAGE_INTERNAL) { | ||
result = SDL_AndroidGetInternalStoragePath(); | ||
} else if (path == PATH_ANDROID_STORAGE_EXTERNAL) { | ||
result = SDL_AndroidGetExternalStoragePath(); | ||
} | ||
|
||
// TODO(captainurist): No PATH_HOME on Android? Verify & write a comment here. | ||
|
||
if (result) | ||
return result; | ||
return {}; | ||
} | ||
|
||
std::string AndroidEnvironment::getenv(const std::string &key) const { | ||
const char *result = SDL_getenv(key.c_str()); | ||
if (result) | ||
return result; | ||
return {}; | ||
} | ||
|
||
std::unique_ptr<Environment> Environment::createStandardEnvironment() { | ||
return std::make_unique<AndroidEnvironment>(); | ||
} |
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 @@ | ||
#pragma once | ||
|
||
#include "Library/Environment/Interface/Environment.h" | ||
|
||
class AndroidEnvironment : public Environment { | ||
public: | ||
virtual std::string queryRegistry(const std::string &path) const override; | ||
virtual std::string path(EnvironmentPath path) const override; | ||
virtual std::string getenv(const std::string &key) const override; | ||
}; |
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,16 @@ | ||
cmake_minimum_required(VERSION 3.24 FATAL_ERROR) | ||
|
||
set(LIBRARY_ENVIRONMENT_ANDROID_SOURCES | ||
AndroidEnvironment.cpp) | ||
|
||
set(LIBRARY_ENVIRONMENT_ANDROID_HEADERS | ||
AndroidEnvironment.h) | ||
|
||
if(BUILD_PLATFORM STREQUAL "android") | ||
add_library(library_environment_android STATIC ${LIBRARY_ENVIRONMENT_ANDROID_SOURCES} ${LIBRARY_ENVIRONMENT_ANDROID_HEADERS}) | ||
target_check_style(library_environment_android) | ||
target_link_libraries(library_environment_android PUBLIC library_environment_interface PRIVATE SDL2::SDL2OE) | ||
|
||
add_library(library_environment_implementation INTERFACE) | ||
target_link_libraries(library_environment_implementation INTERFACE library_environment_android) | ||
endif() |
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,7 @@ | ||
cmake_minimum_required(VERSION 3.24 FATAL_ERROR) | ||
|
||
add_subdirectory(Android) | ||
add_subdirectory(Interface) | ||
add_subdirectory(Posix) | ||
add_subdirectory(Test) | ||
add_subdirectory(Win) |
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 @@ | ||
cmake_minimum_required(VERSION 3.24 FATAL_ERROR) | ||
|
||
set(LIBRARY_ENVIRONMENT_INTERFACE_SOURCES) | ||
|
||
set(LIBRARY_ENVIRONMENT_INTERFACE_HEADERS | ||
Environment.h | ||
EnvironmentEnums.h) | ||
|
||
add_library(library_environment_interface INTERFACE ${LIBRARY_ENVIRONMENT_INTERFACE_SOURCES} ${LIBRARY_ENVIRONMENT_INTERFACE_HEADERS}) | ||
target_check_style(library_environment_interface) |
Oops, something went wrong.