Changed naming convention for unique file includes from FILE_NAME_H to _FILE_NAME_H. Fixed some typos for some of these macros.

This commit is contained in:
Ulysse Cura 2026-11-02 20:56:13 +01:00
parent 820bf6d902
commit ea5d21e306
37 changed files with 111 additions and 111 deletions

View File

@ -1,5 +1,5 @@
#ifndef ERRORS_H #ifndef _ERRORS_H
#define ERRORS_H #define _ERRORS_H
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
@ -54,4 +54,4 @@
fputc('\n', stderr); \ fputc('\n', stderr); \
} while (0) } while (0)
#endif // ERRORS_H #endif // _ERRORS_H

View File

@ -1,9 +1,9 @@
#ifndef IMAGE_H #ifndef _IMAGE_H
#define IMAGE_H #define _IMAGE_H
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
int build_image(const char *input_file_name, FILE *output_file, uint32_t *asset_size); int build_image(const char *input_file_name, FILE *output_file, uint32_t *asset_size);
#endif // IMAGE_H #endif // _IMAGE_H

View File

@ -1,9 +1,9 @@
#ifndef MAP_H #ifndef _MAP_H
#define MAP_H #define _MAP_H
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
int build_map(const char *input_file_name, FILE *output_file, uint32_t *asset_size); int build_map(const char *input_file_name, FILE *output_file, uint32_t *asset_size);
#endif // MAP_H #endif // _MAP_H

View File

@ -1,8 +1,8 @@
#ifndef OBJECT_H #ifndef _OBJECT_H
#define OBJECT_H #define _OBJECT_H
#include <stdio.h> #include <stdio.h>
int build_object(const char *input_file_path, FILE *output_file); int build_object(const char *input_file_path, FILE *output_file);
#endif // OBJECT_H #endif // _OBJECT_H

View File

@ -1,5 +1,5 @@
#ifndef UTILS_H #ifndef _UTILS_H
#define UTILS_H #define _UTILS_H
#include <stdio.h> #include <stdio.h>
@ -7,4 +7,4 @@ int file_read(void *ptr, size_t size, size_t nb, FILE *file);
int file_write(const void *ptr, size_t size, size_t nb, FILE *file); int file_write(const void *ptr, size_t size, size_t nb, FILE *file);
#endif // UTILS_H #endif // _UTILS_H

View File

@ -1,5 +1,5 @@
#ifndef ASSET_MANAGER_H #ifndef _ASSET_MANAGER_H
#define ASSET_MANAGER_H #define _ASSET_MANAGER_H
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
@ -46,4 +46,4 @@ asset_t *asset_manager_load_asset(char *asset_name, asset_type_t asset_type);
int asset_manager_let_go_asset(char *asset_name); int asset_manager_let_go_asset(char *asset_name);
asset_t *asset_manager_get_asset(char *asset_name); asset_t *asset_manager_get_asset(char *asset_name);
#endif // ASSET_MANAGER_H #endif // _ASSET_MANAGER_H

View File

@ -1,5 +1,5 @@
#ifndef CAMERA_H #ifndef _CAMERA_H
#define CAMERA_H #define _CAMERA_H
#include "vector2d.h" #include "vector2d.h"
@ -13,4 +13,4 @@ void camera_init(void);
void camera_update(void); void camera_update(void);
#endif // CAMERA_H #endif // _CAMERA_H

View File

@ -1,5 +1,5 @@
#ifndef ECS_H #ifndef _ECS_H
#define ECS_H #define _ECS_H
#include <stdarg.h> #include <stdarg.h>
#include <stddef.h> #include <stddef.h>
@ -68,4 +68,4 @@ int entity_manager_update(void);
int entity_manager_draw(void); int entity_manager_draw(void);
int entity_manager_remove_entity(size_t id); int entity_manager_remove_entity(size_t id);
#endif // ECS_H #endif // _ECS_H

View File

@ -1,5 +1,5 @@
#ifndef EVENT_BUS_H #ifndef _EVENT_BUS_H
#define EVENT_BUS_H #define _EVENT_BUS_H
#include <stdarg.h> #include <stdarg.h>
#include "linked_list.h" #include "linked_list.h"
@ -35,4 +35,4 @@ int event_bus_publish(size_t id, void *arg);
int event_bus_subscribe(size_t id, callback_t callback, void *data); int event_bus_subscribe(size_t id, callback_t callback, void *data);
int event_bus_unsubscribe(size_t id, callback_t callback); int event_bus_unsubscribe(size_t id, callback_t callback);
#endif // EVENT_BUS_H #endif // _EVENT_BUS_H

View File

@ -1,5 +1,5 @@
#ifndef GAME_H #ifndef _GAME_H
#define GAME_H #define _GAME_H
#include <stdbool.h> #include <stdbool.h>
#include "display.h" #include "display.h"
@ -42,4 +42,4 @@ void game_handle_event(void);
int game_update(void); int game_update(void);
int game_render(void); int game_render(void);
#endif // GAME_H #endif // _GAME_H

View File

@ -1,5 +1,5 @@
#ifndef DISPLAY_H #ifndef _DISPLAY_H
#define DISPLAY_H #define _DISPLAY_H
#include <gint/display.h> #include <gint/display.h>
#include "texture.h" #include "texture.h"
@ -20,4 +20,4 @@ int display_update(void);
int display_draw_texture(texture_t *texture, const rect_t *src_rect, const rect_t *dst_rect, bool flip); int display_draw_texture(texture_t *texture, const rect_t *src_rect, const rect_t *dst_rect, bool flip);
int display_draw_frect(const frect_t *frect, unsigned int r, unsigned int g, unsigned int b, unsigned int a); int display_draw_frect(const frect_t *frect, unsigned int r, unsigned int g, unsigned int b, unsigned int a);
#endif // DISPLAY_H #endif // _DISPLAY_H

View File

@ -1,5 +1,5 @@
#ifndef KEYBOARD_H #ifndef _INPUTS_H
#define KEYBOARD_H #define _INPUTS_H
#include "keycodes.h" #include "keycodes.h"
@ -14,4 +14,4 @@ typedef struct inputs_t {
bool keys[MAX_KEYCODES]; bool keys[MAX_KEYCODES];
} inputs_t; } inputs_t;
#endif // KEYBOARD_H #endif // _INPUTS_H

View File

@ -1,5 +1,5 @@
#ifndef KEYCODES_H #ifndef _KEYCODES_H
#define KEYCODES_H #define _KEYCODES_H
#include <gint/keyboard.h> #include <gint/keyboard.h>
@ -12,4 +12,4 @@
#define INPUT_EVENT_KEY_DOWN KEYEV_DOWN #define INPUT_EVENT_KEY_DOWN KEYEV_DOWN
#define INPUT_EVENT_QUIT 0xFF #define INPUT_EVENT_QUIT 0xFF
#endif // KEYCODES_H #endif // _KEYCODES_H

View File

@ -1,6 +1,6 @@
#ifndef MEMORY_ALLOC_H #ifndef _MEMORY_ALLOC_H
#define MEMORY_ALLOC_H #define _MEMORY_ALLOC_H
#include <stdlib.h> #include <stdlib.h>
#endif // MEMORY_ALLOC_H #endif // _MEMORY_ALLOC_H

View File

@ -1,5 +1,5 @@
#ifndef TEXTURE_H #ifndef _TEXTURE_H
#define TEXTURE_H #define _TEXTURE_H
#include <gint/display.h> #include <gint/display.h>
@ -13,4 +13,4 @@ typedef bopti_image_t texture_t;
texture_t *load_texture(void); texture_t *load_texture(void);
void destroy_texture(texture_t *texture); void destroy_texture(texture_t *texture);
#endif // TEXTURE_H #endif // _TEXTURE_H

View File

@ -1,6 +1,6 @@
#ifndef TIME_H #ifndef _UPDATE_TIME_H
#define TIME_H #define _UPDATE_TIME_H
void update_time(void); void update_time(void);
#endif // TIME_H #endif // _UPDATE_TIME_H

View File

@ -1,5 +1,5 @@
#ifndef VECTOR2D_H #ifndef _VECTOR2D_H
#define VECTOR2D_H #define _VECTOR2D_H
#include <stdbool.h> #include <stdbool.h>
#include <math.h> #include <math.h>
@ -160,4 +160,4 @@ float lerp(float a, float b, float s);
*/ */
float lerp_time(float a, float b, float s, float t); float lerp_time(float a, float b, float s, float t);
#endif // VECTOR2D_H #endif // _VECTOR2D_H

View File

@ -1,5 +1,5 @@
#ifndef DISPLAY_H #ifndef _DISPLAY_H
#define DISPLAY_H #define _DISPLAY_H
#include <SDL3/SDL_render.h> #include <SDL3/SDL_render.h>
#include "texture.h" #include "texture.h"
@ -28,4 +28,4 @@ int display_update(void);
int display_draw_texture(texture_t *texture, const rect_t *src_rect, const rect_t *dst_rect, bool flip); int display_draw_texture(texture_t *texture, const rect_t *src_rect, const rect_t *dst_rect, bool flip);
int display_draw_frect(const frect_t *frect, unsigned int r, unsigned int g, unsigned int b, unsigned int a); int display_draw_frect(const frect_t *frect, unsigned int r, unsigned int g, unsigned int b, unsigned int a);
#endif // DISPLAY_H #endif // _DISPLAY_H

View File

@ -1,5 +1,5 @@
#ifndef KEYBOARD_H #ifndef _INPUTS_H
#define KEYBOARD_H #define _INPUTS_H
#include "keycodes.h" #include "keycodes.h"
@ -14,4 +14,4 @@ typedef struct inputs_t {
bool keys[MAX_KEYCODES]; bool keys[MAX_KEYCODES];
} inputs_t; } inputs_t;
#endif // KEYBOARD_H #endif // _INPUTS_H

View File

@ -1,5 +1,5 @@
#ifndef KEYCODES_H #ifndef _KEYCODES_H
#define KEYCODES_H #define _KEYCODES_H
#include <SDL3/SDL_events.h> #include <SDL3/SDL_events.h>
@ -16,4 +16,4 @@
#define INPUT_EVENT_KEY_DOWN SDL_EVENT_KEY_DOWN #define INPUT_EVENT_KEY_DOWN SDL_EVENT_KEY_DOWN
#define INPUT_EVENT_QUIT SDL_EVENT_QUIT #define INPUT_EVENT_QUIT SDL_EVENT_QUIT
#endif // KEYCODES_H #endif // _KEYCODES_H

View File

@ -1,6 +1,6 @@
#ifndef MEMORY_ALLOC_H #ifndef _MEMORY_ALLOC_H
#define MEMORY_ALLOC_H #define _MEMORY_ALLOC_H
#include <stdlib.h> #include <stdlib.h>
#endif // MEMORY_ALLOC_H #endif // _MEMORY_ALLOC_H

View File

@ -1,5 +1,5 @@
#ifndef TEXTURE_H #ifndef _TEXTURE_H
#define TEXTURE_H #define _TEXTURE_H
#include <SDL3/SDL_render.h> #include <SDL3/SDL_render.h>
@ -13,4 +13,4 @@ typedef SDL_Texture texture_t;
texture_t *load_texture(void); texture_t *load_texture(void);
void destroy_texture(texture_t *texture); void destroy_texture(texture_t *texture);
#endif // TEXTURE_H #endif // _TEXTURE_H

View File

@ -1,6 +1,6 @@
#ifndef TIME_H #ifndef _UPDATE_TIME_H
#define TIME_H #define _UPDATE_TIME_H
void update_time(void); void update_time(void);
#endif // TIME_H #endif // _UPDATE_TIME_H

View File

@ -1,5 +1,5 @@
#ifndef VECTOR2D_H #ifndef _VECTOR2D_H
#define VECTOR2D_H #define _VECTOR2D_H
#include <SDL3/SDL_rect.h> #include <SDL3/SDL_rect.h>
#include <math.h> #include <math.h>
@ -150,4 +150,4 @@ float lerp(float a, float b, float s);
*/ */
float lerp_time(float a, float b, float s, float t); float lerp_time(float a, float b, float s, float t);
#endif // VECTOR2D_H #endif // _VECTOR2D_H

View File

@ -1,5 +1,5 @@
#ifndef LINKED_LIST_H #ifndef _LINKED_LIST_H
#define LINKED_LIST_H #define _LINKED_LIST_H
#include <stdbool.h> #include <stdbool.h>
#include <stdarg.h> #include <stdarg.h>
@ -280,4 +280,4 @@ int linked_list_for_each(const linked_list_t *linked_list, const action_t action
*/ */
void linked_list_insertion_sort(linked_list_t *linked_list, const condition_t condition, void *arg); void linked_list_insertion_sort(linked_list_t *linked_list, const condition_t condition, void *arg);
#endif // LINKED_LIST_H #endif // _LINKED_LIST_H

View File

@ -1,5 +1,5 @@
#ifndef MAP_H #ifndef _MAP_H
#define MAP_H #define _MAP_H
#include <stdint.h> #include <stdint.h>
#include "linked_list.h" #include "linked_list.h"
@ -45,4 +45,4 @@ int map_display_foreground(void);
int map_display_hitboxes(void); int map_display_hitboxes(void);
#endif // DEBUG > 1 #endif // DEBUG > 1
#endif // MAP_H #endif // _MAP_H

View File

@ -1,5 +1,5 @@
#ifndef ANIMATION_SYSTEM_H #ifndef _ANIMATION_SYSTEM_H
#define ANIMATION_SYSTEM_H #define _ANIMATION_SYSTEM_H
#include <stdbool.h> #include <stdbool.h>
#include "ecs.h" #include "ecs.h"
@ -27,4 +27,4 @@ int animation_system_destroy(component_t *system);
int animation_system_apply_changes(component_t *system); int animation_system_apply_changes(component_t *system);
#endif // SPRITE_COMPONENT_H #endif // _SPRITE_COMPONENT_H

View File

@ -1,5 +1,5 @@
#ifndef COMPONENTS_H #ifndef _COMPONENTS_H
#define COMPONENTS_H #define _COMPONENTS_H
#include "transform_component.h" #include "transform_component.h"
#include "sprite_component.h" #include "sprite_component.h"
@ -13,4 +13,4 @@
//#include "lua_component.h" //#include "lua_component.h"
// Add new components header file here // Add new components header file here
#endif // COMPONENTS_H #endif // _COMPONENTS_H

View File

@ -1,5 +1,5 @@
#ifndef DOOR_COMPONENT_H #ifndef _DOOR_COMPONENT_H
#define DOOR_COMPONENT_H #define _DOOR_COMPONENT_H
#include "ecs.h" #include "ecs.h"
@ -22,4 +22,4 @@ int door_component_destroy(component_t *component);
int door_component_subscribe(component_t *component); int door_component_subscribe(component_t *component);
#endif // DOOR_COMPONENT_H #endif // _DOOR_COMPONENT_H

View File

@ -1,5 +1,5 @@
#ifndef HITBOX_COMPONENT_H #ifndef _HITBOX_COMPONENT_H
#define HITBOX_COMPONENT_H #define _HITBOX_COMPONENT_H
#include <stdbool.h> #include <stdbool.h>
#include "ecs.h" #include "ecs.h"
@ -23,4 +23,4 @@ int hitbox_component_draw(const component_t *component);
#endif #endif
int hitbox_component_destroy(component_t *component); int hitbox_component_destroy(component_t *component);
#endif // HITBOX_COMPONENT_H #endif // _HITBOX_COMPONENT_H

View File

@ -1,5 +1,5 @@
#ifndef INTERACT_COMPONENT_H #ifndef _INTERACT_COMPONENT_H
#define INTERACT_COMPONENT_H #define _INTERACT_COMPONENT_H
#include "ecs.h" #include "ecs.h"
#include "vector2d.h" #include "vector2d.h"
@ -32,4 +32,4 @@ int interact_component_destroy(component_t *component);
int interact_component_interact(component_t *component); int interact_component_interact(component_t *component);
#endif // TRANSFORM_COMPONENT_H #endif // _TRANSFORM_COMPONENT_H

View File

@ -1,5 +1,5 @@
#ifndef LEVER_COMPONENT_H #ifndef _LEVER_COMPONENT_H
#define LEVER_COMPONENT_H #define _LEVER_COMPONENT_H
#include "ecs.h" #include "ecs.h"
#include "vector2d.h" #include "vector2d.h"
@ -21,4 +21,4 @@ int lever_component_destroy(component_t *component);
int lever_component_subscribe(component_t *component); int lever_component_subscribe(component_t *component);
#endif // LEVER_COMPONENT_H #endif // _LEVER_COMPONENT_H

View File

@ -1,5 +1,5 @@
#ifndef LUA_COMPONENT_H #ifndef _LUA_COMPONENT_H
#define LUA_COMPONENT_H #define _LUA_COMPONENT_H
#include <lua.h> #include <lua.h>
#include "ecs.h" #include "ecs.h"
@ -16,4 +16,4 @@ int lua_component_draw(const component_t *component);
#endif // DEBUG >= 2 #endif // DEBUG >= 2
int lua_component_destroy(component_t *component); int lua_component_destroy(component_t *component);
#endif // LUA_COMPONENT_H #endif // _LUA_COMPONENT_H

View File

@ -1,5 +1,5 @@
#ifndef PHYSICS_SYSTEM_H #ifndef _PHYSICS_SYSTEM_H
#define PHYSICS_SYSTEM_H #define _PHYSICS_SYSTEM_H
#include "ecs.h" #include "ecs.h"
#include "vector2d.h" #include "vector2d.h"
@ -18,4 +18,4 @@ int physics_system_init(component_t *component);
int physics_system_update(component_t *component); int physics_system_update(component_t *component);
int physics_system_destroy(component_t *component); int physics_system_destroy(component_t *component);
#endif // PHYSICS_SYSTEM_H #endif // _PHYSICS_SYSTEM_H

View File

@ -1,5 +1,5 @@
#ifndef PLAYER_SYSTEM_H #ifndef _PLAYER_SYSTEM_H
#define PLAYER_SYSTEM_H #define _PLAYER_SYSTEM_H
#include "ecs.h" #include "ecs.h"
@ -33,4 +33,4 @@ int player_system_init(component_t *component);
int player_system_update(component_t *component); int player_system_update(component_t *component);
int player_system_destroy(component_t *component); int player_system_destroy(component_t *component);
#endif // PLAYER_SYSTEM_H #endif // _PLAYER_SYSTEM_H

View File

@ -1,5 +1,5 @@
#ifndef SPRITE_COMPONENT_H #ifndef _SPRITE_COMPONENT_H
#define SPRITE_COMPONENT_H #define _SPRITE_COMPONENT_H
#include "ecs.h" #include "ecs.h"
#include "asset_manager.h" #include "asset_manager.h"
@ -20,4 +20,4 @@ int sprite_component_update(component_t *component);
int sprite_component_draw(const component_t *component); int sprite_component_draw(const component_t *component);
int sprite_component_destroy(component_t *component); int sprite_component_destroy(component_t *component);
#endif // SPRITE_COMPONENT_H #endif // _SPRITE_COMPONENT_H

View File

@ -1,5 +1,5 @@
#ifndef TRANSFORM_COMPONENT_H #ifndef _TRANSFORM_COMPONENT_H
#define TRANSFORM_COMPONENT_H #define _TRANSFORM_COMPONENT_H
#include "ecs.h" #include "ecs.h"
#include "vector2d.h" #include "vector2d.h"
@ -16,4 +16,4 @@ int transform_component_draw(const component_t *component);
#endif // DEBUG >= 2 #endif // DEBUG >= 2
int transform_component_destroy(component_t *component); int transform_component_destroy(component_t *component);
#endif // TRANSFORM_COMPONENT_H #endif // _TRANSFORM_COMPONENT_H