From d90840571ea2530f2ae5bd7534a34f1a8f52cbed Mon Sep 17 00:00:00 2001 From: marouault Date: Mon, 3 Jan 2022 10:42:55 +0100 Subject: [PATCH] Documented some files --- Pontu/include/engine/ArrayUtils.h | 31 +++++++++++++++++---------- Pontu/include/engine/TextureHandler.h | 19 ++++++++++------ Pontu/include/engine/TextureLoader.h | 6 ++++++ Pontu/include/model/Bridge.h | 2 +- 4 files changed, 39 insertions(+), 19 deletions(-) diff --git a/Pontu/include/engine/ArrayUtils.h b/Pontu/include/engine/ArrayUtils.h index e00e0e2..64e6220 100644 --- a/Pontu/include/engine/ArrayUtils.h +++ b/Pontu/include/engine/ArrayUtils.h @@ -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 #define ARRAY_UTILS_INCLUDED @@ -5,19 +12,21 @@ #include #include -/* -This file define a macro used to generate array structs and associated functions - -If you want an int array use - GENERATE_DYNAMIC_ARRAY(int) - -If you miss a function, write it with a type as int first then rewrite it in the macro - 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 -*/ +/** + * \brief Generate a dynamic array for type T + * If you want an int array use + * GENERATE_DYNAMIC_ARRAY(int) + * If you miss a function, write it with a type as int first then rewrite it in the macro + * 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) \ +/** \ + * \struct array_##T \ + * \ + * */\ struct array_##T { \ T* elems; \ size_t arraySize; \ diff --git a/Pontu/include/engine/TextureHandler.h b/Pontu/include/engine/TextureHandler.h index 4696d6b..149a954 100644 --- a/Pontu/include/engine/TextureHandler.h +++ b/Pontu/include/engine/TextureHandler.h @@ -12,18 +12,23 @@ #include #include "engine/TextureLoader.h" -// List here the different texture to handle -// In the enum -// Island become TEXTURE_Island -// In file -// Island become Island.png +/** List here the different texture to handle + * In the enum + * Island become TEXTURE_Island + * In file + * Island become Island.png + * \sa MACRO_TEXTURE_ENUM_GEN(E) + */ #define MACRO_FOR_ALL_TEXTURES(M) \ M(Island) \ M(Bridge) \ M(Piece) \ 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, /** @@ -50,7 +55,7 @@ typedef struct /** * \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 - * \return ** TextureHandler filled with textures + * \return TextureHandler filled with textures */ TextureHandler newTextureHandler(SDL_Renderer* renderer); diff --git a/Pontu/include/engine/TextureLoader.h b/Pontu/include/engine/TextureLoader.h index 9ad7b20..8a87b3a 100644 --- a/Pontu/include/engine/TextureLoader.h +++ b/Pontu/include/engine/TextureLoader.h @@ -1,3 +1,9 @@ +/** + * \file TextureLoader.h + * \brief Define functions to load textures + * \author Allan Point + */ + #include #include diff --git a/Pontu/include/model/Bridge.h b/Pontu/include/model/Bridge.h index a4374a6..152a5d1 100644 --- a/Pontu/include/model/Bridge.h +++ b/Pontu/include/model/Bridge.h @@ -1,7 +1,7 @@ /** * \file Bridge.h * \brief Bridge - * \autor Martin Rouault, Jacques Thomas + * \author Martin Rouault, Jacques Thomas * \date 13/12/2021 */