Moved sendstream to GM tick
This commit is contained in:
parent
158247ddb5
commit
dea15ec319
|
@ -218,6 +218,8 @@ void ACarlaGameModeBase::Tick(float DeltaSeconds)
|
|||
{
|
||||
Recorder->Tick(DeltaSeconds);
|
||||
}
|
||||
|
||||
SendAtlas();
|
||||
}
|
||||
|
||||
void ACarlaGameModeBase::EndPlay(const EEndPlayReason::Type EndPlayReason)
|
||||
|
@ -451,8 +453,6 @@ void ACarlaGameModeBase::CaptureAtlas()
|
|||
This->AtlasImage,
|
||||
FReadSurfaceDataFlags(RCM_UNorm, CubeFace_MAX));
|
||||
|
||||
This->SendAtlas();
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -561,6 +561,8 @@ bool ASceneCaptureSensor::CopyTextureFromAtlas(
|
|||
uint32 AtlasTextureWidth)
|
||||
{
|
||||
|
||||
Buffer.reset(Offset + ImageWidth * ImageHeight * sizeof(FColor));
|
||||
|
||||
// Check that the atlas alreay contains our texture
|
||||
// and our image has been initialized
|
||||
uint32 ExpectedSize = (uint32)(PositionInAtlas.Y * AtlasTextureWidth + ImageWidth * ImageHeight);
|
||||
|
@ -579,7 +581,6 @@ bool ASceneCaptureSensor::CopyTextureFromAtlas(
|
|||
const uint32 DstStride = ImageWidth * sizeof(FColor);
|
||||
const uint32 SrcStride = AtlasTextureWidth * sizeof(FColor);
|
||||
|
||||
Buffer.reset(Offset + ImageHeight * DstStride);
|
||||
for(uint32 i = 0; i < ImageHeight; i++)
|
||||
{
|
||||
Buffer.copy_from(Dest, Source, DstStride);
|
||||
|
|
|
@ -284,7 +284,8 @@ public:
|
|||
auto Stream = GetDataStream(Sensor);
|
||||
carla::Buffer Buffer = Stream.PopBufferFromPool();
|
||||
|
||||
if(CopyTextureFromAtlas(Buffer, AtlasImage, AtlasTextureWidth))
|
||||
CopyTextureFromAtlas(Buffer, AtlasImage, AtlasTextureWidth);
|
||||
|
||||
{
|
||||
SCOPE_CYCLE_COUNTER(STAT_CarlaSensorStreamSend);
|
||||
Stream.Send(Sensor, std::move(Buffer));
|
||||
|
|
Loading…
Reference in New Issue