aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/zvision/render_table.cpp4
-rw-r--r--engines/zvision/render_table.h4
-rw-r--r--engines/zvision/vector2.h (renamed from engines/zvision/point.h)27
3 files changed, 17 insertions, 18 deletions
diff --git a/engines/zvision/render_table.cpp b/engines/zvision/render_table.cpp
index ca7f9a8030..5754c91b24 100644
--- a/engines/zvision/render_table.cpp
+++ b/engines/zvision/render_table.cpp
@@ -25,7 +25,7 @@
#include "graphics/colormasks.h"
#include "zvision/render_table.h"
-#include "zvision/point.h"
+#include "zvision/vector2.h"
namespace ZVision {
@@ -35,7 +35,7 @@ RenderTable::RenderTable(uint32 numColumns, uint32 numRows)
_renderState(RenderState::FLAT) {
assert(numRows != 0 && numColumns != 0);
- _internalBuffer = new Point<int16>[numRows * numColumns];
+ _internalBuffer = new Vector2[numRows * numColumns];
}
RenderTable::~RenderTable() {
diff --git a/engines/zvision/render_table.h b/engines/zvision/render_table.h
index ec405e5dfe..3f87c2e026 100644
--- a/engines/zvision/render_table.h
+++ b/engines/zvision/render_table.h
@@ -26,7 +26,7 @@
#include "common/types.h"
#include "common/rect.h"
-#include "zvision/point.h"
+#include "zvision/vector2.h"
namespace ZVision {
@@ -44,7 +44,7 @@ public:
private:
uint32 _numColumns, _numRows;
- Point<int16> *_internalBuffer;
+ Vector2 *_internalBuffer;
RenderState _renderState;
struct {
diff --git a/engines/zvision/point.h b/engines/zvision/vector2.h
index da244e9449..d301aef4c6 100644
--- a/engines/zvision/point.h
+++ b/engines/zvision/vector2.h
@@ -23,35 +23,34 @@
#ifndef COMMON_ZVISION_POINT_H
#define COMMON_ZVISION_POINT_H
-#include "common/types.h"
+#include "common/scummsys.h"
namespace ZVision {
/**
* Simple class for handling both 2D position and size.
*/
-template<class T>
-class Point {
+class Vector2 {
public:
- T x; ///< The horizontal part of the point
- T y; ///< The vertical part of the point
+ int16 x; ///< The horizontal part of the point
+ int16 y; ///< The vertical part of the point
public:
- Point() : x(0), y(0) {}
- Point(T x1, T y1) : x(x1), y(y1) {}
+ Vector2() : x(0), y(0) {}
+ Vector2(int16 x1, int16 y1) : x(x1), y(y1) {}
public:
- bool operator==(const Point &p) const { return x == p.x && y == p.y; }
- bool operator!=(const Point &p) const { return x != p.x || y != p.y; }
- Point operator+(const Point &delta) const { return Point(x + delta.x, y + delta.y); }
- Point operator-(const Point &delta) const { return Point(x - delta.x, y - delta.y); }
+ bool operator==(const Vector2 &p) const { return x == p.x && y == p.y; }
+ bool operator!=(const Vector2 &p) const { return x != p.x || y != p.y; }
+ Vector2 operator+(const Vector2 &delta) const { return Vector2(x + delta.x, y + delta.y); }
+ Vector2 operator-(const Vector2 &delta) const { return Vector2(x - delta.x, y - delta.y); }
- void operator+=(const Point &delta) {
+ void operator+=(const Vector2 &delta) {
x += delta.x;
y += delta.y;
}
- void operator-=(const Point &delta) {
+ void operator-=(const Vector2 &delta) {
x -= delta.x;
y -= delta.y;
}
@@ -62,7 +61,7 @@ public:
* @param p the other point
* @return the distance between this and p
*/
- uint sqrDist(const Point &p) const {
+ uint sqrDist(const Vector2 &p) const {
int diffx = ABS(p.x - x);
if (diffx >= 0x1000)
return 0xFFFFFF;