Skip to content

Commit

Permalink
Fixed warnings
Browse files Browse the repository at this point in the history
The BuildConfiguration default has been changed from warning to error.
  • Loading branch information
mik14a committed Mar 30, 2020
1 parent f53b80d commit 2aa01f6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Source/VOX4U/Private/Voxel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ void UVoxel::PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChange
void UVoxel::CalcCellBounds()
{
FBoxSphereBounds Bounds(ForceInit);
for (const auto* Mesh : this->Mesh.FilterByPredicate([](UStaticMesh* m) { return !!m; })) {
Bounds = Bounds + Mesh->GetBounds();
for (const auto* Cell : Mesh.FilterByPredicate([](UStaticMesh* m) { return !!m; })) {
Bounds = Bounds + Cell->GetBounds();
}
CellBounds = Bounds;
}
Expand Down
12 changes: 6 additions & 6 deletions Source/VOX4U/Private/VoxelComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ void UVoxelComponent::PostEditChangeProperty(FPropertyChangedEvent& PropertyChan
ClearVoxel();
AddVoxel();
} else if (PropertyChangedEvent.Property->GetFName() == NAME_Mesh) {
FBoxSphereBounds Bounds(ForceInit);
FBoxSphereBounds MeshBounds(ForceInit);
for (int32 i = 0; i < Mesh.Num(); ++i) {
InstancedStaticMeshComponents[i]->SetStaticMesh(Mesh[i]);
if (Mesh[i]) {
Bounds = Bounds + Mesh[i]->GetBounds();
MeshBounds = MeshBounds + Mesh[i]->GetBounds();
}
}
CellBounds = Bounds;
CellBounds = MeshBounds;
} else if (PropertyChangedEvent.Property->GetFName() == NAME_Voxel) {
SetVoxel(Voxel, true);
}
Expand Down Expand Up @@ -126,11 +126,11 @@ bool UVoxelComponent::GetVoxelTransform(const FIntVector& InVector, FTransform&

FBoxSphereBounds UVoxelComponent::CalcBounds(const FTransform& LocalToWorld) const
{
FBoxSphereBounds Bounds = FBoxSphereBounds(ForceInit);
FBoxSphereBounds ComponentBounds = FBoxSphereBounds(ForceInit);
for (auto* InstancedStaticMeshComponent : InstancedStaticMeshComponents) {
Bounds = Bounds + InstancedStaticMeshComponent->CalcBounds(LocalToWorld);
ComponentBounds = ComponentBounds + InstancedStaticMeshComponent->CalcBounds(LocalToWorld);
}
return Bounds;
return ComponentBounds;
}

const TArray<UInstancedStaticMeshComponent*>& UVoxelComponent::GetInstancedStaticMeshComponent() const
Expand Down
8 changes: 4 additions & 4 deletions Source/VOX4UEditor/Private/VoxelFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,13 @@ UDestructibleMesh* UVoxelFactory::CreateDestructibleMesh(UObject* InParent, FNam
BuildStaticMesh(RootMesh, RawMesh);
DestructibleMesh->SourceStaticMesh = RootMesh;

TArray<FRawMesh> RawMeshes;
Vox->CreateRawMeshes(RawMeshes, ImportOption);
TArray<FRawMesh> CellMeshes;
Vox->CreateRawMeshes(CellMeshes, ImportOption);
TArray<UStaticMesh*> FractureMeshes;
for (FRawMesh& RawMesh : RawMeshes) {
for (FRawMesh& CellMesh : CellMeshes) {
UStaticMesh* FructureMesh = NewObject<UStaticMesh>();
FructureMesh->StaticMaterials.Add(FStaticMaterial(Material));
BuildStaticMesh(FructureMesh, RawMesh);
BuildStaticMesh(FructureMesh, CellMesh);
FractureMeshes.Add(FructureMesh);
}
DestructibleMesh->SetupChunksFromStaticMeshes(FractureMeshes);
Expand Down

0 comments on commit 2aa01f6

Please sign in to comment.