summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-09-01 23:50:59 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-09-01 23:50:59 +0200
commit005aac2dbe2ed590e30e85424100f016c6c65fd6 (patch)
treea976723bc3c18472b13c81f607b0e8260699d80a /core
parent168f6ca63b6b244273afb69163704bf3212f4206 (diff)
parentb7e2d452336ec3eff6f3393e68443773178c2910 (diff)
Merge pull request #65187 from JohanAR/vector_to_size
Diffstat (limited to 'core')
-rw-r--r--core/io/image.cpp4
-rw-r--r--core/io/image.h2
-rw-r--r--core/math/a_star_grid_2d.cpp8
-rw-r--r--core/math/a_star_grid_2d.h12
4 files changed, 13 insertions, 13 deletions
diff --git a/core/io/image.cpp b/core/io/image.cpp
index 2d87523ca4..dee751eec5 100644
--- a/core/io/image.cpp
+++ b/core/io/image.cpp
@@ -416,8 +416,8 @@ int Image::get_height() const {
return height;
}
-Vector2i Image::get_size() const {
- return Vector2i(width, height);
+Size2i Image::get_size() const {
+ return Size2i(width, height);
}
bool Image::has_mipmaps() const {
diff --git a/core/io/image.h b/core/io/image.h
index 9d415423be..fd264a7a38 100644
--- a/core/io/image.h
+++ b/core/io/image.h
@@ -209,7 +209,7 @@ private:
public:
int get_width() const; ///< Get image width
int get_height() const; ///< Get image height
- Vector2i get_size() const;
+ Size2i get_size() const;
bool has_mipmaps() const;
int get_mipmap_count() const;
diff --git a/core/math/a_star_grid_2d.cpp b/core/math/a_star_grid_2d.cpp
index 8db33bde6f..23d7e379ee 100644
--- a/core/math/a_star_grid_2d.cpp
+++ b/core/math/a_star_grid_2d.cpp
@@ -57,7 +57,7 @@ static real_t heuristic_chebyshev(const Vector2i &p_from, const Vector2i &p_to)
static real_t (*heuristics[AStarGrid2D::HEURISTIC_MAX])(const Vector2i &, const Vector2i &) = { heuristic_manhattan, heuristic_euclidian, heuristic_octile, heuristic_chebyshev };
-void AStarGrid2D::set_size(const Vector2i &p_size) {
+void AStarGrid2D::set_size(const Size2i &p_size) {
ERR_FAIL_COND(p_size.x < 0 || p_size.y < 0);
if (p_size != size) {
size = p_size;
@@ -65,7 +65,7 @@ void AStarGrid2D::set_size(const Vector2i &p_size) {
}
}
-Vector2i AStarGrid2D::get_size() const {
+Size2i AStarGrid2D::get_size() const {
return size;
}
@@ -80,14 +80,14 @@ Vector2 AStarGrid2D::get_offset() const {
return offset;
}
-void AStarGrid2D::set_cell_size(const Vector2 &p_cell_size) {
+void AStarGrid2D::set_cell_size(const Size2 &p_cell_size) {
if (!cell_size.is_equal_approx(p_cell_size)) {
cell_size = p_cell_size;
dirty = true;
}
}
-Vector2 AStarGrid2D::get_cell_size() const {
+Size2 AStarGrid2D::get_cell_size() const {
return cell_size;
}
diff --git a/core/math/a_star_grid_2d.h b/core/math/a_star_grid_2d.h
index 66312d10ac..bf6363aa01 100644
--- a/core/math/a_star_grid_2d.h
+++ b/core/math/a_star_grid_2d.h
@@ -58,9 +58,9 @@ public:
};
private:
- Vector2i size;
+ Size2i size;
Vector2 offset;
- Vector2 cell_size = Vector2(1, 1);
+ Size2 cell_size = Size2(1, 1);
bool dirty = false;
bool jumping_enabled = false;
@@ -136,14 +136,14 @@ protected:
GDVIRTUAL2RC(real_t, _compute_cost, Vector2i, Vector2i)
public:
- void set_size(const Vector2i &p_size);
- Vector2i get_size() const;
+ void set_size(const Size2i &p_size);
+ Size2i get_size() const;
void set_offset(const Vector2 &p_offset);
Vector2 get_offset() const;
- void set_cell_size(const Vector2 &p_cell_size);
- Vector2 get_cell_size() const;
+ void set_cell_size(const Size2 &p_cell_size);
+ Size2 get_cell_size() const;
void update();