From 06ff8e110be9a424da49529f44fd0a155f87a091 Mon Sep 17 00:00:00 2001 From: Relintai Date: Fri, 26 May 2023 14:32:17 +0200 Subject: [PATCH] Small improvements to Vector2's api. --- gdnative/vector2.cpp | 4 ++-- include/gdn/vector2.h | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/gdnative/vector2.cpp b/gdnative/vector2.cpp index bdeedac..88019df 100644 --- a/gdnative/vector2.cpp +++ b/gdnative/vector2.cpp @@ -57,11 +57,11 @@ pandemonium_real GDAPI pandemonium_vector2_get_y(const pandemonium_vector2 *p_se return self->y; } -void GDAPI pandemonium_vector2_set_axis(pandemonium_vector2 *p_self, const pandemonium_int p_axis, const pandemonium_real p_value) { +void GDAPI pandemonium_vector2_set_axis(pandemonium_vector2 *p_self, const pandemonium_vector2_axis p_axis, const pandemonium_real p_value) { Vector2 *self = (Vector2 *)p_self; self->operator[](p_axis) = p_value; } -pandemonium_real GDAPI pandemonium_vector2_get_axis(const pandemonium_vector2 *p_self, const pandemonium_int p_axis) { +pandemonium_real GDAPI pandemonium_vector2_get_axis(const pandemonium_vector2 *p_self, const pandemonium_vector2_axis p_axis) { const Vector2 *self = (const Vector2 *)p_self; return self->operator[](p_axis); } diff --git a/include/gdn/vector2.h b/include/gdn/vector2.h index c6e4e61..a8f7494 100644 --- a/include/gdn/vector2.h +++ b/include/gdn/vector2.h @@ -60,8 +60,6 @@ extern "C" { typedef enum { PANDEMONIUM_VECTOR2_AXIS_X, PANDEMONIUM_VECTOR2_AXIS_Y, - - PANDEMONIUM_VECTOR2_AXIS_COUNT, } pandemonium_vector2_axis; void GDAPI pandemonium_vector2_set_x(pandemonium_vector2 *p_self, const pandemonium_real p_x); @@ -70,8 +68,8 @@ void GDAPI pandemonium_vector2_set_y(pandemonium_vector2 *p_self, const pandemon pandemonium_real GDAPI pandemonium_vector2_get_x(const pandemonium_vector2 *p_self); pandemonium_real GDAPI pandemonium_vector2_get_y(const pandemonium_vector2 *p_self); -void GDAPI pandemonium_vector2_set_axis(pandemonium_vector2 *p_self, const pandemonium_int p_axis, const pandemonium_real p_value); -pandemonium_real GDAPI pandemonium_vector2_get_axis(const pandemonium_vector2 *p_self, const pandemonium_int p_axis); +void GDAPI pandemonium_vector2_set_axis(pandemonium_vector2 *p_self, const pandemonium_vector2_axis p_axis, const pandemonium_real p_value); +pandemonium_real GDAPI pandemonium_vector2_get_axis(const pandemonium_vector2 *p_self, const pandemonium_vector2_axis p_axis); void GDAPI pandemonium_vector2_set_all(pandemonium_vector2 *p_self, const pandemonium_real p_value);