Скелет функции анимации

This commit is contained in:
2025-11-17 15:04:05 +03:00
parent 743b8336a3
commit 5ac43bb236
6 changed files with 90 additions and 5 deletions

View File

@@ -0,0 +1,29 @@
/* generate-offsets.c
* Генерирует offsets.inc с смещениями полей структур
*/
#include <stdio.h>
#include <stddef.h>
#include "window.h"
int main(void) {
printf("; offsets.inc — generated automatically\n");
// window_draw_info offsets
printf("WDI_DATA equ %zu\n", offsetof(struct window_draw_info, data));
printf("WDI_WIDTH equ %zu\n", offsetof(struct window_draw_info, width));
printf("WDI_HEIGHT equ %zu\n", offsetof(struct window_draw_info, height));
printf("WDI_FIGURE equ %zu\n", offsetof(struct window_draw_info, figure));
printf("WDI_FIGURE_MUTEX equ %zu\n", offsetof(struct window_draw_info, figure_mutex));
printf("\n");
// figure_animation_info offsets
printf("FIG_TYPE equ %zu\n", offsetof(struct figure_animation_info, type));
printf("FIG_POSITION equ %zu\n", offsetof(struct figure_animation_info, position));
printf("FIG_VELOCITY equ %zu\n", offsetof(struct figure_animation_info, velocity));
printf("FIG_ANGLE equ %zu\n", offsetof(struct figure_animation_info, angle));
printf("FIG_ANG_VEL equ %zu\n", offsetof(struct figure_animation_info, angular_velocity));
printf("FIG_SPEED equ %zu\n", offsetof(struct figure_animation_info, speed));
return 0;
}