summaryrefslogtreecommitdiff
path: root/src/vector.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-03-27 21:41:20 +0300
committerAndrei Karas <akaras@inbox.ru>2011-03-27 21:41:20 +0300
commit964ffbb9b6ed5246b14a7d0c0d065f7d38af0912 (patch)
treeedef1b3f31183402e2d0f86ee48c9734c2a03c7e /src/vector.h
parent41ac086fcd38fd472b579a495a8e8e7685ae4722 (diff)
downloadplus-964ffbb9b6ed5246b14a7d0c0d065f7d38af0912.tar.gz
plus-964ffbb9b6ed5246b14a7d0c0d065f7d38af0912.tar.bz2
plus-964ffbb9b6ed5246b14a7d0c0d065f7d38af0912.tar.xz
plus-964ffbb9b6ed5246b14a7d0c0d065f7d38af0912.zip
Fix some warnings and improve code from gcc 4.6 compilation.
Diffstat (limited to 'src/vector.h')
-rw-r--r--src/vector.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/vector.h b/src/vector.h
index 87e9c647a..b2e5f136b 100644
--- a/src/vector.h
+++ b/src/vector.h
@@ -38,15 +38,15 @@ class Vector
* Constructor.
*/
Vector():
- x(0.0f),
- y(0.0f),
- z(0.0f)
+ x(0),
+ y(0),
+ z(0)
{}
/**
* Constructor.
*/
- Vector(float x, float y, float z = 0.0f):
+ Vector(int x, int y, int z = 0.0f):
x(x),
y(y),
z(z)
@@ -67,13 +67,13 @@ class Vector
*/
bool isNull() const
{
- return x == 0.0f && y == 0.0f && z == 0.0f;
+ return x == 0 && y == 0 && z == 0;
}
/**
* Scale vector operator.
*/
- Vector operator*(float c) const
+ Vector operator*(int c) const
{
return Vector(x * c,
y * c,
@@ -83,7 +83,7 @@ class Vector
/**
* In-place scale vector operator.
*/
- Vector &operator*=(float c)
+ Vector &operator*=(int c)
{
x *= c;
y *= c;
@@ -94,7 +94,7 @@ class Vector
/**
* Scale vector operator.
*/
- Vector operator/(float c) const
+ Vector operator/(int c) const
{
return Vector(x / c,
y / c,
@@ -104,7 +104,7 @@ class Vector
/**
* In-place scale vector operator.
*/
- Vector &operator/=(float c)
+ Vector &operator/=(int c)
{
x /= c;
y /= c;
@@ -189,7 +189,7 @@ class Vector
return Vector(x / l, y / l, z / l);
}
- float x, y, z;
+ int x, y, z;
};
/**