2025-05-31 00:27:25 +02:00

66 lines
1.3 KiB
C

#ifndef ENGINE_TYPE_H
# define ENGINE_TYPE_H
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
# include <stdint.h>
# include <stdlib.h>
# include <string.h>
# include <assert.h>
#ifndef ARRAY_ALLOC_STEP
# define ARRAY_ALLOC_STEP 1.25f
#endif
#define MAX_QUEUE_SIZE 100
/**
* @brief
*
*/
typedef struct static_queue {
void *data; // Dynamic byte buffer
unsigned int front;
unsigned int rear;
unsigned int size;
unsigned int data_size; // Use larger type (not limited to 255 bytes)
unsigned int capacity;
} static_queue;
typedef struct dynamic_queue {
void *data; // Dynamic byte buffer
unsigned int front;
unsigned int rear;
unsigned int size;
unsigned int data_size; // Use larger type (not limited to 255 bytes)
unsigned int capacity;
} dynamic_queue;
typedef struct octree_node {
uint8_t child_mask;
float center[3];
float extent;
void* data;
octree_node* children[8];
} octree_node;
typedef struct octree {
uint8_t depth;
uint32_t size;
octree_node root;
} octree;
typedef struct dynamic_array {
char data_size;// Size of each element (in bytes)
void* data;
size_t size;// Number of elements in the array
size_t capacity;// Total capacity of the array (in bytes)
size_t alignement;//Alignment requirement (must be a power of two)
} dynamic_array;
#endif