diff --git a/src/definition/SurfaceMaterial.cpp b/src/definition/SurfaceMaterial.cpp index 72b5b7f..f08971a 100644 --- a/src/definition/SurfaceMaterial.cpp +++ b/src/definition/SurfaceMaterial.cpp @@ -52,6 +52,16 @@ void SurfaceMaterial::load(PackStream* stream) stream->read(&receive_shadows); } +void SurfaceMaterial::copy(SurfaceMaterial *destination) const +{ + *destination->base = *base; + destination->hardness = hardness; + destination->reflection = reflection; + destination->shininess = shininess; + destination->receive_shadows = receive_shadows; + destination->validate(); +} + void SurfaceMaterial::validate() { } diff --git a/src/definition/SurfaceMaterial.h b/src/definition/SurfaceMaterial.h index 0c0accf..3a137be 100644 --- a/src/definition/SurfaceMaterial.h +++ b/src/definition/SurfaceMaterial.h @@ -17,7 +17,7 @@ public: void save(PackStream* stream) const; void load(PackStream* stream); - + void copy(SurfaceMaterial *destination) const; void validate(); public: diff --git a/src/tests/SpaceSegment_Test.cpp b/src/tests/SpaceSegment_Test.cpp index 0a9a4aa..c7c219f 100644 --- a/src/tests/SpaceSegment_Test.cpp +++ b/src/tests/SpaceSegment_Test.cpp @@ -21,7 +21,7 @@ TEST(SpaceSegment, iterateOnGrid) SpaceSegment segment(Vector3(0.5, 1.5, 0.0), Vector3(2.5, 0.5, 0.0)); segment.iterateOnGrid(it); - ASSERT_EQ(4, it.locations.size()); + ASSERT_EQ(4, (int)it.locations.size()); EXPECT_VECTOR3_COORDS(it.locations[0], 0.0, 1.0, 0.0); EXPECT_VECTOR3_COORDS(it.locations[1], 1.0, 1.0, 0.0); EXPECT_VECTOR3_COORDS(it.locations[2], 1.0, 0.0, 0.0); @@ -34,7 +34,7 @@ TEST(SpaceSegment, iterateOnGrid_Corner) SpaceSegment segment(Vector3(0.5, 0.5, 0.5), Vector3(2.5, 2.5, 2.5)); segment.iterateOnGrid(it); - ASSERT_EQ(7, it.locations.size()); + ASSERT_EQ(7, (int)it.locations.size()); EXPECT_VECTOR3_COORDS(it.locations[0], 0.0, 0.0, 0.0); EXPECT_VECTOR3_COORDS(it.locations[3], 1.0, 1.0, 1.0); EXPECT_VECTOR3_COORDS(it.locations[6], 2.0, 2.0, 2.0); @@ -46,7 +46,7 @@ TEST(SpaceSegment, iterateOnGrid_OneCell) SpaceSegment segment(Vector3(8.1, 8.2, 8.9), Vector3(8.9, 8.3, 8.6)); segment.iterateOnGrid(it); - ASSERT_EQ(1, it.locations.size()); + ASSERT_EQ(1, (int)it.locations.size()); EXPECT_VECTOR3_COORDS(it.locations[0], 8.0, 8.0, 8.0); } @@ -56,6 +56,6 @@ TEST(SpaceSegment, iterateOnGrid_Negative) SpaceSegment segment(Vector3(-8.1, -8.2, -8.9), Vector3(-8.9, -8.3, -8.6)); segment.iterateOnGrid(it); - ASSERT_EQ(1, it.locations.size()); + ASSERT_EQ(1, (int)it.locations.size()); EXPECT_VECTOR3_COORDS(it.locations[0], -9.0, -9.0, -9.0); }