8000 Minor notes · getnamo/BLUI-Unreal@b305eed · GitHub
[go: up one dir, main page]

Skip to content

Commit

Permalink
Minor notes
Browse files Browse the repository at this point in the history
  • Loading branch information
getnamo committed Jun 6, 2024
1 parent 8e669a6 commit b305eed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
9 changes: 8 additions & 1 deletion Source/Blu/Private/BluEye.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ void UBluEye::TextureUpdate(const void *Buffer, FUpdateTextureRegion2D *UpdateRe
{
for (uint32 RegionIndex = 0; RegionIndex < RegionData->NumRegions; RegionIndex++)
{
//NB: FORCEINLINE void RHIUpdateTexture2D(FRHITexture2D* Texture, uint32 MipIndex, const struct FUpdateTextureRegion2D& UpdateRegion, uint32 SourcePitch, const uint8* SourceData)
RHIUpdateTexture2D(RegionData->Texture2DResource->TextureRHI->GetTexture2D(), 0, RegionData->Regions[RegionIndex], RegionData->SrcPitch,
RegionData->SrcData.GetData()
+ RegionData->Regions[RegionIndex].SrcY * RegionData->SrcPitch
Expand Down Expand Up @@ -652,7 +653,13 @@ void UBluEye::SpawnTickEventLoopIfNeeded()
{
UE_LOG(LogTemp, Log, TEXT("Delta: %1.2f"), DeltaTime);
}
BluManager::DoBluMessageLoop();

//NB: this wrapper doesn't crash, but will fail to render
//Async(EAsyncExecution::ThreadPool, [this]
//{
BluManager::DoBluMessageLoop();
//});

}

return true;
Expand Down
12 changes: 6 additions & 6 deletions Source/Blu/Private/RenderHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ void RenderHandler::OnPaint(CefRefPtr<CefBrowser> Browser, PaintElementType Type
{
FUpdateTextureRegion2D *UpdateRegions = static_cast<FUpdateTextureRegion2D*>(FMemory::Malloc(sizeof(FUpdateTextureRegion2D) * DirtyRects.size()));

int Current = 0;
int RegionIndex = 0;
for (auto DirtyRect : DirtyRects)
{
UpdateRegions[Current].DestX = UpdateRegions[Current].SrcX = DirtyRect.x;
UpdateRegions[Current].DestY = UpdateRegions[Current].SrcY = DirtyRect.y;
UpdateRegions[Current].Height = DirtyRect.height;
UpdateRegions[Current].Width = DirtyRect.width;
UpdateRegions[RegionIndex].DestX = UpdateRegions[RegionIndex].SrcX = DirtyRect.x;
UpdateRegions[RegionIndex].DestY = UpdateRegions[RegionIndex].SrcY = DirtyRect.y;
UpdateRegions[RegionIndex].Height = DirtyRect.height;
UpdateRegions[RegionIndex].Width = DirtyRect.width;

Current++;
RegionIndex++;
}

// Trigger our parent UIs Texture to update
Expand Down

0 comments on commit b305eed

Please sign in to comment.
0