From 04050c1685855a0640c7c0d5147299fadbd2ebe8 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Wed, 30 Jul 2008 17:16:55 +0000 Subject: select-on-release --- src/math/color.cc | 3 ++- src/math/vector3f.cc | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src/math') diff --git a/src/math/color.cc b/src/math/color.cc index 0cf2ea8..231ec80 100644 --- a/src/math/color.cc +++ b/src/math/color.cc @@ -58,7 +58,8 @@ void Color::assign(float red, float green, float blue, float alpha) void Color::assign(Color const & other) { - memcpy(rgba_data, other.rgba_data, sizeof(rgba_data)); + for (int i =0; i < 4; i++) + rgba_data[i] = other.rgba_data[i]; } void Color::assign(float grey, float alpha) diff --git a/src/math/vector3f.cc b/src/math/vector3f.cc index 57ad52a..3d816f6 100644 --- a/src/math/vector3f.cc +++ b/src/math/vector3f.cc @@ -37,7 +37,8 @@ Vector3f::~Vector3f() void Vector3f::clear() { - memset(coord, 0, sizeof(coord)); + for (size_t i =0; i < 3; i++) + coord[i] = 0; } void Vector3f::assign(const float vx, const float vy, const float vz) @@ -49,9 +50,8 @@ void Vector3f::assign(const float vx, const float vy, const float vz) void Vector3f::assign(Vector3f const & other) { - coord[0] = other.coord[0]; - coord[1] = other.coord[1]; - coord[2] = other.coord[2]; + for (size_t i =0; i < 3; i++) + coord[i] = other.coord[i]; } Vector3f & Vector3f::operator=(const Vector3f & other) -- cgit v1.2.3