diff options
author | uruk | 2014-05-19 17:23:50 +0200 |
---|---|---|
committer | uruk | 2014-05-19 17:23:50 +0200 |
commit | 63e57b2eb62c7c3fe2a1b4d878da5941648b6603 (patch) | |
tree | c047ddf3f2c387775a546988d3201d2e630aa569 /engines | |
parent | e6229a259608de6bf1c9f81d2e66101addef1339 (diff) | |
download | scummvm-rg350-63e57b2eb62c7c3fe2a1b4d878da5941648b6603.tar.gz scummvm-rg350-63e57b2eb62c7c3fe2a1b4d878da5941648b6603.tar.bz2 scummvm-rg350-63e57b2eb62c7c3fe2a1b4d878da5941648b6603.zip |
CGE2: Fix formatting in general.h.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cge2/general.h | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/engines/cge2/general.h b/engines/cge2/general.h index 747fb84e45..bd145e1731 100644 --- a/engines/cge2/general.h +++ b/engines/cge2/general.h @@ -50,36 +50,36 @@ public: V3D(void) { } V3D(double x, double y, double z = 0) : _x(x), _y(y), _z(z) { } V3D(const V3D &p) : _x(p._x), _y(p._y), _z(p._z) { } - V3D operator + (const V3D& p) const { return V3D(_x + p._x, _y + p._y, _z + p._z); } - V3D operator - (const V3D& p) const { return V3D(_x - p._x, _y - p._y, _z - p._z); } - V3D operator * (long n) const { return V3D(_x * n, _y * n, _z * n); } - V3D operator / (long n) const { return V3D(_x / n, _y / n, _z / n); } - bool operator == (V3D& p) const { return _x == p._x && _y == p._y && _z == p._z; } - bool operator != (V3D& p) const { return _x != p._x || _y != p._y || _z != p._z; } - V3D& operator += (const V3D& x) { return *this = *this + x; } - V3D& operator -= (const V3D& x) { return *this = *this - x; } + V3D operator+(const V3D &p) const { return V3D(_x + p._x, _y + p._y, _z + p._z); } + V3D operator-(const V3D &p) const { return V3D(_x - p._x, _y - p._y, _z - p._z); } + V3D operator*(long n) const { return V3D(_x * n, _y * n, _z * n); } + V3D operator/ (long n) const { return V3D(_x / n, _y / n, _z / n); } + bool operator==(V3D &p) const { return _x == p._x && _y == p._y && _z == p._z; } + bool operator!=(V3D &p) const { return _x != p._x || _y != p._y || _z != p._z; } + V3D& operator+=(const V3D &x) { return *this = *this + x; } + V3D& operator-=(const V3D &x) { return *this = *this - x; } }; class V2D : public Common::Point { CGE2Engine *_vm; public: - V2D& operator = (const V3D& p3) { + V2D& operator=(const V3D &p3) { double m = _vm->_eye->_z / (p3._z - _vm->_eye->_z); x = round((_vm->_eye->_x + (_vm->_eye->_x - p3._x) * m)); y = round((_vm->_eye->_y + (_vm->_eye->_y - p3._y) * m)); return *this; } V2D(CGE2Engine *vm) : _vm(vm) { } - V2D(CGE2Engine *vm, const V3D& p3) : _vm(vm) { *this = p3; } + V2D(CGE2Engine *vm, const V3D &p3) : _vm(vm) { *this = p3; } V2D(CGE2Engine *vm, int x, int y) : _vm(vm), Common::Point(x, y) { } - bool operator < (const V2D& p) const { return (x < p.x) && (y < p.y); } - bool operator <= (const V2D& p) const { return (x <= p.x) && (y <= p.y); } - bool operator >(const V2D& p) const { return (x > p.x) && (y > p.y); } - bool operator >= (const V2D& p) const { return (x >= p.x) && (y >= p.y); } - V2D operator + (const V2D& p) const { return V2D(_vm, x + p.x, y + p.y); } - V2D operator - (const V2D& p) const { return V2D(_vm, x - p.x, y - p.y); } + bool operator<(const V2D &p) const { return (x < p.x) && (y < p.y); } + bool operator<=(const V2D &p) const { return (x <= p.x) && (y <= p.y); } + bool operator>(const V2D &p) const { return (x > p.x) && (y > p.y); } + bool operator>=(const V2D &p) const { return (x >= p.x) && (y >= p.y); } + V2D operator+(const V2D &p) const { return V2D(_vm, x + p.x, y + p.y); } + V2D operator-(const V2D &p) const { return V2D(_vm, x - p.x, y - p.y); } uint16 area(void) { return x * y; } - bool limited(const V2D& p) { + bool limited(const V2D &p) { return (uint16(x) < uint16(p.x)) && (uint16(y) < uint16(p.y)); } V2D scale(int z) { |