Переход на версию 0.3: изменение подхода к именованию сущностей, добавление, изменение и удаление ряда функций

This commit is contained in:
Andrey Pokidov 2026-01-30 19:37:49 +07:00
parent d33daf4e2d
commit f7e41645fe
87 changed files with 4580 additions and 4051 deletions

View file

@ -22,7 +22,7 @@ void test_vector2()
const int TEST_FP32_VECTOR2_AMOUNT_1 = 5;
const BgcVector2FP32 TEST_FP32_VECTOR2_COMMON_1[] = {
const BGC_FP32_Vector2 TEST_FP32_VECTOR2_COMMON_1[] = {
{ 3.0f, 4.0f },
{ -3.0f, -4.0f },
{ 10000.0f, -20000.0f },
@ -30,7 +30,7 @@ const BgcVector2FP32 TEST_FP32_VECTOR2_COMMON_1[] = {
{ -123.5f, 3.7283f }
};
const BgcVector2FP32 TEST_FP32_VECTOR2_COMMON_2[] = {
const BGC_FP32_Vector2 TEST_FP32_VECTOR2_COMMON_2[] = {
{ -3.0f, -4.0f },
{ -3.0f, -4.0f },
{ 0.002f, -0.05f },
@ -49,7 +49,7 @@ int test_vector2_fp32_square_modulus()
float square_modulus;
for (int i = 0; i < TEST_FP32_VECTOR2_AMOUNT_1; i++) {
square_modulus = bgc_vector2_get_square_modulus_fp32(&TEST_FP32_VECTOR2_COMMON_1[i]);
square_modulus = bgc_fp32_vector2_get_square_modulus(&TEST_FP32_VECTOR2_COMMON_1[i]);
if (!test_are_equal_fp32(square_modulus, FP32_VECTOR2_SQUARE_MODULUS_1[i])) {
print_testing_failed();
@ -72,7 +72,7 @@ int test_vector2_fp32_modulus()
float square_modulus;
for (int i = 0; i < TEST_FP32_VECTOR2_AMOUNT_1; i++) {
square_modulus = bgc_vector2_get_modulus_fp32(&TEST_FP32_VECTOR2_COMMON_1[i]);
square_modulus = bgc_fp32_vector2_get_modulus(&TEST_FP32_VECTOR2_COMMON_1[i]);
if (!test_are_equal_fp32(square_modulus, FP32_VECTOR2_MODULUS_1[i])) {
print_testing_failed();
@ -86,7 +86,7 @@ int test_vector2_fp32_modulus()
// ===================== Add ==================== //
const BgcVector2FP32 TEST_FP32_VECTOR2_COMMON_1_2_SUM[] = {
const BGC_FP32_Vector2 TEST_FP32_VECTOR2_COMMON_1_2_SUM[] = {
{ 0.0f, 0.0f },
{ -6.0f, -8.0f },
{ 10000.002f, -20000.05f },
@ -98,10 +98,10 @@ int test_vector2_add_fp32()
{
print_testing_name("vector2_fp32_t add");
BgcVector2FP32 vector;
BGC_FP32_Vector2 vector;
for (int i = 0; i < TEST_FP32_VECTOR2_AMOUNT_1; i++) {
bgc_vector2_add_fp32(&TEST_FP32_VECTOR2_COMMON_1[i], &TEST_FP32_VECTOR2_COMMON_2[i], &vector);
bgc_fp32_vector2_add(&TEST_FP32_VECTOR2_COMMON_1[i], &TEST_FP32_VECTOR2_COMMON_2[i], &vector);
if (!test_are_equal_fp32(vector.x1, TEST_FP32_VECTOR2_COMMON_1_2_SUM[i].x1) ||
!test_are_equal_fp32(vector.x2, TEST_FP32_VECTOR2_COMMON_1_2_SUM[i].x2)) {
@ -116,7 +116,7 @@ int test_vector2_add_fp32()
// ================== Subtract ================== //
const BgcVector2FP32 TEST_FP32_VECTOR2_COMMON_1_2_DIFF[] = {
const BGC_FP32_Vector2 TEST_FP32_VECTOR2_COMMON_1_2_DIFF[] = {
{ 6.0f, 8.0f },
{ 0.0f, 0.0f },
{ 9999.998f, -19999.95f },
@ -128,10 +128,10 @@ int test_vector2_subtract_fp32()
{
print_testing_name("vector2_fp32_t subtract");
BgcVector2FP32 vector;
BGC_FP32_Vector2 vector;
for (int i = 0; i < TEST_FP32_VECTOR2_AMOUNT_1; i++) {
bgc_vector2_subtract_fp32(&TEST_FP32_VECTOR2_COMMON_1[i], &TEST_FP32_VECTOR2_COMMON_2[i], &vector);
bgc_fp32_vector2_subtract(&TEST_FP32_VECTOR2_COMMON_1[i], &TEST_FP32_VECTOR2_COMMON_2[i], &vector);
if (!test_are_equal_fp32(vector.x1, TEST_FP32_VECTOR2_COMMON_1_2_DIFF[i].x1) ||
!test_are_equal_fp32(vector.x2, TEST_FP32_VECTOR2_COMMON_1_2_DIFF[i].x2)) {