FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add more calls to TCHAR_TO_WCHAR by slartibaartfast · Pull Request #644 · 20tab/UnrealEnginePython · GitHub

Repository navigation

Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .cpp  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
20 changes: 18 additions & 2 deletions Source/UnrealEnginePython/Private/UnrealEnginePython.cpp
This file contains hidden or 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
Expand Up @@ -47,7 +47,6 @@ const char *ue4_module_options = "linux_global_symbols";
#include "Android/AndroidApplication.h"
#endif


const char *UEPyUnicode_AsUTF8(PyObject *py_str)
{
#if PY_MAJOR_VERSION < 3
Expand Down Expand Up @@ -249,7 +248,11 @@ void FUnrealEnginePythonModule::StartupModule()
if (GConfig->GetString(UTF8_TO_TCHAR("Python"), UTF8_TO_TCHAR("Home"), PythonHome, GEngineIni))
{
#if PY_MAJOR_VERSION >= 3
#if ENGINE_MINOR_VERSION >= 20
wchar_t *home = (wchar_t *)(TCHAR_TO_WCHAR(*PythonHome));
#else
wchar_t *home = (wchar_t *)*PythonHome;
#endif
#else
char *home = TCHAR_TO_UTF8(*PythonHome);
#endif
Expand All @@ -263,7 +266,11 @@ void FUnrealEnginePythonModule::StartupModule()
FPaths::NormalizeFilename(PythonHome);
PythonHome = FPaths::ConvertRelativePathToFull(PythonHome);
#if PY_MAJOR_VERSION >= 3
#if ENGINE_MINOR_VERSION >= 20
wchar_t *home = (wchar_t *)(TCHAR_TO_WCHAR(*PythonHome));
#else
wchar_t *home = (wchar_t *)*PythonHome;
#endif
#else
char *home = TCHAR_TO_UTF8(*PythonHome);
#endif
Expand All @@ -277,7 +284,11 @@ void FUnrealEnginePythonModule::StartupModule()
if (GConfig->GetString(UTF8_TO_TCHAR("Python"), UTF8_TO_TCHAR("ProgramName"), IniValue, GEngineIni))
{
#if PY_MAJOR_VERSION >= 3
#if ENGINE_MINOR_VERSION >= 20
wchar_t *program_name = (wchar_t *)(TCHAR_TO_WCHAR(*IniValue));
#else
wchar_t *program_name = (wchar_t *)*IniValue;
#endif
#else
char *program_name = TCHAR_TO_UTF8(*IniValue);
#endif
Expand All @@ -290,7 +301,11 @@ void FUnrealEnginePythonModule::StartupModule()
FPaths::NormalizeFilename(IniValue);
IniValue = FPaths::ConvertRelativePathToFull(IniValue);
#if PY_MAJOR_VERSION >= 3
#if ENGINE_MINOR_VERSION >= 20
wchar_t *program_name = (wchar_t *)(TCHAR_TO_WCHAR(*IniValue));
#else
wchar_t *program_name = (wchar_t *)*IniValue;
#endif
#else
char *program_name = TCHAR_TO_UTF8(*IniValue);
#endif
Expand Down Expand Up @@ -391,6 +406,7 @@ void FUnrealEnginePythonModule::StartupModule()
}

// Setup our own paths for PYTHONPATH
#if PLATFORM_WINDOWS
TArray<FString> OurPythonPaths = {
PythonHome,
FPaths::Combine(PythonHome, TEXT("Lib")),
Expand All @@ -403,10 +419,10 @@ void FUnrealEnginePythonModule::StartupModule()
PathVars.Append(OurPythonPaths);
FString ModifiedPath = FString::Join(PathVars, PathDelimiter);
FPlatformMisc::SetEnvironmentVar(TEXT("PATH"), *ModifiedPath);
#endif
}



#if PY_MAJOR_VERSION >= 3
init_unreal_engine_builtin();
#if PLATFORM_ANDROID
Expand Down

Back | FazBrowse Home | New Git URL