Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Linux support. Fix Header include. Correct ISO C++11 violations. …REVIEW... #4

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions Source/UE4EditorCustomize/Private/UE4EditorCustomize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <AssetToolsModule.h>
#include <../Launch/Resources/Version.h>
#include <IAssetTools.h>
#include <Editor\UnrealEd\Classes\Factories\FontFileImportFactory.h>
#include <Editor/UnrealEd/Classes/Factories/FontFileImportFactory.h>

#define LOCTEXT_NAMESPACE "FUE4EditorCustomizeModule"

Expand Down Expand Up @@ -545,9 +545,11 @@ UFontFace* FUE4EditorCustomizeModule::_Internal_ImportFontFace(TArray<uint8>& UT
Offset += FontDataSize;
FString AssetPackageName = FPackageName::ObjectPathToPackageName(AssetPathName);
FText errorMsg;
// REVIEW: This needs review from the original developer.
// Isn't clear to OdinVex as to why here unless missed refactorization.
#if ENGINE_MINOR_VERSION >=18
if (!FFileHelper::IsFilenameValidForSaving(AssetPackageName, errorMsg))
return false;
/*if (!FFileHelper::IsFilenameValidForSaving(AssetPackageName, errorMsg))
return false;*/
#endif
FString AssetName = FPackageName::GetLongPackageAssetName(AssetPackageName);
UPackage* AssetPackage = CreatePackage(*AssetPackageName);
Expand Down Expand Up @@ -925,7 +927,7 @@ bool FUE4EditorCustomizeModule::ImportUTheme(FString FilePath, FText* ErrorMsg)
*ErrorMsg = LOCTEXT("FailedToLoadFile", "Failed To Load File.");
return false;
}
constexpr char* UThemeHead = "_UTheme";
char const* UThemeHead = "_UTheme";
if (memcmp(FileData.GetData(), UThemeHead, 7))
{
if (ErrorMsg)
Expand Down Expand Up @@ -1017,7 +1019,7 @@ bool FUE4EditorCustomizeModule::PackageTheme(FString FilePath, FUThemeInfo_v0 UT
TArray<uint8> UThemeFile;
TArray<uint8> UThemeInfoData;
TArray<uint8> UThemeData;
constexpr char* UThemeHead = "_UTheme";
char const* UThemeHead = "_UTheme";
UThemeFile.Append((uint8*)UThemeHead, 7); //UTheme Head(_UTheme)
UThemeFile.Add(0); //UTheme Version.
bool RequestEngineVersion = false;
Expand Down Expand Up @@ -1085,13 +1087,13 @@ bool FUE4EditorCustomizeModule::PackageTheme(FString FilePath, FUThemeInfo_v0 UT
unsigned long DestLen = (unsigned long)UThemeData.Num();
if (compress2(DataBuffer, &DestLen, UThemeData.GetData(), UThemeData.Num(), Z_BEST_COMPRESSION) != Z_OK)
{
delete DataBuffer;
delete[] DataBuffer;
return false;
}
UThemeData.Empty();
UThemeData.Append(UThemeInfoData);
UThemeData.Append(DataBuffer, (int32)DestLen);
delete DataBuffer;
delete[] DataBuffer;
FMD5 md5;
md5.Update(UThemeData.GetData(), UThemeData.Num());
uint8 md5Bytes[16];
Expand Down Expand Up @@ -1203,4 +1205,4 @@ void FUE4EditorCustomizeModule::RestoreCachedBrush()

#undef LOCTEXT_NAMESPACE

IMPLEMENT_MODULE(FUE4EditorCustomizeModule, UE4EditorCustomize)
IMPLEMENT_MODULE(FUE4EditorCustomizeModule, UE4EditorCustomize)
3 changes: 2 additions & 1 deletion UE4EditorCustomize.uplugin
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
"Type": "Editor",
"LoadingPhase": "Default",
"WhitelistPlatforms": [
"Linux",
"Win64"
]
}
]
}
}