Skip to content

Commit

Permalink
Platform Warning fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
getnamo committed Apr 7, 2022
1 parent e049a31 commit 6036dbf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion SocketIOClient.uplugin
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"FileVersion": 3,
"Version": 1,
"VersionName": "2.0.0",
"VersionName": "2.0.1",
"EngineVersion" : "5.0.0",
"FriendlyName": "Socket.IO Client",
"Description": "Real-time networking library Socket.IO Client usable from blueprints and c++.",
Expand Down
12 changes: 6 additions & 6 deletions Source/CoreUtility/Private/CUBlueprintLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ UTexture2D* UCUBlueprintLibrary::Conv_BytesToTexture(const TArray<uint8>& InByte
[UpdateData](FRHICommandList& CommandList)
{
RHIUpdateTexture2D(
((FTextureResource*)UpdateData->Texture2D->Resource)->TextureRHI->GetTexture2D(),
((FTextureResource*)UpdateData->Texture2D->GetResource())->TextureRHI->GetTexture2D(),
0,
UpdateData->Region,
UpdateData->Pitch,
Expand Down Expand Up @@ -366,7 +366,7 @@ TFuture<UTexture2D*> UCUBlueprintLibrary::Conv_BytesToTexture_Async(const TArray
[UpdateData](FRHICommandList& CommandList)
{
RHIUpdateTexture2D(
((FTextureResource*)UpdateData->Texture2D->Resource)->TextureRHI->GetTexture2D(),
((FTextureResource*)UpdateData->Texture2D->GetResource())->TextureRHI->GetTexture2D(),
0,
UpdateData->Region,
UpdateData->Pitch,
Expand All @@ -390,18 +390,18 @@ bool UCUBlueprintLibrary::Conv_TextureToBytes(UTexture2D* Texture, TArray<uint8>
IImageWrapperModule& ImageWrapperModule = FModuleManager::LoadModuleChecked<IImageWrapperModule>(FName("ImageWrapper"));
TSharedPtr<IImageWrapper> ImageWrapper = ImageWrapperModule.CreateImageWrapper((EImageFormat)Format);

int32 Width = Texture->PlatformData->Mips[0].SizeX;
int32 Height = Texture->PlatformData->Mips[0].SizeY;
int32 Width = Texture->GetPlatformData()->Mips[0].SizeX;
int32 Height = Texture->GetPlatformData()->Mips[0].SizeY;
int32 DataLength = Width * Height * 4;

void* TextureDataPointer = Texture->PlatformData->Mips[0].BulkData.Lock(LOCK_READ_ONLY);
void* TextureDataPointer = Texture->GetPlatformData()->Mips[0].BulkData.Lock(LOCK_READ_ONLY);

ImageWrapper->SetRaw(TextureDataPointer, DataLength, Width, Height, ERGBFormat::BGRA, 8);

//This part can take a while, has performance implications
OutBuffer = ImageWrapper->GetCompressed();

Texture->PlatformData->Mips[0].BulkData.Unlock();
Texture->GetPlatformData()->Mips[0].BulkData.Unlock();

return true;
}
Expand Down

0 comments on commit 6036dbf

Please sign in to comment.