From 0842c81cd112efad5e1b1859aaca443aaa9d9b2f Mon Sep 17 00:00:00 2001 From: "Nicholas St. Germain" Date: Thu, 12 Sep 2024 17:42:09 -0500 Subject: [PATCH 1/6] Add LinuxArm64 Support --- README.md | 2 +- Scripts/BuildPlugin.bat | 3 +++ Source/ThirdParty/LinuxArm64/libthirdweb.a | 3 +++ Source/Thirdweb/Thirdweb.Build.cs | 3 +-- Thirdweb.uplugin | 3 ++- 5 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 Scripts/BuildPlugin.bat create mode 100644 Source/ThirdParty/LinuxArm64/libthirdweb.a diff --git a/README.md b/README.md index d1986b5..83e8545 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Additionally, you need to add `bCompileCEF3 = true;` to your build target | Platform | x64 | arm64 | |----------|:---:|:-----:| | Windows | ✅ | ➖ | -| Linux | ✅ | ❌ | +| Linux | ✅ | ✅ | | Mac | ✅ | ✅ | | IOS | ➖ | ✅ | | TVOS | ➖ | ✅ | diff --git a/Scripts/BuildPlugin.bat b/Scripts/BuildPlugin.bat new file mode 100644 index 0000000..a03012f --- /dev/null +++ b/Scripts/BuildPlugin.bat @@ -0,0 +1,3 @@ +@echo off +CD /D .. +ue4 package -NoHostPlatform -TargetPlatforms=Win64+Android+Linux+LinuxArm64 \ No newline at end of file diff --git a/Source/ThirdParty/LinuxArm64/libthirdweb.a b/Source/ThirdParty/LinuxArm64/libthirdweb.a new file mode 100644 index 0000000..1e1bd58 --- /dev/null +++ b/Source/ThirdParty/LinuxArm64/libthirdweb.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:83a2d7b221328c40550d9b20c5c08ff3a380885e3716977123288276a4b922df +size 93387736 diff --git a/Source/Thirdweb/Thirdweb.Build.cs b/Source/Thirdweb/Thirdweb.Build.cs index 6795ec4..d3d20d0 100644 --- a/Source/Thirdweb/Thirdweb.Build.cs +++ b/Source/Thirdweb/Thirdweb.Build.cs @@ -24,7 +24,6 @@ public class Thirdweb : ModuleRules private string LibDir => Path.Combine(Path.Combine(ModuleDirectory, "..", "ThirdParty"), IsIOSIsh ? "IOS" : Target.Platform.ToString()); - public Thirdweb(ReadOnlyTargetRules target) : base(target) { PrivateDependencyModuleNames.AddRange(new string[] { "Boost" }); @@ -89,4 +88,4 @@ public Thirdweb(ReadOnlyTargetRules target) : base(target) "SlateCore" }); } -} +} \ No newline at end of file diff --git a/Thirdweb.uplugin b/Thirdweb.uplugin index 308f825..654f72e 100644 --- a/Thirdweb.uplugin +++ b/Thirdweb.uplugin @@ -1,7 +1,7 @@ { "FileVersion": 3, "Version": 3, - "VersionName": "1.2.0", + "VersionName": "1.3.0", "FriendlyName": "Thirdweb", "Description": "Unreal Integration of Thirdweb Wallets", "Category": "Thirdweb", @@ -23,6 +23,7 @@ "Win64", "Mac", "Linux", + "LinuxArm64", "Android", "IOS", "VisionOS" From 19f117f32332f0de69af02aa7a5b1208d22e08d0 Mon Sep 17 00:00:00 2001 From: "Nicholas St. Germain" Date: Thu, 12 Sep 2024 18:35:52 -0500 Subject: [PATCH 2/6] Remove WebBrowserWidget Engine Plugin Dependency --- Content/Assets/WebTexture_M.uasset | Bin 0 -> 10680 bytes Content/Assets/WebTexture_T.uasset | Bin 0 -> 2753 bytes Content/Assets/WebTexture_TM.uasset | Bin 0 -> 10670 bytes .../Thirdweb/Private/ThirdwebAssetManager.cpp | 36 +++++++++++++++ Source/Thirdweb/Private/ThirdwebModule.cpp | 42 +++++++++++++++++- Source/Thirdweb/Public/ThirdwebAssetManager.h | 38 ++++++++++++++++ Source/Thirdweb/Public/ThirdwebModule.h | 24 ++++++++++ Source/Thirdweb/Thirdweb.Build.cs | 32 +++++++++++-- Source/Thirdweb/Thirdweb_UPL.xml | 31 +++++++++++++ Thirdweb.uplugin | 6 --- 10 files changed, 197 insertions(+), 12 deletions(-) create mode 100644 Content/Assets/WebTexture_M.uasset create mode 100644 Content/Assets/WebTexture_T.uasset create mode 100644 Content/Assets/WebTexture_TM.uasset create mode 100644 Source/Thirdweb/Private/ThirdwebAssetManager.cpp create mode 100644 Source/Thirdweb/Public/ThirdwebAssetManager.h create mode 100644 Source/Thirdweb/Public/ThirdwebModule.h create mode 100644 Source/Thirdweb/Thirdweb_UPL.xml diff --git a/Content/Assets/WebTexture_M.uasset b/Content/Assets/WebTexture_M.uasset new file mode 100644 index 0000000000000000000000000000000000000000..52e159d38df30b370e24f3052795dd287e395ae6 GIT binary patch literal 10680 zcmeGiX?RrC^-eNC2&9n6zElE%03l={E7pc&mSkck37H9jx`daRm*l~l_riN`vd{_% zAX5C=ieka7RxGI4Dk_U;Tgs~CvkOubkYZX;E7lgNW!Lna`|g{02@$X*zv}Uu+;`78 z_uRAHa~IjUbn;KmcXV{jjU*&Gf{@RkMd%B^C+<5RceyyYqW_WaZJ6|{={c!@`*ZO9 zNr}#<+8f^*`1q+~Q^v&t?pr(W%Dz-|viIp_WXqxjlP6dKw|v;>xy#D@KREuTRt3T^^G;Lk}YtE?? z0Y^p>@=a(`y!C?OZ{llG@>P}B)RZc|#>+QrL4~h&BOhslUnE#;fp+OP2#JR_H!H`P zT9A{Qot>LIEjK?aH#IXY$Cj4sNOh#8r=@2C3n6QOxfisF1HomiUlpedYJzq#{33=E zB92@;c-IrFXFPE8O?5}#JY+rKICOD%%lgud8<*4`EM2n$Cq_A_NH1cA|HdEvW&{i- zNlBHC%%lol4a2eoVRpOhd~r}K6KkC{Fn&yFPo&}jK2`&4s?$Oh!rN< zAn2!fe2UPZrPySJuPm#X$NMyL-j)3A0VbM5suLuhET3_Y>slW6lJT!Ds>9sK57Y>} zq?P%6Vo()iiCn(p!*l(RAPK6hDRM&#S#frv2tFnGio&&&1BzF)7UJ4;Lg0@ zDB@H%r}2uwi6vYMuc+kPf6re)2Lq{`S6q^+agvX>1yxNB*g1_Oqu$#0k0ETZiKBv( z{BnRSY+U@n7)GrKN}3ShX93d;r2r+V=WiM=5qWSR?YYAbn(I7AFRIaPqmIw4)2{EfNP&qfYD_R?{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%I?RIC zwa#zMVH&;~0Ii#c=FU8Z=5`*g-xa*tAWJYg>gcvtRMVTL{v;EA9KefTXqf)kiZb654?UIpGs#2`GS z`&x`gLh4(5=JA%etM%JCyixc{Wyvlm`eQ7-Enq0t!RZ6zh(D5re*o}Ghk!_wf)HZT zyY#d~X0VQN+D&17Y+!RIl)*TfUO{Y!gAN|L5b(lfhJhUG`B{teC!4<6Cv9+WR9c_F zD>L&)yS87LeD~%{cl?zlDRG)OsZMy_n#Yh=5b2W}BTi#24)C#WY|OeQ7v;Bnc29-G8CG~q;Aw_TKU#szL=wY-5p19eUErekO>`sOl%UZLxSG{a3x;=Z%?&VFz z_s>na_lI>@F*^HRO+AFMWh5rYU`(;GDR!wKb z>o(}^k89GRPV6mg+rRJ5Ilup?9nX~rR~Uo}cXDv24iJ&S1wVv%_+9(o5t=3Jgnxs% i=Ir{`skiJofW_IkJfbv&#^X6Nt^0RO!aWE9`TqmS#$HhX literal 0 HcmV?d00001 diff --git a/Content/Assets/WebTexture_T.uasset b/Content/Assets/WebTexture_T.uasset new file mode 100644 index 0000000000000000000000000000000000000000..cf5696d391a5ad4ae630ca66220c5fae3849c8dd GIT binary patch literal 2753 zcma)8eQZ-z6uEP(jHSM>ZUEWnbwuA#1y~D{Sl5b_0UAy|s7SlWwnh@3muo z@uh$`O%_S?55NRJ62$;U0l%V>U}E^kXrfV2A#oB})IZEZmWj;syM3>F8L`N25xtWZO(hS1%Q{vav#opJhB)`c&GVY&mRk*9GYTRx|MY*foWp|WUI4WFT zr`=KQsBsEyD8tR`G|#0OdoLD5L7Fj6&{#h_I`YG#t+l6%vprc#;+dn_UmhG9tgk(I zdHBiGTSpGTHgMp`9F|SLRTo!gE~Z^+X{)EIG{|FI()ijcTcwaQwyAO~V`e!W67|S? z<7{8;v;KL+F1OX#)|Io%CzpM)khV@$l?IwsCC*iSfca1TBIkpP%lG%j6;-d3bcy}; zPD>ci>53_l?cfBuy6`+~i+yx34}t-mr%|ppt^FLPymCzED%x(>unu;0D~q09?ln(x3;yt;8Ajoi>XvgUOTv?(=c+r0ZE@dV+LK{qHx?@cWkLYz*f z-ruB0RVV0ndgG*b&u#RU8#3!O6P{JiXc;s5XVpWQfvk8p$)6OLF=~2L@{@$;1EEC! zi%i>)6I2?@)JLL$@CcxPrs>?5Vzc=)O9t4;EcQ&BGuboXSgD~jU1x=%fLL9|dZVTF z;FyVTh||+_th9g@$ikTjb}$-fJlEXh%gbF3YkB_qx}YJ-%t4l`XYz_@TH>#BhI6(? zq8%M$i_R}-D9Fra3rjMxHm)dok;KgJX{tNn>evGxZz+dcGP;eBFBrFJo|uyIg#=@E zT1$o6rc@ca1LAW=qbk?5&0-UFwo_sD#;uYqQzbLCTYO%&ZWFFMlad^hI;mk$dq&>* znp+ui&aL#uVTig`i0f#Yn#hl^ySK@ut`^Bi4y6ATml*QJ*DQ;#fa}72&sYCL0Ds$RD%UP0RasJ1#8BO zj$%C}7^GxYmerD3-Bx{oB3*KZF9ZW$)z7Qn?;p?APUdeh`w=e7B*DXJJT(Z-!z6)@ ziUXP52R8!3A-oC*YpV<5pxN?F|Al6%f{o?>nx-8Wc92D&LK?IFt2;-3Mqj@E#xC2# a=f6fUW}5^6DEYIaCHul>tL>>RgZ{q(mIn?1 literal 0 HcmV?d00001 diff --git a/Content/Assets/WebTexture_TM.uasset b/Content/Assets/WebTexture_TM.uasset new file mode 100644 index 0000000000000000000000000000000000000000..b554d1abcf9e2cb734dac5c8982d4a93e22a3cb1 GIT binary patch literal 10670 zcmeG?d3+Vsx#wnqB#@FscA-KDBq2Z+62hVl$z8ITkdT`YsC|UVy(h`Q+?mVF+$>aM zf{2K}wxS5GwL(?YDse&U(!R24dF^Y3qJR|Bg81ZVpP~;C(DeJxoVj-rBF0zq*Yo(x zJ#)VAJKui3v*6BKrvChVcX#))a6)3j2>A?pY|-%d@Ezw9E|mn<4Lx$>W2wKHJ39kl ze+|5sn(W%z)pQ{4q0`5vO^OHDwL6#QUMxB}=;JkHN88G&Qz8Jic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); + ThirdwebAssetManager->LoadDefaultMaterials(); + + IWebBrowserModule::Get(); // force the module to load + if (IWebBrowserModule::IsAvailable() && IWebBrowserModule::Get().IsWebModuleAvailable()) + { + IWebBrowserSingleton* WebBrowserSingleton = IWebBrowserModule::Get().GetSingleton(); + if (WebBrowserSingleton) + { + WebBrowserSingleton->SetDefaultMaterial(ThirdwebAssetManager->GetDefaultMaterial()); + WebBrowserSingleton->SetDefaultTranslucentMaterial(ThirdwebAssetManager->GetDefaultTranslucentMaterial()); + } + } + } + } + + virtual void ShutdownModule() override + { + } + +private: + UThirdwebAssetManager* ThirdwebAssetManager = nullptr; +}; + +IMPLEMENT_MODULE(FThirdwebModule, Thirdweb); -IMPLEMENT_MODULE(FDefaultModuleImpl, Thirdweb) diff --git a/Source/Thirdweb/Public/ThirdwebAssetManager.h b/Source/Thirdweb/Public/ThirdwebAssetManager.h new file mode 100644 index 0000000..a0289f9 --- /dev/null +++ b/Source/Thirdweb/Public/ThirdwebAssetManager.h @@ -0,0 +1,38 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "Materials/Material.h" + +#include "UObject/SoftObjectPtr.h" + +#include "ThirdwebAssetManager.generated.h" + +class UMaterial; +/** + * @class UThirdwebAssetManager + * @brief Manages and handles loading, unloading, and accessing game assets. + * + * The UThirdwebAssetManager class is responsible for the efficient management + * of game assets such as textures, models, sound files, and other resources. + * It provides functions to load and unload assets, handles asset reference + * counting, and ensures that assets are loaded only once. This helps in + * optimizing game performance by minimizing redundant loading and memory usage. + */ +UCLASS() +class THIRDWEB_API UThirdwebAssetManager : public UObject +{ + GENERATED_BODY() +public: + UThirdwebAssetManager(); + + void LoadDefaultMaterials(); + + UMaterial* GetDefaultMaterial(); + UMaterial* GetDefaultTranslucentMaterial(); + +protected: + UPROPERTY() + TSoftObjectPtr DefaultMaterial; + TSoftObjectPtr DefaultTranslucentMaterial; +}; diff --git a/Source/Thirdweb/Public/ThirdwebModule.h b/Source/Thirdweb/Public/ThirdwebModule.h new file mode 100644 index 0000000..da0a044 --- /dev/null +++ b/Source/Thirdweb/Public/ThirdwebModule.h @@ -0,0 +1,24 @@ +// Copyright (c) 2024 Thirdweb. All Rights Reserved. + +#pragma once + +#include "Modules/ModuleManager.h" + +class IThirdwebModule : public IModuleInterface +{ +public: + /** + * Singleton-like access to this module's interface. This is just for convenience! + * Beware of calling this during the shutdown phase, though. Your module might have been unloaded already. + * + * @return Returns singleton instance, loading the module on demand if needed + */ + static IThirdwebModule& Get() { return FModuleManager::LoadModuleChecked("Thirdweb"); } + + /** + * Checks to see if this module is loaded and ready. It is only valid to call Get() if IsAvailable() returns true. + * + * @return True if the module is loaded and ready to use + */ + static bool IsAvailable() { return FModuleManager::Get().IsModuleLoaded("Thirdweb"); } +}; diff --git a/Source/Thirdweb/Thirdweb.Build.cs b/Source/Thirdweb/Thirdweb.Build.cs index d3d20d0..fe7d131 100644 --- a/Source/Thirdweb/Thirdweb.Build.cs +++ b/Source/Thirdweb/Thirdweb.Build.cs @@ -15,8 +15,10 @@ public class Thirdweb : ModuleRules ; private bool IsApple => Target.Platform.IsInGroup(UnrealPlatformGroup.Apple); + + private bool IsAndroid => Target.Platform.Equals(UnrealTargetPlatform.Android); - private bool IsMobile => IsIOSIsh || Target.Platform.Equals(UnrealTargetPlatform.Android); + private bool IsMobile => IsIOSIsh || IsAndroid; private string LibExt => IsWin64 ? ".lib" : Target.Architectures.Contains(UnrealArch.IOSSimulator) ? ".sim.a" : ".a"; @@ -26,7 +28,7 @@ public class Thirdweb : ModuleRules public Thirdweb(ReadOnlyTargetRules target) : base(target) { - PrivateDependencyModuleNames.AddRange(new string[] { "Boost" }); + PrivateDependencyModuleNames.AddRange(new [] { "Boost" }); PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; #if UE_5_3_OR_LATER @@ -35,8 +37,21 @@ public Thirdweb(ReadOnlyTargetRules target) : base(target) #if UE_5_0_OR_LATER PublicDefinitions.Add("WITH_CEF=1"); - PublicDependencyModuleNames.Add("WebBrowserWidget"); PrivateDependencyModuleNames.Add("WebBrowser"); + + // Copied from WebBrowserWidget + if (target.bBuildEditor || IsAndroid || IsIOSIsh) + { + // WebBrowserTexture required for cooking Android + PrivateIncludePathModuleNames.AddRange(new [] { "WebBrowserTexture" }); + PrivateDependencyModuleNames.AddRange(new [] { "WebBrowserTexture" }); + + if (IsAndroid) + { + var PluginPath = Utils.MakePathRelativeTo(ModuleDirectory, target.RelativeEnginePath); + AdditionalPropertiesForReceipt.Add("AndroidPlugin", Path.Combine(PluginPath, "Thirdweb_UPL.xml")); + } + } #else PublicDefinitions.Add("WITH_CEF=0"); #endif @@ -68,7 +83,7 @@ public Thirdweb(ReadOnlyTargetRules target) : base(target) { PrivateDependencyModuleNames.Add("Launch"); } - + PublicDependencyModuleNames.AddRange(new[] { // Standard deps @@ -87,5 +102,14 @@ public Thirdweb(ReadOnlyTargetRules target) : base(target) "Slate", "SlateCore" }); + + // Copied from WebBrowserWidget + if (target.bBuildEditor) + { + // @TODO: UnrealEd Needed for the triangulation code used for sprites (but only in editor mode) + // @TOOD: Try to move the code dependent on the triangulation code to the editor-only module + PrivateIncludePathModuleNames.AddRange(new [] { "UnrealEd" }); + PrivateDependencyModuleNames.AddRange(new [] { "EditorFramework", "UnrealEd" }); + } } } \ No newline at end of file diff --git a/Source/Thirdweb/Thirdweb_UPL.xml b/Source/Thirdweb/Thirdweb_UPL.xml new file mode 100644 index 0000000..87f72a8 --- /dev/null +++ b/Source/Thirdweb/Thirdweb_UPL.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Thirdweb.uplugin b/Thirdweb.uplugin index 654f72e..09d2f33 100644 --- a/Thirdweb.uplugin +++ b/Thirdweb.uplugin @@ -29,11 +29,5 @@ "VisionOS" ] } - ], - "Plugins": [ - { - "Name": "WebBrowserWidget", - "Enabled": true - } ] } From 21d72a85a63ddc550a3370dc0419cb3854c7e5de Mon Sep 17 00:00:00 2001 From: "Nicholas St. Germain" Date: Thu, 12 Sep 2024 18:36:36 -0500 Subject: [PATCH 3/6] bump internal version number --- Thirdweb.uplugin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Thirdweb.uplugin b/Thirdweb.uplugin index 09d2f33..8987816 100644 --- a/Thirdweb.uplugin +++ b/Thirdweb.uplugin @@ -1,6 +1,6 @@ { "FileVersion": 3, - "Version": 3, + "Version": 4, "VersionName": "1.3.0", "FriendlyName": "Thirdweb", "Description": "Unreal Integration of Thirdweb Wallets", From bf85a8a9fd64fed1d8c5096e8525b5cb7087ef08 Mon Sep 17 00:00:00 2001 From: "Nicholas St. Germain" Date: Thu, 12 Sep 2024 18:37:01 -0500 Subject: [PATCH 4/6] use matching version internally --- Thirdweb.uplugin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Thirdweb.uplugin b/Thirdweb.uplugin index 8987816..c4eb8a2 100644 --- a/Thirdweb.uplugin +++ b/Thirdweb.uplugin @@ -1,6 +1,6 @@ { "FileVersion": 3, - "Version": 4, + "Version": 130, "VersionName": "1.3.0", "FriendlyName": "Thirdweb", "Description": "Unreal Integration of Thirdweb Wallets", From 1181006ed131ddd8289bce3fb4eed3812a32c6fa Mon Sep 17 00:00:00 2001 From: "Nicholas St. Germain" Date: Thu, 12 Sep 2024 18:44:39 -0500 Subject: [PATCH 5/6] enable TVOS --- Scripts/build-plugin.sh | 2 ++ Thirdweb.uplugin | 1 + 2 files changed, 3 insertions(+) create mode 100644 Scripts/build-plugin.sh diff --git a/Scripts/build-plugin.sh b/Scripts/build-plugin.sh new file mode 100644 index 0000000..11de7aa --- /dev/null +++ b/Scripts/build-plugin.sh @@ -0,0 +1,2 @@ +#!/bin/sh +ue4 package -NoHostPlatform -TargetPlatforms=IOS+Mac+TVOS+VisionOS \ No newline at end of file diff --git a/Thirdweb.uplugin b/Thirdweb.uplugin index c4eb8a2..80b008f 100644 --- a/Thirdweb.uplugin +++ b/Thirdweb.uplugin @@ -26,6 +26,7 @@ "LinuxArm64", "Android", "IOS", + "TVOS", "VisionOS" ] } From 98bdfe3c8bfd32204c5458962fad4032dca21d26 Mon Sep 17 00:00:00 2001 From: "Nicholas St. Germain" Date: Thu, 12 Sep 2024 18:47:29 -0500 Subject: [PATCH 6/6] update copywrite --- Source/Thirdweb/Private/ThirdwebAssetManager.cpp | 2 +- Source/Thirdweb/Public/ThirdwebAssetManager.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Thirdweb/Private/ThirdwebAssetManager.cpp b/Source/Thirdweb/Private/ThirdwebAssetManager.cpp index a04164b..36804e0 100644 --- a/Source/Thirdweb/Private/ThirdwebAssetManager.cpp +++ b/Source/Thirdweb/Private/ThirdwebAssetManager.cpp @@ -1,4 +1,4 @@ -// Copyright Epic Games, Inc. All Rights Reserved. +// Copyright (c) 2024 Thirdweb. All Rights Reserved. #include "ThirdwebAssetManager.h" diff --git a/Source/Thirdweb/Public/ThirdwebAssetManager.h b/Source/Thirdweb/Public/ThirdwebAssetManager.h index a0289f9..bc8e64b 100644 --- a/Source/Thirdweb/Public/ThirdwebAssetManager.h +++ b/Source/Thirdweb/Public/ThirdwebAssetManager.h @@ -1,4 +1,4 @@ -// Copyright Epic Games, Inc. All Rights Reserved. +// Copyright (c) 2024 Thirdweb. All Rights Reserved. #pragma once