Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/math
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-07-30 17:16:55 +0000
committerStijn Buys <ingar@osirion.org>2008-07-30 17:16:55 +0000
commit04050c1685855a0640c7c0d5147299fadbd2ebe8 (patch)
treeb0789947f5cc363950472c5f5a8b55048ca72d18 /src/math
parentd09a1be33a647aedc12ce5ddcb7ea4ee23a75c8c (diff)
select-on-release
Diffstat (limited to 'src/math')
-rw-r--r--src/math/color.cc3
-rw-r--r--src/math/vector3f.cc8
2 files changed, 6 insertions, 5 deletions
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)