Documented some files

merge-requests/1/merge
marouault 4 years ago
parent 9a7701330f
commit d90840571e

@ -1,3 +1,10 @@
/**
* \file ArrayUtils.h
* \brief This file define a macro used to generate dynamic array structs and associated functions
* \author Martin Rouault
* \date 3/01/2022
*/
#ifndef ARRAY_UTILS_INCLUDED #ifndef ARRAY_UTILS_INCLUDED
#define ARRAY_UTILS_INCLUDED #define ARRAY_UTILS_INCLUDED
@ -5,19 +12,21 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdlib.h> #include <stdlib.h>
/* /**
This file define a macro used to generate array structs and associated functions * \brief Generate a dynamic array for type T
* If you want an int array use
* GENERATE_DYNAMIC_ARRAY(int)
If you want an int array use * If you miss a function, write it with a type as int first then rewrite it in the macro
GENERATE_DYNAMIC_ARRAY(int) * You will need to follow function naming convetions to avoid multiple functions with the same name
* Functions in header must be marked as inline
If you miss a function, write it with a type as int first then rewrite it in the macro * Don't forget antislashes
You will need to follow function naming convetions to avoid multiple functions with the same name
Functions in header must be marked as inline
Don't forget antislashes
*/ */
#define GENERATE_DYNAMIC_ARRAY(T) \ #define GENERATE_DYNAMIC_ARRAY(T) \
/** \
* \struct array_##T \
* \
* */\
struct array_##T { \ struct array_##T { \
T* elems; \ T* elems; \
size_t arraySize; \ size_t arraySize; \

@ -12,18 +12,23 @@
#include <stdio.h> #include <stdio.h>
#include "engine/TextureLoader.h" #include "engine/TextureLoader.h"
// List here the different texture to handle /** List here the different texture to handle
// In the enum * In the enum
// Island become TEXTURE_Island * Island become TEXTURE_Island
// In file * In file
// Island become Island.png * Island become Island.png
* \sa MACRO_TEXTURE_ENUM_GEN(E)
*/
#define MACRO_FOR_ALL_TEXTURES(M) \ #define MACRO_FOR_ALL_TEXTURES(M) \
M(Island) \ M(Island) \
M(Bridge) \ M(Bridge) \
M(Piece) \ M(Piece) \
M(Water) M(Water)
// Allow the generation of enum /**
* \brief Allow the generation of enum
* \sa MACRO_FOR_ALL_TEXTURES(M)
*/
#define MACRO_TEXTURE_ENUM_GEN(E) TEXTURE_##E, #define MACRO_TEXTURE_ENUM_GEN(E) TEXTURE_##E,
/** /**
@ -50,7 +55,7 @@ typedef struct
/** /**
* \brief Create a TextureHandler and load each texture defined in MACRO_FOR_ALL_TEXTURES in it * \brief Create a TextureHandler and load each texture defined in MACRO_FOR_ALL_TEXTURES in it
* \param renderer The renderer which is passed to texture when they are created * \param renderer The renderer which is passed to texture when they are created
* \return ** TextureHandler filled with textures * \return TextureHandler filled with textures
*/ */
TextureHandler newTextureHandler(SDL_Renderer* renderer); TextureHandler newTextureHandler(SDL_Renderer* renderer);

@ -1,3 +1,9 @@
/**
* \file TextureLoader.h
* \brief Define functions to load textures
* \author Allan Point
*/
#include <SDL2/SDL.h> #include <SDL2/SDL.h>
#include <SDL2/SDL_image.h> #include <SDL2/SDL_image.h>

@ -1,7 +1,7 @@
/** /**
* \file Bridge.h * \file Bridge.h
* \brief Bridge * \brief Bridge
* \autor Martin Rouault, Jacques Thomas * \author Martin Rouault, Jacques Thomas
* \date 13/12/2021 * \date 13/12/2021
*/ */

Loading…
Cancel
Save