Рабочий прототип

This commit is contained in:
2025-11-17 22:46:36 +03:00
parent 494686a203
commit f48bc757ea
4 changed files with 299 additions and 109 deletions

View File

@@ -69,36 +69,36 @@ static void *window_aux_loop(void *arg)
{
/* На время обновления позиции фигуры локаем мутекс */
pthread_mutex_lock(&draw_info->figure_mutex);
// figure_animation_step(draw_info);
figure_animation_step(draw_info);
const size_t n = 8;
struct vec2 *pts = malloc(sizeof(struct vec2) * n);
if (!pts)
{
printf("malloc failed\n");
}
// const size_t n = 8;
// struct vec2 *pts = malloc(sizeof(struct vec2) * n);
// if (!pts)
// {
// printf("malloc failed\n");
// }
float center_x = 0.0f;
float center_y = 0.0f;
float offset = 0.78f;
float radius = 1.0f;
// float center_x = 0.0f;
// float center_y = 0.0f;
// float offset = 0.78f;
// float radius = 1.0f;
// Вызов ASM-функции
place_points_on_circle(
center_x,
center_y,
offset,
radius,
(float *)pts, // адрес выходного массива
n);
// // Вызов ASM-функции
// place_points_on_circle(
// center_x,
// center_y,
// offset,
// radius,
// (float *)pts, // адрес выходного массива
// n);
// Вывод для проверки (и удобной точки останова)
for (size_t i = 0; i < n; i++)
{
printf("%zu: x = %f, y = %f\n", i, pts[i].x, pts[i].y);
}
// // Вывод для проверки (и удобной точки останова)
// for (size_t i = 0; i < n; i++)
// {
// printf("%zu: x = %f, y = %f\n", i, pts[i].x, pts[i].y);
// }
free(pts);
// free(pts);
pthread_mutex_unlock(&draw_info->figure_mutex);
usleep(30 * 1000);